|
|
|
@@ -14,6 +14,18 @@ export default async function initCloudrainSow() { |
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
function paddingZeros(str, len) { |
|
|
|
str = str.toString(); |
|
|
|
if (str.length < len) { |
|
|
|
str = new Array(len - str.length).fill('0').join('') + str; |
|
|
|
} |
|
|
|
return str; |
|
|
|
} |
|
|
|
|
|
|
|
function timeFormat(date) { |
|
|
|
return `${date.getFullYear()}-${paddingZeros(date.getMonth() + 1, 2)}-${paddingZeros(date.getDate(), 2)} ${paddingZeros(date.getHours(), 2)}:${paddingZeros(date.getMinutes(), 2)}:${paddingZeros(date.getSeconds(), 2)}`; |
|
|
|
} |
|
|
|
|
|
|
|
function logScroll(version_name, repoPath, ID) { |
|
|
|
let container = document.querySelector(`#log${version_name}`); |
|
|
|
let scrollTop = container.scrollTop; |
|
|
|
@@ -217,7 +229,6 @@ export default async function initCloudrainSow() { |
|
|
|
let ID = $(`#accordion${version_name}`).data("jobid"); |
|
|
|
let repoPath = $(`#accordion${version_name}`).data("repopath"); |
|
|
|
refreshStatusShow(version_name, ID, repoPath); |
|
|
|
$(`.log-info-${version_name} .log_bottom`).trigger("click"); |
|
|
|
e.stopPropagation(); |
|
|
|
}); |
|
|
|
$(".stop-show-version").click(function (e) { |
|
|
|
@@ -265,6 +276,13 @@ export default async function initCloudrainSow() { |
|
|
|
|
|
|
|
e.stopPropagation(); |
|
|
|
}); |
|
|
|
$('.ui.pointing.secondary.menu .item:eq(0)').click(function(e) { |
|
|
|
const self = $(this); |
|
|
|
setTimeout(function() { |
|
|
|
self.closest('.accordion').find('.refresh-status').trigger('click'); |
|
|
|
}, 20); |
|
|
|
|
|
|
|
}); |
|
|
|
function refreshStatusShow(version_name, ID, repoPath) { |
|
|
|
$.get( |
|
|
|
`/api/v1/repos/${repoPath}/${ID}?version_name=${version_name}`, |
|
|
|
@@ -276,13 +294,20 @@ export default async function initCloudrainSow() { |
|
|
|
//accroding下的运行时长 |
|
|
|
$(`#${version_name}-duration-span`).text(data.JobDuration); |
|
|
|
//配置信息详情页的状态 |
|
|
|
data.StartTime !== undefined && data.StartTime > 0 && $(`#${version_name}-startTime`).text(timeFormat(new Date(data.StartTime * 1000))); |
|
|
|
//配置信息详情页的状态 |
|
|
|
$(`#${version_name}-status`).text(data.JobStatus); |
|
|
|
//配置信息详情页的状态 |
|
|
|
$(`#${version_name}-duration`).text(data.JobDuration); |
|
|
|
//配置信息详情页的状态 |
|
|
|
$(`#${version_name}-ai_center`).text(data.AiCenter); |
|
|
|
} |
|
|
|
).fail(function (err) { |
|
|
|
console.log(err); |
|
|
|
}); |
|
|
|
const accordionEl = $(`#accordion${version_name}`); |
|
|
|
const activeTab = accordionEl.find('.ui.pointing.secondary.menu .item:not(:eq(0)).active'); |
|
|
|
activeTab.trigger('click'); |
|
|
|
} |
|
|
|
// |
|
|
|
$(".content-pad").on("click", ".load-model-file", function () { |
|
|
|
|