Browse Source

fix issue

tags/v1.22.11.1^2
zhoupzh 2 years ago
parent
commit
20be4ef7e7
9 changed files with 141 additions and 91 deletions
  1. +40
    -0
      templates/custom/max_log.tmpl
  2. +17
    -9
      templates/repo/cloudbrain/benchmark/show.tmpl
  3. +17
    -10
      templates/repo/cloudbrain/inference/show.tmpl
  4. +12
    -4
      templates/repo/cloudbrain/trainjob/show.tmpl
  5. +12
    -4
      templates/repo/grampus/trainjob/show.tmpl
  6. +13
    -10
      templates/repo/modelarts/inferencejob/show.tmpl
  7. +1
    -39
      templates/repo/modelarts/trainjob/show.tmpl
  8. +18
    -9
      templates/repo/modelsafety/show.tmpl
  9. +11
    -6
      web_src/js/features/cloudbrainShow.js

+ 40
- 0
templates/custom/max_log.tmpl View File

@@ -0,0 +1,40 @@
<div>
<div class="ui modal max-full-log{{.VersionName}} container" style="height: 90%;margin: 3rem auto;">
<div class="file-info" style="padding: 2rem;justify-content: space-between;">
<div style="font-size: 16px;font-weight:600">日志文件</div>
<div>
<div class="file-info close-log-dialog" data-version="{{.VersionName}}" style="margin-left: 1rem;color:#0366d6;cursor: pointer;">
<i class="ri-fullscreen-exit-fill" style="font-size: 16px;"></i>
<span style="margin-left: 0.3rem;font-size: 12px;">退出全屏</span>
</div>
</div>
</div>
<div style="margin: 0 2rem;border: 1px solid #e8e8e8;height: 88%;position: relative;">
<span>
<a style="position: absolute; right: -32px;cursor: pointer;"
class="log_top-max" data-version="{{.VersionName}}" data-max="-max"><i class="icon-to-top"></i></a>
</span>
<span class="log-info-{{.VersionName}}">
<a style="position: absolute; bottom: 10px;right: -32px;cursor: pointer;"
class="log_bottom-max" data-version="{{.VersionName}}" data-max="-max"><i
class="icon-to-bottom"></i></a>
</span>
<div class="ui message message-max{{.VersionName}}" style="display: none;">
<div id="header"></div>
</div>
<div class="log-scroll-max" id="log-max{{.VersionName}}" data-version="{{.VersionName}}" style="overflow: auto;max-height: 100%;">
<div class="ui inverted active dimmer">
<div class="ui loader"></div>
</div>
<pre id="log_file-max{{.VersionName}}"></pre>
</div>
</div>
</div>
</div>
<script>
$(".ui.modal .close-log-dialog").click(function () {
let version_name = $(this).data("version");
$(`.ui.modal.max-full-log${version_name}`).modal("hide");
});
</script>

+ 17
- 9
templates/repo/cloudbrain/benchmark/show.tmpl View File

@@ -524,14 +524,17 @@
</div>
</div>
<div class="ui tab" data-tab="second{{$k}}">
<div>
<div class="file-info"></div>>
<a id="{{.VersionName}}-log-down"
class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}}'
class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}} file-info'
href="/api/v1/repos/{{$.RepoRelPath}}/cloudbrain/{{.ID}}/download_log_file">
<i class="ri-download-cloud-2-line"></i>
<span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span>
</a>
<div class="file-info full-log-dialog" data-version="{{.VersionName}}" style="margin-left: 1rem;color:#0366d6;cursor: pointer;">
<i class="ri-aspect-ratio-line"></i>
<span style="margin-left: 0.3rem;">全屏查看</span>
</div>
</div>
<div
style="position: relative;border: 1px solid rgba(0,0,0,.2);padding: 0 10px;margin-top: 10px;">
@@ -549,12 +552,16 @@
</div>
<div class="ui attached log log-scroll" id="log{{.VersionName}}" data-version="{{.VersionName}}"
style="height: 300px !important; overflow: auto;">
<div class="ui inverted active dimmer">
<div class="ui loader"></div>
</div>
<input type="hidden" name="end_line" value>
<input type="hidden" name="start_line" value>
<pre id="log_file{{.VersionName}}"></pre>
<div class="ui inverted active dimmer">
<div class="ui loader"></div>
</div>
<input type="hidden" name="end_line" value>
<input type="hidden" name="end_line-max" value>
<input type="hidden" name="start_line-max" value>
<input type="hidden" name="start_line-max-copy" value>
<input type="hidden" name="start_line" value> <input type="hidden" name="start_line" value>
<input type="hidden" name="init_log" value>
<pre id="log_file{{.VersionName}}"></pre>
</div>
</div>
@@ -565,6 +572,7 @@
</div>
</div>
</div>
{{template "custom/max_log" .}}
{{end}} {{template "base/paginate" .}}
</div>
<!-- 确认模态框 -->


+ 17
- 10
templates/repo/cloudbrain/inference/show.tmpl View File

@@ -535,14 +535,17 @@
</div>

<div class="ui tab" data-tab="third">
<div>
<div class="file-info">
<a id="{{.VersionName}}-log-down"
class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}}'
class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}} file-info'
href="/api/v1/repos/{{$.RepoRelPath}}/cloudbrain/{{.ID}}/download_log_file">
<i class="ri-download-cloud-2-line"></i>
<span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span>
</a>
<div class="file-info full-log-dialog" data-version="{{.VersionName}}" style="margin-left: 1rem;color:#0366d6;cursor: pointer;">
<i class="ri-aspect-ratio-line"></i>
<span style="margin-left: 0.3rem;">全屏查看</span>
</div>
</div>
<div
style="position: relative;border: 1px solid rgba(0,0,0,.2);padding: 0 10px;margin-top: 10px;">
@@ -559,13 +562,17 @@
<div id="header"></div>
</div>
<div class="ui attached log log-scroll" id="log{{.VersionName}}" data-version="{{.VersionName}}"
style="height: 300px !important; overflow: auto;">
<div class="ui inverted active dimmer">
style="height: 300px !important; overflow: auto;">
<div class="ui inverted active dimmer">
<div class="ui loader"></div>
</div>
<input type="hidden" name="end_line" value>
<input type="hidden" name="start_line" value>
<pre id="log_file{{.VersionName}}"></pre>
</div>
<input type="hidden" name="end_line" value>
<input type="hidden" name="end_line-max" value>
<input type="hidden" name="start_line-max" value>
<input type="hidden" name="start_line-max-copy" value>
<input type="hidden" name="start_line" value> <input type="hidden" name="start_line" value>
<input type="hidden" name="init_log" value>
<pre id="log_file{{.VersionName}}"></pre>
</div>
</div>
@@ -589,7 +596,7 @@
</div>
</div>
</div>
{{template "custom/max_log" .}}
{{end}}
</div>



+ 12
- 4
templates/repo/cloudbrain/trainjob/show.tmpl View File

@@ -524,14 +524,17 @@
</div>

<div class="ui tab" data-tab="third{{$k}}">
<div>
<div class="file-info">
<a id="{{.VersionName}}-log-down"
class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}}'
class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}} file-info'
href="/api/v1/repos/{{$.RepoRelPath}}/cloudbrain/{{.ID}}/download_log_file">
<i class="ri-download-cloud-2-line"></i>
<span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span>
</a>

<div class="file-info full-log-dialog" data-version="{{.VersionName}}" style="margin-left: 1rem;color:#0366d6;cursor: pointer;">
<i class="ri-aspect-ratio-line"></i>
<span style="margin-left: 0.3rem;">全屏查看</span>
</div>
</div>
<div style="position: relative;border: 1px solid rgba(0,0,0,.2);padding: 0 10px;margin-top: 10px;">
<span>
@@ -552,7 +555,11 @@
<div class="ui loader"></div>
</div>
<input type="hidden" name="end_line" value>
<input type="hidden" name="start_line" value>
<input type="hidden" name="end_line-max" value>
<input type="hidden" name="start_line-max" value>
<input type="hidden" name="start_line-max-copy" value>
<input type="hidden" name="start_line" value> <input type="hidden" name="start_line" value>
<input type="hidden" name="init_log" value>
<pre id="log_file{{.VersionName}}"></pre>
</div>

@@ -581,6 +588,7 @@
</div>
</div>
</div>
{{template "custom/max_log" .}}
{{end}} {{template "base/paginate" .}}
</div>
<!-- 确认模态框 -->


+ 12
- 4
templates/repo/grampus/trainjob/show.tmpl View File

@@ -520,14 +520,17 @@
</div>
</div>
<div class="ui tab" data-tab="second{{$k}}">
<div>
<div class="file-info">
<a id="{{.VersionName}}-log-down"
class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}}'
class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}} file-info'
href="/api/v1/repos/{{$.RepoRelPath}}/grampus/train-job/{{.JobID}}/download_log">
<i class="ri-download-cloud-2-line"></i>
<span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span>
</a>

<div class="file-info full-log-dialog" data-log-type="c2Net" data-version="{{.VersionName}}" style="margin-left: 1rem;color:#0366d6;cursor: pointer;">
<i class="ri-aspect-ratio-line"></i>
<span style="margin-left: 0.3rem;">全屏查看</span>
</div>
</div>
<div style="position: relative;border: 1px solid rgba(0,0,0,.2);padding: 0 10px;margin-top: 10px;">
<span>
@@ -548,7 +551,11 @@
<div class="ui loader"></div>
</div>
<input type="hidden" name="end_line" value>
<input type="hidden" name="start_line" value>
<input type="hidden" name="end_line-max" value>
<input type="hidden" name="start_line-max" value>
<input type="hidden" name="start_line-max-copy" value>
<input type="hidden" name="start_line" value>
<input type="hidden" name="init_log" value>
<pre id="log_file{{.VersionName}}"></pre>
</div>

@@ -576,6 +583,7 @@
</div>
</div>
</div>
{{template "custom/max_log" .}}
{{end}} {{template "base/paginate" .}}
</div>
<!-- 确认模态框 -->


+ 13
- 10
templates/repo/modelarts/inferencejob/show.tmpl View File

@@ -460,14 +460,17 @@ td, th {
</div>

<div class="ui tab" data-tab="second">
<div>
<div class="file-info">
<a id="{{.VersionName}}-log-down"
class='{{if and ($.canDownload) (eq .Status "KILLED" "FAILED" "START_FAILED" "STOPPED" "COMPLETED") }}ti-download-file{{else}}disabled{{end}}'
class='{{if and ($.canDownload) (eq .Status "KILLED" "FAILED" "START_FAILED" "STOPPED" "COMPLETED") }}ti-download-file{{else}}disabled{{end}} file-info'
href="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/download_log_file?version_name={{.VersionName}}">
<i class="ri-download-cloud-2-line"></i>
<span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span>
</a>

<div class="file-info full-log-dialog" data-version="{{.VersionName}}" style="margin-left: 1rem;color:#0366d6;cursor: pointer;">
<i class="ri-aspect-ratio-line"></i>
<span style="margin-left: 0.3rem;">全屏查看</span>
</div>
</div>
<div style="position: relative;border: 1px solid rgba(0,0,0,.2);padding: 0 10px;margin-top: 10px;">
<span>
@@ -486,8 +489,12 @@ td, th {
<div class="ui inverted active dimmer">
<div class="ui loader"></div>
</div>
<input type="hidden" name="end_line" value>
<input type="hidden" name="start_line" value>
<input type="hidden" name="end_line" value>
<input type="hidden" name="end_line-max" value>
<input type="hidden" name="start_line-max" value>
<input type="hidden" name="start_line-max-copy" value>
<input type="hidden" name="start_line" value> <input type="hidden" name="start_line" value>
<input type="hidden" name="init_log" value>
<pre id="log_file{{.VersionName}}"></pre>
</div>

@@ -510,12 +517,8 @@ td, th {
</div>
</div>
</div>
{{template "custom/max_log" .}}
{{end}}





</div>
<!-- 确认模态框 -->
</div>


+ 1
- 39
templates/repo/modelarts/trainjob/show.tmpl View File

@@ -616,41 +616,7 @@
</div>
</div>
</div>

<div>
<div class="ui modal max-full-log{{.VersionName}} container" style="height: 90%;margin: 3rem auto;">
<div class="file-info" style="padding: 2rem;justify-content: space-between;">
<div style="font-size: 16px;font-weight:600">日志文件</div>
<div>
<div class="file-info close-log-dialog" data-version="{{.VersionName}}" style="margin-left: 1rem;color:#0366d6;cursor: pointer;">
<i class="ri-fullscreen-exit-fill" style="font-size: 16px;"></i>
<span style="margin-left: 0.3rem;font-size: 12px;">退出全屏</span>
</div>
</div>
</div>
<div style="margin: 0 2rem;border: 1px solid #e8e8e8;height: 88%;position: relative;">
<span>
<a title="{{$.i18n.Tr "repo.log_scroll_start"}}" style="position: absolute; right: -32px;cursor: pointer;"
class="log_top-max" data-version="{{.VersionName}}" data-max="-max"><i class="icon-to-top"></i></a>
</span>
<span class="log-info-{{.VersionName}}">
<a title="{{$.i18n.Tr "repo.log_scroll_end"}}" style="position: absolute; bottom: 10px;right: -32px;cursor: pointer;"
class="log_bottom-max" data-version="{{.VersionName}}" data-max="-max"><i
class="icon-to-bottom"></i></a>
</span>
<div class="ui message message-max{{.VersionName}}" style="display: none;">
<div id="header"></div>
</div>
<div class="log-scroll-max" id="log-max{{.VersionName}}" data-version="{{.VersionName}}" style="overflow: auto;max-height: 100%;">
<div class="ui inverted active dimmer">
<div class="ui loader"></div>
</div>
<pre id="log_file-max{{.VersionName}}"></pre>
</div>
</div>
</div>
</div>
{{template "custom/max_log" .}}
{{end}} {{template "base/paginate" .}}
</div>
<!-- 确认模态框 -->
@@ -764,10 +730,6 @@
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="/self/ztree/js/jquery.ztree.excheck.js"></script>
<script>
$(".ui.modal .close-log-dialog").click(function () {
let version_name = $(this).data("version");
$(`.ui.modal.max-full-log${version_name}`).modal("hide");
});
var setting = {
check: {
enable: true,


+ 18
- 9
templates/repo/modelsafety/show.tmpl View File

@@ -467,13 +467,17 @@
</div>
</div>
<div class="ui tab" data-tab="second0">
<div>
<div class="file-info">
<a id="-log-down"
class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}}'
class='{{if $.canDownload}}ti-download-file{{else}}disabled{{end}} file-info'
href="/api/v1/repos/{{$.RepoRelPath}}/cloudbrain">
<i class="ri-download-cloud-2-line"></i>
<span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span>
</a>
<div class="file-info full-log-dialog" data-version="{{.VersionName}}" style="margin-left: 1rem;color:#0366d6;cursor: pointer;">
<i class="ri-aspect-ratio-line"></i>
<span style="margin-left: 0.3rem;">全屏查看</span>
</div>
</div>
<div
style="position: relative;border: 1px solid rgba(0,0,0,.2);padding: 0 10px;margin-top: 10px;">
@@ -490,13 +494,17 @@
<div id="header"></div>
</div>
<div class="ui attached log log-scroll" id="log" data-version=""
style="height: 300px !important; overflow: auto;">
<div class="ui inverted active dimmer">
<div class="ui loader"></div>
</div>
<input type="hidden" name="end_line" value>
<input type="hidden" name="start_line" value>
<pre id="log_file"></pre>
style="height: 300px !important; overflow: auto;">
<div class="ui inverted active dimmer">
<div class="ui loader"></div>
</div>
<input type="hidden" name="end_line" value>
<input type="hidden" name="end_line-max" value>
<input type="hidden" name="start_line-max" value>
<input type="hidden" name="start_line-max-copy" value>
<input type="hidden" name="start_line" value> <input type="hidden" name="start_line" value>
<input type="hidden" name="init_log" value>
<pre id="log_file"></pre>
</div>
</div>
</div>
@@ -571,6 +579,7 @@
</div>
</div>
</div>
{{template "custom/max_log" .}}
{{template "base/paginate" .}}
</div>
<!-- 确认模态框 -->


+ 11
- 6
web_src/js/features/cloudbrainShow.js View File

@@ -15,6 +15,7 @@ export default async function initCloudrainSow() {
}

function logScroll(version_name, repoPath, ID, max = "", lines = 50) {
console.log("----------");
let container = document.querySelector(`#log${max}${version_name}`);
let scrollTop = container.scrollTop;
let scrollHeight = container.scrollHeight;
@@ -297,6 +298,7 @@ export default async function initCloudrainSow() {

$(".full-log-dialog").click(function () {
let version_name = $(this).data("version");
let log_type = $(this).data("log-type") || "";
let logContentDom = document.querySelector(`#log-max${version_name}`);
$(`.ui.modal.max-full-log${version_name}`)
.modal({
@@ -319,12 +321,15 @@ export default async function initCloudrainSow() {
logContentDom.scrollTop + 1,
logContentDom.scrollHeight - logContentDom.clientHeight
);
$(".log-scroll-max").bind("scroll", function () {
let version_name = $(this).data("version");
let ID = $(`#accordion${version_name}`).data("jobid");
let repoPath = $(`#accordion${version_name}`).data("repopath");
fn(version_name, repoPath, ID, "-max", 100);
});
if (log_type !== "c2Net") {
$(".log-scroll-max").bind("scroll", function () {
let version_name = $(this).data("version");
let ID = $(`#accordion${version_name}`).data("jobid");
let repoPath = $(`#accordion${version_name}`).data("repopath");
fn(version_name, repoPath, ID, "-max", 100);
});
}

$(".log_bottom-max").bind("click", logBottom);
$(".log_top-max").bind("click", logTop);
},


Loading…
Cancel
Save