改进 主机统计

This commit is contained in:
Database Server 2022-11-08 09:43:48 +08:00
parent 33da4f2270
commit aa80c6d6d2

View File

@ -58,12 +58,21 @@ public function handle()
$this->info('正在获取主机数量...');
$hosts = Host::count();
$this->info('正在获取部署中的主机数量...');
$pending_hosts = Host::where('status', 'pending')->count();
$this->info('正在获取已停止的主机数量...');
$stopped_hosts = Host::where('status', 'stopped')->count();
$this->info('正在获取部署失败的主机数量...');
$error_hosts = Host::where('status', 'error')->count();
$this->info('正在获取激活的主机数量...');
$active_hosts = Host::active()->count();
$active_hosts = Host::where('status', 'running')->count();
$this->info('正在获取暂停的主机数量...');
$suspended_hosts = Host::whereNull('suspended_at')->count();
$suspended_hosts = Host::whereNotNull('suspended_at')->count();
$this->info('正在获取工单数量...');
$workOrders = WorkOrder::count();
@ -80,6 +89,9 @@ public function handle()
$this->warn('用户数量: ' . $users);
$this->warn('主机数量: ' . $hosts);
$this->warn('正在部署的主机数量: ' . $pending_hosts);
$this->warn('已停止的主机数量: ' . $stopped_hosts);
$this->warn('部署失败的主机数量: ' . $error_hosts);
$this->warn('正常的主机数量: ' . $active_hosts);
$this->warn('暂停的主机数量: ' . $suspended_hosts);
$this->warn('服务器数量: ' . $servers);