| @@ -474,12 +474,16 @@ func ShowModelPageInfo(ctx *context.Context) { | |||
| if page <= 0 { | |||
| page = 1 | |||
| } | |||
| pageSize := ctx.QueryInt("pageSize") | |||
| if pageSize <= 0 { | |||
| pageSize = setting.UI.IssuePagingNum | |||
| } | |||
| repoId := ctx.Repo.Repository.ID | |||
| Type := -1 | |||
| modelResult, count, err := models.QueryModel(&models.AiModelQueryOptions{ | |||
| ListOptions: models.ListOptions{ | |||
| Page: page, | |||
| PageSize: setting.UI.IssuePagingNum, | |||
| PageSize: pageSize, | |||
| }, | |||
| RepoID: repoId, | |||
| Type: Type, | |||
| @@ -1,20 +1,5 @@ | |||
| <!-- 头部导航栏 --> | |||
| {{template "base/head" .}} | |||
| <style> | |||
| .width70{ | |||
| width: 70% !important; | |||
| } | |||
| .width83{ | |||
| width: 83% !important; | |||
| } | |||
| .content-padding{ | |||
| padding: 40px !important; | |||
| } | |||
| .model_disabled{ | |||
| background-color: rgba(245, 245, 246, 100) !important; | |||
| color: rgba(136, 136, 136, 100) !important; | |||
| } | |||
| </style> | |||
| <!-- 弹窗 --> | |||
| <div id="mask"> | |||
| <div id="loadingPage"> | |||
| @@ -34,7 +19,7 @@ | |||
| <!-- 列表容器 --> | |||
| <div class="ui container active loader" id="loadContainer"> | |||
| {{template "base/alert" .}} | |||
| <div class="ui two column stackable grid "> | |||
| <div class="ui two column stackable grid" style="display: none;"> | |||
| <div class="column"></div> | |||
| <div class="column right aligned"> | |||
| <!-- --> | |||
| @@ -43,7 +28,7 @@ | |||
| </div> | |||
| <!-- 中下列表展示区 --> | |||
| <div class="ui grid"> | |||
| <div class="ui grid" style="display: none;"> | |||
| <div class="row" style="padding-top: 0;"> | |||
| <div class="ui sixteen wide column"> | |||
| <!-- 任务展示 --> | |||
| @@ -238,68 +223,5 @@ | |||
| $(".ui.dropdown.selection.search.width70").removeClass("loading") | |||
| }) | |||
| } | |||
| // function check(){ | |||
| // let jobid = document.getElementById("JobId").value | |||
| // let versionname = document.getElementById("VersionName").value | |||
| // let name= document.getElementById("name").value | |||
| // let version= document.getElementById("version").value | |||
| // if(jobid==""){ | |||
| // $(".required.ten.wide.field").addClass("error") | |||
| // return false | |||
| // }else{ | |||
| // $(".required.ten.wide.field").removeClass("error") | |||
| // } | |||
| // if(versionname==""){ | |||
| // $(".required.six.widde.field").addClass("error") | |||
| // return false | |||
| // }else{ | |||
| // $(".required.six.widde.field").removeClass("error") | |||
| // } | |||
| // if(name==""){ | |||
| // $("#modelname").addClass("error") | |||
| // return false | |||
| // }else{ | |||
| // $("#modelname").removeClass("error") | |||
| // } | |||
| // if(versionname==""){ | |||
| // $("#verionname").addClass("error") | |||
| // return false | |||
| // }else{ | |||
| // $("#verionname").removeClass("error") | |||
| // } | |||
| // return true | |||
| // } | |||
| // $('#submitId').click(function(){ | |||
| // let flag=check() | |||
| // if(flag){ | |||
| // let data = $("#formId").serialize() | |||
| // $("#mask").css({"display":"block","z-index":"9999"}) | |||
| // $.ajax({ | |||
| // url:url_href, | |||
| // type:'POST', | |||
| // data:data, | |||
| // success:function(res){ | |||
| // $('.ui.modal.second').modal('hide') | |||
| // window.location.href=location.href | |||
| // }, | |||
| // error: function(xhr){ | |||
| // // 隐藏 loading | |||
| // // 只有请求不正常(状态码不为200)才会执行 | |||
| // console.log("-------------",xhr) | |||
| // $('.ui.error.message').text(xhr.responseText) | |||
| // $('.ui.error.message').css('display','block') | |||
| // }, | |||
| // complete:function(xhr){ | |||
| // $("#mask").css({"display":"none","z-index":"1"}) | |||
| // } | |||
| // }) | |||
| // }else{ | |||
| // return false | |||
| // } | |||
| // }) | |||
| </script> | |||
| @@ -92,7 +92,13 @@ | |||
| </tr> | |||
| <tr> | |||
| <td class="ti-text-form-label text-width80">标签</td> | |||
| <td class="ti-text-form-content word-elipsis"><span id="Label" title=""></span></td> | |||
| <td class="ti-text-form-content"> | |||
| <div id="Label"> | |||
| </div> | |||
| </td> | |||
| </tr> | |||
| <tr> | |||
| <td class="ti-text-form-label text-width80">大小</td> | |||
| @@ -231,20 +237,24 @@ function editorSure(text,id){ | |||
| }).done((res)=>{ | |||
| $('#edit-div').replaceWith(`<div id="edit-td" style="display:flex;"><span id="Description" title="${description}" class="iword-elipsis">${description}</span><i id="edit-pencil" data-id="${id}" data-desc="${description}" class="pencil alternate icon" style="cursor:pointer;vertical-align: top;" id="editor" onclick="editorFn(this)"></div>`) | |||
| }) | |||
| } | |||
| function renderInfo(obj,accObj,id){ | |||
| for(let key in obj){ | |||
| if(key==="Description"){ | |||
| $(`#${key}`).text(obj[key]) | |||
| $(`#${key}`).attr("title",obj[key]) | |||
| $('#edit-pencil').attr("data-id",id) | |||
| $('#edit-pencil').attr("data-desc",obj[key]) | |||
| }else{ | |||
| } | |||
| else if(key==="Label"){ | |||
| let labelArray = obj[key].split(' ') | |||
| let html='' | |||
| for(let i=0;i<labelArray.length;i++){ | |||
| html += `<a class="ui label">${labelArray[i]}</a>` | |||
| } | |||
| $('#Label').append(html) | |||
| } | |||
| else{ | |||
| $(`#${key}`).text(obj[key]) | |||
| $(`#${key}`).attr("title",obj[key]) | |||
| } | |||
| @@ -254,41 +264,6 @@ function renderInfo(obj,accObj,id){ | |||
| $(`#${key}`).text(accObj[key]) | |||
| $(`#${key}`).attr("title",accObj[key]) | |||
| } | |||
| // let html = '' | |||
| // html += '<div class="half-table">' | |||
| // html += '<span class="model_header_text">基本信息</span>' | |||
| // html += '<table class="tableStyle" style="margin-top:20px;">' | |||
| // html += '<tbody>' | |||
| // for(let key in obj){ | |||
| // html += '<tr style="font-size: 12px;">' | |||
| // html += `<td class="ti-text-form-label text-width80">${key}</td>` | |||
| // if(key==="Description"){ | |||
| // let description = obj[key] | |||
| // html += '<td class="ti-text-form-content" ><div id="edit-td" style="display:flex"><span title="\'' + description + '\'" class="iword-elipsis">'+description+'</span><i class="pencil alternate icon" style="cursor:pointer;vertical-align: top;" id="editor" onclick="editorFn(\'' + description + '\',\'' + id + '\')"></div></td>' | |||
| // }else{ | |||
| // html += `<td class="ti-text-form-content word-elipsis"><span title="${obj[key]}">${obj[key]}</span></td>` | |||
| // } | |||
| // html += '</tr>' | |||
| // } | |||
| // html += '</tbody>' | |||
| // html += '</table>' | |||
| // html += '</div>' | |||
| // html += '<div class="half-table">' | |||
| // html += '<span class="model_header_text">模型精度</span>' | |||
| // html += '<table class="tableStyle" style="margin-top:20px;">' | |||
| // html += '<tbody>' | |||
| // for(let key in accObj){ | |||
| // html += '<tr style="font-size: 12px;">' | |||
| // html += `<td class="ti-text-form-label text-width80">${key}</td>` | |||
| // html += `<td class="ti-text-form-content word-elipsis">${accObj[key]}</td>` | |||
| // html += '</tr>' | |||
| // } | |||
| // html += '</tbody>' | |||
| // html += '</table>' | |||
| // html += '</div>' | |||
| // html += '<div style="clear: both;"></div>' | |||
| // $('#showInfo').append(html) | |||
| } | |||
| </script> | |||
| @@ -119,7 +119,7 @@ | |||
| @size-change="handleSizeChange" | |||
| @current-change="handleCurrentChange" | |||
| :current-page="currentPage" | |||
| :page-sizes="[10]" | |||
| :page-sizes="[5,10,15]" | |||
| :page-size="pageSize" | |||
| layout="total, sizes, prev, pager, next, jumper" | |||
| :total="totalNum"> | |||
| @@ -180,7 +180,7 @@ export default { | |||
| } | |||
| }, | |||
| handleSizeChange(val){ | |||
| this.params.size = val | |||
| this.params.pageSize = val | |||
| this.getModelList() | |||
| }, | |||
| handleCurrentChange(val){ | |||
| @@ -246,7 +246,7 @@ export default { | |||
| submit(){ | |||
| let context = this | |||
| let flag= this.check() | |||
| console.log(flag) | |||
| console.log(flag,context) | |||
| if(flag){ | |||
| let data = $("#formId").serialize() | |||
| $("#mask").css({"display":"block","z-index":"9999"}) | |||
| @@ -255,13 +255,12 @@ export default { | |||
| type:'POST', | |||
| data:data, | |||
| success:function(res){ | |||
| context.getModelList() | |||
| $('.ui.modal.second').modal('hide') | |||
| console.log(res) | |||
| }, | |||
| error: function(xhr){ | |||
| // 隐藏 loading | |||
| // 只有请求不正常(状态码不为200)才会执行 | |||
| console.log("-------------",xhr,context) | |||
| $('.ui.error.message').text(xhr.responseText) | |||
| $('.ui.error.message').css('display','block') | |||
| }, | |||
| @@ -327,6 +326,7 @@ export default { | |||
| this.$axios.get(location.href+'_api',{ | |||
| params:this.params | |||
| }).then((res)=>{ | |||
| $(".ui.grid").removeAttr("style") | |||
| $("#loadContainer").removeClass("loader") | |||
| let TrainTaskInfo | |||
| this.tableData = res.data.data | |||
| @@ -4124,4 +4124,10 @@ function initDropDown() { | |||
| $("#dropdown_explore").dropdown({ | |||
| on:'hover' ,//鼠标悬浮显示,默认值是click | |||
| }); | |||
| } | |||
| } | |||
| //云脑提示 | |||
| $('.question.circle.icon').hover(function(){ | |||
| $(this).popup('show') | |||
| $('.ui.popup.mini.top.center').css({"border-color":'rgba(50, 145, 248, 100)',"color":"rgba(3, 102, 214, 100)","border-radius":"5px","border-shadow":"none"}) | |||
| }); | |||
| @@ -518,4 +518,17 @@ display: block; | |||
| } | |||
| .letf2{ | |||
| margin-left: -2px; | |||
| } | |||
| .width70{ | |||
| width: 70% !important; | |||
| } | |||
| .width83{ | |||
| width: 83% !important; | |||
| } | |||
| .content-padding{ | |||
| padding: 40px !important; | |||
| } | |||
| .model_disabled{ | |||
| background-color: rgba(245, 245, 246, 100) !important; | |||
| color: rgba(136, 136, 136, 100) !important; | |||
| } | |||