diff --git a/webapp/.env.development b/webapp/.env.development index 702f9a5..bcbbe28 100644 --- a/webapp/.env.development +++ b/webapp/.env.development @@ -3,11 +3,24 @@ ENV = 'development' # 默认BASE URL VUE_APP_BASE_API = '' -# 数据管理 -VUE_APP_DATA_API = '' - # minio -VUE_APP_MINIO_API = '' // 建议使用与当前 web 服务域名的域名 +VUE_APP_MINIO_API = 'http://{HOST}/minio' -# atlas 模型炼知 +# atlas 服务,需要单独部署 VUE_APP_ATLAS_HOST = '' + +# 医疗影像 DCM4CHEE 服务访问地址 +# 部署文档参考:http://docs.dubhe.ai/docs/setup/deploy-algorithm +VUE_APP_DCM_API = 'http://{HOST}/dcm4chee/dcm4chee-arc/aets/DCM4CHEE_ADMIN' + +# minIO 服务 IP +VUE_APP_MINIO_ENDPOINT = '' + +# minIO 服务 端口 +VUE_APP_MINIO_PORT = '9000' + +# 是否开启 SSL +VUE_APP_MINIO_USESSL = 'false' + +# bucketName +VUE_APP_MINIO_BUCKETNAME = 'dubhe-dev' diff --git a/webapp/.env.mock b/webapp/.env.mock index f913c6a..dadee4d 100644 --- a/webapp/.env.mock +++ b/webapp/.env.mock @@ -1,4 +1,22 @@ ENV='development' + +# 开启 mock 模式 VUE_APP_MOCK=true -VUE_APP_BASE_API = '' -VUE_APP_DATA_API = '/mock' + +# 默认BASE URL,需要自行配置 +VUE_APP_BASE_API = '/mock' + +# 用户 minio 访问地址 +VUE_APP_MINIO_API = 'http://{HOST}/minio' + +# minIO 服务 IP +VUE_APP_MINIO_ENDPOINT = '' + +# minIO 服务 端口 +VUE_APP_MINIO_PORT = '9000' + +# 是否开启 SSL +VUE_APP_MINIO_USESSL = 'false' + +# bucketName +VUE_APP_MINIO_BUCKETNAME = 'dubhe-dev' diff --git a/webapp/.env.production b/webapp/.env.production index bf67105..8df70ee 100644 --- a/webapp/.env.production +++ b/webapp/.env.production @@ -1,13 +1,27 @@ ENV = 'production' -# 默认BASE URL -VUE_APP_BASE_API = '/' +# 默认BASE URL, 后端服务地址 +VUE_APP_BASE_API = 'http://127.0.0.1:8000' -# 数据管理 -VUE_APP_DATA_API = '/' +# 用户 minio 访问地址 +VUE_APP_MINIO_API = 'http://{HOST}/minio' -# minio -VUE_APP_MINIO_API = '' +# atlas 服务,需要单独部署 +VUE_APP_ATLAS_HOST = 'http://127.0.0.1:8000' -# atlas -VUE_APP_ATLAS_HOST = '' +# 医疗影像 DCM4CHEE 服务访问地址 +# 部署文档参考:http://docs.dubhe.ai/docs/setup/deploy-algorithm +VUE_APP_DCM_API = 'http://{HOST}/dcm4chee/dcm4chee-arc/aets/DCM4CHEE_ADMIN' + +# minIO 服务 IP +# 部署文档参考:http://docs.dubhe.ai/docs/setup/deploy-minio +VUE_APP_MINIO_ENDPOINT = '{IP}' + +# minIO 服务 端口 +VUE_APP_MINIO_PORT = '9000' + +# 是否开启 SSL +VUE_APP_MINIO_USESSL = 'false' + +# bucketName +VUE_APP_MINIO_BUCKETNAME = 'dubhe-prod' diff --git a/webapp/.env.test b/webapp/.env.test index 5fa6d82..f4d80b0 100644 --- a/webapp/.env.test +++ b/webapp/.env.test @@ -3,11 +3,25 @@ ENV = 'test' # 默认BASE URL VUE_APP_BASE_API = '' -# 数据管理 -VUE_APP_DATA_API = '' - -# minio +# 用户 minio 访问地址 VUE_APP_MINIO_API = '' -# atlas +# atlas 服务,需要单独部署 VUE_APP_ATLAS_HOST = '' + +# 医疗影像 DCM4CHEE 服务访问地址 +# 部署文档参考:http://docs.dubhe.ai/docs/setup/deploy-algorithm +VUE_APP_DCM_API = 'http://{HOST}/dcm4chee/dcm4chee-arc/aets/DCM4CHEE_ADMIN' + +# minIO 服务 IP +VUE_APP_MINIO_ENDPOINT = '' + +# minIO 服务 端口 +VUE_APP_MINIO_PORT = '9000' + +# 是否开启 SSL +VUE_APP_MINIO_USESSL = 'false' + +# BucketName +VUE_APP_MINIO_BUCKETNAME = 'dubhe-test' + diff --git a/webapp/CHANGELOG.md b/webapp/CHANGELOG.md index b01e4c4..884d08e 100644 --- a/webapp/CHANGELOG.md +++ b/webapp/CHANGELOG.md @@ -1,3 +1,28 @@ +## 0.3.0 (2021-01-14) + +### Breaking Change + +- [模型管理] 完成内置优化、我的优化功能,支持模型量化、剪枝、蒸馏 +- [云端Serving] 完成在线服务、批量服务功能,在线服务支持 HTTP 请求、GRPC 请求、灰度分流、服务回滚 +- [模型炼知] 移植重构图谱可视化、图谱列表功能,完成度量管理功能 + +### Features + +- 路由迁移到本地管理,移除在线「菜单管理」页面 +- MinIO 配置更新 +- [数据管理] 增加 NLP 文本分类数据标注功能 +- [数据管理] 增加医疗影像数据标注,支持自动器官分割和病灶识别 +- [训练管理] 支持使用教师模型、学生模型进行模型炼知 +- [训练管理] 镜像管理支持管理员上传Notebook镜像, 并可以设置为默认Notebook镜像 +- [训练管理] 模型、算法、镜像等文件上传时不允许文件名包含不合法字符 +- [训练管理] 运行日志展示组件重构。以 K8S 的 pod 为单位进行日志查询展示 +- [模型管理] 增加炼知模型管理 + +### Bug Fixs + +- [模型开发] 修复 Notebook 页面重置按钮失效的问题 +- [训练管理] 修复模型下载文件路径问题 + ## 0.2.1 (2020-11-16) ### Features diff --git a/webapp/README.md b/webapp/README.md index 5eddbc3..ffa07e5 100644 --- a/webapp/README.md +++ b/webapp/README.md @@ -26,8 +26,9 @@ cd dubhe-web 根据需要修改如下配置文件 ``` -config/index.js -settings.js +.env.mock +.env.development +.env.test .env.production ``` diff --git a/webapp/mock/api/data/datasets.js b/webapp/mock/api/data/datasets.js deleted file mode 100644 index 0a90cac..0000000 --- a/webapp/mock/api/data/datasets.js +++ /dev/null @@ -1,56 +0,0 @@ -module.exports = { - "code": 200, - "msg": null, - "data": { - "result": [{ - "id": 56, - "name": "bag_data", - "remark": "不可删除,不可删除", - "type": 0, - "uri": null, - "dataType": 0, - "annotateType": 2, - "status": 104, - "createTime": "2020-10-21 15:39:01", - "updateTime": "2020-10-22 14:13:10", - "team": null, - "createUser": null, - "updateUser": null, - "progress": null, - "currentVersionName": null, - "decompressState": 0, - "labelGroupId": 1, - "labelGroupName": "COCO", - "labelGroupType": 1, - "import": false, - "top": true - }, { - "id": 346, - "name": "test432", - "remark": "test432", - "type": 0, - "uri": null, - "dataType": 0, - "annotateType": 1, - "status": 101, - "createTime": "2020-10-27 15:20:58", - "updateTime": "2020-10-27 15:20:58", - "team": null, - "createUser": null, - "updateUser": null, - "progress": null, - "currentVersionName": null, - "decompressState": 0, - "labelGroupId": 468, - "labelGroupName": "test432", - "labelGroupType": 0, - "import": false, - "top": false - }], - "page": { - "size": 10, - "current": 1, - "total": 218 - }, - } -} diff --git a/webapp/mock/api/data/datasets/count.js b/webapp/mock/api/data/datasets/count.js new file mode 100644 index 0000000..8483a4d --- /dev/null +++ b/webapp/mock/api/data/datasets/count.js @@ -0,0 +1,8 @@ +module.exports = { + code: 200, + msg: null, + data: { + "finished": 10, + "unfinished": 0 + } +} \ No newline at end of file diff --git a/webapp/mock/api/data/labelGroup/getList/id.js b/webapp/mock/api/data/labelGroup/getList/id.js deleted file mode 100644 index 0a68b30..0000000 --- a/webapp/mock/api/data/labelGroup/getList/id.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - "code": 200, - "msg": null, - "data": [] -} \ No newline at end of file diff --git a/webapp/mock/mock-map.js b/webapp/mock/mock-map.js index ee14253..383afe6 100644 --- a/webapp/mock/mock-map.js +++ b/webapp/mock/mock-map.js @@ -1,4 +1,4 @@ // 定义 RESTful 接口和实际代码的映射 module.exports = { - 'GET::/api/data/labelGroup/getList/(\\d+)': '/api/data/labelGroup/getList/id', + 'GET::/api/data/datasets/(\\d+)/count': 'api/data/datasets/count', }; diff --git a/webapp/package.json b/webapp/package.json index 5604797..5ff6c1e 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -1,6 +1,6 @@ { "name": "dubhe-web", - "version": "0.2.1", + "version": "0.3.0", "description": "之江天枢人工智能开源平台", "author": "zhejianglab", "keywords": [ @@ -41,15 +41,19 @@ "@riophae/vue-treeselect": "0.1.0", "@vue/babel-plugin-transform-vue-jsx": "^1.1.2", "@vue/composition-api": "^0.5.0", + "@wulucxy/dwv": "0.28.1-beta.9", "add-dom-event-listener": "^1.1.0", "axios": "0.18.1", "chroma-js": "^2.1.0", "classnames": "^2.2.6", + "clipboard": "^2.0.6", "d3": "^5.16.0", "d3-selection": "^1.4.1", "d3-zoom": "^1.8.3", "dagre-d3": "^0.6.4", "date-fns": "^2.13.0", + "dicom-parser": "^1.8.7", + "dicomweb-client": "^0.6.0", "echarts": "4.2.1", "echarts-gl": "^1.1.1", "element-ui": "2.13.2", @@ -59,18 +63,21 @@ "jquery-contextmenu": "^2.9.1", "js-beautify": "^1.13.0", "js-cookie": "2.2.0", + "jschardet": "^2.2.1", "jsencrypt": "^3.0.0-rc.1", "json2csv": "^5.0.1", "lodash": "^4.17.15", - "minio": "^7.0.16", + "minio": "7.0.16", "nanoid": "^3.1.3", "normalize.css": "7.0.0", "nprogress": "0.2.0", "p-map": "^4.0.0", "path-to-regexp": "^6.2.0", + "portal-vue": "^2.1.7", "prismjs": "^1.20.0", "promise.allsettled": "^1.0.2", "qs": "^6.9.1", + "screenfull": "^5.0.2", "stream-to-array": "^2.3.0", "streamsaver": "^2.0.4", "v-click-outside": "^3.0.1", diff --git a/webapp/src/App.vue b/webapp/src/App.vue index 3cf15e0..b67cdaa 100644 --- a/webapp/src/App.vue +++ b/webapp/src/App.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ diff --git a/webapp/src/api/algorithm/algorithm.js b/webapp/src/api/algorithm/algorithm.js index 26732d3..5f9ea71 100644 --- a/webapp/src/api/algorithm/algorithm.js +++ b/webapp/src/api/algorithm/algorithm.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,14 +48,6 @@ export function del(ids) { }); } -export function listImage(params) { - return request({ - url: 'api/v1/ptImage', - method: 'get', - params, - }); -} - export function myAlgorithmCount() { return request({ url: `api/v1/algorithm/myAlgorithmCount`, @@ -63,4 +55,4 @@ export function myAlgorithmCount() { }); } -export default { list, add, del, listImage }; +export default { list, add, del }; diff --git a/webapp/src/api/algorithm/algorithmUsage.js b/webapp/src/api/algorithm/algorithmUsage.js index 83c6fc1..55a7736 100644 --- a/webapp/src/api/algorithm/algorithmUsage.js +++ b/webapp/src/api/algorithm/algorithmUsage.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/api/system/menu.js b/webapp/src/api/atlas/index.js similarity index 77% rename from webapp/src/api/system/menu.js rename to webapp/src/api/atlas/index.js index e42020c..cbd42a6 100644 --- a/webapp/src/api/system/menu.js +++ b/webapp/src/api/atlas/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,18 +14,12 @@ * ============================================================= */ +/* eslint-disable no-unreachable */ import request from '@/utils/request'; -export function getMenusTree() { - return request({ - url: 'api/v1/menus/tree', - method: 'get', - }); -} - export function list(params) { return request({ - url: 'api/v1/menus', + url: 'api/v1/ptMeasure', method: 'get', params, }); @@ -33,26 +27,32 @@ export function list(params) { export function add(data) { return request({ - url: 'api/v1/menus', + url: 'api/v1/ptMeasure', method: 'post', data, }); } +export function edit(data) { + return request({ + url: 'api/v1/ptMeasure', + method: 'put', + data, + }); +} + export function del(ids) { return request({ - url: 'api/v1/menus', + url: 'api/v1/ptMeasure', method: 'delete', data: { ids }, }); } -export function edit(data) { +export function getGraphs(name) { return request({ - url: 'api/v1/menus', - method: 'put', - data, + url: 'api/v1/ptMeasure/byName', + method: 'get', + params: { name }, }); } - -export default { list, add, edit, del, getMenusTree }; diff --git a/webapp/src/api/auth.js b/webapp/src/api/auth.js index baafe9c..56f9ad4 100644 --- a/webapp/src/api/auth.js +++ b/webapp/src/api/auth.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/api/cloudServing/batch.js b/webapp/src/api/cloudServing/batch.js new file mode 100644 index 0000000..6529123 --- /dev/null +++ b/webapp/src/api/cloudServing/batch.js @@ -0,0 +1,89 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + +import request from '@/utils/request'; + +export function list(params) { + return request({ + url: 'api/batchServing', + method: 'get', + params, + }); +} + +export function add(data) { + return request({ + url: 'api/batchServing', + method: 'post', + data, + }); +} + +export function edit(data) { + return request({ + url: 'api/batchServing', + method: 'put', + data, + }); +} + +export function del(id) { + return request({ + url: `api/batchServing`, + method: 'delete', + data: { id }, + }); +} + +export function detail(id) { + return request({ + url: `api/batchServing/detail`, + method: 'get', + params: { id }, + }); +} + +export function start(id) { + return request({ + url: `api/batchServing/start`, + method: 'post', + data: { id }, + }); +} + +export function stop(id) { + return request({ + url: `api/batchServing/stop`, + method: 'post', + data: { id }, + }); +} + +export function getBatchServingPods(id) { + return request({ + url: `api/batchServing/pod/${id}`, + method: 'get', + }); +} + +export function getServiceProgress(id) { + return request({ + url: `api/batchServing/queryById/${id}`, + method: 'get', + }); +} + +export default { list, add, edit, del }; diff --git a/webapp/src/api/cloudServing/index.js b/webapp/src/api/cloudServing/index.js new file mode 100644 index 0000000..1267b68 --- /dev/null +++ b/webapp/src/api/cloudServing/index.js @@ -0,0 +1,114 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + +import request from '@/utils/request'; + +export function list(params) { + return request({ + url: 'api/serving', + method: 'get', + params, + }); +} + +export function add(data) { + return request({ + url: 'api/serving', + method: 'post', + data, + }); +} + +export function edit(data) { + return request({ + url: 'api/serving', + method: 'put', + data, + }); +} + +export function del(id) { + return request({ + url: `api/serving`, + method: 'delete', + data: { id }, + }); +} + +export function detail(id) { + return request({ + url: `api/serving/detail`, + method: 'get', + params: { id }, + }); +} + +export function start(id) { + return request({ + url: `api/serving/start`, + method: 'post', + data: { id }, + }); +} + +export function stop(id) { + return request({ + url: `api/serving/stop`, + method: 'post', + data: { id }, + }); +} + +export function getPredictParam(id) { + return request({ + url: `api/serving/predictParam`, + method: 'get', + params: { id }, + }); +} + +export function getMetrics(id) { + return request({ + url: `api/serving/metrics/${id}`, + method: 'get', + }); +} + +export function getServingPods(configId) { + return request({ + url: `api/serving/servingConfig/pod/${configId}`, + method: 'get', + }); +} + +export function getRollbackList(servingId) { + return request({ + url: `api/serving/rollback/${servingId}`, + method: 'get', + }); +} + +export function predict(data, params) { + return request({ + url: `api/serving/predict`, + method: 'post', + headers: { 'Content-Type': 'multipart/form-data' }, + params, + data, + }); +} + +export default { list, add, edit, del }; diff --git a/webapp/src/api/development/notebook.js b/webapp/src/api/development/notebook.js index a6a3d55..8a62af2 100644 --- a/webapp/src/api/development/notebook.js +++ b/webapp/src/api/development/notebook.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/api/model/model.js b/webapp/src/api/model/model.js index 02f02ad..04771f5 100644 --- a/webapp/src/api/model/model.js +++ b/webapp/src/api/model/model.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,4 +48,12 @@ export function del(data) { }); } +export function getModelByResource(modelResource) { + return request({ + url: 'api/ptModelInfo/byResource', + method: 'get', + params: { modelResource }, + }); +} + export default { list, add, edit, del }; diff --git a/webapp/src/api/model/modelVersion.js b/webapp/src/api/model/modelVersion.js index 7555930..0b25754 100644 --- a/webapp/src/api/model/modelVersion.js +++ b/webapp/src/api/model/modelVersion.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/api/modelOptimize/optimize.js b/webapp/src/api/modelOptimize/optimize.js new file mode 100644 index 0000000..42d3242 --- /dev/null +++ b/webapp/src/api/modelOptimize/optimize.js @@ -0,0 +1,107 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + +import request from '@/utils/request'; + +export function list(params) { + return request({ + url: 'api/modelOpt/task', + method: 'get', + params, + }); +} + +export function add(data) { + return request({ + url: 'api/modelOpt/task', + method: 'post', + data, + }); +} + +export function edit(data) { + return request({ + url: 'api/modelOpt/task', + method: 'put', + data, + }); +} + +export function del(data) { + return request({ + url: `api/modelOpt/task`, + method: 'delete', + data, + }); +} + +export function getOptimizeAlgorithms(params) { + return request({ + url: 'api/modelOpt/task/getAlgorithm', + method: 'get', + params, + }); +} + +export function getBuiltInModel(params) { + return request({ + url: 'api/modelOpt/task/getBuiltInModel', + method: 'get', + params, + }); +} + +export function getOptimizeDatasets(params) { + return request({ + url: 'api/modelOpt/task/getDataset', + method: 'get', + params, + }); +} + +export function getCustomizeDatasets(params) { + return request({ + url: 'api/modelOpt/task/MyDataset', + method: 'get', + params, + }); +} + +export function addCustomizeDatasets(data) { + return request({ + url: 'api/modelOpt/task/MyDataset', + method: 'post', + data, + }); +} + +export function addCustomizeModel(data) { + return request({ + url: 'api/ptModelInfo/uploadModel', + method: 'post', + data, + }); +} + +export function submit(data) { + return request({ + url: `api/modelOpt/task/submit`, + method: 'post', + data, + }); +} + +export default { list, add, edit, del }; diff --git a/webapp/src/api/system/harbor.js b/webapp/src/api/modelOptimize/record.js similarity index 61% rename from webapp/src/api/system/harbor.js rename to webapp/src/api/modelOptimize/record.js index 15fe6ce..fae4a12 100644 --- a/webapp/src/api/system/harbor.js +++ b/webapp/src/api/modelOptimize/record.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,40 +16,42 @@ import request from '@/utils/request'; -export function harborProjectNames() { +export function list(params) { return request({ - url: `api/v1/ptImage/imageNameList`, + url: 'api/modelOpt/taskInstance', method: 'get', + params, }); } -export function harborImageNames(params) { +export function del(data) { return request({ - url: `api/v1/ptImage`, - method: 'get', - params, + url: `api/modelOpt/taskInstance`, + method: 'delete', + data, }); } -export function harborProjects(source = 0) { +export function getInstance(params) { return request({ - url: `api/v1/harbor/projects/${source}`, + url: `api/modelOpt/taskInstance/detail`, method: 'get', + params, }); } -export function harborImages(params) { +export function cancel(data) { return request({ - url: `api/v1/harbor/images`, - method: 'get', - params, + url: `api/modelOpt/taskInstance/cancel`, + method: 'put', + data, }); } -export function allImages(params) { +export function resubmit(data) { return request({ - url: `api/v1/harbor/image_page`, - method: 'get', - params, + url: `api/modelOpt/taskInstance/resubmit`, + method: 'post', + data, }); } diff --git a/webapp/src/api/preparation/annotation.js b/webapp/src/api/preparation/annotation.js index 5edc191..0a73a4a 100644 --- a/webapp/src/api/preparation/annotation.js +++ b/webapp/src/api/preparation/annotation.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/api/preparation/datafile.js b/webapp/src/api/preparation/datafile.js index 1f224bb..9af5703 100644 --- a/webapp/src/api/preparation/datafile.js +++ b/webapp/src/api/preparation/datafile.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/api/preparation/datalabel.js b/webapp/src/api/preparation/datalabel.js index 390b051..4e95849 100644 --- a/webapp/src/api/preparation/datalabel.js +++ b/webapp/src/api/preparation/datalabel.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,9 +39,9 @@ export function editLabel(id, label) { }); } -export function getAutoLabels() { +export function getAutoLabels(labelGroupType) { return request({ - url: 'api/data/datasets/labels/auto', + url: `api/data/datasets/labels/auto/${labelGroupType}`, method: 'get', }); } diff --git a/webapp/src/api/preparation/dataset.js b/webapp/src/api/preparation/dataset.js index 02eca08..eedd085 100644 --- a/webapp/src/api/preparation/dataset.js +++ b/webapp/src/api/preparation/dataset.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -139,6 +139,24 @@ export function queryFileOffset(datasetId, fileId, query = {}) { }); } +// 查询数据集标签 +export function queryLabels(datasetId, params) { + return request({ + url: `api/data/datasets/${datasetId}/labels`, + method: 'get', + params, + }); +} + +// 创建数据集标签 +export function createLabel (datasetId, data) { + return request({ + url: `api/data/datasets/${datasetId}/labels`, + method: 'post', + data, + }); +} + // 查询预置标签 export function queryPresetLabels() { return request({ @@ -150,7 +168,7 @@ export function queryPresetLabels() { // 查询数据增强字典 export function queryDataEnhanceList() { return request({ - baseURL: process.env.VUE_APP_DATA_API, + baseURL: process.env.VUE_APP_BASE_API, url: `api/v1/user/dict/dataset_enhance`, method: 'get', }); diff --git a/webapp/src/api/preparation/labelGroup.js b/webapp/src/api/preparation/labelGroup.js index 0a6e172..1da5cfd 100644 --- a/webapp/src/api/preparation/labelGroup.js +++ b/webapp/src/api/preparation/labelGroup.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -64,8 +64,9 @@ export function list(params) { // 标签组列表的简况查询 用于详情页选择标签组列举 export function getLabelGroupList(params) { return request({ - url: `/api/data/labelGroup/getList/${params}`, + url: `/api/data/labelGroup/getList`, method: 'get', + params, }); } diff --git a/webapp/src/api/preparation/medical.js b/webapp/src/api/preparation/medical.js new file mode 100644 index 0000000..d1d4282 --- /dev/null +++ b/webapp/src/api/preparation/medical.js @@ -0,0 +1,170 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + +import request from '@/utils/request'; + +// 获取数据集对应的 studyInstanceUID 和 seriesInstanceUID +export function getCaseInfo(datasetId) { + return request({ + url: `api/data/datasets/medical/detail/${datasetId}`, + method: 'get', + }); +} + +// 获取自动标注详情 +export const queryAutoResult = (datasetId) => { + return request({ + url: `api/data/datasets/medical/getAuto/${datasetId}`, + method: 'get', + }); +}; + +// 获取手动标注详情 +export const queryManualResult = (datasetId) => { + return request({ + url: `api/data/datasets/medical/getFinished/${datasetId}`, + method: 'get', + }); +}; + +export function list(params) { + return request({ + url: '/api/data/datasets/medical', + method: 'get', + params, + }); +} + +// 数据集详情 +export function detail(id) { + return request({ + url: `/api/data/datasets/medical/${id}`, + method: 'get', + }); +} + +// 创建数据集 +export function add(data) { + return request({ + url: 'api/data/datasets/medical', + method: 'post', + data, + }); +} + +// 保存标注 +export function save(data) { + return request({ + url: '/api/data/datasets/medical/annotation/save', + method: 'post', + data, + }); +} + +// 上传文件 +export function upload(datasetId, params) { + return request({ + url: '/api/data/datasets/medical/files', + method: 'post', + data: { + id: datasetId, + dataMedicineFileCreateList: params, + }, + }); +} + +export function del(ids) { + const delData = { ids }; + return request({ + url: 'api/data/datasets/medical', + method: 'delete', + data: delData, + }); +} + +export function editDataset(data) { + return request({ + url: `api/data/datasets/medical/${data.medicalId}`, + method: 'put', + data, + }); +} + +// 导入自定义数据集 +export function addCustomDataset(data) { + return request({ + url: `api/data/datasets/medical/custom`, + method: 'post', + data, + }); +} + +export function autoAnnotate(id) { + const data = { medicalId: id }; + return request({ + url: 'api/data/datasets/medical/annotation/auto', + method: 'post', + data, + }); +} + +// 查询数据集状态 +export function queryDatasetsProgress(params) { + return request({ + url: `/api/data/datasets/medical/annotation/schedule`, + method: 'get', + params, + }); +} + +// 保存病灶信息 +export function saveLesions(medicalId, data) { + return request({ + url: `/api/data/datasets/medical/lesion/${medicalId}`, + method: 'post', + data, + }); +} + +// 查询病灶信息 +export function queryLesions(medicalId, params) { + return request({ + url: `/api/data/datasets/medical/lesion/${medicalId}`, + method: 'get', + params, + }); +} + +// 删除病灶信息 +export function deleteLesion(id) { + return request({ + url: `/api/data/datasets/medical/lesion`, + method: 'delete', + data: { id }, + }); +} + +// 修改病灶信息 +export function updateLesion(id) { + return request({ + url: `/api/data/datasets/medical/lesion`, + method: 'put', + data: { id }, + }); +} + +export default { list, add, del }; + diff --git a/webapp/src/api/preparation/textData.js b/webapp/src/api/preparation/textData.js new file mode 100644 index 0000000..c32ee2c --- /dev/null +++ b/webapp/src/api/preparation/textData.js @@ -0,0 +1,63 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================= + */ + +import request from '@/utils/request'; + +export function list(params) { + const { datasetId } = params; + return request({ + url: `api/data/datasets/${datasetId}/files/txt`, + method: 'get', + params, + }); +} + +export function count(datasetId) { + return request({ + url: `/api/data/datasets/${datasetId}/count`, + }); +} + +// 获取分页信息 +export function queryFiles(datasetId, params) { + return request({ + url: `/api/data/datasets/${datasetId}/files/txt`, + params, + }); +} + +// 删除文件 +export function deleteFile(datasetId, fileId) { + return request({ + url: `/api/data/datasets/files`, + method: 'delete', + data: { + datasetIds: [Number(datasetId)], + fileIds: [Number(fileId)], + }, + }); +} + +// 保存 +export function save(datasetId, fileId, data){ + return request({ + url: `/api/data/datasets/files/${datasetId}/${fileId}/annotations/finish`, + method: 'post', + data, + }); +} + +export default { list }; \ No newline at end of file diff --git a/webapp/src/api/system/dict.js b/webapp/src/api/system/dict.js index 33bf3b4..0bed26f 100644 --- a/webapp/src/api/system/dict.js +++ b/webapp/src/api/system/dict.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/api/system/dictDetail.js b/webapp/src/api/system/dictDetail.js index 73697d7..55a2f57 100644 --- a/webapp/src/api/system/dictDetail.js +++ b/webapp/src/api/system/dictDetail.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/api/system/node.js b/webapp/src/api/system/node.js index 39b05a3..f8a2fa5 100644 --- a/webapp/src/api/system/node.js +++ b/webapp/src/api/system/node.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/api/system/pod.js b/webapp/src/api/system/pod.js index 969d5e8..bf2fb5b 100644 --- a/webapp/src/api/system/pod.js +++ b/webapp/src/api/system/pod.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/api/system/role.js b/webapp/src/api/system/role.js index 6dfa9d6..bf694cb 100644 --- a/webapp/src/api/system/role.js +++ b/webapp/src/api/system/role.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,4 +71,11 @@ export function editMenu(data) { }); } +export function getMenusTree() { + return request({ + url: 'api/v1/menus/tree', + method: 'get', + }); +} + export default { list, add, edit, del, get, editMenu }; diff --git a/webapp/src/api/system/user.js b/webapp/src/api/system/user.js index 4f811f7..d2026b7 100644 --- a/webapp/src/api/system/user.js +++ b/webapp/src/api/system/user.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/api/trainingImage/index.js b/webapp/src/api/trainingImage/index.js index b04a497..c4f47d2 100644 --- a/webapp/src/api/trainingImage/index.js +++ b/webapp/src/api/trainingImage/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,10 +48,27 @@ export function del(ids) { }); } -export function imageNameList() { +export function getImageNameList(params) { return request({ url: 'api/v1/ptImage/imageNameList', method: 'get', + params, + }); +} + +export function getImageTagList(params) { + return request({ + url: 'api/v1/ptImage', + method: 'get', + params, + }); +} + +export function setPrecast(params) { + return request({ + url: 'api/v1/ptImage/imageResource', + method: 'put', + params, }); } diff --git a/webapp/src/api/trainingJob/job.js b/webapp/src/api/trainingJob/job.js index 08eaf95..5a44e13 100644 --- a/webapp/src/api/trainingJob/job.js +++ b/webapp/src/api/trainingJob/job.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -116,4 +116,12 @@ export function getPods(jobId) { }); } +export function getTrainModel(params) { + return request({ + url: `api/v1/trainJob/model`, + method: 'get', + params, + }); +} + export default { list, add, edit, del }; diff --git a/webapp/src/api/trainingJob/params.js b/webapp/src/api/trainingJob/params.js index 1dd386a..53e7418 100644 --- a/webapp/src/api/trainingJob/params.js +++ b/webapp/src/api/trainingJob/params.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/api/user.js b/webapp/src/api/user.js index 04085db..50603df 100644 --- a/webapp/src/api/user.js +++ b/webapp/src/api/user.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/api/visual/index.js b/webapp/src/api/visual/index.js index 366f50c..19469b2 100644 --- a/webapp/src/api/visual/index.js +++ b/webapp/src/api/visual/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/assets/images/dataset/medicalDataset.png b/webapp/src/assets/images/dataset/medicalDataset.png new file mode 100644 index 0000000..08313c2 Binary files /dev/null and b/webapp/src/assets/images/dataset/medicalDataset.png differ diff --git a/webapp/src/assets/images/dataset/normalDataset.png b/webapp/src/assets/images/dataset/normalDataset.png new file mode 100644 index 0000000..10cc49b Binary files /dev/null and b/webapp/src/assets/images/dataset/normalDataset.png differ diff --git a/webapp/src/assets/styles/atomic.scss b/webapp/src/assets/styles/atomic.scss index a475124..514fbe0 100644 --- a/webapp/src/assets/styles/atomic.scss +++ b/webapp/src/assets/styles/atomic.scss @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -129,10 +129,26 @@ padding-bottom: 10px; } +.mt-0 { + margin-top: 0 !important; +} + +.mt-50 { + margin-top: 50px; +} + .mt-10 { margin-top: 10px; } +.mt-20 { + margin-top: 20px; +} + +.ml-4 { + margin-left: 4px; +} + .ml-10 { margin-left: 10px; } @@ -149,6 +165,14 @@ margin-left: 16px; } +.ml-40 { + margin-left: 40px; +} + +.mb-50 { + margin-bottom: 50px; +} + .mb-20 { margin-bottom: 20px; } @@ -161,10 +185,42 @@ margin-bottom: 10px; } +.mx-10 { + margin-right: 10px; + margin-left: 10px; +} + +.my-10 { + margin-top: 10px; + margin-bottom: 10px; +} + +.mx-auto { + margin-right: auto; + margin-left: auto; +} + +.my-auto { + margin-top: auto; + margin-bottom: auto; +} + +.w-150 { + width: 150px; +} + +.w-200 { + width: 200px; +} + .lh-1 { line-height: 1; } +.bold { + font-weight: bold; +} + img.responsive { display: inline-block; max-width: 100%; @@ -183,6 +239,14 @@ img.responsive { cursor: pointer; } +.pen { + pointer-events: none; +} + +.pea { + pointer-events: auto; +} + .inlineBlock { display: block; } @@ -202,6 +266,10 @@ img.responsive { user-select: none; } +.hidden { + visibility: hidden; +} + .cp { cursor: pointer; } @@ -218,6 +286,10 @@ img.responsive { color: $successColor; } +.with-border { + border-color: $borderColor; +} + .g3 { color: #333; } @@ -253,3 +325,12 @@ img.responsive { .w100 { min-width: 100px; } + +.fullBg { + position: fixed; + top: 0; + left: 0; + z-index: 9; + width: 100vw; + height: 100vh; +} diff --git a/webapp/src/assets/styles/common.scss b/webapp/src/assets/styles/common.scss index 014fd4f..19e9c36 100644 --- a/webapp/src/assets/styles/common.scss +++ b/webapp/src/assets/styles/common.scss @@ -235,3 +235,18 @@ margin-top: 20px; overflow-y: scroll; } + +pre { + margin: 0; + font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; + font-size: 1em; +} + +.command-preview { + min-height: 80px; + padding: 0 10px; + line-height: 25px; + color: rgb(204, 204, 204); + background: rgb(30, 30, 30); + border-radius: 5px; +} diff --git a/webapp/src/assets/styles/mixin.scss b/webapp/src/assets/styles/mixin.scss index 4ea405d..202ad54 100644 --- a/webapp/src/assets/styles/mixin.scss +++ b/webapp/src/assets/styles/mixin.scss @@ -62,6 +62,15 @@ background-size: contain; } +@mixin checkmark($width, $height, $borderWidth, $borderColor) { + display: inline-block; + width: $width; + height: $height; + border-right: $borderWidth solid $borderColor; + border-bottom: $borderWidth solid $borderColor; + transform: rotate(45deg); +} + @mixin triangle($width, $height, $color, $direction) { $width: $width/2; $color-border-style: $height solid $color; diff --git a/webapp/src/boot/errorHandle.js b/webapp/src/boot/errorHandle.js index 5ea2f0c..3851c44 100644 --- a/webapp/src/boot/errorHandle.js +++ b/webapp/src/boot/errorHandle.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/boot/index.js b/webapp/src/boot/index.js index eb79ae1..4a11caa 100644 --- a/webapp/src/boot/index.js +++ b/webapp/src/boot/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/BaseModal/index.js b/webapp/src/components/BaseModal/index.js index 5109388..e74c3b9 100644 --- a/webapp/src/components/BaseModal/index.js +++ b/webapp/src/components/BaseModal/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,6 +46,10 @@ const BaseModal = { type: Boolean, default: true, }, + showOk: { + type: Boolean, + default: true, + }, loading: { type: Boolean, default: false, @@ -100,7 +104,10 @@ const BaseModal = { {this.cancelText} ) } - {this.okText} + { this.showOk && ( + {this.okText} + ) + } ); }; diff --git a/webapp/src/components/Card/info.vue b/webapp/src/components/Card/info.vue index c69dec8..13b3536 100644 --- a/webapp/src/components/Card/info.vue +++ b/webapp/src/components/Card/info.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/Drag/drag.vue b/webapp/src/components/Drag/drag.vue index d1d5da6..cc01dbd 100644 --- a/webapp/src/components/Drag/drag.vue +++ b/webapp/src/components/Drag/drag.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/Drag/index.js b/webapp/src/components/Drag/index.js index 010364e..04547fb 100644 --- a/webapp/src/components/Drag/index.js +++ b/webapp/src/components/Drag/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/DropdownHeader/index.vue b/webapp/src/components/DropdownHeader/index.vue index e613184..9ed71b4 100644 --- a/webapp/src/components/DropdownHeader/index.vue +++ b/webapp/src/components/DropdownHeader/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ {{ title }} - + { diff --git a/webapp/src/components/Exception/index.vue b/webapp/src/components/Exception/index.vue index ccbe530..f9635ee 100644 --- a/webapp/src/components/Exception/index.vue +++ b/webapp/src/components/Exception/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/IconFont/icon.js b/webapp/src/components/IconFont/icon.js index 7a37892..1dcd215 100644 --- a/webapp/src/components/IconFont/icon.js +++ b/webapp/src/components/IconFont/icon.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/IconFont/iconfont.js b/webapp/src/components/IconFont/iconfont.js index 8558d3b..1d981f4 100644 --- a/webapp/src/components/IconFont/iconfont.js +++ b/webapp/src/components/IconFont/iconfont.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/IconFont/index.js b/webapp/src/components/IconFont/index.js index 0070d1a..62bf6ea 100644 --- a/webapp/src/components/IconFont/index.js +++ b/webapp/src/components/IconFont/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ import create from './iconfont'; const IconFont = create({ - scriptUrl: '//at.alicdn.com/t/font_1756495_k4j524i5vng.js', + scriptUrl: '//at.alicdn.com/t/font_1756495_6jl45md8krp.js', extraIconProps: { class: 'svg-icon' }, }); diff --git a/webapp/src/components/IconFont/utils.js b/webapp/src/components/IconFont/utils.js index 36318cf..e1f5122 100644 --- a/webapp/src/components/IconFont/utils.js +++ b/webapp/src/components/IconFont/utils.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/ImageGallery/index.vue b/webapp/src/components/ImageGallery/index.vue index 7023def..558e8b7 100644 --- a/webapp/src/components/ImageGallery/index.vue +++ b/webapp/src/components/ImageGallery/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/InfoSelect/index.js b/webapp/src/components/InfoSelect/index.js index 407fc4d..d226bd7 100644 --- a/webapp/src/components/InfoSelect/index.js +++ b/webapp/src/components/InfoSelect/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/InfoSelect/info-select.vue b/webapp/src/components/InfoSelect/info-select.vue index ac1f972..87c93d7 100644 --- a/webapp/src/components/InfoSelect/info-select.vue +++ b/webapp/src/components/InfoSelect/info-select.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/InfoTable/column.js b/webapp/src/components/InfoTable/column.js index d6acf54..7f8500c 100644 --- a/webapp/src/components/InfoTable/column.js +++ b/webapp/src/components/InfoTable/column.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/InfoTable/index.js b/webapp/src/components/InfoTable/index.js index 8b2f3c7..4edb553 100644 --- a/webapp/src/components/InfoTable/index.js +++ b/webapp/src/components/InfoTable/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/InfoTable/info-table.vue b/webapp/src/components/InfoTable/info-table.vue index 426f206..c52e215 100644 --- a/webapp/src/components/InfoTable/info-table.vue +++ b/webapp/src/components/InfoTable/info-table.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,6 +34,7 @@ { if (state.loading) { return; @@ -153,11 +158,17 @@ export default { }; onMounted(() => { - queryList(); - if (typeof actionRef === 'function') { - actionRef().value = { - refresh: queryList, - }; + // 首先判断是否为异步请求 + if(typeof request === 'function') { + queryList(); + if (typeof actionRef === 'function') { + actionRef().value = { + refresh: queryList, + }; + } + } else if(Array.isArray(props.dataSource)) { + // 检测是否为静态数据源 + setData(props.dataSource); } }); @@ -168,6 +179,12 @@ export default { lazy: true, }); + watch(() => props.dataSource, (next) => { + setData(next); + }, { + lazy: true, + }); + watch(() => pageInfo.current, () => { queryList(); }, { diff --git a/webapp/src/components/InlineTableEdit/index.vue b/webapp/src/components/InlineTableEdit/index.vue index e55bfd2..b16b242 100644 --- a/webapp/src/components/InlineTableEdit/index.vue +++ b/webapp/src/components/InlineTableEdit/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@

{{ errors[0] }}

- 取消 + 取消 确定
@@ -97,7 +97,10 @@ export default { if (!success) { return; } - ctx.emit('handleOk', state.value, props.row); + // 判断是否发生过变更 + if(String(state.value) !== String(props.row[valueBy])) { + ctx.emit('handleOk', state.value, props.row); + } handleCancel(); }); }; diff --git a/webapp/src/components/LogContainer/index.vue b/webapp/src/components/LogContainer/index.vue index 6534a34..7c4eaaa 100644 --- a/webapp/src/components/LogContainer/index.vue +++ b/webapp/src/components/LogContainer/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,6 +54,10 @@ export default { type: String, default: '', }, + disabled: { + type: Boolean, + default: false, + }, }, data() { return { @@ -66,7 +70,7 @@ export default { }, computed: { getLogDisabled() { - return this.logLoading || this.noMoreLog; + return this.logLoading || this.noMoreLog || this.disabled; }, logTxt() { return `${this.showMsg ? `${this.msg}\n` : ''}${this.logList.join('\n')}`; diff --git a/webapp/src/components/LogContainer/podLogContainer.vue b/webapp/src/components/LogContainer/podLogContainer.vue new file mode 100644 index 0000000..e257f00 --- /dev/null +++ b/webapp/src/components/LogContainer/podLogContainer.vue @@ -0,0 +1,364 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/components/LoginPublic/index.vue b/webapp/src/components/LoginPublic/index.vue index 286d17e..01a2d3e 100644 --- a/webapp/src/components/LoginPublic/index.vue +++ b/webapp/src/components/LoginPublic/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/Prism/index.vue b/webapp/src/components/Prism/index.vue index 5e12bc7..e3d9827 100644 --- a/webapp/src/components/Prism/index.vue +++ b/webapp/src/components/Prism/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,6 +47,7 @@ export default { code[class*="language-"], pre[class*="language-"] { + word-wrap: break-word; white-space: pre-wrap; } diff --git a/webapp/src/components/SortingMenu/index.vue b/webapp/src/components/SortingMenu/index.vue index f56d2a2..2597117 100644 --- a/webapp/src/components/SortingMenu/index.vue +++ b/webapp/src/components/SortingMenu/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/Training/algorithmDetail.vue b/webapp/src/components/Training/algorithmDetail.vue index d1b9a30..3d3515a 100644 --- a/webapp/src/components/Training/algorithmDetail.vue +++ b/webapp/src/components/Training/algorithmDetail.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -89,7 +89,7 @@
- 取消 + 取消 确定
diff --git a/webapp/src/components/Training/dataSourceSelector.vue b/webapp/src/components/Training/dataSourceSelector.vue index dd68f69..ea95339 100644 --- a/webapp/src/components/Training/dataSourceSelector.vue +++ b/webapp/src/components/Training/dataSourceSelector.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/components/Training/jobForm.vue b/webapp/src/components/Training/jobForm.vue index 5b80ef1..cbbc9a1 100644 --- a/webapp/src/components/Training/jobForm.vue +++ b/webapp/src/components/Training/jobForm.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,6 @@ id="algorithm_tab_0" :label="1" border - class="mr-0" >我的算法 - + - + - 我的模型 + 我的模型 预训练模型 + 炼知模型 - + + + + + + + + + + + + + + @@ -239,7 +292,6 @@ id="resourcesPoolType_tab_0" :label="0" border - class="mr-0" >CPU -
+
{{ preview }}
@@ -319,8 +371,23 @@ {{ form.imageName }} - - {{ form.modelName }} + + {{ trainModel.name }} + + + {{ teacherModelNames }} + + + {{ studentModelNames }} {{ form.dataSourceName }} @@ -359,7 +426,7 @@ {{ formSpecs && formSpecs.label }} -
+
{{ preview }}
@@ -369,15 +436,25 @@ - diff --git a/webapp/src/config/index.js b/webapp/src/config/index.js index ed79491..7ddf17d 100644 --- a/webapp/src/config/index.js +++ b/webapp/src/config/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,34 +14,6 @@ * ============================================================= */ -// minIO 参数配置 -export const minIO = { - development: { - config: { - endPoint: '', // MinIO 服务地址 - port: 9000, - useSSL: false, - }, - bucketName: 'dubhe-dev', - }, - test: { - config: { - endPoint: '', - port: 9000, - useSSL: false, - }, - bucketName: 'dubhe-test', - }, - production: { - config: { - endPoint: '', - port: 9000, - useSSL: false, - }, - bucketName: 'dubhe-prod', - }, -}; - // 训练管理模块参数配置 export const trainConfig = { trainNodeMax: Infinity, // 分布式训练节点上限 @@ -63,3 +35,13 @@ export const imageConfig = { export const modelConfig = { uploadFileAcceptSize: 0, // 上传模型文件大小限制,单位为 MB,0 表示不限制大小 }; + +// 云端 Serving 模块参数配置 +export const servingConfig = { + onlineServingNodeSumMax: 10, +}; + +// 模型炼知模块参数配置 +export const atlasConfig = { + uploadFileAcceptSize: 5, // 上传度量图文件大小限制,单位为 MB,0 表示不限制大小 +}; diff --git a/webapp/src/directives/index.js b/webapp/src/directives/index.js index ff38453..b021fef 100644 --- a/webapp/src/directives/index.js +++ b/webapp/src/directives/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/directives/modules/clickOnce.js b/webapp/src/directives/modules/clickOnce.js index 69d91d2..5470b85 100644 --- a/webapp/src/directives/modules/clickOnce.js +++ b/webapp/src/directives/modules/clickOnce.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/directives/modules/elSelectLoadMore.js b/webapp/src/directives/modules/elSelectLoadMore.js index 2263623..213918a 100644 --- a/webapp/src/directives/modules/elSelectLoadMore.js +++ b/webapp/src/directives/modules/elSelectLoadMore.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/directives/modules/mouseWheel.js b/webapp/src/directives/modules/mouseWheel.js index 821da0f..0c3fc7a 100644 --- a/webapp/src/directives/modules/mouseWheel.js +++ b/webapp/src/directives/modules/mouseWheel.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/hooks/brush/BasicBrush.js b/webapp/src/hooks/brush/BasicBrush.js index 145df66..b8c8368 100644 --- a/webapp/src/hooks/brush/BasicBrush.js +++ b/webapp/src/hooks/brush/BasicBrush.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/hooks/brush/index.js b/webapp/src/hooks/brush/index.js index 5c26d1f..e1807f0 100644 --- a/webapp/src/hooks/brush/index.js +++ b/webapp/src/hooks/brush/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/hooks/brush/useBrush.js b/webapp/src/hooks/brush/useBrush.js index 567d1e8..14c808c 100644 --- a/webapp/src/hooks/brush/useBrush.js +++ b/webapp/src/hooks/brush/useBrush.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/hooks/image/index.js b/webapp/src/hooks/image/index.js index 7f1c653..c08743f 100644 --- a/webapp/src/hooks/image/index.js +++ b/webapp/src/hooks/image/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/hooks/index.js b/webapp/src/hooks/index.js index 608d457..3780386 100644 --- a/webapp/src/hooks/index.js +++ b/webapp/src/hooks/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/hooks/tooltip/BasicTooltip.js b/webapp/src/hooks/tooltip/BasicTooltip.js index c6f1612..113acef 100644 --- a/webapp/src/hooks/tooltip/BasicTooltip.js +++ b/webapp/src/hooks/tooltip/BasicTooltip.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/hooks/tooltip/TooltipContainer.js b/webapp/src/hooks/tooltip/TooltipContainer.js index 6e0757b..eaff85f 100644 --- a/webapp/src/hooks/tooltip/TooltipContainer.js +++ b/webapp/src/hooks/tooltip/TooltipContainer.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/hooks/tooltip/index.js b/webapp/src/hooks/tooltip/index.js index c13eaca..a13ca3c 100644 --- a/webapp/src/hooks/tooltip/index.js +++ b/webapp/src/hooks/tooltip/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/hooks/tooltip/style.scss b/webapp/src/hooks/tooltip/style.scss index f92c152..5f65c8f 100644 --- a/webapp/src/hooks/tooltip/style.scss +++ b/webapp/src/hooks/tooltip/style.scss @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/hooks/tooltip/tableTooltip.js b/webapp/src/hooks/tooltip/tableTooltip.js index ea61721..a2d5fb6 100644 --- a/webapp/src/hooks/tooltip/tableTooltip.js +++ b/webapp/src/hooks/tooltip/tableTooltip.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,9 +33,6 @@ export default { type: [Array, Object], required: true, }, - annotateType: { - type: Number, - }, className: { type: String, }, @@ -57,7 +54,7 @@ export default { }, render(h, context) { const { props } = context; - const { className, keys, title, colorScale, keyAccessor, valueAccessor, showIcon, data, annotateType } = props; + const { className, keys, title, colorScale, keyAccessor, valueAccessor, showIcon, data } = props; if (!keys.length) return null; const klass = cx('tt-wrapper', { [className]: !!className, @@ -72,9 +69,6 @@ export default { backgroundColor: colorScale ? colorScale(key) : '', }, }; - if(annotateType !== 5 && idx === 3 ) { - return null; - } return (
diff --git a/webapp/src/hooks/tooltip/useTooltip.js b/webapp/src/hooks/tooltip/useTooltip.js index ddee345..f991afa 100644 --- a/webapp/src/hooks/tooltip/useTooltip.js +++ b/webapp/src/hooks/tooltip/useTooltip.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/hooks/utils.js b/webapp/src/hooks/utils.js index 5bff321..69e8f8e 100644 --- a/webapp/src/hooks/utils.js +++ b/webapp/src/hooks/utils.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/hooks/zoom/index.js b/webapp/src/hooks/zoom/index.js index 2604ab8..f85fd38 100644 --- a/webapp/src/hooks/zoom/index.js +++ b/webapp/src/hooks/zoom/index.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/hooks/zoom/useZoom.js b/webapp/src/hooks/zoom/useZoom.js index e655ab8..756ffc6 100644 --- a/webapp/src/hooks/zoom/useZoom.js +++ b/webapp/src/hooks/zoom/useZoom.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/layout/BaseLayout.vue b/webapp/src/layout/BaseLayout.vue index 9ebc7df..0b0d1a5 100644 --- a/webapp/src/layout/BaseLayout.vue +++ b/webapp/src/layout/BaseLayout.vue @@ -19,7 +19,7 @@
-
+
+ + diff --git a/webapp/src/views/atlas/graphVisual.vue b/webapp/src/views/atlas/graphVisual.vue new file mode 100644 index 0000000..3c32966 --- /dev/null +++ b/webapp/src/views/atlas/graphVisual.vue @@ -0,0 +1,395 @@ + + + + + + + \ No newline at end of file diff --git a/webapp/src/views/atlas/measure.vue b/webapp/src/views/atlas/measure.vue new file mode 100644 index 0000000..92c6d17 --- /dev/null +++ b/webapp/src/views/atlas/measure.vue @@ -0,0 +1,339 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + diff --git a/webapp/src/views/atlas/util.js b/webapp/src/views/atlas/util.js new file mode 100644 index 0000000..7bee32b --- /dev/null +++ b/webapp/src/views/atlas/util.js @@ -0,0 +1,22 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + +export const ERROR_MSG = { + NO_NODES: '度量图中不存在节点信息,请检查后重试', + NO_EDGES: '度量图中不存在边信息,请检查后重试', + NODES_NOT_ARRAY: '度量图中的节点信息结构错误,请检查后重试', + EDGES_NOT_ARRAY: '度量图中的边信息结构错误,请检查后重试', +}; diff --git a/webapp/src/views/cloudServing/batch.vue b/webapp/src/views/cloudServing/batch.vue new file mode 100644 index 0000000..5de0564 --- /dev/null +++ b/webapp/src/views/cloudServing/batch.vue @@ -0,0 +1,507 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/batchDetail.vue b/webapp/src/views/cloudServing/batchDetail.vue new file mode 100644 index 0000000..5c4eb33 --- /dev/null +++ b/webapp/src/views/cloudServing/batchDetail.vue @@ -0,0 +1,344 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/components/forms/batchServingForm.vue b/webapp/src/views/cloudServing/components/forms/batchServingForm.vue new file mode 100644 index 0000000..1483909 --- /dev/null +++ b/webapp/src/views/cloudServing/components/forms/batchServingForm.vue @@ -0,0 +1,461 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + diff --git a/webapp/src/views/cloudServing/components/forms/batchUploadDialog.vue b/webapp/src/views/cloudServing/components/forms/batchUploadDialog.vue new file mode 100644 index 0000000..b839b65 --- /dev/null +++ b/webapp/src/views/cloudServing/components/forms/batchUploadDialog.vue @@ -0,0 +1,193 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/components/forms/servingForm.vue b/webapp/src/views/cloudServing/components/forms/servingForm.vue new file mode 100644 index 0000000..c903d24 --- /dev/null +++ b/webapp/src/views/cloudServing/components/forms/servingForm.vue @@ -0,0 +1,332 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/components/forms/servingModelConfig.vue b/webapp/src/views/cloudServing/components/forms/servingModelConfig.vue new file mode 100644 index 0000000..32bdc06 --- /dev/null +++ b/webapp/src/views/cloudServing/components/forms/servingModelConfig.vue @@ -0,0 +1,481 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/components/keyValueTable/index.vue b/webapp/src/views/cloudServing/components/keyValueTable/index.vue new file mode 100644 index 0000000..60b6c94 --- /dev/null +++ b/webapp/src/views/cloudServing/components/keyValueTable/index.vue @@ -0,0 +1,74 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/components/modelDetail/index.vue b/webapp/src/views/cloudServing/components/modelDetail/index.vue new file mode 100644 index 0000000..90fe5dc --- /dev/null +++ b/webapp/src/views/cloudServing/components/modelDetail/index.vue @@ -0,0 +1,127 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + diff --git a/webapp/src/views/cloudServing/components/servingCallGuide/index.vue b/webapp/src/views/cloudServing/components/servingCallGuide/index.vue new file mode 100644 index 0000000..835d848 --- /dev/null +++ b/webapp/src/views/cloudServing/components/servingCallGuide/index.vue @@ -0,0 +1,145 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/components/servingCallGuide/servingApiInfo.vue b/webapp/src/views/cloudServing/components/servingCallGuide/servingApiInfo.vue new file mode 100644 index 0000000..47b1527 --- /dev/null +++ b/webapp/src/views/cloudServing/components/servingCallGuide/servingApiInfo.vue @@ -0,0 +1,58 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/components/servingDeploymentRecord/index.vue b/webapp/src/views/cloudServing/components/servingDeploymentRecord/index.vue new file mode 100644 index 0000000..fcccc7c --- /dev/null +++ b/webapp/src/views/cloudServing/components/servingDeploymentRecord/index.vue @@ -0,0 +1,194 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/components/servingLog/index.vue b/webapp/src/views/cloudServing/components/servingLog/index.vue new file mode 100644 index 0000000..3db1139 --- /dev/null +++ b/webapp/src/views/cloudServing/components/servingLog/index.vue @@ -0,0 +1,338 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/components/servingMonitor/index.vue b/webapp/src/views/cloudServing/components/servingMonitor/index.vue new file mode 100644 index 0000000..039c3e6 --- /dev/null +++ b/webapp/src/views/cloudServing/components/servingMonitor/index.vue @@ -0,0 +1,113 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + \ No newline at end of file diff --git a/webapp/src/views/cloudServing/components/servingMonitor/servingMonitorCard.vue b/webapp/src/views/cloudServing/components/servingMonitor/servingMonitorCard.vue new file mode 100644 index 0000000..cbb3b9b --- /dev/null +++ b/webapp/src/views/cloudServing/components/servingMonitor/servingMonitorCard.vue @@ -0,0 +1,158 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/components/servingMonitor/servingMonitorUsageUnit.vue b/webapp/src/views/cloudServing/components/servingMonitor/servingMonitorUsageUnit.vue new file mode 100644 index 0000000..f19a7e3 --- /dev/null +++ b/webapp/src/views/cloudServing/components/servingMonitor/servingMonitorUsageUnit.vue @@ -0,0 +1,85 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/components/servingPredict/index.vue b/webapp/src/views/cloudServing/components/servingPredict/index.vue new file mode 100644 index 0000000..7d64bf0 --- /dev/null +++ b/webapp/src/views/cloudServing/components/servingPredict/index.vue @@ -0,0 +1,187 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/detail.vue b/webapp/src/views/cloudServing/detail.vue new file mode 100644 index 0000000..e8a4408 --- /dev/null +++ b/webapp/src/views/cloudServing/detail.vue @@ -0,0 +1,372 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/formPage.vue b/webapp/src/views/cloudServing/formPage.vue new file mode 100644 index 0000000..d68fcb8 --- /dev/null +++ b/webapp/src/views/cloudServing/formPage.vue @@ -0,0 +1,183 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/index.vue b/webapp/src/views/cloudServing/index.vue new file mode 100644 index 0000000..6bc2889 --- /dev/null +++ b/webapp/src/views/cloudServing/index.vue @@ -0,0 +1,519 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/cloudServing/util.js b/webapp/src/views/cloudServing/util.js new file mode 100644 index 0000000..61f02b9 --- /dev/null +++ b/webapp/src/views/cloudServing/util.js @@ -0,0 +1,186 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + +export const SERVING_STATUS_ENUM = { + EXCEPTION: '0', + IN_DEPLOYMENT: '1', + WORKING: '2', + STOP: '3', + COMPLETED: '4', + UNKNOWN: '5', +}; + +export const ONLINE_SERVING_STATUS_MAP = { + [SERVING_STATUS_ENUM.IN_DEPLOYMENT]: { name: '部署中', tagMap: '' }, + [SERVING_STATUS_ENUM.WORKING]: { name: '运行中', tagMap: 'success' }, + [SERVING_STATUS_ENUM.STOP]: { name: '已停止', tagMap: 'info' }, + [SERVING_STATUS_ENUM.EXCEPTION]: { name: '运行失败', tagMap: 'danger' }, +}; + +export const BATCH_SERVING_STATUS_MAP = { + [SERVING_STATUS_ENUM.IN_DEPLOYMENT]: { name: '部署中', tagMap: '' }, + [SERVING_STATUS_ENUM.WORKING]: { name: '运行中', tagMap: '' }, + [SERVING_STATUS_ENUM.STOP]: { name: '已停止', tagMap: 'info' }, + [SERVING_STATUS_ENUM.EXCEPTION]: { name: '运行失败', tagMap: 'danger' }, + [SERVING_STATUS_ENUM.COMPLETED]: { name: '运行完成', tagMap: 'success' }, + [SERVING_STATUS_ENUM.UNKNOWN]: { name: '未知', tagMap: 'info' }, +}; + +export function generateMap(originMap, field) { + const map = {}; + Object.keys(originMap).forEach(key => { + map[key] = originMap[key][field]; + }); + return map; +} + +export const ONLINE_SERVING_TYPE = { + HTTP: 0, + GRPC: 1, +}; + +export const serviceTypeMap = { + [ONLINE_SERVING_TYPE.HTTP]: 'HTTP 模式', + [ONLINE_SERVING_TYPE.GRPC]: 'GRPC 模式', +}; + +export function map2Array(obj) { + const result = []; + if (typeof obj !== 'object' || obj === null) { + return result; + } + for (const key of Object.keys(obj)) { + result.push({ + name: key, + type: obj[key], + }); + } + return result; +} + +export function numFormatter(num) { + return num < 10000 ? `${num}` : `${Math.round(num / 1000) / 10}万`; +} + +function getResponseBody(xhr) { + const response = xhr.response || xhr.responseText; + try { + return JSON.parse(response); + } catch (e) { + return response; + } +} + +// 自定义了上传方法,用于支持多文件上传预测 +export function upload(options) { + const xhr = new XMLHttpRequest(); + const formData = new FormData(); + for (const file of options.fileList) { + formData.append(options.uploadName, file, file.name); + } + + if (xhr.upload && options.onUploadProgress) { + xhr.upload.onprogress = function progress(e) { + if (e.total > 0) { + e.percent = e.loaded / e.total * 100; + } + options.onUploadProgress(e); + }; + } + + xhr.onreadystatechange = () => { + if (xhr.readyState === 4) { + const response = getResponseBody(xhr); + if (xhr.status < 200 || xhr.status >= 300) { + const error = new Error(response.msg || '未知错误'); + return options.onUploadError(error); + } + options.onUploadSuccess(response); + } + }; + + xhr.open('post', options.requestUrl, true); + xhr.send(formData); + return xhr; +} + +export function cpuFormatter(num, unit) { + // 如果单位为空,则直接以“核”为单位展示,否则以 m 为单位展示 + if (!unit) { + return `${num}核`; + } + if (unit === 'n') { + num /= 1e6; + unit = 'm'; + } + if (unit === 'm') { + return `${Math.round(num * 10) / 10}m`; + } + // 如果单位不为 核、m、n 其中的一个,则直接返回格式 + return num + unit; +} + +export function cpuPercentage(used, usedUnit, total, totalUnit) { + const _transition = (num, unit) => { + switch (unit) { + case '': + num *= 1e9; + break; + case 'm': + num *= 1e6; + break; + // no default + } + return num; + }; + return Math.round(_transition(used, usedUnit) / _transition(total, totalUnit) * 10000) / 100; +} + +export function memFormatter(num, unit) { + if (unit === 'Ki' && num > 1024) { + unit = 'Mi'; + num /= 1024; + } + if (unit === 'Mi' && num > 1024) { + unit = 'Gi'; + num /= 1024; + } + return Math.round(num * 10) / 10 + unit; +} + +export function memPercentage(used, usedUnit, total, totalUnit) { + const _transition = (num, unit) => { + switch (unit) { + case 'Gi': + num *= 2 ** 20; + break; + case 'Mi': + num *= 2 ** 10; + break; + // no default + } + return num; + }; + return Math.round(_transition(used, usedUnit) / _transition(total, totalUnit) * 10000) / 100; +} + +export const batchServingProgressColor = [ + { color: '#67c23a', percentage: 100 }, +]; + +export function getPollId() { + return new Date().getTime(); +}; diff --git a/webapp/src/views/dashboard/components/CardPanel.vue b/webapp/src/views/dashboard/components/CardPanel.vue index f018664..a660f1e 100644 --- a/webapp/src/views/dashboard/components/CardPanel.vue +++ b/webapp/src/views/dashboard/components/CardPanel.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/views/dashboard/components/Welcome.vue b/webapp/src/views/dashboard/components/Welcome.vue index 6729dee..5f61e8c 100644 --- a/webapp/src/views/dashboard/components/Welcome.vue +++ b/webapp/src/views/dashboard/components/Welcome.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/views/dashboard/dashboard.vue b/webapp/src/views/dashboard/dashboard.vue index 279456c..a971838 100644 --- a/webapp/src/views/dashboard/dashboard.vue +++ b/webapp/src/views/dashboard/dashboard.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/views/dataset/annotate/index.vue b/webapp/src/views/dataset/annotate/index.vue index fc006f6..8c52807 100644 --- a/webapp/src/views/dataset/annotate/index.vue +++ b/webapp/src/views/dataset/annotate/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ import { Message, MessageBox } from 'element-ui'; import { isEmpty, isFunction, omit, isNil } from 'lodash'; -import { detail, detectFileList, queryFileOffset, queryDataEnhanceList, getEnhanceFileList } from '@/api/preparation/dataset'; +import { detail, detectFileList, queryFileOffset, queryDataEnhanceList, getEnhanceFileList, queryLabels as queryLabelApi, createLabel as createLabelApi } from '@/api/preparation/dataset'; import request from '@/utils/request'; import { generateUuid, generateBbox, bbox2Extent, extent2Bbox, endsWith, replace, remove, AssertError } from '@/utils'; import { parseAnnotation, labelsSymbol, enhanceSymbol, stringifyAnnotations, annotationMap, transformFiles, withExtent } from '../util'; @@ -170,13 +170,13 @@ export default { // 查询标签 const queryLabels = async(requestParams = {}) => { - const labels = await request(`api/data/datasets/${params.datasetId}/labels`, { params: requestParams }); + const labels = await queryLabelApi(params.datasetId, requestParams); return labels || []; }; // 新建标签 const createLabel = async(labelParams = {}) => { - const result = await request.post(`api/data/datasets/${params.datasetId}/labels`, labelParams); + const result = await createLabelApi(params.datasetId, labelParams); return result; }; diff --git a/webapp/src/views/dataset/annotate/settingContainer/annotations.vue b/webapp/src/views/dataset/annotate/settingContainer/annotations.vue index 74952b4..cfa5d1c 100644 --- a/webapp/src/views/dataset/annotate/settingContainer/annotations.vue +++ b/webapp/src/views/dataset/annotate/settingContainer/annotations.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ diff --git a/webapp/src/views/dataset/annotate/settingContainer/editLabel.vue b/webapp/src/views/dataset/annotate/settingContainer/editLabel.vue index 0688b62..c2f2ae2 100644 --- a/webapp/src/views/dataset/annotate/settingContainer/editLabel.vue +++ b/webapp/src/views/dataset/annotate/settingContainer/editLabel.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/views/dataset/annotate/settingContainer/enhance.vue b/webapp/src/views/dataset/annotate/settingContainer/enhance.vue index bd2a060..259060e 100644 --- a/webapp/src/views/dataset/annotate/settingContainer/enhance.vue +++ b/webapp/src/views/dataset/annotate/settingContainer/enhance.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/views/dataset/annotate/settingContainer/enhanceTip.vue b/webapp/src/views/dataset/annotate/settingContainer/enhanceTip.vue index 39ca958..a1466de 100644 --- a/webapp/src/views/dataset/annotate/settingContainer/enhanceTip.vue +++ b/webapp/src/views/dataset/annotate/settingContainer/enhanceTip.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/views/dataset/annotate/settingContainer/footer.vue b/webapp/src/views/dataset/annotate/settingContainer/footer.vue index 305bc75..45547cb 100644 --- a/webapp/src/views/dataset/annotate/settingContainer/footer.vue +++ b/webapp/src/views/dataset/annotate/settingContainer/footer.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/views/dataset/annotate/settingContainer/index.vue b/webapp/src/views/dataset/annotate/settingContainer/index.vue index 1cfadc9..8bad7b9 100644 --- a/webapp/src/views/dataset/annotate/settingContainer/index.vue +++ b/webapp/src/views/dataset/annotate/settingContainer/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,6 +82,7 @@ import { isNil } from 'lodash'; import { getAutoLabels, editLabel } from '@/api/preparation/datalabel'; import { labelsSymbol } from '@/views/dataset/util'; +import { labelGroupTypeCodeMap } from '@/views/labelGroup/util'; import SelectLabel from './selectLabel'; import LabelList from './labelList'; @@ -168,7 +169,7 @@ export default { }; const getSystemLabel = () => { - getAutoLabels().then(res => { + getAutoLabels(labelGroupTypeCodeMap.VISUAL).then(res => { const labelsObj = res.map((item) => ({ value: item.id, label: item.name, diff --git a/webapp/src/views/dataset/annotate/settingContainer/label.vue b/webapp/src/views/dataset/annotate/settingContainer/label.vue index 22a0201..9e6245c 100644 --- a/webapp/src/views/dataset/annotate/settingContainer/label.vue +++ b/webapp/src/views/dataset/annotate/settingContainer/label.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/views/dataset/annotate/settingContainer/labelList/edit.vue b/webapp/src/views/dataset/annotate/settingContainer/labelList/edit.vue index 17bae7f..014b2d3 100644 --- a/webapp/src/views/dataset/annotate/settingContainer/labelList/edit.vue +++ b/webapp/src/views/dataset/annotate/settingContainer/labelList/edit.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,7 +77,7 @@ export default { // 表单规则 const rules = { name: [ - { required: true, message: '请输入数据集名称', trigger: ['change', 'blur'] }, + { required: true, message: '请输入标签名称', trigger: ['change', 'blur'] }, { validator: validateName, trigger: ['change', 'blur'] }, ], }; diff --git a/webapp/src/views/dataset/annotate/settingContainer/labelList/index.vue b/webapp/src/views/dataset/annotate/settingContainer/labelList/index.vue index 2af9eae..5c48779 100644 --- a/webapp/src/views/dataset/annotate/settingContainer/labelList/index.vue +++ b/webapp/src/views/dataset/annotate/settingContainer/labelList/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ diff --git a/webapp/src/views/dataset/entrance.vue b/webapp/src/views/dataset/entrance.vue new file mode 100644 index 0000000..d3460d7 --- /dev/null +++ b/webapp/src/views/dataset/entrance.vue @@ -0,0 +1,121 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + diff --git a/webapp/src/views/dataset/fork.vue b/webapp/src/views/dataset/fork.vue new file mode 100644 index 0000000..0a13b6c --- /dev/null +++ b/webapp/src/views/dataset/fork.vue @@ -0,0 +1,39 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + diff --git a/webapp/src/views/dataset/list/action.js b/webapp/src/views/dataset/list/action.js index 79f1aa8..f6dccd5 100644 --- a/webapp/src/views/dataset/list/action.js +++ b/webapp/src/views/dataset/list/action.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * ============================================================= */ -import { statusCodeMap, dataTypeCodeMap } from '../util'; +import { statusCodeMap, dataTypeCodeMap, annotationCodeMap, isPublishDataset } from '../util'; export default { name: 'DatasetAction', @@ -42,6 +42,10 @@ export default { return ( 操作 + +
如果文本数据集关联的不是预置标签组,
自动标注按钮可能无法使用
+ +
); }, @@ -62,8 +66,14 @@ export default { if (row.dataType === dataTypeCodeMap.VIDEO && statusCodeMap[row.status] === 'AUTO_ANNOTATED') { showCheckButton = false; } - // 查看标注按钮 - const checkButton = ( + // 查看标注按钮根据版本发布的状态决定是否置灰加提示 + const checkButton = isPublishDataset(row) ? ( + + + 查看标注 + + + ) : ( goDetail(row)}> 查看标注 @@ -71,6 +81,10 @@ export default { // 自动标注按钮只在 未标注 标注中 时显示 let showAutoButton = ['UNANNOTATED', 'ANNOTATING'].includes(statusCodeMap[row.status]); + // 如果是文本分类,只有使用了预置标签组的数据集可以进行自动标注,autoAnnotation字段 + if(row.dataType === dataTypeCodeMap.TEXT && !row.autoAnnotation) { + showAutoButton = false; + } // 自动标注按钮 const autoButton = ( autoAnnotate(row)}> @@ -110,7 +124,8 @@ export default { 发布 ); - + + // 当类型为文本时,不显示发布按钮 // 当类型为视频时,状态为标注完成、目标跟踪完成时显示发布按钮,其余状态不显示发布按钮 // 当类型为图片时,状态为自动标注完成时显示有弹窗确认的发布按钮,为标注完成时显示发布按钮,其余状态不显示发布按钮 if (row.dataType === dataTypeCodeMap.VIDEO) { @@ -118,12 +133,14 @@ export default { showPublishButton = true; publishButton = publishDialogButton; } - } else if (statusCodeMap[row.status] === 'AUTO_ANNOTATED') { - showPublishButton = true; - publishButton = publishConfirmButton; - } else if (statusCodeMap[row.status] === 'ANNOTATED') { - showPublishButton = true; - publishButton = publishDialogButton; + } else if (row.dataType === dataTypeCodeMap.IMAGE) { + if (statusCodeMap[row.status] === 'AUTO_ANNOTATED') { + showPublishButton = true; + publishButton = publishConfirmButton; + } else if (statusCodeMap[row.status] === 'ANNOTATED') { + showPublishButton = true; + publishButton = publishDialogButton; + } } let showUploadButton = false; @@ -145,6 +162,10 @@ export default { // 当标注完成、目标跟踪完成,以及非视频的自动标注完成时显示重新自动标注按钮 (若为视频此时下游会进行目标跟踪) let showReAutoButton = ['ANNOTATED', 'TRACK_SUCCEED'].includes(statusCodeMap[row.status]) || (statusCodeMap[row.status] === 'AUTO_ANNOTATED' && row.dataType === dataTypeCodeMap.IMAGE); + // 文本不能重新自动标注 + if (row.dataType === dataTypeCodeMap.TEXT) { + showReAutoButton = false; + } // 重新自动标注按钮 const reAutoButton = ( track(row, false)}> @@ -223,6 +244,21 @@ export default { ) : null; + + // 数据集版本发布或者切换中 只允许置顶 修改 历史版本,查看标注置灰 + if (isPublishDataset(row)) { + showPublishButton = false; + showUploadButton = false; + showCheckButton = true; + showAutoButton = false; + showReAutoButton = false; + showTrackButton = false; + showReTrackButton = false; + showVersionButton = true; + showAugmentButton = false; + showTopButton = true; + showEditButton = true; + }; // 预置数据集只具备查看标注,历史版本功能。 if (row.type === 2) { diff --git a/webapp/src/views/dataset/list/create-dataset.vue b/webapp/src/views/dataset/list/create-dataset.vue index 2531dff..701b2d8 100644 --- a/webapp/src/views/dataset/list/create-dataset.vue +++ b/webapp/src/views/dataset/list/create-dataset.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,7 +50,6 @@ v-model="form.annotateType" placeholder="标注类型" :dataSource="annotationList" - :disabled="form.dataType === dataTypeCodeMap.VIDEO" @change="handleAnnotateTypeChange" /> @@ -63,12 +62,13 @@ :props="{expandTrigger: 'hover'}" :show-all-levels="false" filterable - popper-class="group-cascader" - style="width:100%; line-height:32px;" + popper-class="group-cascader" + style="width: 100%; line-height: 32px;" @change="handleGroupChange" + @focus="handleGroupFocus" >
- 没有找到标签组?去 + 没有找到标签组?去 页面创建
-
- + 查看详情 - -
+ +
+
{ - let disabled = false; + // 图片,可用图像分类和目标检测;视频,可用目标跟踪;文本,可用文本分类 + return rawAnnotationList.filter(d => { if (this.form.dataType === dataTypeCodeMap.IMAGE) { - disabled = d.value === annotationCodeMap.TRACK; - } else if (this.form.dataType === dataTypeCodeMap.VIDEO) { - disabled = d.value !== annotationCodeMap.TRACK; + return [annotationCodeMap.ANNOTATE, annotationCodeMap.CLASSIFY].includes(d.value); + } + if (this.form.dataType === dataTypeCodeMap.VIDEO) { + return d.value === annotationCodeMap.TRACK; } - return { - ...d, - disabled, - }; + if (this.form.dataType === dataTypeCodeMap.TEXT) { + return d.value === annotationCodeMap.TEXTCLASSIFY; + } + return true; }); }, @@ -348,30 +374,38 @@ export default { if(this.skipUpload) return true; return this.uploadStatus && ['success', 'exception'].includes(this.uploadStatus); }, - }, - created() { - this.crud.toQuery(); - getLabelGroupList(1).then(res => { - res.forEach((item) => { - this.labelGroupOptions[1].children.push({ - value: item.id, - label: item.name, - disabled: false, - }); - }); - }); - getLabelGroupList(0).then(res => { - res.forEach((item) => { - this.labelGroupOptions[0].children.push({ - value: item.id, - label: item.name, - disabled: false, - }); - }); - }); }, methods: { - handleGroupChange(val) { + handleGroupFocus() { + // 在未选择数据类型和标注类型之前,不对可用的标签组进行查询 + if(!isNil(this.form.dataType) && this.form.dataType !== '' && !isNil(this.form.annotateType) && this.form.annotateType !== ''){ + // 在数据类型和标注类型未改动的情况下 避免对可用的标签组列表进行重复查询 + if((this.labelGroupOptions[1].children).length === 0){ + getLabelGroupList({type: 1, dataType: this.form.dataType, annotateType: this.form.annotateType}).then(res => { + res.forEach((item) => { + this.labelGroupOptions[1].children.push({ + value: item.id, + label: item.name, + disabled: false, + }); + }); + }); + } + if((this.labelGroupOptions[0].children).length === 0){ + getLabelGroupList({type: 0, dataType: this.form.dataType, annotateType: this.form.annotateType}).then(res => { + res.forEach((item) => { + this.labelGroupOptions[0].children.push({ + value: item.id, + label: item.name, + disabled: false, + }); + }); + }); + } + } + }, + + handleGroupChange(val){ if(val.length === 0) { this.chosenGroup = null; this.chosenGroupId = null; @@ -402,43 +436,21 @@ export default { this.uploadPercent = 0; this.videoUploadProgress = 0; }, - + // 清空标签组可选列表 清除选中的标签组 + clearLabelGroupItem() { + this.labelGroupOptions[0].children = []; + this.labelGroupOptions[1].children = []; + this.chosenGroupId = null; + this.chosenGroup = null; + }, // step0 改变数据类型 handleDataTypeChange(dataType) { - // 数据类型选中为视频时,标注类型自动切换为目标跟踪,同时清除不符合类型的标签组 - if (dataType === dataTypeCodeMap.VIDEO) { - this.form.annotateType = annotationCodeMap.TRACK; - this.handleAnnotateTypeChange(annotationCodeMap.TRACK); - } else { - // 数据类型选中为其他时 去除限制 - this.form.annotateType = undefined; - this.labelGroupOptions[1].disabled = false; - this.labelGroupOptions[1].children.forEach( item => {item.disabled = false;}); - } + this.clearLabelGroupItem(); + this.form.annotateType = dataTypeAnnotateTypeMap.get(dataType); }, // step0 改变标注类型 - handleAnnotateTypeChange(annotateType) { - // 更改标注类型会清除不符合条件的标签组 - // 目标检测和目标跟踪可以选中预置标签组中的Coco(id=1) - if ([annotationCodeMap.ANNOTATE, annotationCodeMap.TRACK].includes(annotateType)) { - if(this.chosenGroupId !== 1){ - this.chosenGroup = null; - this.chosenGroupId = null; - } - this.labelGroupOptions[1].disabled = false; - this.labelGroupOptions[1].children.forEach( item => { - // 此处1是预置的coco标签组固定id为1 - if(item.value === 1){ - item.disabled = false; - } else { - item.disabled = true; - } - }); - } else { - // 其余可以使用任意标签组 - this.labelGroupOptions[1].disabled = false; - this.labelGroupOptions[1].children.forEach(item => {item.disabled = false;}); - } + handleAnnotateTypeChange() { + this.clearLabelGroupItem(); }, // step0 创建数据集调用 createDataset() { @@ -479,13 +491,16 @@ export default { // 文件上传 if (dataType === dataTypeCodeMap.IMAGE) { return submit(datasetId, files); - } + } if (dataType === dataTypeCodeMap.VIDEO) { return submitVideo(datasetId, { frameInterval: this.step1Form.frameInterval, url: files[0].url, }); } + if (dataType === dataTypeCodeMap.TEXT) { + return submit(datasetId, files); + } return Promise.reject(); }, // step1 上传成功 @@ -497,7 +512,14 @@ export default { if (this.form.dataType === dataTypeCodeMap.VIDEO) { this.videoUploadProgress = 100; } - const files = getImgFromMinIO(res); + + let files; + if (this.form.dataType === dataTypeCodeMap.TEXT) { + files = getTextFromMinIO(res); + } else { + files = getImgFromMinIO(res); + } + // 自动标注完成时 导入 提示信息不同 const successMessage = '上传文件成功'; if (files.length > 0) { @@ -511,11 +533,10 @@ export default { }); } }, - // step1 上传失败 - uploadError() { - this.uploadStatus = 'exception'; + // step1 上传失败 + uploadError(err) { this.$message({ - message: '上传文件失败', + message: err.message || '上传文件失败', type: 'error', }); }, @@ -527,16 +548,15 @@ export default { // step1 确定上传 uploadSubmit(formName) { this.$refs[formName].uploadSubmit((resolved, total) => { + if (this.crud.status.cu > 0) { + this.activeStep = 2; + } // eslint-disable-next-line func-names this.$nextTick(function() { this.uploadPercent = this.uploadPercent > 100 ? 100 : toFixed(resolved / total); }); }); - - if (this.crud.status.cu > 0) { - this.activeStep = 2; - } }, // step2 进度格式化 diff --git a/webapp/src/views/dataset/list/data-enhance.vue b/webapp/src/views/dataset/list/data-enhance.vue index bf6814e..8c4045b 100644 --- a/webapp/src/views/dataset/list/data-enhance.vue +++ b/webapp/src/views/dataset/list/data-enhance.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/views/dataset/list/edit-dataset.vue b/webapp/src/views/dataset/list/edit-dataset.vue index 8d6aa2d..dcb286f 100644 --- a/webapp/src/views/dataset/list/edit-dataset.vue +++ b/webapp/src/views/dataset/list/edit-dataset.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ filterable :clearable="deletable" popper-class="group-cascader" - style="width:100%; line-height:32px;" + style="width: 100%; line-height: 32px;" @change="handleGroupChange" >
@@ -70,7 +70,7 @@ 页面创建
-
+
import {isNil} from 'lodash'; -import { watch, reactive, computed, onMounted } from '@vue/composition-api'; +import { watch, reactive, computed } from '@vue/composition-api'; import BaseModal from '@/components/BaseModal'; import InfoSelect from '@/components/InfoSelect'; @@ -215,14 +215,15 @@ export default { label: annotationMap[d].name, value: Number(d), })); - // 如果是图片,目标跟踪不可用 - // 如果是视频,只能用目标跟踪 + // 图片,可用图像分类和目标检测;视频,可用目标跟踪;文本,可用文本分类 return rawAnnotationList.map(d => { let disabled = false; if (state.model.dataType === dataTypeCodeMap.IMAGE) { - disabled = d.value === annotationCodeMap.TRACK; + disabled = ![annotationCodeMap.ANNOTATE, annotationCodeMap.CLASSIFY].includes(d.value); } else if (state.model.dataType === dataTypeCodeMap.VIDEO) { disabled = d.value !== annotationCodeMap.TRACK; + } else { + disabled = d.value !== annotationCodeMap.TEXTCLASSIFY; } return { ...d, @@ -257,49 +258,30 @@ export default { } }; - onMounted(() => { - getLabelGroupList(1).then(res => { - res.forEach((item) => { - state.labelGroupOptions[1].children.push({ - value: item.id, - label: item.name, - disabled: false, - }); - }); - }); - getLabelGroupList(0).then(res => { - res.forEach((item) => { - state.labelGroupOptions[0].children.push({ - value: item.id, - label: item.name, - disabled: false, - }); - }); - }); - }); - watch(() => props.row, (next) => { Object.assign(state, { model: { ...state.model, ...next }, }); - // 图像分类可任意选择 - if(next?.annotateType === annotationCodeMap.CLASSIFY) { - state.labelGroupOptions[1].disabled = false; - state.labelGroupOptions[1].children.forEach( item => {item.disabled = false;}); + if(!isNil(state.model.dataType)){ + getLabelGroupList({type: 1, dataType: state.model.dataType, annotateType: state.model.annotateType}).then(res => { + res.forEach((item) => { + state.labelGroupOptions[1].children.push({ + value: item.id, + label: item.name, + disabled: false, + }); + }); + }); } - // 目标检测和目标跟踪 在预置标签组中只可选择coco - if([annotationCodeMap.ANNOTATE, annotationCodeMap.TRACK].includes(next?.annotateType)) { - if(state.chosenGroupId !== 1) { - state.chosenGroup = null; - state.chosenGroupId = null; - } - state.labelGroupOptions[1].disabled = false; - state.labelGroupOptions[1].children.forEach( item => { - if(item.value === 1){ - item.disabled = false; - } else { - item.disabled = true; - } + if(!isNil(state.model.dataType)){ + getLabelGroupList({type: 0, dataType: state.model.dataType, annotateType: state.model.annotateType}).then(res => { + res.forEach((item) => { + state.labelGroupOptions[0].children.push({ + value: item.id, + label: item.name, + disabled: false, + }); + }); }); } // 读取数据集已有标签组 diff --git a/webapp/src/views/dataset/list/import-dataset.vue b/webapp/src/views/dataset/list/import-dataset.vue index 9a2c20c..2b8d33e 100644 --- a/webapp/src/views/dataset/list/import-dataset.vue +++ b/webapp/src/views/dataset/list/import-dataset.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,17 +27,15 @@
- 请认真阅读下方说明,创建数据集完毕后,按照系统格式要求上传数据集文件,否则标注文件可能无法正确解析。 - 下载示例数据集模板 + 请参考下方说明文档,创建数据集完毕后,按照数据集模板格式上传数据集文件,否则标注文件可能无法正确解析。
-

1. 系统提供了一站式脚本服务用以快速导入本地已有数据集(使用文档),推荐使用 -

2. 本地数据集需要包括图片(origin 目录)、标注文件(annotation 目录)和标签文件三部分

-

3. 注意区分「图像分类」和「目标检测」类型数据集

-

4. 图片格式支持 jpg/png/bmp/jpeg,不大于 5M,位于 origin 目录下,不支持目录嵌套

-

5. 标注文件为 json 格式,位于 annotation 目录下,必须和文件同名(如果不存在标注,可不上传),不支持目录嵌套

-

6. 标签文件为 json 格式,命名要求为 label_{name}.json,其中 name 为标签组名称,不能与系统已有标签组重名

-

7. 更多参考示例数据集模板

+

1. 数据集脚本工具(文档) +

2. 图片数据集(文档

+

3. 文本数据集(文档

+

4. 图片数据集模板(下载

+

5. 文本数据集模板(下载

+

7. 更多参考(官网文档

@@ -52,7 +50,12 @@ - + ["1", "2"].includes(type)).map(d => ({ + // 原始标注列表 + const rawAnnotationList = Object.keys(annotationMap).map(d => ({ label: annotationMap[d].name, value: Number(d), })); - return activeList; + // 图片,可用图像分类和目标检测;视频,可用目标跟踪;文本,可用文本分类 + return rawAnnotationList.filter(d => { + if (this.form.dataType === dataTypeCodeMap.IMAGE) { + return [annotationCodeMap.ANNOTATE, annotationCodeMap.CLASSIFY].includes(d.value); + } + if (this.form.dataType === dataTypeCodeMap.VIDEO) { + return d.value === annotationCodeMap.TRACK; + } + if (this.form.dataType === dataTypeCodeMap.TEXT) { + return d.value === annotationCodeMap.TEXTCLASSIFY; + } + return true; + }); }, + + dataTypeList: () => + Object.keys(dataTypeMap) + .filter(type => [dataTypeCodeMap.IMAGE, dataTypeCodeMap.TEXT].includes(Number(type))) + .map(d => ({ + label: dataTypeMap[d], + value: Number(d), + }), + ), }, methods: { nextImportStep() { @@ -159,7 +191,7 @@ export default { return; } const customForm = { - name: this.form.name, + name: this.form.name, remark: this.form.remark, annotateType: this.form.annotateType, dataType: this.form.dataType, @@ -182,14 +214,17 @@ export default { resetFormFields() { this.formKey += 1; this.importStep = 0; - this.form = { + this.form = { name: "", - dataType: 0, - annotateType: 2, + dataType: "", + annotateType: "", status: 4, remark: "", }; }, + handleDataTypeChange(dataType) { + this.form.annotateType = dataTypeAnnotateTypeMap.get(dataType); + }, }, }; - \ No newline at end of file + diff --git a/webapp/src/views/dataset/list/index.vue b/webapp/src/views/dataset/list/index.vue index 362879b..bbc7954 100644 --- a/webapp/src/views/dataset/list/index.vue +++ b/webapp/src/views/dataset/list/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,21 +19,21 @@
- 创建数据集 - 导入数据集 @@ -64,29 +64,34 @@
- - -
+
- +
+ + + + +
{{ scope.row.id }} - - +
当前数据集为外部导入数据集
点击复制数据集 ID
使用文档
-
@@ -151,14 +154,14 @@ - \ No newline at end of file + diff --git a/webapp/src/views/dataset/medical/action.js b/webapp/src/views/dataset/medical/action.js new file mode 100644 index 0000000..05b233f --- /dev/null +++ b/webapp/src/views/dataset/medical/action.js @@ -0,0 +1,105 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + +import { statusCodeMap } from '../util'; +import { medicalAnnotationCodeMap } from './constant'; + +export default { + name: 'DatasetAction', + functional: true, + props: { + goDetail: Function, + autoAnnotate: Function, + editDataset: Function, + }, + render(h, { data, props }) { + const { goDetail, autoAnnotate, editDataset } = props; + const columnProps = { + ...data, + scopedSlots: { + header: () => { + return ( + + 操作 + +
自动标注仅支持肺部CT影像
+ +
+
+ ); + }, + default: ({ row }) => { + const btnProps = { + props: { + type: 'text', + disabled: row.disabledAction, + }, + style: { + marginLeft: '0px', + marginRight: '10px', + }, + }; + + // 查看标注按钮在自动标注中时不显示 + let showCheckButton = !(statusCodeMap[row.status] === 'AUTO_ANNOTATING'); + // 查阅影像按钮 + const checkButton = ( + goDetail(row)}> + 查阅影像 + + ); + + // 自动标注按钮只在未标注且目前算法支持的情形下显示 + let showAutoButton = ['UNANNOTATED'].includes(statusCodeMap[row.status]) + && row.bodyPartExamined === "LUNG" + && row.modality === "CT" + && row.annotateType === medicalAnnotationCodeMap.OrganSegmentation; + // 自动标注按钮 + const autoButton = ( + autoAnnotate(row)}> + 自动标注 + + ); + + let showEditButton = true; + // 修改按钮总会显示 + const editButton = ( + editDataset(row)}> + 修改 + + ); + + // 预置数据集只具备查阅影像功能 + if (row.type === 2) { + showCheckButton = true; + showAutoButton = false; + showEditButton = false; + }; + + return ( + + {showCheckButton && checkButton} + {showAutoButton && autoButton} + {showEditButton && editButton} + + ); + }, + }, + }; + + return h('el-table-column', columnProps); + }, +}; diff --git a/webapp/src/views/dataset/medical/constant.js b/webapp/src/views/dataset/medical/constant.js new file mode 100644 index 0000000..9364e9d --- /dev/null +++ b/webapp/src/views/dataset/medical/constant.js @@ -0,0 +1,74 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + +export const medicalProgressMap = { + unfinished: '未标注', + autoFinished: '自动标注完成', + manualAnnotating: '手动标注中', + finished: '标注完成', +}; + +export const medicalAnnotationCodeMap = { + 'OrganSegmentation': 1001, + 'LesionDetection': 2001, + 'Other': 2999, +}; + +export const medicalFirstLevelCodeMap = { + 1000: { name: '器官分割' }, + 2000: { name: '病灶识别' }, +}; + +export const medicalAnnotationMap = { + 1001: { name: '器官分割', urlPrefix: 'organSegmentation', parentName: '器官分割' }, + 2001: { name: '肺结节检测', urlPrefix: 'lesionDetection', parentName: '病灶识别' }, + 2999: { name: '其它', urlPrefix: 'other', parentName: '病灶识别' }, +}; + +export const modalityMap = { + 'CT': 'CT', + 'MR': 'MR', + 'US': 'US', + 'X-Ray': 'X-Ray', + 'OTHER': 'OTHER', +}; + +export const bodyPartMap = { + BRAIN: 'BRAIN', + LUNG: 'LUNG', + LIVER: 'LIVER', + SOFTTISSUE: 'SOFTTISSUE', + OTHER: 'OTHER', +}; + +// 医学数据集状态 +export const medicalStatusMap = { + 101: { name: '未标注', type: 'info' }, + 102: { name: '标注中', type: 'warning' }, + 103: { name: '自动标注中', type: 'danger' }, + 104: { name: '自动标注完成', type: '' }, + 105: { name: '标注完成', type: 'success' }, +}; + +// 标注类型 +export const getAnnotateType = (type) => { + // 2001-2999 病灶检测 + if(Number(type) > 2000 && Number(type) < 3000) return 1; + // 1001-1999 为器官分割 + if(Number(type) > 1000 && Number(type) < 2000) return 0; + // 历史数据 + return 0; +}; diff --git a/webapp/src/views/dataset/medical/create-dataset.vue b/webapp/src/views/dataset/medical/create-dataset.vue new file mode 100644 index 0000000..292c362 --- /dev/null +++ b/webapp/src/views/dataset/medical/create-dataset.vue @@ -0,0 +1,294 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + \ No newline at end of file diff --git a/webapp/src/views/dataset/medical/edit-dataset.vue b/webapp/src/views/dataset/medical/edit-dataset.vue new file mode 100644 index 0000000..b86c2b7 --- /dev/null +++ b/webapp/src/views/dataset/medical/edit-dataset.vue @@ -0,0 +1,127 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + diff --git a/webapp/src/views/dataset/medical/lib/actions.js b/webapp/src/views/dataset/medical/lib/actions.js new file mode 100644 index 0000000..da582c9 --- /dev/null +++ b/webapp/src/views/dataset/medical/lib/actions.js @@ -0,0 +1,166 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ +import { noop } from '@/utils'; +import { genDrawingFromAnnotations } from './index'; + +export const defaultWlPresets = { + SoftTissue: { + name: '软组织', + wc: 40, + ww: 400, + }, + Lung: { + name: '肺', + wc: -600, + ww: 1500, // todo: 为啥不一致 + }, + Liver: { + name: '肝脏', + wc: 90, + ww: 150, + }, + Brain: { + name: '大脑', + wc: 40, + ww: 80, + }, +}; + +// 可绘制形状配置 +export const drawOptions = { + Rectangle: { + name: '矩形', + }, + Roi: { + name: '自定义', + }, +}; + +const actions = [ + { + command: 'Scroll', + type: 'tool', + text: '滚动浏览', + icon: 'bars', + }, + { + command: 'ZoomAndPan', + type: 'tool', + text: '缩放', + icon: 'zoom', + }, + { + command: 'WindowLevel', + type: 'tool', + text: '窗宽/窗位', + icon: 'manual', + }, + { + command: 'Draw', + type: 'tool', + text: '标注', + icon: 'polygon', + options: drawOptions, + }, + { + command: 'Hidden', + type: 'command', + text: '隐藏信息', + icon: 'hidden', + }, + { + command: 'Visible', + type: 'command', + text: '展示信息', + icon: 'visible', + }, + { + command: 'Reset', + type: 'command', + text: '重置', + icon: 'reset', + }, + { + command: 'SetWlPreset', + type: 'command', + text: '预设窗口', + icon: 'body', + options: defaultWlPresets, + }, +]; + +export const viewerCommands = { + Hidden: (app, updateState) => { + updateState({ + showInfo: false, + }); + }, + Visible: (app, updateState) => { + updateState({ + showInfo: true, + }); + }, + Reset: (app, updateState) => { + app.resetDisplay(); + updateState((state) => { + const prevOverlayInfo = state.overlayInfo; + return { + wlPreset: '', + shape: '', + showInfo: true, + overlayInfo: { + ...prevOverlayInfo, + zoom: { scale: 1 }, + }, + }; + }); + }, + SetWlPreset: (app, updateState, tool) => { + updateState({ + wlPreset: tool.value, + }); + const wl = defaultWlPresets[tool.value]; + app.getViewController().setWindowLevel(wl.wc, wl.ww); + }, + SetPrecision: (app, updateState, tool, state) => { + updateState({ + precision: tool.precision, + }); + const { autoAnnotationIds } = state; + const drawLayer = app.getDrawController().getDrawLayer(); + const posGroups = drawLayer.getChildren(); + const kGroups = []; + + // 遍历所有的posGroups,并提供匹配的形状groups + posGroups.forEach(group => { + const subGroups = group.getChildren( + node => autoAnnotationIds.includes(node.id())); + kGroups.push(subGroups); + }); + + for(let i=0; i ({}); +const RSUrl = `${process.env.VUE_APP_DCM_API}/rs`; +const dwc = new DICOMwebClient.api.DICOMwebClient({ + url: RSUrl, + headers: getAuthorizationHeader(), +}); + +// 对一个序列下的文件进行排序 +export const sortInstances = (series) => { + return series.sort((a, b) => { + const instanceNumberA = a['00200013'].Value[0]; + const instanceNumberB = b['00200013'].Value[0]; + return instanceNumberA - instanceNumberB; + }); +}; + + +export const buildWADOUrl = ({studyInstanceUID, seriesInstanceUID, objectUID }) => { + return `${process.env.VUE_APP_DCM_API}/wado?requestType=WADO&studyUID=${studyInstanceUID}&seriesUID=${seriesInstanceUID}&objectUID=${objectUID}&contentType=application/dicom`; +}; + +export const getImageIdsForSeries = (seriesData) => { + if (!seriesData || !seriesData.length) { + return []; + } + + return sortInstances(seriesData).map(instance => { + const BulkDataURI = instance['7FE00010'].BulkDataURI.replace(/^https?:\/\//, ''); + const bulkDataArr = BulkDataURI.split('/'); + const studyIndex = bulkDataArr.findIndex(d => d === 'studies'); + const seriesIndex = bulkDataArr.findIndex(d => d === 'series'); + const instanceIndex = bulkDataArr.findIndex(d => d === 'instances'); + + if(studyIndex > -1 && seriesIndex > -1) { + const studyInstanceUID = bulkDataArr[studyIndex + 1]; + const seriesInstanceUID = bulkDataArr[seriesIndex + 1]; + const objectUID = bulkDataArr[instanceIndex + 1]; + return { studyInstanceUID, seriesInstanceUID, objectUID }; + } + throw new Error('找不到对应的 studyUID 或 seriesUID'); + }); +}; + +// 获取实例instanceID +export const getSOPInstanceUID = (data) => { + if (typeof data.x00020010 !== 'undefined') { + if (typeof data.x00080018 !== 'undefined') { + // SOPInstanceUID + return dwv.dicom.cleanString(data.x00080018.value[0]); + } + } + throw new Error('当前 dcm 文件不合法,无法找到 SOPInstanceUID'); +}; + +export const retrieveBulkData = imageId => { + return dwc.retrieveBulkData({ + BulkDataURI: imageId, + }); +}; + +export function readRawData(drawings) { + // update drawings + const data = {}; + const v02DAndD = dwv.v01Tov02DrawingsAndDetails(drawings); + data.drawings = dwv.v02Tov03Drawings( v02DAndD.drawings ).toObject(); + data.drawingsDetails = v02DAndD.drawingsDetails; + return data; +} + +// 解析dicom 文件 +export const parseDicom = (byteArray, filename) => { + try { + const dataSet = dicomParser.parseDicom(byteArray); + + const rows = dataSet.uint16('x00280010'); + const columns = dataSet.uint16('x00280011'); + const seriesInstanceUID = dataSet.string('x0020000e'); + const patientID = dataSet.string('x00100020'); + const studyInstanceUID = dataSet.string('x0020000d'); + const modality = dataSet.string('x00080060'); + const bodyPartExamined = dataSet.string('x00180015'); + const SOPInstanceUID = dataSet.string('x00080018'); + const pixelData = dataSet.elements.x7fe00010; + if(!pixelData) { + throw new Error(`文件信息不完整:7fe00010字段不存在`); + } + return {rows, columns, patientID, seriesInstanceUID, studyInstanceUID, modality, bodyPartExamined, filename, SOPInstanceUID}; + } catch(err) { + // parse返回错误信息为err.exception + return err instanceof Error ? err : new Error(err.exception || err); + } +}; + +// 读文件 +export const readDicom = (file) => { + return new Promise((resolve, reject) => { + const reader = new FileReader(); + reader.onload = e => { + const arrayBuffer = e.target.result; + const byteArray = new Uint8Array(arrayBuffer); + const info = parseDicom(byteArray, file.raw.name.slice(0, -4)); + if(info instanceof Error) { + reject(info); + } else { + resolve(info); + } + }; + + reader.readAsArrayBuffer(file.raw); + }); +}; + +// 读取上传文件信息 +export const readDicoms = async (files) => { + const mapper = (file) => new Promise((resolve, reject) => { + const reader = new FileReader(); + + reader.onload = e => { + const arrayBuffer = e.target.result; + const byteArray = new Uint8Array(arrayBuffer); + const info = parseDicom(byteArray, file.raw.name.slice(0, -4)); + if(info instanceof Error) { + reject(info); + } else { + resolve(info); + } + }; + + reader.readAsArrayBuffer(file.raw); + }); + + try { + const result = await pMap(files, mapper, {concurrency: 10}); + return result; + } catch(err){ + return Promise.reject(err); + } +}; + +// 判断上传系列文件格式是否一致 +export const validateDicomSeries = (series) => { + if(series.length < 1) return '文件数量不能为空'; + const isEqualRows = isEqualBy(series, 'rows'); + if(!isEqualRows) return '文件系列 rows 必须一致'; + const isEqualColumns = isEqualBy(series, 'columns'); + if(!isEqualColumns) return '文件系列 columns 必须一致'; + return ''; +}; + +// 解析自动标注结果 +export const genDrawingFromAnnotations = (annotations, percent) => { + const draws = []; + const frames = 1; + const drawingIds = []; + // 记录标注对应的slice 和 标注 对应关系 + const sliceDrawingMap = {}; + // 遍历 slice + for(let k = 0; k < annotations.length; k+=1) { + const slice = []; + // 每个 slice 分别对应的标注 id + const sliceDrawingIds = []; + // 自动标注帧数为1 + for(let f = 0; f < frames; f+=1) { + const frame = []; + for(let g = 0; g < annotations[k].length; g+=1) { + const pos = annotations[k][g]; + // percent为精度 100%时步长为1,显示所有标注点。10%时步长为10,即10个标注点取1个点显示 + const step = 1/percent; + const points = everyStep(pos, step); + const guid = dwv.math.guid(); + frame.push({ + "attrs": { + "name": "roi-group", + "id": guid, + }, + "className": "Group", + "children": [{ + "attrs": { + "points": flatten(points), + "name": "shape", + "closed": true, + "strokeWidth": 3, + "draggable": true, + }, + "className": "Line", + }], + }); + drawingIds.push(guid); + sliceDrawingIds.push(guid); + } + slice.push(frame); + } + sliceDrawingMap[k] = sliceDrawingIds; + draws.push(slice); + } + const { drawings, drawingsDetails } = readRawData(draws); + // sliceDrawingMap: 每个slice 对应的 drawingId + return { drawings, drawingsDetails, drawingIds, sliceDrawingMap }; +}; + +// 保存标注时去掉 anchor 信息 +export const removeAnchorsFromDrawer = (drawLayer) => { + const pGroups = drawLayer.getChildren(dwv.draw.isPositionNode); + pGroups.forEach(group => { + const subGroups = group.getChildren(); + subGroups.forEach(shape => { + const anchors = shape.getChildren(node => node.name() === 'anchor'); + anchors.each(anchor => anchor.remove()); + }); + }); +}; + +// 获取当前的 drawLayer +export const getDrawLayer = (app) => { + const drawLayer = app.getDrawController().getDrawLayer(); + return drawLayer; +}; + +export const getShapeEditor = (app) => { + return app.getShapeEditor(); +}; + +// 选中效果 +export const activeShapeGroup = (app, selectedShape) => { + const shapeEditor = getShapeEditor(app); + shapeEditor.disable(); + shapeEditor.setShape(selectedShape); + shapeEditor.setImage(app.getImage()); + shapeEditor.enable(); +}; + +// 根据 drawId 返回 shapeGroup +export const getShapeGroup = (drawId, drawLayer) => { + const pGroups = drawLayer.getChildren(dwv.draw.isPositionNode); + let selectedShape = null; + for(const group of pGroups) { + const subGroups = group.getChildren(); + const groups = subGroups.filter(shape => drawId === shape.id()); + if(groups.length) { + [selectedShape] = groups[0].find(".shape"); + break; + } + } + return selectedShape; +}; + +export { dwc }; diff --git a/webapp/src/views/dataset/medical/lib/overlays.json b/webapp/src/views/dataset/medical/lib/overlays.json new file mode 100644 index 0000000..74dd871 --- /dev/null +++ b/webapp/src/views/dataset/medical/lib/overlays.json @@ -0,0 +1,22 @@ +[ + {"tags": ["x00100020"], "pos": "tl"}, + {"tags": ["x00100010", "x00100040"], "pos": "tl", "format": "{v0} [{v1}]"}, + {"tags": ["x00100030"], "pos": "tl"}, + + {"tags": ["x00200011", "x00200012", "x00200013"], "pos": "bl", "format": "{v0}:{v1}:{v2}"}, + {"tags": ["x00185100"], "pos": "bl"}, + {"tags": ["x00201041"], "pos": "bl", "format": "SL: {v0}"}, + {"tags": ["x00180050"], "pos": "bl", "format": "ST: {v0}"}, + {"tags": ["x00280010", "x00280011"], "pos": "bl", "format": "RES: {v0}x{v1}"}, + + {"tags": ["x00080080"], "pos": "tr"}, + {"tags": ["x00080020", "x00080030"], "pos": "tr", "format": "{v0} {v1}"}, + {"tags": ["x00080060"], "pos": "tr"}, + {"tags": ["x00180015"], "pos": "tr"}, + + {"value": "Wwwc", "pos": "br", "format": "{v0} / {v1}"}, + {"value": "zoom", "pos": "br", "format": "Z: {v0}"}, + {"value": "offset", "pos": "br", "format": "Off: {v0},{v1}"}, + {"value": "position", "pos": "br", "format": "Pos: {v0},{v1},{v2}"}, + {"value": "value", "pos": "br", "format": "Value: {v0}"} +] diff --git a/webapp/src/views/dataset/medical/list.vue b/webapp/src/views/dataset/medical/list.vue new file mode 100644 index 0000000..c3f8439 --- /dev/null +++ b/webapp/src/views/dataset/medical/list.vue @@ -0,0 +1,650 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + \ No newline at end of file diff --git a/webapp/src/views/dataset/medical/status.js b/webapp/src/views/dataset/medical/status.js new file mode 100644 index 0000000..f6720e2 --- /dev/null +++ b/webapp/src/views/dataset/medical/status.js @@ -0,0 +1,71 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + +import { medicalStatusMap } from './constant'; + +export default { + name: 'DatasetStatus', + functional: true, + render(h, { data, props }) { + const { statusList, filterByDatasetStatus, datasetStatusFilter } = props; + const iconClass = ['el-icon-arrow-down', 'el-icon--right']; + const textClass = datasetStatusFilter === 'all' ? null : 'primary'; + const columnProps = { + ...data, + scopedSlots: { + header: () => { + return ( + + + 状态 + + + + {statusList.map(item => { + return ( + filterByDatasetStatus(item.value)} + > + {item.label} + + ); + })} + + + ); + }, + default: ({ row }) => { + const status = medicalStatusMap[row.status] || {}; + const colorProps = (!status.type && status.bgColor) && { + props: { + color: status.bgColor, + }, + style: { + color: status.color, + borderColor: status.bgColor, + }, + }; + return ( + {status.name} + ); + }, + }, + }; + + return h('el-table-column', columnProps); + }, +}; diff --git a/webapp/src/views/dataset/medical/viewer/action.vue b/webapp/src/views/dataset/medical/viewer/action.vue new file mode 100644 index 0000000..499631a --- /dev/null +++ b/webapp/src/views/dataset/medical/viewer/action.vue @@ -0,0 +1,362 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + diff --git a/webapp/src/views/dataset/medical/viewer/controls.vue b/webapp/src/views/dataset/medical/viewer/controls.vue new file mode 100644 index 0000000..e8769bc --- /dev/null +++ b/webapp/src/views/dataset/medical/viewer/controls.vue @@ -0,0 +1,209 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + diff --git a/webapp/src/views/dataset/medical/viewer/helpInfo.vue b/webapp/src/views/dataset/medical/viewer/helpInfo.vue new file mode 100644 index 0000000..2b480a5 --- /dev/null +++ b/webapp/src/views/dataset/medical/viewer/helpInfo.vue @@ -0,0 +1,118 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + \ No newline at end of file diff --git a/webapp/src/views/dataset/medical/viewer/index.vue b/webapp/src/views/dataset/medical/viewer/index.vue new file mode 100644 index 0000000..a9d7324 --- /dev/null +++ b/webapp/src/views/dataset/medical/viewer/index.vue @@ -0,0 +1,780 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + \ No newline at end of file diff --git a/webapp/src/views/dataset/medical/viewer/infoLayer.vue b/webapp/src/views/dataset/medical/viewer/infoLayer.vue new file mode 100644 index 0000000..d2cb660 --- /dev/null +++ b/webapp/src/views/dataset/medical/viewer/infoLayer.vue @@ -0,0 +1,164 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + \ No newline at end of file diff --git a/webapp/src/views/dataset/medical/viewer/lesionInfo.vue b/webapp/src/views/dataset/medical/viewer/lesionInfo.vue new file mode 100644 index 0000000..17dd0f0 --- /dev/null +++ b/webapp/src/views/dataset/medical/viewer/lesionInfo.vue @@ -0,0 +1,215 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + \ No newline at end of file diff --git a/webapp/src/views/dataset/medical/viewer/toolbar.vue b/webapp/src/views/dataset/medical/viewer/toolbar.vue new file mode 100644 index 0000000..a7527cc --- /dev/null +++ b/webapp/src/views/dataset/medical/viewer/toolbar.vue @@ -0,0 +1,90 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + diff --git a/webapp/src/views/dataset/medical/viewer/toolbarButton.vue b/webapp/src/views/dataset/medical/viewer/toolbarButton.vue new file mode 100644 index 0000000..90165fa --- /dev/null +++ b/webapp/src/views/dataset/medical/viewer/toolbarButton.vue @@ -0,0 +1,80 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + diff --git a/webapp/src/views/dataset/medical/viewer/toolbarItem.js b/webapp/src/views/dataset/medical/viewer/toolbarItem.js new file mode 100644 index 0000000..4440eb7 --- /dev/null +++ b/webapp/src/views/dataset/medical/viewer/toolbarItem.js @@ -0,0 +1,67 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + +import ToolbarButton from './toolbarButton'; +import ToolbarControls from './controls'; + +const ToolbarItem = { + name: 'ToolbarItem', + inheritAttrs: false, + components: { + ToolbarButton, + ToolbarControls, + }, + props: { + item: Object, + activeTool: String, + wlPreset: String, + shape: String, + }, + render() { + const toolItemProps = { + props: { + item: this.item, + activeTool: this.activeTool, + }, + on: this.$listeners, + }; + if(this.item.command === 'Draw') { + return ( + + ); + } + + if(this.item.command === 'SetWlPreset') { + return ( + + ); + } + + return ( + + ); + }, +}; + +export default ToolbarItem; diff --git a/webapp/src/views/dataset/medical/viewer/toolbarMore.vue b/webapp/src/views/dataset/medical/viewer/toolbarMore.vue new file mode 100644 index 0000000..209ce6b --- /dev/null +++ b/webapp/src/views/dataset/medical/viewer/toolbarMore.vue @@ -0,0 +1,181 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + diff --git a/webapp/src/views/dataset/nlp/annotation/index.vue b/webapp/src/views/dataset/nlp/annotation/index.vue new file mode 100644 index 0000000..1ceacdc --- /dev/null +++ b/webapp/src/views/dataset/nlp/annotation/index.vue @@ -0,0 +1,439 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + \ No newline at end of file diff --git a/webapp/src/views/dataset/nlp/annotation/sidebar/add.vue b/webapp/src/views/dataset/nlp/annotation/sidebar/add.vue new file mode 100644 index 0000000..6eb25f7 --- /dev/null +++ b/webapp/src/views/dataset/nlp/annotation/sidebar/add.vue @@ -0,0 +1,131 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + diff --git a/webapp/src/views/dataset/nlp/annotation/sidebar/index.vue b/webapp/src/views/dataset/nlp/annotation/sidebar/index.vue new file mode 100644 index 0000000..b5b6875 --- /dev/null +++ b/webapp/src/views/dataset/nlp/annotation/sidebar/index.vue @@ -0,0 +1,63 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + \ No newline at end of file diff --git a/webapp/src/views/dataset/nlp/annotation/sidebar/labelList.vue b/webapp/src/views/dataset/nlp/annotation/sidebar/labelList.vue new file mode 100644 index 0000000..a2aaf83 --- /dev/null +++ b/webapp/src/views/dataset/nlp/annotation/sidebar/labelList.vue @@ -0,0 +1,157 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + diff --git a/webapp/src/views/dataset/nlp/annotation/workspace/index.vue b/webapp/src/views/dataset/nlp/annotation/workspace/index.vue new file mode 100644 index 0000000..c3be650 --- /dev/null +++ b/webapp/src/views/dataset/nlp/annotation/workspace/index.vue @@ -0,0 +1,158 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + \ No newline at end of file diff --git a/webapp/src/views/dataset/nlp/textClassify/action.js b/webapp/src/views/dataset/nlp/textClassify/action.js new file mode 100644 index 0000000..2809b0a --- /dev/null +++ b/webapp/src/views/dataset/nlp/textClassify/action.js @@ -0,0 +1,76 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + +export default { + name: 'textAction', + functional: true, + props: { + showDetail: Function, + doDelete: Function, + }, + render(h, { data, props }) { + const { showDetail, doDelete } = props; + const columnProps = { + ...data, + scopedSlots: { + header: () => { + return ( + + 操作 + + ); + }, + default: ({ row, $index }) => { + const btnProps = { + props: { + type: 'text', + disabled: row.disabledAction, + }, + style: { + marginLeft: '0px', + marginRight: '10px', + }, + }; + + // 查看标注按钮总会显示 + const showCheckButton = true; + const checkButton = ( + showDetail(row, $index)}> + 查看 + + ); + + // 删除按钮总会显示 + const showDeleteButton = true; + const deleteButton = ( + doDelete([{id: row.id}])}> + 删除 + + ); + + return ( + + { showCheckButton && checkButton } + { showDeleteButton && deleteButton } + + ); + }, + }, + }; + + return h('el-table-column', columnProps); + }, +}; diff --git a/webapp/src/views/dataset/nlp/textClassify/index.vue b/webapp/src/views/dataset/nlp/textClassify/index.vue new file mode 100644 index 0000000..38a66a3 --- /dev/null +++ b/webapp/src/views/dataset/nlp/textClassify/index.vue @@ -0,0 +1,597 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + + + diff --git a/webapp/src/views/dataset/nlp/textClassify/textStatus.js b/webapp/src/views/dataset/nlp/textClassify/textStatus.js new file mode 100644 index 0000000..2ca1e34 --- /dev/null +++ b/webapp/src/views/dataset/nlp/textClassify/textStatus.js @@ -0,0 +1,71 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + +import { fileCodeMap, textStatusMap } from '../../util'; + +export default { + name: 'TextStatus', + functional: true, + render(h, { data, props }) { + const { statusList, filterByTextStatus, textStatusFilter } = props; + const iconClass = ['el-icon-arrow-down', 'el-icon--right']; + const textClass = [fileCodeMap.UNFINISHED, fileCodeMap.FINISHED, null].includes(textStatusFilter) ? null : 'primary'; + const columnProps = { + ...data, + scopedSlots: { + header: () => { + return ( + + + 标注状态 + + + + {statusList.map(item => { + return ( + filterByTextStatus(item.value)} + > + {item.label} + + ); + })} + + + ); + }, + default: ({ row }) => { + const status = textStatusMap[row.status] || {}; + const colorProps = (!status.type && status.bgColor) && { + props: { + color: status.bgColor, + }, + style: { + color: status.color, + borderColor: status.bgColor, + }, + }; + return ( + {status.name} + ); + }, + }, + }; + + return h('el-table-column', columnProps); + }, +}; diff --git a/webapp/src/views/dataset/style/list.scss b/webapp/src/views/dataset/style/list.scss index 6741ece..276435a 100644 --- a/webapp/src/views/dataset/style/list.scss +++ b/webapp/src/views/dataset/style/list.scss @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,11 +16,11 @@ @import "~@/assets/styles/variables.scss"; -.group-cascader{ - .el-cascader-menu__wrap{ - max-height: 300px; - min-height: 100px; +.group-cascader { + .el-cascader-menu__wrap { max-width: 280px; + min-height: 100px; + max-height: 300px; } } @@ -95,6 +95,7 @@ } .requirement { + margin-left: 20px; font-size: 14px; color: $infoColor; } diff --git a/webapp/src/views/dataset/util.js b/webapp/src/views/dataset/util.js index c6b6103..ac3fd85 100644 --- a/webapp/src/views/dataset/util.js +++ b/webapp/src/views/dataset/util.js @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,11 @@ * ============================================================= */ -import { parseBbox, flatBbox, generateUuid } from '@/utils'; +import { parseBbox, flatBbox, generateUuid, promisifyFileReader } from '@/utils'; import { bucketName, bucketHost } from '@/utils/minIO'; +const jschardet = require("jschardet"); + // 解析 annotation 信息 export const parseAnnotation = (annotationStr, labels) => { let result = []; @@ -86,11 +88,22 @@ export const stringifyAnnotations = (annotations) => { return resultString; }; +// 根据文件信息返回结果 +export const buildUrlItem = d => ({ + url: `${bucketName}/${d.data.objectName}`, + ...(d.data.meta || {}), // 附加的信息,目前只包括 width, height +}); + // 解析 minIO 返回的图片 const buildImgUrl = (list = []) => { - return list.map(d => ({ - url: `${bucketName}/${d.data.objectName}`, - ...(d.data.meta || {}), // 附加的信息,目前只包括 width, height + return list.map(buildUrlItem); +}; + +// 解析minIO 返回的文本 +const buildTextUrl = (list = []) => { + return list.map(res => ({ + url: `${bucketName}/${res.data.objectName}`, + ...(res.data.meta || {}), })); }; @@ -121,6 +134,10 @@ export const getImgFromMinIO = (res) => { return buildImgUrl(res); }; +export const getTextFromMinIO = (res) => { + return buildTextUrl(res); +}; + const defaultTransform = d => ({ id: d.id, url: `${bucketHost}/${d.url}`, @@ -191,11 +208,27 @@ export const enhanceSymbol = Symbol('enhance'); export const dataTypeMap = { 0: '图片', 1: '视频', + 2: '文本', }; export const dataTypeCodeMap = { 'IMAGE': 0, 'VIDEO': 1, + 'TEXT': 2, +}; + +// 存储用户选择数据集场景(视觉/文本场景:0,医学场景:1) +export const cacheDatasetType = (type) => localStorage.setItem('datasetListType', type); + +export const getDatasetType = () => { + let datasetListType; + try { + datasetListType = JSON.parse(localStorage.getItem('datasetListType')); + } catch (err) { + console.error(err); + throw err; + } + return datasetListType; }; // 文件状态 @@ -218,14 +251,15 @@ export const fileCodeMap = { 'MANUAL_ANNOTATED': 104, 'UNRECOGNIZED': 105, 'TRACK_SUCCEED': 201, - 'UNCOMPLETED': 301, - 'COMPLETED': 302, + 'UNFINISHED': 301, + 'FINISHED': 302, }; export const annotationCodeMap = { 'ANNOTATE': 1, 'CLASSIFY': 2, 'TRACK': 5, + 'TEXTCLASSIFY': 6, }; export const annotationMap = { @@ -234,8 +268,14 @@ export const annotationMap = { // 3: { name: '行为分析', urlPrefix: 'analysis' }, // 4: { name: '异常检测', urlPrefix: 'exception' }, 5: { name: '目标跟踪', urlPrefix: 'track', component: 'TrackDataset' }, + 6: { name: '文本分类', urlPrefix: 'textclassify', component: 'TextClassify'}, }; +// 数据类型和标注类型的对应关系 +export const dataTypeAnnotateTypeMap = new Map() + .set(dataTypeCodeMap.VIDEO, annotationCodeMap.TRACK) + .set(dataTypeCodeMap.TEXT, annotationCodeMap.TEXTCLASSIFY); + // 数据集状态 export const datasetStatusMap = { 101: { name: '未标注', type: 'info' }, @@ -268,6 +308,24 @@ export const statusCodeMap = { 402: 'IMPORTING', }; +// 文本数据集状态 +export const textStatusMap = { + 101: { name: '未标注', 'color': '#FFFFFF'}, + 103: { name: '自动标注完成', 'color': '#468CFF' }, + 104: { name: '手动标注完成', 'color': '#FF9943' }, + 105: { name: '未识别', 'color': '#FFFFFF'}, +}; + +export const textFinishedMap = { + 103: '自动标注完成', + 104: '手动标注完成', +}; + +export const textUnfinishedMap = { + 101: '未标注', + 105: '未识别', +}; + // 标注精度 export const annotationProgressMap = { finished: '已完成', @@ -284,6 +342,13 @@ export const decompressProgressMap = { 3: '解压失败', }; +export const publishStateMap = { + 4: 'PUBLISHING', +}; + +// 发布中 +export const isPublishDataset = row => publishStateMap[row.dataConversion] === 'PUBLISHING'; + // 数据增强类型 export const dataEnhanceMap = { 1: '', @@ -293,7 +358,33 @@ export const dataEnhanceMap = { }; // 根据value取key -export const findKey = (value, data, compare = (a, b) => a === b) => -{ +export const findKey = (value, data, compare = (a, b) => a === b) => +{ return Object.keys(data).find(k => compare(data[k], value)); -}; \ No newline at end of file +}; + +// TODO: 覆盖更多 case? +const charsetMap = { + 'gbk': ['windows-1253'], + 'utf-8': ['ascii', 'windows-1252'], +}; + +// 读取文本文件,解决中文文本字符编码乱码 +export const readTxt = async (url, encoding) => { + const result = await fetch(url); + const blob = await result.blob(); + const txt = await blob.text(); + + const chardet = jschardet.detect(txt); + let nextEncoding; + if(chardet.encoding) { + for(const [key, arr] of Object.entries(charsetMap)) { + if(arr.includes(chardet.encoding)) { + nextEncoding = key; + break; + } + } + } + const text = await promisifyFileReader(blob, encoding || nextEncoding || 'utf-8'); + return text; +}; diff --git a/webapp/src/views/dataset/version/actions.vue b/webapp/src/views/dataset/version/actions.vue index 8d526fa..c715a2d 100644 --- a/webapp/src/views/dataset/version/actions.vue +++ b/webapp/src/views/dataset/version/actions.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@
详情 - 查看标注 + 查看标注 删除 - + 导出 @@ -58,7 +58,7 @@ import { computed } from '@vue/composition-api'; import { Message } from 'element-ui'; import { toFixed, downloadZipFromObjectPath } from '@/utils'; -import { datasetStatusMap, annotationMap } from '@/views/dataset/util'; +import { datasetStatusMap, annotationMap, isPublishDataset } from '@/views/dataset/util'; import { toggleVersion, deleteVersion } from '@/api/preparation/dataset'; import { TableTooltip } from '@/hooks/tooltip'; @@ -77,9 +77,9 @@ export default { setup(props, ctx) { const { actions } = props; const { $router } = ctx.root; - - // 数据发布后,后台会进行文件转换,导出数据集需要图片和标注文件,无需二进制文件,故转换状态码为1,2,3 - const downloadDisabled = computed(() => [1, 2, 3].includes(props.row.dataConversion)); + + // 发布中 + const publishing = computed(() => isPublishDataset(props.row)); const isCurrent = computed(() => !!props.row.isCurrent); const title = computed(() => `${props.row.name}(${props.row.versionName})`); @@ -142,7 +142,7 @@ export default { const keyAccessor = (key, idx, data) => data[key].label; return { - downloadDisabled, + publishing, isCurrent, title, labels: Object.keys(list), diff --git a/webapp/src/views/dataset/version/index.vue b/webapp/src/views/dataset/version/index.vue index 9f0af08..e8fdbf6 100644 --- a/webapp/src/views/dataset/version/index.vue +++ b/webapp/src/views/dataset/version/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/views/development/components/CreateDialog.vue b/webapp/src/views/development/components/CreateDialog.vue index d572cd9..ffccc2c 100644 --- a/webapp/src/views/development/components/CreateDialog.vue +++ b/webapp/src/views/development/components/CreateDialog.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,9 +32,39 @@ - - - + + + + + + @@ -50,15 +80,20 @@ diff --git a/webapp/src/views/modelOptimize/components/customizeForm.vue b/webapp/src/views/modelOptimize/components/customizeForm.vue new file mode 100644 index 0000000..31ba51e --- /dev/null +++ b/webapp/src/views/modelOptimize/components/customizeForm.vue @@ -0,0 +1,403 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + diff --git a/webapp/src/views/modelOptimize/components/optimizeForm.vue b/webapp/src/views/modelOptimize/components/optimizeForm.vue new file mode 100644 index 0000000..ae43962 --- /dev/null +++ b/webapp/src/views/modelOptimize/components/optimizeForm.vue @@ -0,0 +1,268 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + diff --git a/webapp/src/views/modelOptimize/components/optimizeResult.vue b/webapp/src/views/modelOptimize/components/optimizeResult.vue new file mode 100644 index 0000000..ae6206a --- /dev/null +++ b/webapp/src/views/modelOptimize/components/optimizeResult.vue @@ -0,0 +1,134 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/modelOptimize/components/quickUploadPopover.vue b/webapp/src/views/modelOptimize/components/quickUploadPopover.vue new file mode 100644 index 0000000..0a666d1 --- /dev/null +++ b/webapp/src/views/modelOptimize/components/quickUploadPopover.vue @@ -0,0 +1,216 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + diff --git a/webapp/src/views/modelOptimize/components/recordDetail.vue b/webapp/src/views/modelOptimize/components/recordDetail.vue new file mode 100644 index 0000000..99c8a4b --- /dev/null +++ b/webapp/src/views/modelOptimize/components/recordDetail.vue @@ -0,0 +1,114 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/modelOptimize/index.vue b/webapp/src/views/modelOptimize/index.vue new file mode 100644 index 0000000..ebaf7e6 --- /dev/null +++ b/webapp/src/views/modelOptimize/index.vue @@ -0,0 +1,408 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/modelOptimize/record.vue b/webapp/src/views/modelOptimize/record.vue new file mode 100644 index 0000000..d1f4a08 --- /dev/null +++ b/webapp/src/views/modelOptimize/record.vue @@ -0,0 +1,527 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + + + + + + diff --git a/webapp/src/views/modelOptimize/util.js b/webapp/src/views/modelOptimize/util.js new file mode 100644 index 0000000..61afa80 --- /dev/null +++ b/webapp/src/views/modelOptimize/util.js @@ -0,0 +1,64 @@ +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* ============================================================= +*/ + +// 内置算法分类 +export const OPTIMIZE_ALGORITHM_TYPE_ENUM = { + PRUNE: 0, // 剪枝 + DISTILL: 1, // 蒸馏 + QUNTIFICAT: 2, // 量化 +}; + +export const OPTIMIZE_ALGORITHM_TYPE_MAP = { + [OPTIMIZE_ALGORITHM_TYPE_ENUM.PRUNE]: '剪枝', + [OPTIMIZE_ALGORITHM_TYPE_ENUM.DISTILL]: '蒸馏', + [OPTIMIZE_ALGORITHM_TYPE_ENUM.QUNTIFICAT]: '量化', +}; + +export const OPTIMIZE_STATUS_ENUM = { + WAITING: '-1', + RUNNING: '0', + FINISHED: '1', + CANCELED: '2', + FAILED: '3', +}; + +export const OPTIMIZE_STATUS_MAP = { + [OPTIMIZE_STATUS_ENUM.WAITING]: { name: '等待中' }, + [OPTIMIZE_STATUS_ENUM.RUNNING]: { name: '进行中' }, + [OPTIMIZE_STATUS_ENUM.FINISHED]: { name: '已完成', tagMap: 'success' }, + [OPTIMIZE_STATUS_ENUM.CANCELED]: { name: '已取消', tagMap: 'info' }, + [OPTIMIZE_STATUS_ENUM.FAILED]: { name: '执行失败', tagMap: 'danger' }, +}; + +export const OPTIIMZE_ALGORITHM_USAGE_NAME = '模型优化'; + +export const RESULT_NAME_MAP = { + 'accuracy': '准确度', + 'reasoningTime': '推理速度', + 'modelSize': '模型大小', +}; + +export const RESULT_STATUS_ENUM = { + NAGATIVE: '-1', + SAME: '0', + POSITIVE: '1', +}; + +export const RESULT_STATUS_MAP = { + [RESULT_STATUS_ENUM.NAGATIVE]: 'decline', + [RESULT_STATUS_ENUM.SAME]: '', + [RESULT_STATUS_ENUM.POSITIVE]: 'promote', +}; diff --git a/webapp/src/views/register.vue b/webapp/src/views/register.vue index 573a822..9e2f166 100644 --- a/webapp/src/views/register.vue +++ b/webapp/src/views/register.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/views/resetpassword.vue b/webapp/src/views/resetpassword.vue index 8465bf3..ee29bd4 100644 --- a/webapp/src/views/resetpassword.vue +++ b/webapp/src/views/resetpassword.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/views/system/menu/index.vue b/webapp/src/views/system/menu/index.vue deleted file mode 100644 index 211c141..0000000 --- a/webapp/src/views/system/menu/index.vue +++ /dev/null @@ -1,265 +0,0 @@ -/* -* Copyright 2019-2020 Zheng Jie -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - - - - - diff --git a/webapp/src/views/system/node/index.vue b/webapp/src/views/system/node/index.vue index 96479af..ae540ce 100644 --- a/webapp/src/views/system/node/index.vue +++ b/webapp/src/views/system/node/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/views/system/role/index.vue b/webapp/src/views/system/role/index.vue index 7495061..c4afc83 100644 --- a/webapp/src/views/system/role/index.vue +++ b/webapp/src/views/system/role/index.vue @@ -82,7 +82,7 @@ @@ -126,8 +126,7 @@ import cdOperation from '@crud/CD.operation'; import udOperation from '@crud/UD.operation'; import pagination from '@crud/Pagination'; import { validateName } from '@/utils/validate'; -import crudRoles, {editMenu, get} from '@/api/system/role'; -import { getMenusTree } from '@/api/system/menu'; +import crudRoles, { editMenu, get, getMenusTree } from '@/api/system/role'; import BaseModal from '@/components/BaseModal'; import datePickerMixin from '@/mixins/datePickerMixin'; diff --git a/webapp/src/views/system/user/index.vue b/webapp/src/views/system/user/index.vue index e216800..ba3145b 100644 --- a/webapp/src/views/system/user/index.vue +++ b/webapp/src/views/system/user/index.vue @@ -252,7 +252,7 @@ export default { }, afterErrorMethod() { // 恢复select - this.crud.form.roleId = crud.form.roles[0]?.id || ''; + this.crud.form.roleId = this.crud.form.roles[0]?.id || ''; }, // 新增与编辑前做的操作 [CRUD.HOOK.afterToCU]() { diff --git a/webapp/src/views/trainingImage/index.vue b/webapp/src/views/trainingImage/index.vue index e97a921..c351040 100644 --- a/webapp/src/views/trainingImage/index.vue +++ b/webapp/src/views/trainingImage/index.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,8 +34,9 @@
- - + + + - + @@ -71,12 +72,32 @@ {{ parseTime(scope.row.createTime) }} - + + + + @@ -92,6 +113,7 @@ :loading="crud.status.cu === 2" :disabled="loading" width="600px" + @open="onDialogOpen" @close="onDialogClose" @cancel="crud.cancelCU" @ok="crud.submitCU" @@ -102,6 +124,12 @@ :rules="rules" label-width="120px" > + + + 训练镜像 + notebook镜像 + + + \ No newline at end of file diff --git a/webapp/src/views/trainingJob/add.vue b/webapp/src/views/trainingJob/add.vue index 2072c3c..2ae3d80 100644 --- a/webapp/src/views/trainingJob/add.vue +++ b/webapp/src/views/trainingJob/add.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/webapp/src/views/trainingJob/components/jobDetail.vue b/webapp/src/views/trainingJob/components/jobDetail.vue index 16e65c9..a6fee3a 100644 --- a/webapp/src/views/trainingJob/components/jobDetail.vue +++ b/webapp/src/views/trainingJob/components/jobDetail.vue @@ -1,4 +1,4 @@ -/** Copyright 2020 Zhejiang Lab. All Rights Reserved. +/** Copyright 2020 Tianshu AI Platform. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */