芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/www/status.pulsehost.co.uk/app/controllers/MonitorLog.php
<?php /* * @copyright Copyright (c) 2024 AltumCode (https://altumcode.com/) * * This software is exclusively sold through https://altumcode.com/ by the AltumCode author. * Downloading this product from any other sources and running it without a proper license is illegal, * except the official ones linked from https://altumcode.com/. */ namespace Altum\controllers; use Altum\Title; class MonitorLog extends Controller { public function index() { if(!settings()->monitors_heartbeats->monitors_is_enabled) { redirect('not-found'); } \Altum\Authentication::guard(); $monitor_log_id = isset($this->params[0]) ? (int) $this->params[0] : null; if(!$monitor_log = db()->where('monitor_log_id', $monitor_log_id)->where('user_id', $this->user->user_id)->getOne('monitors_logs')) { redirect('monitors'); } if(!$monitor = db()->where('monitor_id', $monitor_log->monitor_id)->where('user_id', $this->user->user_id)->getOne('monitors')) { redirect('monitors'); } $monitor->details = json_decode($monitor->details); $monitor->settings = json_decode($monitor->settings ?? ''); /* Get available ping servers */ $ping_servers = (new \Altum\Models\PingServers())->get_ping_servers(); /* Set a custom title */ Title::set(sprintf(l('monitor_log.title'), $monitor->name)); /* Prepare the view */ $data = [ 'monitor' => $monitor, 'monitor_log' => $monitor_log, 'ping_servers' => $ping_servers, ]; $view = new \Altum\View('monitor-log/index', (array) $this); $this->add_view_content('content', $view->run($data)); } }