1
0
mirror of https://github.com/newnius/YAO-portal.git synced 2025-12-13 00:56:44 +00:00

update UI, add pool status

This commit is contained in:
2019-04-29 21:04:19 +08:00
parent 75657a7d6d
commit e80f1c8480
4 changed files with 153 additions and 83 deletions

View File

@@ -171,6 +171,28 @@ function summary_get()
return $res;
}
function summary_get_pool_history()
{
if (!AccessController::hasAccess(Session::get('role', 'visitor'), 'system.summary')) {
$res['errno'] = Code::NO_PRIVILEGE;
return $res;
}
$spider = new Spider();
$spider->doGet(YAO_SCHEDULER_ADDR . '?action=pool_status_history');
$msg = json_decode($spider->getBody(), true);
if ($msg['code'] !== 0) {
$res['errno'] = $msg['code'] !== null ? $msg['code'] : Code::UNKNOWN_ERROR;
$res['msg'] = $msg['error'];
return $res;
}
$res['data'] = $msg['data'];
$res['errno'] = Code::SUCCESS;
return $res;
}
function task_logs(CRObject $job)
{
if (!AccessController::hasAccess(Session::get('role', 'visitor'), 'job.list')) {