diff --git a/templates/repo/modelmanage/create_online.tmpl b/templates/repo/modelmanage/create_online.tmpl index 5d017c256..db3ca6cf9 100644 --- a/templates/repo/modelmanage/create_online.tmpl +++ b/templates/repo/modelmanage/create_online.tmpl @@ -1,12 +1,584 @@ {{template "base/head" .}} - - + + +
+
+
+
+
+
+
+
+
{{$repository := .Repository.ID}}
{{template "repo/header" .}}
-
-
+
+
+
+

+
+
+
+ +
+ +
+
+ +
+
+ + +   + +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+
- {{template "base/footer" .}} + + + diff --git a/templates/repo/modelmanage/index.tmpl b/templates/repo/modelmanage/index.tmpl index 2cced090f..7f21e4053 100644 --- a/templates/repo/modelmanage/index.tmpl +++ b/templates/repo/modelmanage/index.tmpl @@ -77,7 +77,7 @@ 导入本地模型 导入线上模型 + href="{{.RepoLink}}/modelmanage/create_online_model_tmpl">导入线上模型 {{if eq $.MODEL_COUNT 0}} diff --git a/web_src/vuepages/pages/modelmanage/common/modelmanage-common-detail.vue b/web_src/vuepages/pages/modelmanage/common/modelmanage-common-detail.vue index 997722807..1aff6d33f 100644 --- a/web_src/vuepages/pages/modelmanage/common/modelmanage-common-detail.vue +++ b/web_src/vuepages/pages/modelmanage/common/modelmanage-common-detail.vue @@ -21,8 +21,8 @@
可用集群:
-
- {{ state.type == 0 ? 'CPU/GPU' : 'NPU' }} +
+ {{ state.typeStr }}
@@ -32,10 +32,22 @@
{{ state.modelSize }}
-
+
描述:
-
-
{{ state.description }}
+
+
+ {{ state.description }} + +
+
+ + + +
@@ -52,10 +64,22 @@
{{ state.createTime }}
-
+
标签:
-
-
{{ state.label }}
+
+
+ {{ state.label }} + +
+
+ + + +
@@ -66,13 +90,13 @@
训练任务:
-
{{ state.displayJobName }}
+
代码分支:
-
{{ state.branchName }}
+
@@ -192,6 +216,10 @@ export default { label: '', description: '', }, + editDescr: '', + isEidtDescr: false, + editLabel: '', + isEidtLabel: false, engineList: MODEL_ENGINES, curVersion: '', modelList: [], @@ -205,6 +233,7 @@ export default { this.modelType = data.modelType; this.canOperate = data.isCanOper; this.state.type = data.type; + this.state.typeStr = data.type == 0 ? 'CPU/GPU' : data.type == 1 ? 'NPU' : ''; this.state.id = data.id; this.state.name = data.name; this.state.version = data.version; @@ -212,7 +241,9 @@ export default { this.state.engineName = getListValueWithKey(MODEL_ENGINES, data.engine.toString()); this.state.modelSize = transFileSize(data.size); this.state.label = data.label || '--'; + this.state._label = data.label; this.state.description = data.description || '--'; + this.state._description = data.description; this.state.createTime = formatDate(new Date(data.createdUnix * 1000), 'yyyy-MM-dd HH:mm:ss'); const trainTaskInfo = data.trainTaskInfo ? JSON.parse(data.trainTaskInfo) : ''; @@ -228,14 +259,27 @@ export default { if (trainTaskInfo) { const parameters = trainTaskInfo.Parameters ? JSON.parse(trainTaskInfo.Parameters).parameter : []; const parametersStr = parameters.map((item) => { return item.label + '=' + item.value }).join('; '); + const taskType = trainTaskInfo.Type; + let taskUrl = location.href.split('modelmanage')[0]; + if (taskType == 0) { + taskUrl = taskUrl + 'cloudbrain/train-job/' + trainTaskInfo.JobID; + } else if (taskType == 1) { + taskUrl = taskUrl + 'modelarts/train-job/' + trainTaskInfo.JobID; + } else if (taskType == 2) { + taskUrl = taskUrl + 'grampus/train-job/' + trainTaskInfo.JobID; + } + const versionName = trainTaskInfo.VersionName; + const versionHtml = versionName ? `${versionName}` : ''; + const codeCommitID = data.codeCommitID; + const codeCommitIDHtml = codeCommitID ? `${codeCommitID}` : ''; Object.assign(this.state, { - displayJobName: trainTaskInfo.DisplayJobName, - branchName: trainTaskInfo.BranchName, + displayJobName: `${trainTaskInfo.DisplayJobName}${versionHtml}`, + branchName: `${trainTaskInfo.BranchName}${codeCommitIDHtml}`, bootFile: trainTaskInfo.BootFile, datasetName: trainTaskInfo.DatasetName, parameters: parametersStr || '--', workServerNumber: trainTaskInfo.WorkServerNumber || '--', - specStr: trainTaskInfo.Spec ? trainTaskInfo.Spec.toString() : '--' + specStr: trainTaskInfo.FlavorName || '--', }); } this.curVersion = version; @@ -256,6 +300,43 @@ export default { goUploadPage() { window.location.href = `${this.repo}/modelmanage/create_local_model_tmpl2?type=0&name=${this.state.name}&id=${this.state.id}`; }, + submitEidt(type) { + const obj = { + repo: this.repo, + type: this.state.type, + id: this.state.id, + name: this.state.name, + version: this.state.version, + engine: this.state.engine, + label: type == 'label' ? this.editLabel : this.state.label, + description: type == 'descr' ? this.editDescr : this.state.description, + }; + modifyModel(obj).then(res => { + res = res.data; + if (res && res.code == '0') { + if (type == 'label') { + this.state.label = this.editLabel; + this.state._label = this.editLabel; + this.isEidtLabel = false; + } else if (type == 'descr') { + this.state.description = this.editDescr; + this.state._description = this.editDescr; + this.isEidtDescr = false; + } + } else { + this.$message({ + type: 'error', + message: '信息修改失败', + }); + } + }).catch(err => { + console.log(err); + this.$message({ + type: 'error', + message: '信息修改失败', + }); + }); + }, deleteFile(file) { this.$confirm('请确认是否删除当前模型文件?', this.$t('tips'), { confirmButtonText: this.$t('confirm1'), @@ -350,8 +431,12 @@ export default { .row { display: flex; height: 32px; - align-items: center; margin-bottom: 4px; + align-items: center; + + &.edit-row { + height: unset; + } .tit { width: 160px; @@ -365,14 +450,30 @@ export default { position: relative; height: 20px; + &.edit-val { + height: unset; + } + .txt-wrap { position: absolute; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; + + /deep/.append-txt { + margin-left: 6px; + background-color: gainsboro; + padding: 2px; + border-radius: 2px; + font-size: 12px; + } } } + + .txt-edit { + padding-right: 20px; + } } } } @@ -466,9 +567,13 @@ export default { } } -/deep/ .el-input__inner { - font-weight: 600; +.el-select { + /deep/ .el-input__inner { + font-weight: 600; + } +} +/deep/ .el-input__inner { &:focus { border-color: #85b7d9; }