Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/491tags/v1.21.12.1
| @@ -831,6 +831,7 @@ fork = Fork | |||||
| download_archive = Download Repository | download_archive = Download Repository | ||||
| no_desc = No Description | no_desc = No Description | ||||
| no_label = No labels | |||||
| quick_guide = Quick Guide | quick_guide = Quick Guide | ||||
| clone_this_repo = Clone this repository | clone_this_repo = Clone this repository | ||||
| create_new_repo_command = Creating a new repository on the command line | create_new_repo_command = Creating a new repository on the command line | ||||
| @@ -833,6 +833,7 @@ fork=派生 | |||||
| download_archive=下载此项目 | download_archive=下载此项目 | ||||
| no_desc=暂无描述 | no_desc=暂无描述 | ||||
| no_label = 暂无标签 | |||||
| quick_guide=快速帮助 | quick_guide=快速帮助 | ||||
| clone_this_repo=克隆当前项目 | clone_this_repo=克隆当前项目 | ||||
| create_new_repo_command=从命令行创建一个新的项目 | create_new_repo_command=从命令行创建一个新的项目 | ||||
| @@ -187,6 +187,12 @@ | |||||
| cursor: pointer; | cursor: pointer; | ||||
| pointer-events: none; | pointer-events: none; | ||||
| } | } | ||||
| .time-show{ | |||||
| font-size: 10px; | |||||
| margin-top: 0.4rem; | |||||
| display: inline-block; | |||||
| } | |||||
| </style> | </style> | ||||
| <!-- 弹窗 --> | <!-- 弹窗 --> | ||||
| @@ -265,11 +271,21 @@ | |||||
| <div class="three wide column"> | <div class="three wide column"> | ||||
| <!--任务状态 --> | <!--任务状态 --> | ||||
| <span class="ui compact button job-status" id="{{.JobID}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}"> | |||||
| <!-- <span class="ui compact button job-status" id="{{.JobID}}" data-repopath="{{$.RepoRelPath}}" data-jobid="{{.JobID}}"> | |||||
| {{.Status}} | {{.Status}} | ||||
| </span> | |||||
| </span> --> | |||||
| {{if eq .Status "STOPPED"}} | |||||
| <span style="display:flex;position: relative; justify-content: flex-start;"><i class="i-round i-bg-stop"></i><span style="margin-left: 0.4em;font-size: 12px;">已停止</span></span> | |||||
| {{else if eq .Status "RUNNING"}} | |||||
| <span style="display:flex;position: relative; justify-content: flex-start;"><i class="i-round i-bg-running"></i><span style="margin-left: 0.4em;font-size: 12px;">运行中</span></span> | |||||
| {{else if eq .Status "FAILED"}} | |||||
| <span style="display:flex;position: relative; justify-content: flex-start;"><i class="i-round i-bg-running"></i><span style="margin-left: 0.4em;font-size: 12px;">运行失败</span></span> | |||||
| {{else if eq .Status "WAITING"}} | |||||
| <span style="display:flex;position: relative; justify-content: flex-start;"><i class="showCircle"></i><span style="margin-left: 0.4em;font-size: 12px;">初始化等待</span></span> | |||||
| {{end}} | |||||
| <!-- 任务创建时间 --> | <!-- 任务创建时间 --> | ||||
| <span class="">{{TimeSinceUnix .CreatedUnix $.Lang}}</span> | |||||
| <span class="time-show">{{TimeSinceUnix .CreatedUnix $.Lang}}</span> | |||||
| </div> | </div> | ||||
| <div class="seven wide column text right"> | <div class="seven wide column text right"> | ||||
| @@ -269,11 +269,20 @@ | |||||
| <div class="ui" id="repo-topics" style="display: flex;position: relative;margin-bottom: 1.0rem;"> | <div class="ui" id="repo-topics" style="display: flex;position: relative;margin-bottom: 1.0rem;"> | ||||
| <i class="grey bookmark icon"></i> | <i class="grey bookmark icon"></i> | ||||
| <div id="repo-topics1" style="flex: 1;"> | <div id="repo-topics1" style="flex: 1;"> | ||||
| {{range .Topics}}<a class="ui repo-topic small label topic" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a>{{end}} | |||||
| <!-- {{if not .Topics}} | |||||
| <span class="no-description text-italic">{{.i18n.Tr "repo.no_desc"}}</span> | |||||
| {{end}} --> | |||||
| {{range .Topics}} | |||||
| <a class="ui repo-topic small label topic" href="{{AppSubUrl}}/explore/repos?q={{.Name}}&topic=1">{{.Name}}</a> | |||||
| {{end}} | |||||
| </div> | </div> | ||||
| <div> | <div> | ||||
| {{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<i id="manage_topic" class="plus icon"></i>{{end}} | |||||
| {{if and .Permission.IsAdmin (not .Repository.IsArchived)}}<i id="manage_topic" style="cursor: pointer;" class="plus icon"></i>{{end}} | |||||
| </div> | </div> | ||||
| <div id="topic_edit" class="vue_menu" style="display:none"> | <div id="topic_edit" class="vue_menu" style="display:none"> | ||||
| <div id="topic_edit1"> | <div id="topic_edit1"> | ||||
| @@ -3,13 +3,13 @@ | |||||
| <div class="input-search"> | <div class="input-search"> | ||||
| <el-input v-model="input" clearable :autofocus="true" @input="changeValue" id="topics_input" @keyup.enter.native="postTopic"> | |||||
| <el-input v-model="input" clearable :autofocus="true" @input="changeValue" id="topics_input" @keyup.enter.native="postTopic" placeholder="搜索或创建标签"> | |||||
| </el-input> | </el-input> | ||||
| <div class="scrolling-menu"> | <div class="scrolling-menu"> | ||||
| <div v-if="showSearchTopic" class="item-text" v-for="(arr,i) in array" @click="addTopics(i,arr)"> | <div v-if="showSearchTopic" class="item-text" v-for="(arr,i) in array" @click="addTopics(i,arr)"> | ||||
| <div class="icon-wrapper"> | <div class="icon-wrapper"> | ||||
| <i style="vertical-align: middle;color: #303643;" v-if="showInitTopic[i]" class="el-icon-check" ></i> | |||||
| <i style="line-height: 1.5;color: #303643;font-weight: 900;" v-if="showInitTopic[i]" class="el-icon-check" ></i> | |||||
| </div> | </div> | ||||
| <div class="text">{{arr.topic_name}} </div> | <div class="text">{{arr.topic_name}} </div> | ||||
| </div> | </div> | ||||
| @@ -18,7 +18,7 @@ | |||||
| </div> | </div> | ||||
| <div v-if="showAddTopic" class="item-text" @click="addPostTopic"> | <div v-if="showAddTopic" class="item-text" @click="addPostTopic"> | ||||
| <div class="icon-wrapper"> | <div class="icon-wrapper"> | ||||
| <i style="vertical-align: middle;color: #303643;" v-if="showAddFlage" class="el-icon-check" ></i> | |||||
| <i style="line-height: 1.5;color: #303643;font-weight: 900;" v-if="showAddFlage" class="el-icon-check" ></i> | |||||
| </div> | </div> | ||||
| <div class="text">{{input}}</div> | <div class="text">{{input}}</div> | ||||
| </div> | </div> | ||||
| @@ -72,6 +72,7 @@ export default { | |||||
| }) | }) | ||||
| this.Post(data,topics) | this.Post(data,topics) | ||||
| this.$set(this.showInitTopic,item,true) | this.$set(this.showInitTopic,item,true) | ||||
| $('#repo-topics1').children('span').remove() | |||||
| @@ -91,6 +92,12 @@ export default { | |||||
| }) | }) | ||||
| this.Post(data,topics) | this.Post(data,topics) | ||||
| this.$set(this.showInitTopic,item,false) | this.$set(this.showInitTopic,item,false) | ||||
| if(this.arrayTopics.length===0){ | |||||
| console.log("set empty") | |||||
| $('#repo-topics1').append('<span class="no-description text-italic">暂无标签</span>') | |||||
| }else{ | |||||
| $('#repo-topics1').children('span').remove() | |||||
| } | |||||
| } | } | ||||
| @@ -190,21 +197,34 @@ export default { | |||||
| }) | }) | ||||
| }, | }, | ||||
| postTopic(){ | postTopic(){ | ||||
| const patter = /^[\u4e00-\u9fa5a-z0-9][\u4e00-\u9fa5a-zA-Z0-9-]{0,35}$/ | |||||
| let regexp = patter.test(this.input) | |||||
| console.log("regexp",regexp) | |||||
| if(!regexp){ | |||||
| this.$notify({ | |||||
| message: '主题必须以中文、字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符', | |||||
| duration: 3000, | |||||
| type:'error' | |||||
| }); | |||||
| return | |||||
| }else{ | |||||
| let topic = this.input | |||||
| this.arrayTopics.push(topic) | |||||
| let topics = this.arrayTopics | |||||
| let strTopics = topics.join(',') | |||||
| let data = this.qs.stringify({ | |||||
| _csrf:csrf, | |||||
| topics:strTopics | |||||
| }) | |||||
| this.Post(data,topics) | |||||
| $('#repo-topics1').children('span').remove() | |||||
| this.showInputValue = false | |||||
| this.showAddTopic = true | |||||
| this.showAddFlage = true | |||||
| } | |||||
| let topic = this.input | |||||
| this.arrayTopics.push(topic) | |||||
| let topics = this.arrayTopics | |||||
| let strTopics = topics.join(',') | |||||
| let data = this.qs.stringify({ | |||||
| _csrf:csrf, | |||||
| topics:strTopics | |||||
| }) | |||||
| this.Post(data,topics) | |||||
| this.showInputValue = false | |||||
| this.showAddTopic = true | |||||
| this.showAddFlage = true | |||||
| }, | }, | ||||
| addPostTopic(){ | addPostTopic(){ | ||||
| @@ -218,7 +238,13 @@ export default { | |||||
| topics:strTopics | topics:strTopics | ||||
| }) | }) | ||||
| this.Post(data,topics) | this.Post(data,topics) | ||||
| if(this.arrayTopics.length===0){ | |||||
| console.log("add postTopic") | |||||
| $('#repo-topics1').append('<span class="no-description text-italic">暂无标签</span>') | |||||
| }else{ | |||||
| $('#repo-topics1').children('span').remove() | |||||
| } | |||||
| } | } | ||||
| else if(!this.showAddFlage){ | else if(!this.showAddFlage){ | ||||
| let topic = this.input | let topic = this.input | ||||
| @@ -231,6 +257,7 @@ export default { | |||||
| topics:strTopics | topics:strTopics | ||||
| }) | }) | ||||
| this.Post(data,topics) | this.Post(data,topics) | ||||
| $('#repo-topics1').children('span').remove() | |||||
| } | } | ||||
| this.showAddFlage = !this.showAddFlage | this.showAddFlage = !this.showAddFlage | ||||
| }, | }, | ||||
| @@ -245,6 +272,27 @@ export default { | |||||
| editDiv.css('display', ''); // show Semantic UI Grid | editDiv.css('display', ''); // show Semantic UI Grid | ||||
| this.input = '' | this.input = '' | ||||
| if (this.input === ''){ | |||||
| this.array = this.arrayTopics | |||||
| let data = [] | |||||
| this.showInitTopic = [] | |||||
| this.array.forEach((element,index) => { | |||||
| let item = {} | |||||
| item.topic_name = element | |||||
| data.push(item) | |||||
| this.showInitTopic.push(true) | |||||
| }); | |||||
| this.array = data | |||||
| this.showInputValue = false | |||||
| this.showSearchTopic = true | |||||
| } | |||||
| stopPropagation(e); | stopPropagation(e); | ||||
| @@ -310,7 +358,10 @@ mounted() { | |||||
| context.arrayTopics.push($(this).text()) | context.arrayTopics.push($(this).text()) | ||||
| }); | }); | ||||
| if(this.arrayTopics.length===0){ | |||||
| $('#repo-topics1').append('<span class="no-description text-italic">暂无标签</span>') | |||||
| } | |||||
| this.changeValue() | this.changeValue() | ||||
| } , | } , | ||||
| created(){ | created(){ | ||||
| @@ -220,3 +220,16 @@ footer .column{margin-bottom:0!important; padding-bottom:0!important;} | |||||
| .ui.vertical.menu .dropdown.item .menu { | .ui.vertical.menu .dropdown.item .menu { | ||||
| left: 50%; | left: 50%; | ||||
| } | } | ||||
| // icon cloudbrain | |||||
| .i-round{display:inline-block;width:18px;height:18px;background:url("/img/icons.svg");background-position: -496px -52px;} | |||||
| .i-bg-organ{background-position: -496px -52px;} | |||||
| .i-bg-stop{background-position: -459px -52px;} | |||||
| .i-bg-running{background-position: -478px -52px;} | |||||
| .i-bg-orange{background-position: -495px -51px;} | |||||
| .i-bg-red{background-position: -532px -52px;} | |||||
| .i-bg-green{background-position: -441px -52px;} | |||||
| .i-bg-used{background-position: -514px -52px;} | |||||
| .icon-bind{background-position: -550px -52px;} | |||||
| .icon-unbind{background-position: -568px -52px;} | |||||
| .showCircle{display:inline-block;background-image:url('/img/loading.gif');background-repeat:no-repeat;width:16px;height:16px;background-size:16px 16px;margin-right:5px;} | |||||