Browse Source

fix issue

tags/v1.22.11.3^2
zhoupzh 3 years ago
parent
commit
3103f5c6be
8 changed files with 309 additions and 278 deletions
  1. +3
    -0
      modules/templates/helper.go
  2. +1
    -0
      options/locale/locale_en-US.ini
  3. +2
    -0
      options/locale/locale_zh-CN.ini
  4. +1
    -1
      templates/repo/header.tmpl
  5. +12
    -38
      templates/repo/home.tmpl
  6. +28
    -1
      web_src/vuepages/langs/config/en-US.js
  7. +214
    -186
      web_src/vuepages/langs/config/zh-CN.js
  8. +48
    -52
      web_src/vuepages/pages/notebook/debug/index.vue

+ 3
- 0
modules/templates/helper.go View File

@@ -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", "<br>", -1))
},


+ 1
- 0
options/locale/locale_en-US.ini View File

@@ -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


+ 2
- 0
options/locale/locale_zh-CN.ini View File

@@ -1456,6 +1456,8 @@ normal_view=普通视图
line=行
lines=行

notebook_open = 在Notebook中打开

editor.new_file=新建文件
editor.upload_file=上传文件
editor.edit_file=编辑文件


+ 1
- 1
templates/repo/header.tmpl View File

@@ -90,7 +90,7 @@
{{end}}
<div class="ui tabs container">
{{if not .Repository.IsBeingCreated}}
<div class="ui tabular menu navbar">
<div class="ui tabular menu navbar" style="overflow-x:auto;overflow-y:hidden">
{{if .Permission.CanRead $.UnitTypeCode}}
<div class="dropdown-menu">
<a class="{{if or .PageIsViewCode .PageIsReleaseList .PageIsWiki .PageIsActivity .PageIsViewCode}}active{{end}} item hover_active" href="{{.RepoLink}}{{if (ne .BranchName .Repository.DefaultBranch)}}/src/{{.BranchNameSubURL | EscapePound}}{{end}}">


+ 12
- 38
templates/repo/home.tmpl View File

@@ -99,7 +99,9 @@
animation-fill-mode: both;
}
</style>
{{if and (.IsViewFile) (IpynbBool .TreePath)}}
<link rel="stylesheet" href="{{StaticUrlPrefix}}/css/vp-notebook-debug.css?v={{MD5 AppVer}}" />
{{end}}
<div class="repository file list">
{{template "repo/header" .}}
<div class="ui container">
@@ -201,12 +203,14 @@
class="section"><a href="{{EscapePound $.BranchLink}}/{{EscapePound $p}}"
title="{{$v}}">{{EllipsisString $v 30}}</a></span>{{end}}{{end}}</span></div>
{{end}}
<div class="fitted item">
<button class="ui green button mini" id="notebook-debug" style="display: flex;">
<i class="ri-terminal-box-line" style="margin-right: 0.3rem;"></i>
在Notebook中打开
{{if and (.IsViewFile) (IpynbBool .TreePath)}}
<div class="right fitted item">
<button class="ui green button tiny" id="notebook-debug" style="display: flex;align-items: center;">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path fill="none" d="M0 0h24v24H0z"/><path d="M3 3h18a1 1 0 0 1 1 1v16a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1zm1 2v14h16V5H4zm8 10h6v2h-6v-2zm-3.333-3L5.838 9.172l1.415-1.415L11.495 12l-4.242 4.243-1.415-1.415L8.667 12z" fill="rgba(255,255,255,1)"/></svg>
<span style="margin-left:0.3rem">{{.i18n.Tr "repo.notebook_open"}}</span>
</button>
</div>
{{end}}
<div class="right fitted item" id="file-buttons">
<div class="ui tiny blue buttons">
{{if .Repository.CanEnableEditor}}
@@ -230,8 +234,6 @@
</a>
{{end}}
</div>

</div>
<div class="fitted item">
{{if eq $n 0}}
@@ -245,7 +247,6 @@
{{end}}
</div>
<div class="fitted item">

<!-- Only show clone panel in repository home page -->
{{if eq $n 0}}
<div class="ui action tiny input" id="clone-panel">
@@ -311,25 +312,17 @@
{{else}}
<span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span>
{{end}}

</p>

</div>



{{if .Repository.Website}}
<p class="ui">
<i class="gray linkify icon"></i>
<a class="link edit-link" target="_blank" title="{{.Repository.Website}}"
href="{{.Repository.Website}}">{{.Repository.Website}}</a>
</p>

{{end}}

<div class="ui" id="repo-topics" style="display: flex;position: relative;margin-bottom: 1.0rem;">
<i class="grey bookmark icon"></i>

<div id="repo-topics1" style="flex: 1;">
{{range .Topics}}
<a class="ui repo-topic small label topic"
@@ -342,32 +335,22 @@
</div>
<div id="topic_edit" class="vue_menu" style="display:none">
<div id="topic_edit1">

</div>
</div>

</div>


<p class="ui">
<i class="grey code icon"></i>
{{range .LanguageStats}}
{{.Language}}
{{end}}
</p>



{{if .LICENSE}}
<p class="ui">
<i class="grey clone icon"></i>
{{.LICENSE}}
</p>

{{end}}

<div class="ui divider"></div>

<div>
<h4 class="ui header">
{{$lenCon := len .ContributorInfo}}
@@ -395,28 +378,19 @@
{{end}}
</div>
</div>

</div>
</div>
</div>

</div>
{{if and (.IsViewFile) (IpynbBool .TreePath)}}
<div id="__vue-root"></div>
<div id="__vue-self-data" data-branch="{{.BranchName}}" data-owner="{{.Repository.OwnerName}}" data-project="{{.Repository.Name}}"
data-file="{{.TreePath}}">
</div>
{{end}}
</div>

<script type="text/javascript">
// $(document).ready(function(){
// $(".membersmore").click(function(){
// $("#contributorInfo > a:nth-child(n+25)").show();
// });
// });
console.log({{.Repository}})
console.log({{ .BaseRepo}})

console.log({{.TreePath}})
</script>
{{if and (.IsViewFile) (IpynbBool .TreePath)}}
<script src="{{StaticUrlPrefix}}/js/vp-notebook-debug.js?v={{MD5 AppVer}}"></script>
{{end}}
{{template "base/footer" .}}

+ 28
- 1
web_src/vuepages/langs/config/en-US.js View File

@@ -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;

+ 214
- 186
web_src/vuepages/langs/config/zh-CN.js View File

@@ -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;

+ 48
- 52
web_src/vuepages/pages/notebook/debug/index.vue View File

@@ -1,7 +1,7 @@
<template>
<div>
<el-dialog
title="新建Notebook调试任务"
:title="$t('notebook.createNewNotebook')"
:visible.sync="dialogVisible"
width="50%"
:close-on-click-modal="false"
@@ -12,8 +12,8 @@
<div style="display: flex;align-items: center;">
<i class="ri-information-line" style="font-size: 35px;color: rgba(242, 113, 28, 1);;"></i>
<div style="text-align: left;margin-left: 1rem;">
<div style="font-weight: 600;line-height: 2;">您已经有 <span style="color:rgba(242, 113, 28, 1);">同类任务</span> 正在等待或运行中,请等待任务结束再创建</div>
<div style="color:#939393">可以在 “<a href="/cloudbrains" target="_blank">个人中心 &gt; 云脑任务</a>” 查看您所有的云脑任务。</div>
<div style="font-weight: 600;line-height: 2;">{{$t('notebook.sameTaskTips1')}} <span style="color:rgba(242, 113, 28, 1);">{{$t('notebook.sameTaskTips2')}}</span> {{$t('notebook.sameTaskTips3')}}</div>
<div style="color:#939393">{{$t('notebook.sameTaskTips4')}} “<a href="/cloudbrains" target="_blank">{{$t('notebook.sameTaskTips5')}} &gt; {{$t('notebook.sameTaskTips6')}}</a>” {{$t('notebook.sameTaskTips7')}}</div>
</div>
</div>
</div>
@@ -27,12 +27,12 @@
<span class="text">C</span>
</div>
<div class="resource-type-detail">
<div class="detail-title"><span>CPU 环境</span></div>
<div class="detail-title"><span>{{$t('notebook.cpuEnv')}}</span></div>
<div class="detail-spec">
<span>{{cpuSpec}}</span>
</div>
<div class="detail-spec">
<span>镜像:{{notebookInfo.imageCpuDescription}}</span>
<span>{{$t('image')}}:{{notebookInfo.imageCpuDescription}}</span>
</div>
</div>
<div class="resource-select">
@@ -54,12 +54,12 @@
<span class="text">G</span>
</div>
<div class="resource-type-detail">
<div class="detail-title"><span>GPU 环境</span></div>
<div class="detail-title"><span>{{$t('notebook.gpuEnv')}}</span></div>
<div class="detail-spec">
<span>{{gpuSpec}}</span>
</div>
<div class="detail-spec">
<span>镜像:{{notebookInfo.imageGpuDescription}}</span>
<span>{{$t('image')}}:{{notebookInfo.imageGpuDescription}}</span>
</div>
</div>
<div class="resource-select">
@@ -82,12 +82,12 @@
<span class="text">N</span>
</div>
<div class="resource-type-detail">
<div class="detail-title"><span>NPU 环境</span></div>
<div class="detail-title"><span>{{$t('notebook.npuEnv')}}</span></div>
<div class="detail-spec">
<span>{{npuSpec}}</span>
</div>
<div class="detail-spec">
<span>镜像:{{notebookInfo.imageCpuDescription}}</span>
<span>{{$t('image')}}:{{notebookInfo.imageCpuDescription}}</span>
</div>
</div>
<div class="resource-select">
@@ -102,68 +102,68 @@
<div class="resource-footer">
<div class="resource-operate" v-if="selectIndex==0">
<div v-if="btnStatus[0]===0">
<button class="ui green small button" @click="createTask(0)"></i>新建任务3</button>
<span v-if="notebookInfo.waitCountGpu==0" class="text">当前资源充足,没有任务排队</span>
<span v-else class="text">当前有 <span style="color: red;">{{notebookInfo.waitCountGpu}}</span>  个任务正在排队</span>
<button class="ui green small button" @click="createTask(0)"></i>{{$t('notebook.newTask')}}</button>
<span v-if="notebookInfo.waitCountGpu==0" class="text">{{$t('notebook.noQuene')}}</span>
<span v-else class="text">{{$t('notebook.queneTips1')}} <span style="color: red;">{{notebookInfo.waitCountGpu}}</span>  {{$t('notebook.queneTips2')}}</span>
</div>
<div v-else-if="btnStatus[0]===1">
<button class="ui disabled small button" style="background-color: #888;"><i class="loading spinner icon" style="color: #fff;"></i>新建任务</button>
<span class="text">正在等待分配资源,请耐心等待</span>
<button class="ui disabled small button" style="background-color: #888;"><i class="loading spinner icon" style="color: #fff;"></i>{{$t('notebook.newTask')}}</button>
<span class="text">{{$t('notebook.watiResource')}}</span>
</div>
<div v-else-if="btnStatus[0]===2">
<button class="ui small button" style="background-color: #1684fc;">
<a style="color:#fff" :href="deubgUrlGpu" target="_blank">调试</a>
<a style="color:#fff" :href="deubgUrlGpu" target="_blank">{{$t('notebook.debug')}}</a>
</button>
<button class="ui small button" @click="stopDebug(0)">停止</button>
<span class="text">调试环境已启动,单次连接 4 小时或无操作半小时后自动关闭</span>
<button class="ui small button" @click="stopDebug(0)">{{$t('notebook.stop')}}</button>
<span class="text">{{$t('notebook.notebookRunning')}}</span>
</div>
<div v-else>
<button class="ui disabled small button" style="background-color: #888;"><i class="loading spinner icon" style="color: #fff;"></i>停止中</button>
<button class="ui disabled small button" style="background-color: #888;"><i class="loading spinner icon" style="color: #fff;"></i>{{$t('notebook.stopping')}}</button>
</div>
</div>
<div class="resource-operate" v-if="selectIndex==1">
<div v-if="btnStatus[1]===0">
<button class="ui green small button" @click="createTask(1)"></i>新建任务3</button>
<span v-if="notebookInfo.waitCountGpu==0" class="text">当前资源充足,没有任务排队</span>
<span v-else class="text">当前有 <span style="color: red;">{{notebookInfo.waitCountGpu}}</span>  个任务正在排队</span>
<button class="ui green small button" @click="createTask(1)"></i>{{$t('notebook.newTask')}}</button>
<span v-if="notebookInfo.waitCountGpu==0" class="text">{{$t('notebook.noQuene')}}</span>
<span v-else class="text">{{$t('notebook.queneTips1')}} <span style="color: red;">{{notebookInfo.waitCountGpu}}</span>  {{$t('notebook.queneTips2')}}</span>
</div>
<div v-else-if="btnStatus[1]===1">
<button class="ui disabled small button" style="background-color: #888;"><i class="loading spinner icon" style="color: #fff;"></i>新建任务</button>
<span class="text">正在等待分配资源,请耐心等待</span>
<button class="ui disabled small button" style="background-color: #888;"><i class="loading spinner icon" style="color: #fff;"></i>{{$t('notebook.newTask')}}</button>
<span class="text">{{$t('notebook.watiResource')}}</span>
</div>
<div v-else-if="btnStatus[1]===2">
<button class="ui small button" style="background-color: #1684fc;">
<a style="color:#fff" :href="deubgUrlGpu" target="_blank">调试</a>
<a style="color:#fff" :href="deubgUrlGpu" target="_blank">{{$t('notebook.debug')}}</a>
</button>
<button class="ui small button" @click="stopDebug(1)">停止</button>
<span class="text">调试环境已启动,单次连接 4 小时或无操作半小时后自动关闭</span>
<button class="ui small button" @click="stopDebug(1)">{{$t('notebook.stop')}}</button>
<span class="text">{{$t('notebook.notebookRunning')}}</span>
</div>
<div v-else>
<button class="ui disabled small button" style="background-color: #888;"><i class="loading spinner icon" style="color: #fff;"></i>停止中</button>
<button class="ui disabled small button" style="background-color: #888;"><i class="loading spinner icon" style="color: #fff;"></i>{{$t('notebook.stopping')}}</button>
</div>
</div>
<div class="resource-operate" v-if="selectIndex==2">
<div v-if="btnStatus[2]===0">
<button class="ui green small button" @click="createTask(2)"></i>新建任务3</button>
<span v-if="notebookInfo.waitCountNpu==0" class="text">当前资源充足,没有任务排队</span>
<span v-else class="text">当前有 <span style="color: red;">{{notebookInfo.waitCountNpu}}</span>  个任务正在排队</span>
<button class="ui green small button" @click="createTask(2)"></i>{{$t('notebook.newTask')}}</button>
<span v-if="notebookInfo.waitCountNpu==0" class="text">{{$t('notebook.noQuene')}}</span>
<span v-else class="text">{{$t('notebook.queneTips1')}} <span style="color: red;">{{notebookInfo.waitCountNpu}}</span>  {{$t('notebook.queneTips2')}}</span>
</div>
<div v-else-if="btnStatus[2]===1">
<button class="ui disabled small button" style="background-color: #888;"><i class="loading spinner icon" style="color: #fff;"></i>新建任务</button>
<span class="text">正在等待分配资源,请耐心等待</span>
<button class="ui disabled small button" style="background-color: #888;"><i class="loading spinner icon" style="color: #fff;"></i>{{$t('notebook.newTask')}}</button>
<span class="text">{{$t('notebook.watiResource')}}</span>
</div>
<div v-else-if="btnStatus[2]===2">
<button class="ui small button" style="background-color: #1684fc;">
<a style="color:#fff" :href="deubgUrlNpu" target="_blank">调试</a>
<a style="color:#fff" :href="deubgUrlNpu" target="_blank">{{$t('notebook.debug')}}</a>
</button>
<button class="ui small button" @click="stopDebug(2)">停止</button>
<span class="text">调试环境已启动,单次连接 4 小时或无操作半小时后自动关闭</span>
<button class="ui small button" @click="stopDebug(2)">{{$t('notebook.stop')}}</button>
<span class="text">{{$t('notebook.notebookRunning')}}</span>
</div>
<div v-else>
<button class="ui disabled small button" style="background-color: #888;"><i class="loading spinner icon" style="color: #fff;"></i>停止中</button>
<button class="ui disabled small button" style="background-color: #888;"><i class="loading spinner icon" style="color: #fff;"></i>{{$t('notebook.stopping')}}</button>
</div>
</div>
</div>
@@ -240,7 +240,6 @@ export default {
},
getNotebookInfo(){
getFileNotebook().then((res)=>{
console.log(res)
if(res.data.code==0){
this.notebookInfo = res.data
}else{
@@ -252,7 +251,6 @@ export default {
},
getCb1NotebookInfo(path,id,index){
getCb1Notebook(path,id).then((res)=>{
console.log(res)
if(res.status===200){
if(res.data.JobStatus==="RUNNING"){
this.btnStatus[index]=2
@@ -260,9 +258,7 @@ export default {
this.deubgUrlGpuStop = `${AppSubUrl}/${this.fileInfo.owner_name}/${this.notebookInfo.projectName}/cloudbrain/${id}/stop`
clearInterval(timerCb1)
}
console.log(finalState.includes(res.data.JobStatus),finalState,res.data.JobStatus)
if(finalState.includes(res.data.JobStatus)){
console.log("---=-==",index)
this.btnStatus[index] = 0
clearInterval(timerCb1)
}
@@ -279,7 +275,6 @@ export default {
clearInterval(timerCb2)
}
if(finalState.includes(res.data.JobStatus)){
console.log("---=-==")
this.btnStatus[2] = 0
clearInterval(timerCb2)
}
@@ -292,7 +287,7 @@ export default {
stopNotebook(url).then((res)=>{
if(res.data.result_code==='0'){
this.btnStatus[index]=0
Message.success("停止任务成功")
Message.success(this.$t("notebook.stopSuccess"))
}else{
this.btnStatus[index]=0
Message.error(res.data.error_msg)
@@ -314,7 +309,7 @@ export default {
}, 10000)
}else{
timerCb1 = setInterval(() => {
setTimeout(this.getCb1NotebookInfo(repoPath,res.data.message), 0,index)
setTimeout(this.getCb1NotebookInfo(repoPath,res.data.message,index), 0)
}, 10000)
}
this.alertCb = false
@@ -339,19 +334,19 @@ export default {
},
computed: {
cpuSpec(){
return `规格:GPU: ${this.notebookInfo.specCpu.acc_cards_num}*${this.notebookInfo.specCpu.acc_card_type},
CPU: ${this.notebookInfo.specCpu.cpu_cores}, 显存: ${this.notebookInfo.specCpu.gpu_mem_gi_b}GB,
内存: ${this.notebookInfo.specCpu.mem_gi_b}GB, 共享内存: ${this.notebookInfo.specCpu.share_mem_gi_b}GB`
return `${this.$t("notebook.specification")}:GPU: ${this.notebookInfo.specCpu.acc_cards_num}*${this.notebookInfo.specCpu.acc_card_type},
CPU: ${this.notebookInfo.specCpu.cpu_cores}, ${this.$t("notebook.graphicMemory")}: ${this.notebookInfo.specCpu.gpu_mem_gi_b}GB,
${this.$t("notebook.memory")}: ${this.notebookInfo.specCpu.mem_gi_b}GB, ${this.$t("notebook.sharedMemory")}: ${this.notebookInfo.specCpu.share_mem_gi_b}GB`
},
npuSpec(){
return `规格:NPU: ${this.notebookInfo.specNpu.acc_cards_num}*${this.notebookInfo.specNpu.acc_card_type},
CPU: ${this.notebookInfo.specNpu.cpu_cores}, 显存: ${this.notebookInfo.specNpu.gpu_mem_gi_b}GB,
内存: ${this.notebookInfo.specNpu.mem_gi_b}GB, 共享内存: ${this.notebookInfo.specNpu.share_mem_gi_b}GB`
return `${this.$t("notebook.specification")}:NPU: ${this.notebookInfo.specNpu.acc_cards_num}*${this.notebookInfo.specNpu.acc_card_type},
CPU: ${this.notebookInfo.specNpu.cpu_cores}, ${this.$t("notebook.graphicMemory")}: ${this.notebookInfo.specNpu.gpu_mem_gi_b}GB,
${this.$t("notebook.memory")}: ${this.notebookInfo.specNpu.mem_gi_b}GB, ${this.$t("notebook.sharedMemory")}: ${this.notebookInfo.specNpu.share_mem_gi_b}GB`
},
gpuSpec(){
return `规格:NPU: ${this.notebookInfo.specGpu.acc_cards_num}*${this.notebookInfo.specGpu.acc_card_type},
CPU: ${this.notebookInfo.specGpu.cpu_cores}, 显存: ${this.notebookInfo.specGpu.gpu_mem_gi_b}GB,
内存: ${this.notebookInfo.specGpu.mem_gi_b}GB, 共享内存: ${this.notebookInfo.specGpu.share_mem_gi_b}GB`
return `${this.$t("notebook.specification")}:NPU: ${this.notebookInfo.specGpu.acc_cards_num}*${this.notebookInfo.specGpu.acc_card_type},
CPU: ${this.notebookInfo.specGpu.cpu_cores}, ${this.$t("notebook.graphicMemory")}: ${this.notebookInfo.specGpu.gpu_mem_gi_b}GB,
${this.$t("notebook.memory")}: ${this.notebookInfo.specGpu.mem_gi_b}GB, ${this.$t("notebook.sharedMemory")}: ${this.notebookInfo.specGpu.share_mem_gi_b}GB`
}
},
beforeDestroy() {
@@ -445,6 +440,7 @@ export default {
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
.text {
font-size: 26px;
color: rgba(251, 251, 251, 1);


Loading…
Cancel
Save