From aa80c6d6d2b995e75069a5d56f4cd75a817b64a9 Mon Sep 17 00:00:00 2001 From: Database Server Date: Tue, 8 Nov 2022 09:43:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=20=E4=B8=BB=E6=9C=BA?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/Count.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/Count.php b/app/Console/Commands/Count.php index b916ddf..762dd6a 100644 --- a/app/Console/Commands/Count.php +++ b/app/Console/Commands/Count.php @@ -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);