芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/www/status.pulsehost.co.uk/app/controllers/Dashboard.php
monitors_heartbeats->monitors_is_enabled) { $monitors = db()->where('user_id', $this->user->user_id)->get('monitors', 6); $ping_servers = (new \Altum\Models\PingServers())->get_ping_servers(); } /* Get the heartbeats */ if(settings()->monitors_heartbeats->heartbeats_is_enabled) { $heartbeats = db()->where('user_id', $this->user->user_id)->get('heartbeats', 6); } if(settings()->status_pages->status_pages_is_enabled) { /* Get available projects */ $projects = (new \Altum\Models\Projects())->get_projects_by_user_id($this->user->user_id); /* Get available custom domains */ $domains = (new \Altum\Models\Domain())->get_available_domains_by_user($this->user, false); /* Get the status pages */ $status_pages = \Altum\Cache::cache_function_result('status_pages_dashboard?user_id=' . $this->user->user_id, null, function () use ($domains) { $status_pages = []; $status_pages_result = database()->query("SELECT * FROM `status_pages` WHERE `user_id` = {$this->user->user_id} LIMIT 6"); while ($row = $status_pages_result->fetch_object()) { /* Genereate the status page full URL base */ $row->full_url = (new \Altum\Models\StatusPage())->get_status_page_full_url($row, $this->user, $domains); $status_pages[] = $row; } return $status_pages; }); } if(settings()->monitors_heartbeats->domain_names_is_enabled) { /* Get the domain names */ $domain_names = []; $domain_names_result = database()->query("SELECT * FROM `domain_names` WHERE `user_id` = {$this->user->user_id} LIMIT 6"); while ($row = $domain_names_result->fetch_object()) { $row->whois = json_decode($row->whois ?? ''); $row->ssl = json_decode($row->ssl ?? ''); $domain_names[] = $row; } } /* Prepare the view */ $data = [ 'monitors' => $monitors ?? null, 'ping_servers' => $ping_servers ?? [], 'heartbeats' => $heartbeats ?? null, 'status_pages' => $status_pages ?? null, 'domain_names' => $domain_names ?? null, 'projects' => $projects ?? null, ]; $view = new \Altum\View('dashboard/index', (array) $this); $this->add_view_content('content', $view->run($data)); } }