Browse Source

Merge branch 'show-npu-metric' of https://git.openi.org.cn/OpenI/aiforge into show-npu-metric

pull/2283/head
zhoupzh 3 years ago
parent
commit
99d9e715b4
6 changed files with 17 additions and 10 deletions
  1. +1
    -1
      options/locale/locale_zh-CN.ini
  2. +1
    -1
      routers/repo/dataset.go
  3. +2
    -1
      templates/repo/create.tmpl
  4. +3
    -3
      templates/repo/datasets/index.tmpl
  5. +8
    -2
      templates/repo/modelarts/trainjob/show.tmpl
  6. +2
    -2
      web_src/js/index.js

+ 1
- 1
options/locale/locale_zh-CN.ini View File

@@ -1194,7 +1194,7 @@ template.topics=主题
template.avatar=头像 template.avatar=头像
template.issue_labels=任务标签 template.issue_labels=任务标签
template.one_item=必须至少选择一个模板项 template.one_item=必须至少选择一个模板项
template.one_promise=创建项目需承诺使用协议
template.one_promise=创建项目需承诺遵守使用协议
template.invalid=必须选择一个模板项目 template.invalid=必须选择一个模板项目
template.repo_adress=项目地址 template.repo_adress=项目地址
template.repo_path=项目地址 template.repo_path=项目地址


+ 1
- 1
routers/repo/dataset.go View File

@@ -173,7 +173,7 @@ func DatasetIndex(ctx *context.Context) {
uploader, _ := models.GetUserByID(attachment.UploaderID) uploader, _ := models.GetUserByID(attachment.UploaderID)
attachment.Uploader = uploader attachment.Uploader = uploader
if !strings.HasSuffix(attachment.Name, ".zip") { if !strings.HasSuffix(attachment.Name, ".zip") {
attachment.DecompressState = 3 //非zip文件
attachment.DecompressState = -1 //非zip文件
} }


} }


+ 2
- 1
templates/repo/create.tmpl View File

@@ -155,7 +155,8 @@
<input class="hidden" name="auto_agree" type="checkbox"> <input class="hidden" name="auto_agree" type="checkbox">
<label <label
style="width: 76%;text-align: justify;line-height: 1.5;">{{.i18n.Tr "repo.use_repo_agreement"}} style="width: 76%;text-align: justify;line-height: 1.5;">{{.i18n.Tr "repo.use_repo_agreement"}}
<a href="/home/term/">{{.i18n.Tr "repo.openi_use_agreement"}}</a></label>
<a target="_blank"
href="/home/term/">{{.i18n.Tr "repo.openi_use_agreement"}}</a></label>
</div> </div>
</div> </div>
</div> </div>


+ 3
- 3
templates/repo/datasets/index.tmpl View File

@@ -279,7 +279,7 @@
<el-tooltip class="item" effect="dark" placement="top" popper-class="diy-popper"> <el-tooltip class="item" effect="dark" placement="top" popper-class="diy-popper">
<div slot="content"><span class="wrap"> <div slot="content"><span class="wrap">


{{if ne .DecompressState 3}}{{$.i18n.Tr "dataset.unzip_status"}}:{{if eq .DecompressState 1}}{{$.i18n.Tr "dataset.unzip_successed"}}{{else if eq .DecompressState 0}}{{$.i18n.Tr "dataset.unzip_stared"}}{{else}}{{$.i18n.Tr "dataset.unzip_failed"}}{{end}}
{{if ne .DecompressState -1}}{{$.i18n.Tr "dataset.unzip_status"}}:{{if eq .DecompressState 1}}{{$.i18n.Tr "dataset.unzip_successed"}}{{else if eq .DecompressState 0 2}}{{$.i18n.Tr "dataset.unzip_stared"}}{{else}}{{$.i18n.Tr "dataset.unzip_failed"}}{{end}}
&nbsp;&nbsp;{{end}}<i &nbsp;&nbsp;{{end}}<i
class="ri-download-line"></i>{{$.i18n.Tr "dataset.download"}}:{{.DownloadCount}} class="ri-download-line"></i>{{$.i18n.Tr "dataset.download"}}:{{.DownloadCount}}
{{if .Description}}&nbsp;&nbsp;{{$.i18n.Tr "dataset.description"}}:{{.Description}}{{end}}</span> {{if .Description}}&nbsp;&nbsp;{{$.i18n.Tr "dataset.description"}}:{{.Description}}{{end}}</span>
@@ -288,10 +288,10 @@
{{if eq .DecompressState 1}} {{if eq .DecompressState 1}}
<i class="ri-folder-open-line" style="color: #5bb973;" <i class="ri-folder-open-line" style="color: #5bb973;"
title='{{$.i18n.Tr "dataset.unzip_successed"}}'></i> title='{{$.i18n.Tr "dataset.unzip_successed"}}'></i>
{{else if eq .DecompressState 0}}
{{else if eq .DecompressState 0 2}}
<i class="ri-folder-chart-2-line" style="color: #888888;" <i class="ri-folder-chart-2-line" style="color: #888888;"
title='{{$.i18n.Tr "dataset.unzip_stared"}}'></i> title='{{$.i18n.Tr "dataset.unzip_stared"}}'></i>
{{else if eq .DecompressState 2}}
{{else if eq .DecompressState 3}}
<i class="ri-folder-forbid-line" style="color: #101010;" <i class="ri-folder-forbid-line" style="color: #101010;"
title='{{$.i18n.Tr "dataset.unzip_failed"}}'></i> title='{{$.i18n.Tr "dataset.unzip_failed"}}'></i>
{{else}} {{else}}


+ 8
- 2
templates/repo/modelarts/trainjob/show.tmpl View File

@@ -487,8 +487,8 @@
</div> </div>
<div class="ui tab" data-tab="second{{$k}}"> <div class="ui tab" data-tab="second{{$k}}">
<div> <div>
<a class='{{if and (.CanModify) (eq .Status "KILLED" "FAILED" "START_FAILED" "STOPPED" "COMPLETED") }}ti-download-file{{else}}disabled{{end}}'
<a id="{{.VersionName}}-log-down"
class='{{if and (.CanModify) (eq .Status "KILLED" "FAILED" "START_FAILED" "STOPPED" "COMPLETED") }}ti-download-file{{else}}disabled{{end}}'
href="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/download_log_file?version_name={{.VersionName}}"> href="{{$.RepoLink}}/modelarts/train-job/{{.JobID}}/download_log_file?version_name={{.VersionName}}">
<i class="ri-download-cloud-2-line"></i> <i class="ri-download-cloud-2-line"></i>
<span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span> <span style="margin-left: 0.3rem;">{{$.i18n.Tr "repo.modelarts.download_log"}}</span>
@@ -734,6 +734,12 @@
// detail status and duration // detail status and duration
$('#' + version_name + '-duration').text(data.JobDuration) $('#' + version_name + '-duration').text(data.JobDuration)
$('#' + version_name + '-status').text(data.JobStatus) $('#' + version_name + '-status').text(data.JobStatus)
console.log(data)
if (["KILLED", "FAILED", "START_FAILED", "STOPPED", "COMPLETED"].includes(data.JobStatus)) {
$(`#${version_name}-log-down`).removeClass('disabled').addClass('ti-download-file')
$('#' + version_name + '-stop').addClass('disabled')
}

loadLog(version_name) loadLog(version_name)






+ 2
- 2
web_src/js/index.js View File

@@ -1214,7 +1214,7 @@ async function initRepository() {
files: $attachments files: $attachments
}, },
(data) => { (data) => {
if (data.length === 0) {
if (data.length === 0 || data.content === '') {
$renderContent.html($('#no-content').html()); $renderContent.html($('#no-content').html());
} else { } else {
$renderContent.html(data.content); $renderContent.html(data.content);
@@ -1225,7 +1225,7 @@ async function initRepository() {
let imageShow = '' let imageShow = ''
const $content = $segment.parent(); const $content = $segment.parent();
if (!$content.find('.ui.small.images').length) { if (!$content.find('.ui.small.images').length) {
if (data.attachments !== '') {
if (data.attachments !== '' && data.attachments) {
if ($content.find('.ui.middle.aligned').length === 0) { if ($content.find('.ui.middle.aligned').length === 0) {
imageShow += '<div class="ui clearing divider"></div>' imageShow += '<div class="ui clearing divider"></div>'
imageShow += '<div class="ui middle aligned padded grid">' imageShow += '<div class="ui middle aligned padded grid">'


Loading…
Cancel
Save