Browse Source

Merge remote-tracking branch 'origin/master' into cloud

# Conflicts:
#	Makefile
#	admin-portal/src/api/dataManager.js
#	admin-portal/src/api/globalVariable.js
#	admin-portal/src/api/modelDev.js
#	admin-portal/src/error/index.js
#	admin-portal/src/views/userManager/user.vue
#	build/application/api-doc/dockerfile
#	deploy/charts/octopus/templates/api-doc.yaml
#	deploy/charts/octopus/templates/base-server.yaml
#	deploy/charts/octopus/values.yaml
#	openai-portal/src/api/datasetManager.js
#	openai-portal/src/api/generalView.js
#	openai-portal/src/api/globalVariable.js
#	openai-portal/src/api/imageManager.js
#	openai-portal/src/api/trainingManager.js
#	server/admin-server/configs/config.yaml
#	server/base-server/configs/config.yaml
#	server/base-server/internal/conf/conf.proto
#	server/base-server/internal/data/data.go
#	server/common/errors/codes.go
#	server/common/utils/protoc.go
#	server/go.mod
#	server/go.sum
#	server/openai-server/configs/config.yaml
tags/v4.1.0-cloud.40
linfengjun 6 days ago
parent
commit
fe3903ad1c
100 changed files with 5188 additions and 2736 deletions
  1. +1
    -3
      .drone.yml
  2. +2
    -0
      .golangci.yaml
  3. +1
    -0
      admin-portal/.env.development
  4. +25
    -11
      admin-portal/.eslintrc.js
  5. +5
    -0
      admin-portal/README.md
  6. +58
    -27
      admin-portal/src/api/dataManager.js
  7. +9
    -3
      admin-portal/src/api/globalVariable.js
  8. +4
    -1
      admin-portal/src/api/imageManager.js
  9. +116
    -45
      admin-portal/src/api/modelDev.js
  10. +5
    -5
      admin-portal/src/api/modelManager.js
  11. +15
    -8
      admin-portal/src/api/resourceManager.js
  12. +12
    -4
      admin-portal/src/api/trainingManager.js
  13. +1
    -1
      admin-portal/src/components/Breadcrumb/index.vue
  14. +31
    -22
      admin-portal/src/components/search/index.vue
  15. +197
    -69
      admin-portal/src/components/upload/index.vue
  16. +17
    -8
      admin-portal/src/error/index.js
  17. +5
    -4
      admin-portal/src/layout/components/Navbar.vue
  18. +1
    -2
      admin-portal/src/layout/components/Sidebar/index.vue
  19. +3
    -3
      admin-portal/src/layout/index.vue
  20. +4
    -2
      admin-portal/src/main.js
  21. +2
    -6
      admin-portal/src/permission.js
  22. +17
    -0
      admin-portal/src/preventReClick.js
  23. +24
    -8
      admin-portal/src/router/index.js
  24. +2
    -1
      admin-portal/src/store/getters.js
  25. +6
    -3
      admin-portal/src/store/modules/user.js
  26. +3
    -11
      admin-portal/src/utils/index.js
  27. +12
    -1
      admin-portal/src/utils/minIO.js
  28. +1
    -1
      admin-portal/src/utils/request.js
  29. +1
    -4
      admin-portal/src/utils/requestLog.js
  30. +5
    -6
      admin-portal/src/utils/requestMinIO.js
  31. +28
    -18
      admin-portal/src/views/Home/login.vue
  32. +3
    -4
      admin-portal/src/views/clusterMonitor/clusterMonitor.vue
  33. +6
    -7
      admin-portal/src/views/clusterMonitor/groupMonitor.vue
  34. +24
    -9
      admin-portal/src/views/clusterMonitor/index.vue
  35. +85
    -96
      admin-portal/src/views/dataManager/components/newVersion.vue
  36. +109
    -105
      admin-portal/src/views/dataManager/components/preDatasetCreation.vue
  37. +11
    -11
      admin-portal/src/views/dataManager/components/preview.vue
  38. +28
    -23
      admin-portal/src/views/dataManager/components/reuploadDataset.vue
  39. +157
    -173
      admin-portal/src/views/dataManager/components/versionList.vue
  40. +305
    -0
      admin-portal/src/views/dataManager/datasetConfig.vue
  41. +64
    -44
      admin-portal/src/views/dataManager/index.vue
  42. +58
    -61
      admin-portal/src/views/dataManager/templateList.vue
  43. +44
    -45
      admin-portal/src/views/dataManager/userList.vue
  44. +60
    -39
      admin-portal/src/views/devManager/algorithmManager.vue
  45. +288
    -0
      admin-portal/src/views/devManager/components/algorithm/algorithmConfig.vue
  46. +171
    -131
      admin-portal/src/views/devManager/components/algorithm/preAlgorithmCreation.vue
  47. +95
    -100
      admin-portal/src/views/devManager/components/algorithm/preAlgorithmVersionCreation.vue
  48. +59
    -66
      admin-portal/src/views/devManager/components/algorithm/reuploadAlgorithm.vue
  49. +66
    -59
      admin-portal/src/views/devManager/components/algorithm/templateList.vue
  50. +39
    -30
      admin-portal/src/views/devManager/components/algorithm/userList.vue
  51. +220
    -233
      admin-portal/src/views/devManager/components/algorithm/versionList.vue
  52. +58
    -0
      admin-portal/src/views/devManager/components/notebook/detailDialog.vue
  53. +139
    -0
      admin-portal/src/views/devManager/components/notebook/notebookInfo.vue
  54. +86
    -47
      admin-portal/src/views/devManager/components/notebook/notebookList.vue
  55. +113
    -0
      admin-portal/src/views/devManager/components/notebook/notebookProfile.vue
  56. +27
    -15
      admin-portal/src/views/devManager/notebook.vue
  57. +101
    -95
      admin-portal/src/views/imageManager/Image.vue
  58. +38
    -48
      admin-portal/src/views/imageManager/components/dialogForm.vue
  59. +17
    -6
      admin-portal/src/views/imageManager/index.vue
  60. +32
    -71
      admin-portal/src/views/modelManager/Model.vue
  61. +61
    -61
      admin-portal/src/views/modelManager/components/createDialog.vue
  62. +11
    -19
      admin-portal/src/views/modelManager/components/previewDialog.vue
  63. +84
    -0
      admin-portal/src/views/modelManager/components/reupload.vue
  64. +94
    -75
      admin-portal/src/views/modelManager/components/versionList.vue
  65. +18
    -7
      admin-portal/src/views/modelManager/index.vue
  66. +41
    -53
      admin-portal/src/views/resourceManager/components/ResourceSpec.vue
  67. +21
    -30
      admin-portal/src/views/resourceManager/components/nodeList.vue
  68. +68
    -85
      admin-portal/src/views/resourceManager/components/poolManager.vue
  69. +41
    -59
      admin-portal/src/views/resourceManager/components/resource.vue
  70. +40
    -30
      admin-portal/src/views/resourceManager/nodeManager.vue
  71. +41
    -31
      admin-portal/src/views/resourceManager/resPoolManager.vue
  72. +13
    -3
      admin-portal/src/views/resourceManager/resSpecManager.vue
  73. +19
    -8
      admin-portal/src/views/resourceManager/resourceMsg.vue
  74. +264
    -0
      admin-portal/src/views/timeManager/component/consumption.vue
  75. +264
    -0
      admin-portal/src/views/timeManager/component/recharge.vue
  76. +71
    -63
      admin-portal/src/views/timeManager/component/time.vue
  77. +74
    -0
      admin-portal/src/views/timeManager/consumption.vue
  78. +16
    -6
      admin-portal/src/views/timeManager/machine.vue
  79. +73
    -0
      admin-portal/src/views/timeManager/recharge.vue
  80. +25
    -11
      admin-portal/src/views/traningManager/components/index.vue
  81. +169
    -0
      admin-portal/src/views/traningManager/components/taskInfo.vue
  82. +19
    -21
      admin-portal/src/views/traningManager/components/taskLoad.vue
  83. +35
    -47
      admin-portal/src/views/traningManager/components/taskLog.vue
  84. +30
    -40
      admin-portal/src/views/traningManager/components/taskProfile.vue
  85. +16
    -5
      admin-portal/src/views/traningManager/index.vue
  86. +39
    -51
      admin-portal/src/views/traningManager/traningTaskList.vue
  87. +81
    -69
      admin-portal/src/views/userManager/components/addDialog.vue
  88. +80
    -66
      admin-portal/src/views/userManager/components/operateDialog.vue
  89. +16
    -5
      admin-portal/src/views/userManager/index.vue
  90. +61
    -92
      admin-portal/src/views/userManager/user.vue
  91. +18
    -0
      deploy/charts/octopus/Chart.yaml
  92. +0
    -1
      deploy/charts/octopus/README.md
  93. BIN
      deploy/charts/octopus/charts/influxdb-4.10.0.tgz
  94. +4
    -1
      deploy/charts/octopus/requirements.yaml
  95. +46
    -0
      deploy/charts/octopus/templates/_helpers.tpl
  96. +5
    -0
      deploy/charts/octopus/templates/base-server.yaml
  97. +86
    -0
      deploy/charts/octopus/templates/eventrouter.yaml
  98. +2
    -0
      deploy/charts/octopus/templates/prometheus.yaml
  99. +10
    -1
      deploy/charts/octopus/templates/storage/initdb.yaml
  100. +16
    -1
      deploy/charts/octopus/templates/storage/pv.yaml

+ 1
- 3
.drone.yml View File

@@ -6,11 +6,9 @@ platform:
os: linux
arch: amd64
trigger:
branch:
- master
- dev
event:
- push
- pull_request
steps:
- name: 代码检查
image: golangci/golangci-lint:v1.40.1


+ 2
- 0
.golangci.yaml View File

@@ -71,3 +71,5 @@ run:
- resourcepool.go
- resourcespec.go
- node.go
- develop.go
- train_job.go

+ 1
- 0
admin-portal/.env.development View File

@@ -4,3 +4,4 @@ ENV = 'development'
# base api
VUE_APP_BASE_API = '/adminserver'
VUE_APP_BASE_API2 = ''
VUE_APP_BASE_DOMAIN=''

+ 25
- 11
admin-portal/.eslintrc.js View File

@@ -24,6 +24,22 @@ module.exports = {
"vue/singleline-html-element-content-newline": "off",
"vue/multiline-html-element-content-newline":"off",
"vue/name-property-casing": ["error", "PascalCase"],
"vue/html-self-closing": ["error", {
"html": {
"void": "never",
"normal": "any",
"component": "always"
},
"svg": "always",
"math": "always"
}],
// "vue/name-property-casing": ["off", "PascalCase"],
// 'vue/attribute-hyphenation': 0,
// "vue/require-default-prop": 0,
// "vue/prop-name-casing": 0,
// "vue/this-in-template": 0,
// "vue/require-prop-type-constructor": 0,
// "vue/no-dupe-keys":0,
"vue/no-v-html": "off",
'accessor-pairs': 2,
'arrow-spacing': [2, {
@@ -46,16 +62,16 @@ module.exports = {
'constructor-super': 2,
'curly': [2, 'multi-line'],
'dot-location': [2, 'property'],
'eol-last': 2,
'eqeqeq': ["error", "always", {"null": "ignore"}],
// 'eqeqeq': ["error", "always", {"null": "ignore"}],
'eqeqeq': ["off", "always", {"null": "ignore"}],
'generator-star-spacing': [2, {
'before': true,
'after': true
}],
'handle-callback-err': [2, '^(err|error)$'],
'indent': [2, 2, {
'SwitchCase': 1
}],
// "indent": [1, 4],
"vue/html-indent":['off',4],
'jsx-quotes': [2, 'prefer-single'],
'key-spacing': [2, {
'beforeColon': false,
@@ -80,7 +96,8 @@ module.exports = {
'no-delete-var': 2,
'no-dupe-args': 2,
'no-dupe-class-members': 2,
'no-dupe-keys': 2,
// 'no-dupe-keys': 2,
'no-dupe-keys': 0,
'no-duplicate-case': 2,
'no-empty-character-class': 2,
'no-empty-pattern': 2,
@@ -162,11 +179,8 @@ module.exports = {
}
}],
'padded-blocks': [2, 'never'],
'quotes': [2, 'single', {
'avoidEscape': true,
'allowTemplateLiterals': true
}],
'semi': [2, 'never'],

'semi-spacing': [2, {
'before': false,
'after': true


+ 5
- 0
admin-portal/README.md View File

@@ -88,3 +88,8 @@ Modern browsers and Internet Explorer 10+.
[MIT](https://github.com/PanJiaChen/vue-admin-template/blob/master/LICENSE) license.

Copyright (c) 2017-present PanJiaChen

## notice

本地调试执行npm run dev需要在env.development文件中配置环境变量VUE_APP_BASE_DOMAIN中的地址


+ 58
- 27
admin-portal/src/api/dataManager.js View File

@@ -13,50 +13,50 @@ export function judgeParam(params) {
return conditions
}

export async function getUserDatasetList(payload){
let conditions = judgeParam(payload)
export async function getUserDatasetList(payload) {
const conditions = judgeParam(payload)
const res = await request({
url: "/v1/datasetmanage/userdataset?" + conditions.join("&"),
method: "get",
method: "get"
})
return res
}

export async function getPresetDatasetList(payload){
let conditions = judgeParam(payload)
export async function getPresetDatasetList(payload) {
const conditions = judgeParam(payload)
const res = await request({
url: "/v1/datasetmanage/predataset?" + conditions.join("&"),
method: "get",
method: "get"
})
return res
}

export async function getVersionList(payload){
let conditions = judgeParam(payload)
export async function getVersionList(payload) {
const conditions = judgeParam(payload)
const res = await request({
url: `/v1/datasetmanage/dataset/${payload.id}/version?` + conditions.join("&"),
method: "get",
method: "get"
})
return res
}

export async function deleteDatasetVersion(payload){
export async function deleteDatasetVersion(payload) {
const res = await request({
url: `/v1/datasetmanage/dataset/${payload.datasetId}/version/${payload.version}`,
method: "delete",
method: "delete"
})
return res
}

export async function deleteDataset(id){
export async function deleteDataset(id) {
const res = await request({
url: `/v1/datasetmanage/dataset/${id}`,
method: "delete",
method: "delete"
})
return res
}

export async function createPreDataset(payload){
export async function createPreDataset(payload) {
const res = await request({
url: "/v1/datasetmanage/dataset",
method: "post",
@@ -65,10 +65,10 @@ export async function createPreDataset(payload){
return res
}

export async function uploadPreDataset(payload){
export async function uploadPreDataset(payload) {
const res = await request({
url: `/v1/datasetmanage/dataset/${payload.id}/version/${payload.version}/upload`,
method: "post",
method: "post",
data: {
fileName: payload.fileName,
domain: payload.domain
@@ -77,18 +77,18 @@ export async function uploadPreDataset(payload){
return res
}

export async function preDatasetFinishUpload(payload){
export async function preDatasetFinishUpload(payload) {
const res = await request({
url: `/v1/datasetmanage/dataset/${payload.id}/version/${payload.version}/uploadconfirm`,
method: "put",
data:{
data: {
fileName: payload.fileName
}
})
return res
}

export async function createNewVersion(payload){
export async function createNewVersion(payload) {
const res = await request({
url: `/v1/datasetmanage/dataset/${payload.datasetId}/version`,
method: "post",
@@ -99,10 +99,10 @@ export async function createNewVersion(payload){
return res
}

export async function uploadNewVersion(payload){
export async function uploadNewVersion(payload) {
const res = await request({
url: `/v1/datasetmanage/dataset/${payload.datasetId}/version/${payload.version}/upload`,
method: "post",
method: "post",
data: {
fileName: payload.fileName,
domain: payload.domain
@@ -111,22 +111,53 @@ export async function uploadNewVersion(payload){
return res
}

export async function newVersionFinishUpload(payload){
export async function newVersionFinishUpload(payload) {
const res = await request({
url: `/v1/datasetmanage/dataset/${payload.datasetId}/version/${payload.version}/uploadconfirm`,
method: "put",
data:{
data: {
fileName: payload.fileName
}
})
return res
}

export async function previewDataset(payload){
let conditions = judgeParam(payload)
export async function previewDataset(payload) {
const conditions = judgeParam(payload)
const res = await request({
url: `/v1/datasetmanage/dataset/${payload.datasetId}/version/${payload.version}/file?`+ conditions.join("&"),
url: `/v1/datasetmanage/dataset/${payload.datasetId}/version/${payload.version}/file?` + conditions.join("&"),
method: "get"
})
return res
}
export async function datasetType(params) {
const res = await request({
url: `/v1/datasetmanage/datasettype`,
method: "get",
params: params
})
return res
}
}
export async function addDatasetType(data) {
const res = await request({
url: `/v1/datasetmanage/datasettype`,
method: "post",
data: { typeDesc: data }
})
return res
}
export async function deleteDatasetType(params) {
const res = await request({
url: `/v1/datasetmanage/datasettype/${params}`,
method: "delete"
})
return res
}
export async function updateDatasetType(data) {
const res = await request({
url: `/v1/datasetmanage/datasettype/${data.id}`,
method: "put",
data: data
})
return res
}

+ 9
- 3
admin-portal/src/api/globalVariable.js View File

@@ -1,7 +1,13 @@

let DOMAIN
if (process.env.NODE_ENV === 'development') { DOMAIN = 'http://192.168.203.156' }
else { DOMAIN = window.location.protocol + '//' + document.domain }
if (process.env.NODE_ENV === 'development') {
// eslint-disable-next-line no-undef
DOMAIN = process.env.VUE_APP_BASE_DOMAIN || 'http://192.168.202.73'
} else {
if (!window.location.port || window.location.port == '') { DOMAIN = window.location.protocol + '//' + document.domain }
else { DOMAIN = window.location.protocol + '//' + document.domain + ':' + window.location.port }
}
export default {
DOMAIN
}
}
// 本地调试执行npm run dev指令需要修改DOMAIN地址,将http://192.168.202.73替换成服务器地址

+ 4
- 1
admin-portal/src/api/imageManager.js View File

@@ -47,7 +47,10 @@ export function uploadMiniIO(params) {
return requestMinIO({
url: params.uploadUrl,
method: 'put',
data: params.file
data: params.file,
onUploadProgress: function(progress) {
sessionStorage.setItem(JSON.stringify(params.id), JSON.stringify(parseInt(((progress.loaded / progress.total) * 100))));
}
})
}
// 完成镜像上传


+ 116
- 45
admin-portal/src/api/modelDev.js View File

@@ -1,60 +1,69 @@
import request from '@/utils/request'

export function judgeParam(params) {
let conditions = []
const conditions = []
conditions.push(`pageSize=` + params.pageSize);
conditions.push(`pageIndex=` + params.pageIndex);
params.orderBy?conditions.push(`orderBy=` + params.orderBy):null;
params.sortBy?conditions.push(`sortBy=` + params.sortBy):null;
params.searchKey?conditions.push(`searchKey=` + params.searchKey):null;
params.createdAtGte?conditions.push(`createdAtGte=` + params.createdAtGte):null;
params.createdAtLt?conditions.push(`createdAtLt=` + params.createdAtLt):null;
params.status?conditions.push(`status=` + params.status):null;
params.fileStatus?conditions.push(`fileStatus=` + params.fileStatus):null;
params.algorithmVersion?conditions.push(`algorithmVersion=` + params.algorithmVersion):null;
params.orderBy ? conditions.push(`orderBy=` + params.orderBy) : null;
params.sortBy ? conditions.push(`sortBy=` + params.sortBy) : null;
params.searchKey ? conditions.push(`searchKey=` + params.searchKey) : null;
params.createdAtGte ? conditions.push(`createdAtGte=` + params.createdAtGte) : null;
params.createdAtLt ? conditions.push(`createdAtLt=` + params.createdAtLt) : null;
params.status ? conditions.push(`status=` + params.status) : null;
params.fileStatus ? conditions.push(`fileStatus=` + params.fileStatus) : null;
params.algorithmVersion ? conditions.push(`algorithmVersion=` + params.algorithmVersion) : null;
return conditions
}

export async function getNotebookList(payload){
let conditions = judgeParam(payload)
export async function getNotebookList(payload) {
const conditions = judgeParam(payload)
const res = await request({
url: "/v1/developmanage/notebook?" + conditions.join("&"),
method: "get",
method: "get"
})
return res
}

export async function stopNotebook(id){
export async function getNotebookInfo(params) {
const res = await request({
url: `/v1/developmanage/notebookevent`,
method: 'get',
params
})
return res
}

export async function stopNotebook(id) {
const res = await request({
url: `/v1/developmanage/notebook/${id}/stop`,
method: "post",
method: "post"
})
return res
}

export async function getUserAlgorithmList(payload){
let conditions = judgeParam(payload)
export async function getUserAlgorithmList(payload) {
const conditions = judgeParam(payload)
const res = await request({
url: `/v1/algorithmmanage/allalgorithm?` + conditions.join("&"),
method: "get",
method: "get"
})
return res
}

export async function getPresetAlgorithmList(payload){
let conditions = judgeParam(payload)
export async function getPresetAlgorithmList(payload) {
const conditions = judgeParam(payload)
const res = await request({
url: "/v1/algorithmmanage/prealgorithm?" + conditions.join("&"),
method: "get",
method: "get"
})
return res
}

export async function getAlgorithmVersionList(payload){
let conditions = judgeParam(payload)
export async function getAlgorithmVersionList(payload) {
const conditions = judgeParam(payload)
const res = await request({
url: `/v1/algorithmmanage/algorithm/${payload.algorithmId}?` + conditions.join("&"),
method: "get",
method: "get"
})
return res
}
@@ -62,42 +71,42 @@ export async function getAlgorithmVersionList(payload){
export async function queryAlgorithmVersion(payload) {
const res = await request({
url: `/v1/algorithmmanage/algorithm/${payload.algorithmId}/version/${payload.version}`,
method: 'get',
method: 'get'
})
return res
}

export async function addPreAlgorithm(payload){
export async function addPreAlgorithm(payload) {
const res = await request({
url: `/v1/algorithmmanage/prealgorithm`,
method: "post",
data: payload
method: "post",
data: payload
})
return res
}

export async function addPreAlgorithmVersion(payload){
export async function addPreAlgorithmVersion(payload) {
const res = await request({
url: `/v1/algorithmmanage/prealgorithm/${payload.algorithmId}`,
method: "post",
method: "post",
data: {
oriVersion : payload.oriVersion,
algorithmDescript : payload.algorithmDescript
}
oriVersion: payload.oriVersion,
algorithmDescript: payload.algorithmDescript
}
})
return res
}

export async function uploadPreAlgorithm(payload){
export async function uploadPreAlgorithm(payload) {
const res = await request({
url: `/v1/algorithmmanage/prealgorithm/${payload.algorithmId}/version/${payload.version}/upload`,
method: "post",
data: payload
method: "post",
data: payload
})
return res
}

export async function preAlgorithmFinishUpload(payload){
export async function preAlgorithmFinishUpload(payload) {
const res = await request({
url: `/v1/algorithmmanage/prealgorithm/${payload.algorithmId}/version/${payload.version}/uploadconfirm`,
method: "put",
@@ -106,34 +115,96 @@ export async function preAlgorithmFinishUpload(payload){
return res
}

export async function compressAlgorithm(payload){
export async function compressAlgorithm(payload) {
const res = await request({
url: `/v1/algorithmmanage/algorithm/${payload.algorithmId}/version/${payload.version}/downloadcompress`,
method: "post",
method: "post"
})
return res
}

export async function downloadAlgorithmVersion(payload){
export async function downloadAlgorithmVersion(payload) {
const res = await request({
url: `/v1/algorithmmanage/algorithm/${payload.algorithmId}/version/${payload.version}/download?domain=${payload.domain}&compressAt=${payload.compressAt}`,
method: "get",
method: "get"
})
return res
}

export async function deletePreAlgorithmVersion(payload){
export async function deletePreAlgorithmVersion(payload) {
const res = await request({
url: `/v1/algorithmmanage/prealgorithm/${payload.algorithmId}/version/${payload.version}`,
method: "delete",
method: "delete"
})
return res
}

export async function deletePreAlgorithm(algorithmId){
export async function deletePreAlgorithm(algorithmId) {
const res = await request({
url: `/v1/algorithmmanage/prealgorithm/${algorithmId}`,
method: "delete",
method: "delete"
})
return res
}
}
export async function algorithmType(params) {
const res = await request({
url: `/v1/algorithmmanage/algorithmtype`,
method: "get",
params: params
})
return res
}
export async function addAlgorithmType(data) {
const res = await request({
url: `/v1/algorithmmanage/algorithmtype`,
method: "post",
data: { typeDesc: data }
})
return res
}
export async function deleteAlgorithmType(params) {
const res = await request({
url: `/v1/algorithmmanage/algorithmtype/${params}`,
method: "delete"
})
return res
}
export async function updateAlgorithmType(data) {
const res = await request({
url: `/v1/algorithmmanage/algorithmtype/${data.id}`,
method: "put",
data: data
})
return res
}
export async function frameType(params) {
const res = await request({
url: `/v1/algorithmmanage/algorithmframework`,
method: "get",
params: params
})
return res
}
export async function addFrameType(data) {
const res = await request({
url: `/v1/algorithmmanage/algorithmframework`,
method: "post",
data: { frameworkDesc: data }
})
return res
}
export async function deleteFrameType(params) {
const res = await request({
url: `/v1/algorithmmanage/algorithmframework/${params}`,
method: "delete"
})
return res
}
export async function updateFrameType(data) {
const res = await request({
url: `/v1/algorithmmanage/algorithmframework/${data.id}`,
method: "put",
data: data
})
return res
}

+ 5
- 5
admin-portal/src/api/modelManager.js View File

@@ -14,7 +14,7 @@ export function getPreModel(params) {
})
}

//查询模型版本列表
// 查询模型版本列表
export function getModelList(params) {
return request({
url: `/v1/modelmanage/model/${params.modelId}`,
@@ -22,25 +22,25 @@ export function getModelList(params) {
params: { pageIndex: params.pageIndex, pageSize: params.pageSize }
})
}
//删除预置模型
// 删除预置模型
export function deletePreModel(params) {
return request({
url: `/v1/modelmanage/premodel/${params.modelId}`,
method: 'delete',
method: 'delete'
})
}
// 删除预置模型版本
export function deletePreModelVersion(params) {
return request({
url: `/v1/modelmanage/premodel/${params.modelId}/version/${params.version}`,
method: 'delete',
method: 'delete'
})
}
// 模型版本下载
export function downloadModel(params) {
return request({
url: `/v1/modelmanage/model/${params.modelId}/version/${params.version}/download?domain=${params.domain}`,
method: 'get',
method: 'get'
})
}
// 模型管理预览


+ 15
- 8
admin-portal/src/api/resourceManager.js View File

@@ -3,7 +3,7 @@ import request from '@/utils/request'
export function getResourcePool() {
return request({
url: '/v1/resourcemanage/resourcepool',
method: 'get',
method: 'get'

})
}
@@ -46,8 +46,7 @@ export function updateResourcePool(data) {
return request({
url: `/v1/resourcemanage/resourcepool/${data.id}`,
method: 'put',
data: { desc:data.desc, bindingNodes:data.bindingNodes, mapResourceSpecIdList:data.mapResourceSpecIdList }

data: { desc: data.desc, bindingNodes: data.bindingNodes, mapResourceSpecIdList: data.mapResourceSpecIdList }

})
}
@@ -55,7 +54,7 @@ export function updateResourcePool(data) {
export function getNodeList() {
return request({
url: '/v1/resourcemanage/node',
method: 'get',
method: 'get'
})
}
// 创建自定义资源
@@ -71,7 +70,7 @@ export function updateResource(data) {
return request({
url: `/v1/resourcemanage/resource/${data.id}`,
method: 'put',
data:{desc:data.desc,resourceRef:data.resourceRef,bindingNodes:data.bindingNodes}
data: { desc: data.desc, resourceRef: data.resourceRef, bindingNodes: data.bindingNodes }

})
}
@@ -79,7 +78,7 @@ export function updateResource(data) {
export function deleteSpecification(params) {
return request({
url: `/v1/resourcemanage/resourcespec/${params}`,
method: 'delete',
method: 'delete'

})
}
@@ -87,7 +86,7 @@ export function deleteSpecification(params) {
export function getResourceList() {
return request({
url: '/v1/resourcemanage/resource',
method: 'get',
method: 'get'

})
}
@@ -95,7 +94,15 @@ export function getResourceList() {
export function deleteResource(params) {
return request({
url: `/v1/resourcemanage/resource/${params}`,
method: 'delete',
method: 'delete'

})
}
// 获取群组绑定资源池
export function getGroupResourcePool() {
return request({
url: '/v1/usermanage/workspaces',
method: 'get'

})
}

+ 12
- 4
admin-portal/src/api/trainingManager.js View File

@@ -12,28 +12,36 @@ export function getTraining(params) {
export function stopTraining(params) {
return request({
url: `/v1/trainmanage/trainjob/${params}/stop`,
method: 'post',
method: 'post'
})
}
//获取训练任务详情
// 获取训练任务详情
export function trainingDetail(params) {
return request({
url: `/v1/trainmanage/trainjob/${params}`,
method: 'get'
})
}
//任务日志访问
// 任务日志访问
export function showLog(params) {
return requestLog({
url: `/log/user/trainjob/${params.jobId}/${params.subName}/index.log`,
method: 'get'
})
}
//下载训练任务日志
// 下载训练任务日志
export function downloadLog(params) {
return requestLog({
url: `/log/download/user/trainjob/${params.jobId}/${params.subName}/index.log`,
method: 'get'
})
}
// 训任务运行信息
export function getTempalteInfo(params) {
return request({
url: `/v1/trainmanage/trainjobevent`,
method: 'get',
params
})
}


+ 1
- 1
admin-portal/src/components/Breadcrumb/index.vue View File

@@ -34,7 +34,7 @@
const first = matched[0]

if (!this.isDashboard(first)) {
matched = [{ path: '/dashboard', meta: { title: '' } }].concat(matched)
matched = [{ path: '/dashboard', meta: { title: '' }}].concat(matched)
}

this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)


+ 31
- 22
admin-portal/src/components/search/index.vue View File

@@ -1,27 +1,32 @@
<template>
<div>
<el-dialog title="高级搜索" :visible.sync="dialogFormVisible" :close-on-click-modal="false">
<el-form :inline="true" class="demo-form-inline" ref="searchForm" :label-position="labelPosition"
label-width="100px">
<el-form-item :label=item.label v-for="item in searchForm" :key="item.props">
<el-input v-model="searchData[item.prop]" :placeholder="item.placeholder"
v-if="item.type==='Input'">
</el-input>
<el-form
ref="searchForm"
:inline="true"
class="demo-form-inline"
:label-position="labelPosition"
label-width="100px"
>
<el-form-item v-for="item in searchForm" :key="item.props" :label="item.label">
<el-input
v-if="item.type==='Input'"
v-model="searchData[item.prop]"
:placeholder="item.placeholder"
/>
<el-select v-if="item.type==='Select'" v-model="searchData[item.prop]">
<el-option v-for="op in item.options" :label="op.label" :value="op.value" :key="op.value">
</el-option>
<el-option v-for="op in item.options" :key="op.value" :label="op.label" :value="op.value" />
</el-select>
<el-date-picker
v-if="item.type==='Time'"
v-model="searchData[item.prop]"
<el-date-picker
v-if="item.type==='Time'"
v-model="searchData[item.prop]"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="timestamp"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="timestamp"
class="data"
>
</el-date-picker>
/>
</el-form-item>
</el-form>
<div class="buttonWrapper">
@@ -31,7 +36,7 @@
</el-dialog>
<el-form :inline="true" class="demo-form-inline">
<el-form-item>
<el-input v-model.trim="searchData.searchKey" :placeholder=blurName></el-input>
<el-input v-model.trim="searchData.searchKey" :placeholder="blurName" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">搜索</el-button>
@@ -43,7 +48,7 @@
<script>
export default {
props: {
searchForm: { type: Array, default: [] },
searchForm: { type: Array, default: () => [] },
blurName: { type: String, default: '' }
},
data() {
@@ -51,21 +56,21 @@
advanced: false,
searchData: { searchKey: '' },
dialogFormVisible: false,
labelPosition: 'left',
labelPosition: 'left'

}
},
methods: {
onSubmit() {
if (this.dialogFormVisible) { this.searchData.searchKey = "" }
if (!this.dialogFormVisible) {this.searchData = {searchKey:this.searchData.searchKey} }
if (!this.dialogFormVisible) { this.searchData = { searchKey: this.searchData.searchKey } }
if (this.dialogFormVisible) { this.dialogFormVisible = !this.dialogFormVisible }
this.$emit('searchData', this.searchData)
},
changeSearchType() {
this.dialogFormVisible = !this.dialogFormVisible
},
reset() { this.searchData = {searchKey:''} }
reset() { this.searchData = { searchKey: '' } }
}
}
</script>
@@ -74,6 +79,10 @@
text-align: center;
}

.el-select {
width: 188px;
}

.el-select>.el-input {
max-width: 185px !important;
}


+ 197
- 69
admin-portal/src/components/upload/index.vue View File

@@ -1,32 +1,28 @@
<template>
<div>
<el-upload
v-if="showUpload"
class="upload-demo"
action="#"
:on-change="upload"
:file-list="fileList"
:http-request="httpRequest"
multiple
:accept="accept"
>
<el-button size="small" type="primary" :disabled="loadingShow" :loading="loadingShow">点击上传</el-button>
<div class="tipText">{{ this.tipText }}</div>
<el-upload v-if="showUpload" class="upload-demo" action="#" :on-change="upload" :file-list="fileList"
:http-request="httpRequest" multiple :accept="accept" :disabled="show||progress>=0&&progress<=100">
<el-button size="small" type="primary" :disabled="show||progress>=0&&progress<=100" >点击上传
</el-button>
<div class="tipText">{{ tipText }}</div>
</el-upload>
<el-button :loading="loadingShow" size="small" v-if="!showUpload" type="primary">上传中</el-button>
<div slot="footer" v-if="show" class="dialog-footer">
<el-button @click="cancel">取 消</el-button>
<el-button type="primary" @click="confirm">确 定</el-button>
</div>
<el-button v-if="!showUpload" :loading="loadingShow" size="small" type="primary">上传中</el-button>
<el-tooltip class="item" effect="dark" :content="message" placement="top-start" v-if="!showUpload">
<i class="el-icon-warning-outline"></i>
</el-tooltip>
<el-progress :text-inside="true" :stroke-width="18" :percentage="progress-1" class="progress"
v-if="progress>0&&progress<=100" />
</div>
</template>
<script>
import { uploadPreImage, finishUpload, uploadMiniIO } from '@/api/imageManager.js'
import { uploadPreImage, finishUpload } from '@/api/imageManager.js'
import { uploadPreDataset, preDatasetFinishUpload, uploadNewVersion, newVersionFinishUpload } from "@/api/dataManager.js"
import { uploadPreAlgorithm, preAlgorithmFinishUpload } from "@/api/modelDev.js";
import { uploadModel, modelFinishUpload } from '@/api/modelManager.js'
import { minIO } from '@/utils/minIO'
import { getErrorMsg } from '@/error/index'
import { mapGetters } from 'vuex'
import store from '@/store'
export default {
props: {
uploadData: {
@@ -42,43 +38,86 @@
show: false,
loadingShow: false,
showUpload: true,
accept:"application/zip",
tipText: '上传文件格式为 zip'
accept: "application/zip",
tipText: '上传文件格式为 zip',
progress: undefined,
timer: undefined,
message: '上传过程中,本上传页面关闭,不影响上传,但是关闭或者刷新浏览器,上传会被停止'
}
},
created(){
computed: {
...mapGetters([
'progressId',
])
},
created() {
this.timer = setInterval(() => {
if (this.showProgress()) {
if (parseInt(sessionStorage.getItem(JSON.stringify(store.state.user.progressId)))) {
this.progress = parseInt(sessionStorage.getItem(JSON.stringify(store.state.user.progressId)))
this.$emit('upload', true)
}
}
}, 1000)
if (this.uploadData.type === "imageManager") {
this.accept = "application/zip,.tar"
this.tipText = '上传文件格式为 zip 或 tar'
}
},
destory() {
clearInterval(this.timer)
},
watch: {
progress(a, b) {
if (a == 100) {
this.show = true
this.loadingShow = false
}
if (0 < a < 100) {
this.loadingShow = true
}
}
},
methods: {
getErrorMsg(code) {
return getErrorMsg(code)
},
beforeUpload(file, fileList) {

// sessionStorage.setItem(JSON.stringify(store.state.user.progressId), 0);
},
upload(file, fileList) {
// if (this.uploadData.type = "镜像模块") {
if (file) { this.fileList = [file] }
if (file) {
this.fileList = [file]
// sessionStorage.setItem(JSON.stringify(store.state.user.progressId), 0);
}
// }
},
httpRequest() {
let fileName = this.fileList[0].name
let fileForm = fileName.slice(fileName.lastIndexOf(".") + 1).toLowerCase() //获取上传文件格式后缀
const fileName = this.fileList[0].name
const fileForm = fileName.slice(fileName.lastIndexOf(".") + 1).toLowerCase() // 获取上传文件格式后缀
if (this.uploadData.type === "imageManager") {
this.loadingShow = true
this.showUpload = false
this.show = false
if (fileForm === 'zip' || fileForm === 'tar') {
this.$emit('upload', false)
uploadPreImage({ id: this.uploadData.data.id, fileName: this.fileList[0].name, domain: this.GLOBAL.DOMAIN }).then(response => {
store.commit('user/SET_PROGRESSID', this.uploadData.data.id)
const param = {
uploadUrl: response.data.uploadUrl,
file: this.fileList[0].raw
file: this.fileList[0].raw,
id: this.uploadData.data.id
}
uploadMiniIO(param).then(response => {
if (response.success) {
minIO(param).then(response => {
this.$nextTick(() => {
this.loadingShow = false
this.show = true
this.showUpload = true
}
this.show = true
this.showUpload = true
this.confirm()
})

})
})
} else {
@@ -94,19 +133,36 @@
if (this.uploadData.type === "modelManager") {
this.loadingShow = true
this.showUpload = false
this.show = false
if (fileForm === 'zip') {
this.$emit('upload', false)
uploadModel({ modelId: this.uploadData.data.modelId, version: this.uploadData.data.version, fileName: this.fileList[0].name, domain: this.GLOBAL.DOMAIN }).then(response => {
const param = {
uploadUrl: response.data.uploadUrl,
file: this.fileList[0].raw
}
uploadMiniIO(param).then(response => {
if (response.success) {
this.show = true
this.loadingShow = false
this.showUpload = true
if (response.success) {
store.commit('user/SET_PROGRESSID', this.uploadData.data.modelId + this.uploadData.data.version)
const param = {
uploadUrl: response.data.uploadUrl,
file: this.fileList[0].raw,
id: this.uploadData.data.modelId + this.uploadData.data.version
}
})
minIO(param).then(response => {
if (response.success) {
this.show = true
this.loadingShow = false
this.showUpload = true
this.confirm()
}
})
}
else {
this.$message({
message: this.getErrorMsg(response.error.subcode),
type: 'warning'
});
this.loadingShow = false
this.showUpload = true
this.fileList = []
}

})
} else {
this.loadingShow = false
@@ -120,6 +176,7 @@
} else if (this.uploadData.type === "preDatasetCreation") {
this.loadingShow = true
this.showUpload = false
this.show = false
const param = {
id: this.uploadData.id,
fileName: this.fileList[0].name,
@@ -127,17 +184,21 @@
domain: this.GLOBAL.DOMAIN
}
if (fileForm === 'zip') {
this.$emit('upload', false)
uploadPreDataset(param).then(response => {
if (response.success) {
// let uploadUrl = response.data.uploadUrl.replace("octopus-dev-minio:9000","192.168.202.73")
store.commit('user/SET_PROGRESSID', this.uploadData.id + this.uploadData.version)
const param = {
uploadUrl: response.data.uploadUrl,
file: this.fileList[0].raw
file: this.fileList[0].raw,
id: this.uploadData.id + this.uploadData.version
}
minIO(param).then(response => {
this.loadingShow = false
this.show = true
this.showUpload = true
this.confirm()
})
} else {
this.$message({
@@ -162,23 +223,28 @@
} else if (this.uploadData.type === "newPreDatasetVersion") {
this.loadingShow = true
this.showUpload = false
this.show = false
const param = {
datasetId: this.uploadData.datasetId,
fileName: this.fileList[0].name,
version: this.uploadData.version,
domain: this.GLOBAL.DOMAIN
}
if (fileForm === 'zip') {
if (fileForm === 'zip') {
this.$emit('upload', false)
uploadNewVersion(param).then(response => {
if (response.success) {
store.commit('user/SET_PROGRESSID', this.uploadData.datasetId + this.uploadData.version)
const param = {
uploadUrl: response.data.uploadUrl,
file: this.fileList[0].raw
file: this.fileList[0].raw,
id: this.uploadData.datasetId + this.uploadData.version
}
minIO(param).then(response => {
this.loadingShow = false
this.show = true
this.showUpload = true
this.confirm()
})
} else {
this.$message({
@@ -202,23 +268,29 @@
}
} else if (this.uploadData.type === 'newPreAlgorithm') {
this.loadingShow = true
this.showUpload = false
this.show = false
const param = {
algorithmId: this.uploadData.algorithmId,
FileName: this.fileList[0].name,
version: this.uploadData.version,
domain: this.GLOBAL.DOMAIN
}
if (fileForm === 'zip') {
if (fileForm === 'zip') {
this.$emit('upload', false)
uploadPreAlgorithm(param).then(response => {
if (response.success) {
store.commit('user/SET_PROGRESSID', this.uploadData.algorithmId + this.uploadData.version)
const param = {
uploadUrl: response.data.uploadUrl,
file: this.fileList[0].raw
file: this.fileList[0].raw,
id: this.uploadData.algorithmId + this.uploadData.version
}
minIO(param).then(response => {
this.loadingShow = false
this.show = true
this.showUpload = true
this.confirm()
})
} else {
this.$message({
@@ -242,6 +314,8 @@
}
} else if (this.uploadData.type === 'newPreAlgorithmVersion') {
this.loadingShow = true
this.showUpload = false
this.show = false
const param = {
algorithmId: this.uploadData.algorithmId,
FileName: this.fileList[0].name,
@@ -249,16 +323,20 @@
domain: this.GLOBAL.DOMAIN
}
if (fileForm === 'zip') {
this.$emit('upload', false)
uploadPreAlgorithm(param).then(response => {
store.commit('user/SET_PROGRESSID', this.uploadData.algorithmId + this.uploadData.version)
if (response.success) {
const param = {
uploadUrl: response.data.uploadUrl,
file: this.fileList[0].raw
file: this.fileList[0].raw,
id: this.uploadData.algorithmId + this.uploadData.version
}
minIO(param).then(response => {
this.loadingShow = false
this.show = true
this.showUpload = true
this.confirm()
})
} else {
this.$message({
@@ -271,8 +349,8 @@
this.fileList = []
}
})
} else {
this.loadingShow = false
} else {
this.loadingShow = false
this.showUpload = true
this.fileList = []
this.$message({
@@ -287,20 +365,20 @@
finishUpload({ id: this.uploadData.data.id }).then(response => {
if (response.success) {
this.$message({
message: '创建成功',
message: '上传成功',
type: 'success'
});
this.$emit('confirm', false)
}
else {
sessionStorage.setItem(JSON.stringify(this.uploadData.data.id), 0),
this.$emit('confirm', false)
} else {
this.$message({
message: this.getErrorMsg(response.error.subcode),
type: 'warning'
});
});
sessionStorage.setItem(JSON.stringify(this.uploadData.data.id), 0)
}
})
}
else if (this.uploadData.type === "modelManager") {
} else if (this.uploadData.type === "modelManager") {
modelFinishUpload({ fileName: this.fileList[0].name, modelId: this.uploadData.data.modelId, version: this.uploadData.data.version }).then(
response => {
if (response.success) {
@@ -308,15 +386,16 @@
message: '创建成功',
type: 'success'
});
this.$emit('confirm', false)
}
else {
sessionStorage.setItem(JSON.stringify(this.uploadData.data.modelId + this.uploadData.data.version), 0),
this.$emit('confirm', false)
} else {
this.$message({
message: this.getErrorMsg(response.error.subcode),
type: 'warning'
});
});
sessionStorage.setItem(JSON.stringify(this.uploadData.data.modelId + this.uploadData.data.version), 0)
}
},
}

)
} else if (this.uploadData.type === "preDatasetCreation") {
@@ -327,11 +406,14 @@
}
preDatasetFinishUpload(payload).then(response => {
if (response.success) {
this.$message.success("上传预置数据集成功"); } else {
sessionStorage.setItem(JSON.stringify(this.uploadData.id + this.uploadData.version), 0),
this.$message.success("上传预置数据集成功");
} else {
this.$message({
message: this.getErrorMsg(response.error.subcode),
type: 'warning'
});
sessionStorage.setItem(JSON.stringify(this.uploadData.id + this.uploadData.version), 0)
}
}, this.$emit('confirm', false))
} else if (this.uploadData.type === 'newPreDatasetVersion') {
@@ -342,12 +424,14 @@
}
newVersionFinishUpload(payload).then(response => {
if (response.success) {
this.$message.success("上传预置数据集版本成功");
sessionStorage.setItem(JSON.stringify(this.uploadData.datasetId + this.uploadData.version), 0),
this.$message.success("上传预置数据集版本成功");
} else {
this.$message({
message: this.getErrorMsg(response.error.subcode),
type: 'warning'
});
sessionStorage.setItem(JSON.stringify(this.uploadData.datasetId + this.uploadData.version), 0)
}
}, this.$emit('confirm', false))
} else if (this.uploadData.type === 'newPreAlgorithm') {
@@ -358,12 +442,14 @@
}
preAlgorithmFinishUpload(payload).then(response => {
if (response.success) {
this.$message.success("上传预置算法成功");
sessionStorage.setItem(JSON.stringify(this.uploadData.algorithmId + this.uploadData.version), 0),
this.$message.success("上传预置算法成功");
} else {
this.$message({
message: this.getErrorMsg(response.error.subcode),
type: 'warning'
});
sessionStorage.setItem(JSON.stringify(this.uploadData.algorithmId + this.uploadData.version), 0)
}
}, this.$emit('confirm', false))
} else if (this.uploadData.type === 'newPreAlgorithmVersion') {
@@ -374,18 +460,20 @@
}
preAlgorithmFinishUpload(payload).then(response => {
if (response.success) {
this.$message.success("上传预置算法新版本成功");
sessionStorage.setItem(JSON.stringify(this.uploadData.algorithmId + this.uploadData.version), 0),
this.$message.success("上传预置算法新版本成功");
} else {
this.$message({
message: this.getErrorMsg(response.error.subcode),
type: 'warning'
});
sessionStorage.setItem(JSON.stringify(this.uploadData.algorithmId + this.uploadData.version), 0)
}
}, this.$emit('confirm', false))
}
},
cancel() {
this.$confirm('此操作将被取消,是否继续?','提示',{
this.$confirm('此操作将被取消,是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@@ -397,8 +485,33 @@
message: '已中断取消操作'
});
})
},
// 显示进度条
showProgress() {
if (store.state.user.progressId) {
if (store.state.user.progressId == this.uploadData.data.id) {
return true
}
if (store.state.user.progressId == this.uploadData.datasetId + this.uploadData.version) {
return true
}
if (store.state.user.progressId == this.uploadData.id + this.uploadData.version) {
return true
}
if (store.state.user.progressId == this.uploadData.algorithmId + this.uploadData.version) {
return true
}

if (store.state.user.progressId == this.uploadData.data.modelId + this.uploadData.data.version) {
return true
}
else { return false }
}
else { return false }

}


}
}
</script>
@@ -406,9 +519,24 @@
.dialog-footer {
text-align: right;
}

.tipText {
float:right;
margin-left:10px;
font-size:12px
float: right;
margin-left: 10px;
font-size: 12px
}

.progress {
margin: 5px 0px 10px 0px;
}

.dialog-footer {
margin-top: 10px;
}

.item {
margin-left: 5px;
font-size: 16px;
color: #409EFF;
}
</style>
</style>

+ 17
- 8
admin-portal/src/error/index.js View File

@@ -100,16 +100,16 @@ const error = {
13005: '无权限镜像操作',

/* 14001~15000 开发管理错误*/
14001: 'notebook状态不允许操作',
14002: 'notebook使用镜像不在权限范围内',
14003: 'notebook使用算法不在权限范围内',
14001: 'NoteBook状态不允许操作',
14002: 'NoteBook使用镜像不在权限范围内',
14003: 'NoteBook使用算法不在权限范围内',
14004: '余额不足',
14005: '解析资源规格失败',
14006: 'notebook使用镜像状态不允许操作',
14007: 'notebook使用算法状态不允许操作',
14008: 'notebook重复',
14009: 'notebook使用数据集不在权限范围内',
14010: 'notebook使用数据集状态不允许操作',
14006: 'NoteBook使用镜像状态不允许操作',
14007: 'NoteBook使用算法状态不允许操作',
14008: 'NoteBook重复',
14009: 'NoteBook使用数据集不在权限范围内',
14010: 'NoteBook使用数据集状态不允许操作',

/* 15001~16000 训练管理错误*/
15001: '训练使用镜像不在权限范围内',
@@ -145,6 +145,7 @@ const error = {
16023: '空间已存在',
16024: '空间不存在',
16025: '用户无空间权限',
16026: '空间与资源池已绑定',
/* 17001~18000 计费管理错误*/
17001: '获取锁失败',
17002: '状态不允许操作',
@@ -163,6 +164,14 @@ const error = {
19003: '没有权限操作',
19004: ' 数据集重复',
19005: '状态不允许操作',
12012: '算法类型被引用',
12013: '算法框架被引用',
12014: '算法类型重复',
12015: '算法框架重复',
19006: '数据集类型被引用',
19007: '数据集类型重复'

19005: '状态不允许操作',

/* 20001-21000 第三方平台管理错误*/
20001: '平台名称重复',


+ 5
- 4
admin-portal/src/layout/components/Navbar.vue View File

@@ -6,11 +6,12 @@
<el-row class="demo-avatar demo-basic">
<el-dropdown>
<i class="el-icon-document" style="color:#666699;"></i>
<a href="" class="manual">管理手册</a>
<el-dropdown-menu slot="dropdown">
</el-dropdown-menu>
<a href="https://octopus.openi.org.cn/docs/management/intro" target="_blank" class="manual">管理手册</a>
<i class="el-icon-service" style="color:#666699 ;"></i>
<a href="https://git.openi.org.cn/OpenI/octopus/issues" target="_blank" class="manual">问题意见</a>
<el-dropdown-menu slot="dropdown" />
</el-dropdown>
<el-avatar :src="circleUrl" :size="size"></el-avatar>
<el-avatar :src="circleUrl" :size="size" />
<el-dropdown>
<span class="el-dropdown-link">
管理员<i class="el-icon-arrow-down el-icon--right"></i>


+ 1
- 2
admin-portal/src/layout/components/Sidebar/index.vue View File

@@ -1,6 +1,6 @@
<template>
<div :class="{'has-logo':true}">
<logo :collapse="isCollapse" />
<logo :collapse="isCollapse" />
<el-scrollbar wrap-class="scrollbar-wrapper">
<el-menu
:default-active="activeMenu"
@@ -29,7 +29,6 @@ export default {
computed: {
...mapGetters([
'sidebar'
]),
routes() {
return this.$router.options.routes


+ 3
- 3
admin-portal/src/layout/index.vue View File

@@ -1,9 +1,9 @@
<template>
<div :class="classObj" class="app-wrapper">
<div v-if="device==='mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
<div :class="classObj" class="app-wrapper">
<div v-if="device==='mobile' && sidebar.opened" class="drawer-bg" @click="handleClickOutside" />
<sidebar class="sidebar-container" />
<div class="main-container">
<div :class="{'fixed-header':fixedHeader}">
<div :class="{'fixed-header':fixedHeader}">
<navbar />
</div>
<app-main />


+ 4
- 2
admin-portal/src/main.js View File

@@ -3,7 +3,7 @@ import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import locale from 'element-ui/lib/locale/lang/en' // lang i18n
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import zhLocale from 'element-ui/lib/locale/lang/zh-CN'
import '@/styles/index.scss' // global css
import App from './App'
import store from './store'
@@ -14,6 +14,7 @@ import VueAwesomeSwiper from 'vue-awesome-swiper'
import '../theme/index.css'
import '@/styles/dot.scss'
import globalVariable from '@/api/globalVariable.js'
import install from './preventReClick'
Vue.prototype.GLOBAL = globalVariable
/**
* If you don't want to use mock-server
@@ -32,7 +33,8 @@ Vue.prototype.GLOBAL = globalVariable
Vue.use(ElementUI, { zhLocale })
// 如果想要中文版 element-ui,按如下方式声明
// Vue.use(ElementUI)
Vue.use(VueAwesomeSwiper, /* { default global options } */)
Vue.use(VueAwesomeSwiper /* { default global options } */)
Vue.use(install)
Vue.config.productionTip = false

new Vue({


+ 2
- 6
admin-portal/src/permission.js View File

@@ -1,6 +1,4 @@
import router from './router'
import store from './store'
import { Message } from 'element-ui'
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import { getToken } from '@/utils/auth' // get token from cookie
@@ -24,10 +22,8 @@ router.beforeEach(async (to, from, next) => {
// if is logged in, redirect to the home page
next('/index')
NProgress.done()
}
else { next() }
}
else {
} else { next() }
} else {
if (whiteList.indexOf(to.path) !== -1) {
// in the free login whitelist, go directly
next()


+ 17
- 0
admin-portal/src/preventReClick.js View File

@@ -0,0 +1,17 @@
export default {
install(Vue) {
// 防重复点击(指令实现)
Vue.directive('preventReClick', {
inserted(el, binding) {
el.addEventListener('click', () => {
if (!el.disabled) {
el.disabled = true
setTimeout(() => {
el.disabled = false
}, binding.value || 1000)
}
})
}
})
}
}

+ 24
- 8
admin-portal/src/router/index.js View File

@@ -33,7 +33,7 @@ import Layout from '@/layout'
export const constantRoutes = [
{
path: '/',
component: () => import('@/views/Home/login'),
component: () => import('@/views/Home/login')
},

{
@@ -104,12 +104,28 @@ export const constantRoutes = [
{
path: '/timeManager',
component: Layout,
meta: {
title: '机时管理',
icon: 'time'
},
children: [
{
path: 'index',
name: '/',
component: () => import('@/views/timeManager/index'),
meta: { title: '机时管理', icon: 'time' }
path: 'machine',
name: 'machine',
component: () => import('@/views/timeManager/machine'),
meta: { title: '机时', icon: 'dot' }
},
{
path: 'recharge',
name: 'recharge',
component: () => import('@/views/timeManager/recharge'),
meta: { title: '充值', icon: 'dot' }
},
{
path: 'consumption',
name: 'consumption',
component: () => import('@/views/timeManager/consumption'),
meta: { title: '消费', icon: 'dot' }
}
]
},
@@ -125,7 +141,7 @@ export const constantRoutes = [
name: 'dataManager',
component: () => import('@/views/dataManager/index'),
meta: { title: '数据管理', icon: 'data' }
},
}
]
},
{
@@ -150,14 +166,14 @@ export const constantRoutes = [
path: 'notebook',
name: '/',
component: () => import('@/views/devManager/notebook'),
meta: { title: 'Notebook', icon: 'dot' }
meta: { title: 'NoteBook', icon: 'dot' }
},
{
path: 'algorithmManager',
name: '/',
component: () => import('@/views/devManager/algorithmManager'),
meta: { title: '算法管理', icon: 'dot' }
},
}
]
},
{


+ 2
- 1
admin-portal/src/store/getters.js View File

@@ -3,6 +3,7 @@ const getters = {
device: state => state.app.device,
token: state => state.user.token,
avatar: state => state.user.avatar,
name: state => state.user.name
name: state => state.user.name,
progressId: state => state.user.progressId
}
export default getters

+ 6
- 3
admin-portal/src/store/modules/user.js View File

@@ -1,12 +1,12 @@
import { login } from '@/api/user'
import { getToken, setToken, removeToken } from '@/utils/auth'
import { resetRouter } from '@/router'
import { getToken, setToken } from '@/utils/auth'
import { Message } from 'element-ui'
const getDefaultState = () => {
return {
token: getToken(),
name: '',
avatar: ''
avatar: '',
progressId: undefined
}
}

@@ -18,6 +18,9 @@ const mutations = {
// },
SET_TOKEN: (state, token) => {
state.token = token
},
SET_PROGRESSID: (state, progressId) => {
state.progressId = progressId
}
// SET_NAME: (state, name) => {
// state.name = name


+ 3
- 11
admin-portal/src/utils/index.js View File

@@ -120,25 +120,19 @@ export function formatSize(size) {
size = size.substring(0, size.length - 2)
size = size * 1024
return size
}
else if (size.indexOf('Mi') !== -1) {
} else if (size.indexOf('Mi') !== -1) {
size = size.substring(0, size.length - 2)
size = size * 1024 * 1024
return size
}
else if (size.indexOf('Gi') !== -1) {
} else if (size.indexOf('Gi') !== -1) {
size = size.substring(0, size.length - 2)
size = size * 1024 * 1024 * 1024
return size
}
else if (size.indexOf('Ti') !== -1) {
} else if (size.indexOf('Ti') !== -1) {
size = size.substring(0, size.length - 2)
size = size * 1024 * 1024 * 1024 * 1024
return size
}



}
export function formatDuring(mss) {
mss = mss * 1000
@@ -153,5 +147,3 @@ export function formatDuring(mss) {
return days + hours + minutes + seconds
}




+ 12
- 1
admin-portal/src/utils/minIO.js View File

@@ -1,13 +1,24 @@
import requestMinIO from '@/utils/requestMinIO'
import { Message } from 'element-ui'
// import store from '@/store'
export async function minIO(payload) {
const res = await requestMinIO({
url: payload.uploadUrl,
method: "put",
data: payload.file
data: payload.file,
onUploadProgress: function(progress) {
sessionStorage.setItem(JSON.stringify(payload.id), JSON.stringify(parseInt(((progress.loaded / progress.total) * 100))));
}
})
if (res && res.success) {
return res
} else {
sessionStorage.setItem(JSON.stringify(payload.id), 0)
Message({
message: '上传失败',
type: 'error',
duration: 5 * 1000
})
return {
success: false
}


+ 1
- 1
admin-portal/src/utils/request.js View File

@@ -1,5 +1,5 @@
import axios from 'axios'
import { MessageBox, Message } from 'element-ui'
import { Message } from 'element-ui'
import store from '@/store'
import { getToken, removeToken } from '@/utils/auth'
import router from '../router'


+ 1
- 4
admin-portal/src/utils/requestLog.js View File

@@ -47,7 +47,6 @@ service.interceptors.response.use(
// duration: 5 * 1000
// })


// // if (res.code === 50008 || res.code === 50012 || res.code === 50014) {
// // // to re-login
// // MessageBox.confirm('You have been logged out, you can cancel to stay on this page, or log in again', 'Confirm logout', {
@@ -66,15 +65,13 @@ service.interceptors.response.use(
// }
},
error => {

Message({
message: '没有找到日志',
type: 'warning',
duration: 5 * 1000
})
console.log("error:", error)
// return Promise.reject(error)


}
)



+ 5
- 6
admin-portal/src/utils/requestMinIO.js View File

@@ -1,11 +1,9 @@
import axios from 'axios'
import { Message } from 'element-ui'
import store from '@/store'
// create an axios instance
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API, // url = base url + request url
// withCredentials: true, // send cookies when cross-domain requests
// timeout: 5000 // request timeout
baseURL: process.env.VUE_APP_BASE_API
})

// request interceptor
@@ -43,7 +41,6 @@ service.interceptors.response.use(
*/

response => {

// res = response.data
// res.data = response.data.payload
if (response.status === 200) {
@@ -84,10 +81,12 @@ service.interceptors.response.use(
error => {
console.log('err' + error) // for debug
Message({
message: error.message,
message: '上传失败',
type: 'error',
duration: 5 * 1000
})
setTimeout(function() { location.reload() }, 1000)
// location.reload();
return Promise.reject(error)
}
)


+ 28
- 18
admin-portal/src/views/Home/login.vue View File

@@ -5,28 +5,41 @@
<div><img src="../../assets/logo.svg" alt="" class="logo"></div>
<div class="login-container">
<div class="grid-content">
<el-form :model="loginForm" :rules="rules" status-icon ref="loginForm" label-position="left"
label-width="0px" class="demo-ruleForm login-page">
<el-form
ref="loginForm"
:model="loginForm"
:rules="rules"
status-icon
label-position="left"
label-width="0px"
class="demo-ruleForm login-page"
>
<h3 class="title">系统登录</h3>
<el-form-item prop="email">
<el-input type="text" v-model="loginForm.email" auto-complete="off"
placeholder="请输入管理员账号">
</el-input>
<el-input
v-model="loginForm.email"
type="text"
auto-complete="off"
placeholder="请输入管理员账号"
/>
</el-form-item>
<el-form-item prop="password">
<el-input type="password" v-model="loginForm.password" auto-complete="off"
placeholder="密码">
</el-input>
<el-input
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="密码"
/>
</el-form-item>
<!-- <el-checkbox v-model="checked" class="rememberme">记住密码</el-checkbox> -->
<el-form-item style="width:100%;">
<el-button type="primary" style="width:100%;" @click="handleLogin" :loading="logining">
<el-button type="primary" style="width:100%;" :loading="logining" @click="handleLogin">
登录
</el-button>
</el-form-item>
</el-form>
</div>
<div class="note">Powered by Openl Octopus V2.1</div>
<div class="note">Powered by Openl Octopus V4.0.1</div>
<div class="octopus"></div>
</div>
</div>
@@ -38,15 +51,15 @@
<script>
export default {
data() {
// 邮箱类型验证
// 邮箱类型验证
return {
logining: false,
loginForm: {
email: undefined,
password: undefined,
password: undefined