From 3103f5c6be8be35fdf592ec1e44902c2db089687 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Fri, 18 Nov 2022 15:45:40 +0800 Subject: [PATCH] fix issue --- modules/templates/helper.go | 3 + options/locale/locale_en-US.ini | 1 + options/locale/locale_zh-CN.ini | 2 + templates/repo/header.tmpl | 2 +- templates/repo/home.tmpl | 50 +-- web_src/vuepages/langs/config/en-US.js | 29 +- web_src/vuepages/langs/config/zh-CN.js | 400 ++++++++++-------- .../vuepages/pages/notebook/debug/index.vue | 100 +++-- 8 files changed, 309 insertions(+), 278 deletions(-) diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 3e424454b..c314127f1 100755 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -151,6 +151,9 @@ func NewFuncMap() []template.FuncMap { "EscapePound": func(str string) string { return strings.NewReplacer("%", "%25", "#", "%23", " ", "%20", "?", "%3F").Replace(str) }, + "IpynbBool":func(str string) bool{ + return strings.Contains(str, ".ipynb") + }, "nl2br": func(text string) template.HTML { return template.HTML(strings.Replace(template.HTMLEscapeString(text), "\n", "
", -1)) }, diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini index c14955dff..66ee9b64f 100755 --- a/options/locale/locale_en-US.ini +++ b/options/locale/locale_en-US.ini @@ -1438,6 +1438,7 @@ blame = Blame normal_view = Normal View line = line lines = lines +notebook_open = Open in Notebook editor.new_file = New File editor.upload_file = Upload File diff --git a/options/locale/locale_zh-CN.ini b/options/locale/locale_zh-CN.ini index fc0743c59..da82a2316 100755 --- a/options/locale/locale_zh-CN.ini +++ b/options/locale/locale_zh-CN.ini @@ -1456,6 +1456,8 @@ normal_view=普通视图 line=行 lines=行 +notebook_open = 在Notebook中打开 + editor.new_file=新建文件 editor.upload_file=上传文件 editor.edit_file=编辑文件 diff --git a/templates/repo/header.tmpl b/templates/repo/header.tmpl index cb83bebe7..2c94d5f30 100755 --- a/templates/repo/header.tmpl +++ b/templates/repo/header.tmpl @@ -90,7 +90,7 @@ {{end}}
{{if not .Repository.IsBeingCreated}} - - - +{{if and (.IsViewFile) (IpynbBool .TreePath)}} +{{end}} {{template "base/footer" .}} \ No newline at end of file diff --git a/web_src/vuepages/langs/config/en-US.js b/web_src/vuepages/langs/config/en-US.js index bcd1cfe43..3ad30b5e8 100644 --- a/web_src/vuepages/langs/config/en-US.js +++ b/web_src/vuepages/langs/config/en-US.js @@ -192,7 +192,34 @@ const en = { dataDesensitizationModelExperience:'Data desensitization model experience', dataDesensitizationModelDesc:'Use AI technology to desensitize the face and license plate number in the picture. For more information about this model, please visit the project', limitFilesUpload:'Only jpg/jpeg/png files can be uploaded', - limitSizeUpload:'The size of the uploaded file cannot exceed 20M!', + limitSizeUpload: 'The size of the uploaded file cannot exceed 20M!', + notebook: { + createNewNotebook: "Create new notebook debug task", + sameTaskTips1: "You have created an", + sameTaskTips2: "equivalent task", + sameTaskTips3: "that is waiting or running, please wait for the task to finish before creating it.", + sameTaskTips4: "You can view all your Cloudbrain tasks in", + sameTaskTips5: "Home", + sameTaskTips6: "Cloudbrain Task", + sameTaskTips7: "", + cpuEnv: "CPU Environment", + gpuEnv: "GPU Environment", + npuEnv: "NPU environment", + newTask: "Create new task", + noQuene: "The current resources are sufficient and no tasks are queued", + queneTips1: "There are currently", + queneTips2: "tasks queued", + watiResource: "Waiting for resources to be allocated, please be patient", + debug: "Debug", + stop: "Stop", + stopping: "Stopping", + notebookRunning: "The debugging environment has been started, and it will automatically close after a single connection for 4 hours or no operation for half an hour", + stopSuccess: "Stop task succeeded", + specification: "Specification", + graphicMemory: "Graphic Memory", + memory: "Memory", + sharedMemory: "Shared Memory", + }, } export default en; diff --git a/web_src/vuepages/langs/config/zh-CN.js b/web_src/vuepages/langs/config/zh-CN.js index 5b8e800d8..835beb3e0 100644 --- a/web_src/vuepages/langs/config/zh-CN.js +++ b/web_src/vuepages/langs/config/zh-CN.js @@ -1,198 +1,226 @@ const zh = { - loading: '加载中...', - noData: '暂无数据', - date: '日期', + loading: "加载中...", + noData: "暂无数据", + date: "日期", - confirm: '确定', - cancel: '取消', - confirm1: '确认', - pleaseCompleteTheInformationFirst: '请先完善信息!', - submittedSuccessfully: '提交成功!', - submittedFailed: '提交失败!', - operation: '操作', - edit: '修改', - delete: '删除', - tips: '提示', + confirm: "确定", + cancel: "取消", + confirm1: "确认", + pleaseCompleteTheInformationFirst: "请先完善信息!", + submittedSuccessfully: "提交成功!", + submittedFailed: "提交失败!", + operation: "操作", + edit: "修改", + delete: "删除", + tips: "提示", - accomplishTask: '积分任务', - adminOperate: '管理员操作', - runCloudBrainTask: '运行云脑任务', - operating: '消耗中', - succeeded: '已完成', - debugTask: '调试任务', - trainTask: '训练任务', - inferenceTask: '推理任务', - benchmarkTask: '评测任务', - createPublicProject: '创建公开项目', - dailyPutforwardTasks: '每日提出任务', - dailyPR: '每日提出PR', - comment: '发表评论', - uploadDatasetFile: '上传数据集文件', - importNewModel: '导入新模型', - completeWechatCodeScanningVerification: '完成微信扫码验证', - dailyRunCloudbrainTasks: '每日运行云脑任务', - datasetRecommendedByThePlatform: '数据集被平台推荐', - submitNewPublicImage: '提交新公开镜像', - imageRecommendedByThePlatform: '镜像被平台推荐', - firstChangeofAvatar: '首次更换头像', - dailyCommit: '每日commit', - calcPointDetails: '算力积分明细', - calcPointAcquisitionInstructions: '积分获取说明', - CurrAvailableCalcPoints: '当前可用算力积分(分)', - totalGainCalcPoints: '总获取算力积分(分)', - totalConsumeCalcPoints: '总消耗算力积分(分)', - gainDetail: '获取明细', - consumeDetail: '消耗明细', - serialNumber: '流水号', - time: '时间', - scene: '场景', - behaviorOfPoint: '积分行为', - explanation: '说明', - points: '积分', - status: '状态', - runTime: '运行时长', - taskName: '任务名称', + accomplishTask: "积分任务", + adminOperate: "管理员操作", + runCloudBrainTask: "运行云脑任务", + operating: "消耗中", + succeeded: "已完成", + debugTask: "调试任务", + trainTask: "训练任务", + inferenceTask: "推理任务", + benchmarkTask: "评测任务", + createPublicProject: "创建公开项目", + dailyPutforwardTasks: "每日提出任务", + dailyPR: "每日提出PR", + comment: "发表评论", + uploadDatasetFile: "上传数据集文件", + importNewModel: "导入新模型", + completeWechatCodeScanningVerification: "完成微信扫码验证", + dailyRunCloudbrainTasks: "每日运行云脑任务", + datasetRecommendedByThePlatform: "数据集被平台推荐", + submitNewPublicImage: "提交新公开镜像", + imageRecommendedByThePlatform: "镜像被平台推荐", + firstChangeofAvatar: "首次更换头像", + dailyCommit: "每日commit", + calcPointDetails: "算力积分明细", + calcPointAcquisitionInstructions: "积分获取说明", + CurrAvailableCalcPoints: "当前可用算力积分(分)", + totalGainCalcPoints: "总获取算力积分(分)", + totalConsumeCalcPoints: "总消耗算力积分(分)", + gainDetail: "获取明细", + consumeDetail: "消耗明细", + serialNumber: "流水号", + time: "时间", + scene: "场景", + behaviorOfPoint: "积分行为", + explanation: "说明", + points: "积分", + status: "状态", + runTime: "运行时长", + taskName: "任务名称", - createdRepository: '创建了项目', - repositoryWasDel: '项目已删除', - openedIssue: '创建了任务', - createdPullRequest: '创建了合并请求', - commentedOnIssue: '评论了任务', - uploadDataset: '上传了数据集文件', - createdNewModel: '导入了新模型', - firstBindingWechatRewards: '首次绑定微信奖励', - created: '创建了', - type: '类型', - dataset: '数据集', - setAsRecommendedDataset: '被设置为推荐数据集', - committedImage: '提交了镜像', - image: '镜像', - setAsRecommendedImage: '被设置为推荐镜像', - updatedAvatar: '更新了头像', - pushedBranch: '推送了{branch}分支代码到', - deleteBranch: '从{repo}删除分支{branch}', - pushedTag: '推送了标签{tag}到', - deleteTag: '从{repo}删除了标签{tag}', - dailyMaxTips: '达到每日上限积分,不能拿满分', - memory: '内存', - sharedMemory: '共享内存', - ';': ';', + createdRepository: "创建了项目", + repositoryWasDel: "项目已删除", + openedIssue: "创建了任务", + createdPullRequest: "创建了合并请求", + commentedOnIssue: "评论了任务", + uploadDataset: "上传了数据集文件", + createdNewModel: "导入了新模型", + firstBindingWechatRewards: "首次绑定微信奖励", + created: "创建了", + type: "类型", + dataset: "数据集", + setAsRecommendedDataset: "被设置为推荐数据集", + committedImage: "提交了镜像", + image: "镜像", + setAsRecommendedImage: "被设置为推荐镜像", + updatedAvatar: "更新了头像", + pushedBranch: "推送了{branch}分支代码到", + deleteBranch: "从{repo}删除分支{branch}", + pushedTag: "推送了标签{tag}到", + deleteTag: "从{repo}删除了标签{tag}", + dailyMaxTips: "达到每日上限积分,不能拿满分", + memory: "内存", + sharedMemory: "共享内存", + ";": ";", - noPointGainRecord: '还没有积分获取记录', - noPointConsumeRecord: '还没有积分消耗记录', + noPointGainRecord: "还没有积分获取记录", + noPointConsumeRecord: "还没有积分消耗记录", resourcesManagement: { - OpenI: '启智集群', - C2Net: '智算集群', - OpenIOne: '云脑一', - OpenITwo: '云脑二', - OpenIChengdu: '启智成都智算', - chengduCenter: '成都智算', - pclcci: '鹏城云计算所', - hefeiCenter: '合肥类脑类脑智能开放平台', - xuchangCenter: '中原人工智能计算中心', - willOnShelf: '待上架', - onShelf: '已上架', - offShelf: '已下架', - toOnShelf: '上架', - toOffShelf: '下架', - toSetPriceAndOnShelf: '定价上架', - status: '状态', - allStatus: '全部状态', - syncAiNetwork: '同步智算网络', - resQueue: '资源池(队列)', - allResQueue: '全部资源池(队列)', - addResQueue: '新建资源池(队列)', - addResQueueBtn: '新增资源池', - editResQueue: '修改资源池(队列)', - resQueueName: '资源池(队列)名称', - whichCluster: '所属集群', - allCluster: '全部集群', - aiCenter: '智算中心', - aiCenterID: '智算中心ID', - allAiCenter: '全部智算中心', - computeResource: '计算资源', - allComputeResource: '全部计算资源', - accCardType: '卡类型', - allAccCardType: '全部卡类型', - cardsTotalNum: '卡数', - accCardsNum: '卡数', - remark: '备注', - pleaseEnterRemark: '请输入备注(最大长度不超过255)', - pleaseEnterPositiveIntegerCardsTotalNum: '请输入正整数的卡数!', - addResSpecificationAndPriceInfo: '新增资源规格和单价信息', - addResSpecificationBtn: '新增资源规格', - editResSpecificationAndPriceInfo: '修改资源规格和单价信息', - resSpecificationAndPriceManagement: '资源规格单价管理', - sourceSpecCode: '对应资源编码', - sourceSpecCodeTips: '云脑II需要填写对应的资源编码', - sourceSpecId: '智算网络资源规格ID', - cpuNum: 'CPU数', - gpuMem: '显存', - mem: '内存', - shareMem: '共享内存', - unitPrice: '单价', - point_hr: '积分/时', - node: '节点', - free: '免费', - onShelfConfirm: '请确认上架该规格?', - offShelfConfirm: '请确认下架该规格?', - onShelfCode1001: '上架失败,资源池(队列)不可用。', - onShelfCode1003: '上架失败,资源规格不可用。', - offShelfDlgTip1: '当前资源规格已在以下场景中使用:', - offShelfDlgTip2: '请确认进行下架操作?', - resSceneManagement: '算力资源应用场景管理', - addResScene: '新建算力资源应用场景', - addResSceneBtn: '新增应用场景', - editResScene: '修改算力资源应用场景', - resSceneName: '应用场景名称', - jobType: '任务类型', - allJobType: '全部任务类型', - isExclusive: '是否专属', - allExclusiveAndCommonUse: '全部专属和通用', - exclusive: '专属', - commonUse: '通用', - exclusiveOrg: '专属组织', - exclusiveOrgTips: '多个组织名之间用英文分号隔开', - computeCluster: '算力集群', - resourceSpecification: '资源规格', - lastUpdateTime: '最后更新时间', - resSceneDeleteConfirm: '是否确认删除当前应用场景?', - resourceSpecificationIsAvailable: '资源规格是否可用', - resourceSpecificationIsAvailableAll: '资源规格是否可用(全部)', - available: '可用', - notAvailable: '不可用', + OpenI: "启智集群", + C2Net: "智算集群", + OpenIOne: "云脑一", + OpenITwo: "云脑二", + OpenIChengdu: "启智成都智算", + chengduCenter: "成都智算", + pclcci: "鹏城云计算所", + hefeiCenter: "合肥类脑类脑智能开放平台", + xuchangCenter: "中原人工智能计算中心", + willOnShelf: "待上架", + onShelf: "已上架", + offShelf: "已下架", + toOnShelf: "上架", + toOffShelf: "下架", + toSetPriceAndOnShelf: "定价上架", + status: "状态", + allStatus: "全部状态", + syncAiNetwork: "同步智算网络", + resQueue: "资源池(队列)", + allResQueue: "全部资源池(队列)", + addResQueue: "新建资源池(队列)", + addResQueueBtn: "新增资源池", + editResQueue: "修改资源池(队列)", + resQueueName: "资源池(队列)名称", + whichCluster: "所属集群", + allCluster: "全部集群", + aiCenter: "智算中心", + aiCenterID: "智算中心ID", + allAiCenter: "全部智算中心", + computeResource: "计算资源", + allComputeResource: "全部计算资源", + accCardType: "卡类型", + allAccCardType: "全部卡类型", + cardsTotalNum: "卡数", + accCardsNum: "卡数", + remark: "备注", + pleaseEnterRemark: "请输入备注(最大长度不超过255)", + pleaseEnterPositiveIntegerCardsTotalNum: "请输入正整数的卡数!", + addResSpecificationAndPriceInfo: "新增资源规格和单价信息", + addResSpecificationBtn: "新增资源规格", + editResSpecificationAndPriceInfo: "修改资源规格和单价信息", + resSpecificationAndPriceManagement: "资源规格单价管理", + sourceSpecCode: "对应资源编码", + sourceSpecCodeTips: "云脑II需要填写对应的资源编码", + sourceSpecId: "智算网络资源规格ID", + cpuNum: "CPU数", + gpuMem: "显存", + mem: "内存", + shareMem: "共享内存", + unitPrice: "单价", + point_hr: "积分/时", + node: "节点", + free: "免费", + onShelfConfirm: "请确认上架该规格?", + offShelfConfirm: "请确认下架该规格?", + onShelfCode1001: "上架失败,资源池(队列)不可用。", + onShelfCode1003: "上架失败,资源规格不可用。", + offShelfDlgTip1: "当前资源规格已在以下场景中使用:", + offShelfDlgTip2: "请确认进行下架操作?", + resSceneManagement: "算力资源应用场景管理", + addResScene: "新建算力资源应用场景", + addResSceneBtn: "新增应用场景", + editResScene: "修改算力资源应用场景", + resSceneName: "应用场景名称", + jobType: "任务类型", + allJobType: "全部任务类型", + isExclusive: "是否专属", + allExclusiveAndCommonUse: "全部专属和通用", + exclusive: "专属", + commonUse: "通用", + exclusiveOrg: "专属组织", + exclusiveOrgTips: "多个组织名之间用英文分号隔开", + computeCluster: "算力集群", + resourceSpecification: "资源规格", + lastUpdateTime: "最后更新时间", + resSceneDeleteConfirm: "是否确认删除当前应用场景?", + resourceSpecificationIsAvailable: "资源规格是否可用", + resourceSpecificationIsAvailableAll: "资源规格是否可用(全部)", + available: "可用", + notAvailable: "不可用", }, user: { - inviteFriends: '邀请好友', - inviteFriendsTips: '复制二维码或者注册邀请链接分享给好友', - clickToViewTheEventDetails: '点击查看活动详情', - copyRegistrationInvitationLink: '复制注册邀请链接', - registrationAdress: '注册地址:', - recommender: '推荐人:', - invitedFriends: '已邀请好友', - registrationTime: '注册时间', - theSharedContentHasBeenCopiedToTheClipboard: '分享内容已复制到剪切板', - copyError: '复制错误', - Activated: '已激活', - notActive: '未激活', + inviteFriends: "邀请好友", + inviteFriendsTips: "复制二维码或者注册邀请链接分享给好友", + clickToViewTheEventDetails: "点击查看活动详情", + copyRegistrationInvitationLink: "复制注册邀请链接", + registrationAdress: "注册地址:", + recommender: "推荐人:", + invitedFriends: "已邀请好友", + registrationTime: "注册时间", + theSharedContentHasBeenCopiedToTheClipboard: "分享内容已复制到剪切板", + copyError: "复制错误", + Activated: "已激活", + notActive: "未激活", }, - tranformImageFailed:'图片脱敏失败', - originPicture:'原始图片', - desensitizationPicture:'脱敏图片', - desensitizationObject:'脱敏对象', - example:'示例', - startDesensitization:'开始处理', - all:'全部', - onlyFace:'仅人脸', - onlyLicensePlate:'仅车牌', - dragThePictureHere:'拖动图片到这里', - or:'或', - clickUpload:'点击上传', - dataDesensitizationModelExperience:'数据脱敏模型体验', - dataDesensitizationModelDesc:'利用人工智能AI技术,把图片中的人脸、车牌号码进行脱敏处理。该模型更多信息请访问项目', - limitFilesUpload:'只能上传 jpg/jpeg/png 格式的文件', - limitSizeUpload:'上传文件大小不能超过 20M !', -} + tranformImageFailed: "图片脱敏失败", + originPicture: "原始图片", + desensitizationPicture: "脱敏图片", + desensitizationObject: "脱敏对象", + example: "示例", + startDesensitization: "开始处理", + all: "全部", + onlyFace: "仅人脸", + onlyLicensePlate: "仅车牌", + dragThePictureHere: "拖动图片到这里", + or: "或", + clickUpload: "点击上传", + dataDesensitizationModelExperience: "数据脱敏模型体验", + dataDesensitizationModelDesc: + "利用人工智能AI技术,把图片中的人脸、车牌号码进行脱敏处理。该模型更多信息请访问项目", + limitFilesUpload: "只能上传 jpg/jpeg/png 格式的文件", + limitSizeUpload: "上传文件大小不能超过 20M !", + notebook: { + createNewNotebook: "新建Notebook调试任务", + sameTaskTips1: "您已经有", + sameTaskTips2: "同类任务", + sameTaskTips3: "正在等待或运行中,请等待任务结束再创建", + sameTaskTips4: "可以在", + sameTaskTips5: "个人中心", + sameTaskTips6: "云脑任务", + sameTaskTips7: "查看您所有的云脑任务。", + cpuEnv: "CPU 环境", + gpuEnv: "GPU 环境", + npuEnv: "NPU 环境", + newTask: "新建任务", + noQuene: "当前资源充足,没有任务排队", + queneTips1: "当前有", + queneTips2: "个任务正在排队", + watiResource: "正在等待分配资源,请耐心等待", + debug: "调试", + stop: "停止", + stopping: "停止中", + notebookRunning: "调试环境已启动,单次连接 4 小时或无操作半小时后自动关闭", + stopSuccess: "停止任务成功", + specification: "规格", + graphicMemory: "显存", + memory: "内存", + sharedMemory: "共享内存", + }, +}; export default zh; diff --git a/web_src/vuepages/pages/notebook/debug/index.vue b/web_src/vuepages/pages/notebook/debug/index.vue index 5faee62a4..b305816cb 100644 --- a/web_src/vuepages/pages/notebook/debug/index.vue +++ b/web_src/vuepages/pages/notebook/debug/index.vue @@ -1,7 +1,7 @@