From 9bea4ddecf8366c8e6739be2ffb12a502b630fd2 Mon Sep 17 00:00:00 2001 From: Newnius Date: Thu, 16 May 2019 13:48:30 +0800 Subject: [PATCH] update --- modals.php | 4 ++-- static/job.js | 30 ++++++++++++++++++++++++++++-- ucenter.php | 1 + 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/modals.php b/modals.php index 8cb7d37..4b0a32a 100755 --- a/modals.php +++ b/modals.php @@ -160,14 +160,14 @@
- +
- +
diff --git a/static/job.js b/static/job.js index f44f4b9..833f023 100755 --- a/static/job.js +++ b/static/job.js @@ -198,7 +198,7 @@ var statusFormatter = function (status) { status = parseInt(status); switch (status) { case 0: - return 'Created'; + return 'Submitted'; case 1: return 'Starting'; case 2: @@ -337,7 +337,7 @@ function load_job_status(name) { valign: 'middle' }, { field: 'operate', - title: 'Operate', + title: 'Logs', align: 'center', events: jobStatusOperateEvents, formatter: jobStatusOperateFormatter @@ -360,6 +360,7 @@ function jobStatusResponseHandler(res) { function jobStatusOperateFormatter(value, row, index) { var div = '
'; div += ''; + div += ''; div += '
'; return div; } @@ -390,5 +391,30 @@ window.jobStatusOperateEvents = { $("#modal-msg").modal('show'); $('#table-job').bootstrapTable("refresh"); }); + }, + 'click .download': function (e, value, row, index) { + var job = getParameterByName('name'); + var task = row.id; + + var ajax = $.ajax({ + url: "service?action=task_logs", + type: 'GET', + data: { + job: job, + task: task + } + }); + ajax.done(function (res) { + if (res["errno"] !== 0) { + $("#modal-msg-content").html(res["msg"]); + $("#modal-msg").modal('show'); + } + download(res['msg'], job + '_' + task + '.txt', "text/plain"); + }); + ajax.fail(function (jqXHR, textStatus) { + $("#modal-msg-content").html("Request failed : " + jqXHR.statusText); + $("#modal-msg").modal('show'); + $('#table-job').bootstrapTable("refresh"); + }); } }; \ No newline at end of file diff --git a/ucenter.php b/ucenter.php index 7385478..9bcc2e2 100755 --- a/ucenter.php +++ b/ucenter.php @@ -260,6 +260,7 @@ foreach ($entries as $entry) { +