|
|
@@ -24,6 +24,7 @@ |
|
|
|
.ti-text-form-content { |
|
|
|
line-height: 30px; |
|
|
|
padding-bottom: 20px; |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
.change-version{ |
|
|
|
min-width: auto !important; |
|
|
@@ -48,6 +49,13 @@ |
|
|
|
width:100%; |
|
|
|
table-layout: fixed; |
|
|
|
} |
|
|
|
.iword-elipsis{ |
|
|
|
display: inline-block; |
|
|
|
width: 80%; |
|
|
|
overflow: hidden; |
|
|
|
text-overflow: ellipsis; |
|
|
|
white-space: nowrap; |
|
|
|
} |
|
|
|
</style> |
|
|
|
<div class="ui container"> |
|
|
|
<h4 class="ui header" id="vertical-segment"> |
|
|
@@ -80,9 +88,10 @@ function changeInfo(version){ |
|
|
|
}) |
|
|
|
let initObj = transObj(versionData)[0] |
|
|
|
let initModelAcc = transObj(versionData)[1] |
|
|
|
let id= transObj(data)[2] |
|
|
|
console.log("=======",initObj,initModelAcc) |
|
|
|
$('#showInfo').empty() |
|
|
|
renderInfo(initObj,initModelAcc) |
|
|
|
renderInfo(initObj,initModelAcc,id) |
|
|
|
}) |
|
|
|
} |
|
|
|
function loadInfo(){ |
|
|
@@ -94,11 +103,12 @@ function loadInfo(){ |
|
|
|
$('#dropdown').append(html) |
|
|
|
let initObj = transObj(data)[0] |
|
|
|
let initModelAcc = transObj(data)[1] |
|
|
|
renderInfo(initObj,initModelAcc) |
|
|
|
let id= transObj(data)[2] |
|
|
|
renderInfo(initObj,initModelAcc,id) |
|
|
|
}) |
|
|
|
} |
|
|
|
function transObj(data){ |
|
|
|
let {Name,Version,Label,Size,Description,CreatedUnix,Accuracy} = data[0] |
|
|
|
let {ID,Name,Version,Label,Size,Description,CreatedUnix,Accuracy} = data[0] |
|
|
|
let modelAcc = JSON.parse(Accuracy) |
|
|
|
let size = tranSize(Size) |
|
|
|
let time = transTime(CreatedUnix) |
|
|
@@ -116,7 +126,7 @@ function transObj(data){ |
|
|
|
Precision:modelAcc.Precision || '--', |
|
|
|
Recall: modelAcc.Recall || '--' |
|
|
|
} |
|
|
|
return [initObj,initModelAcc] |
|
|
|
return [initObj,initModelAcc,ID] |
|
|
|
|
|
|
|
} |
|
|
|
function transTime(time){ |
|
|
@@ -141,7 +151,33 @@ function tranSize(value){ |
|
|
|
size=size.toFixed(2);//保留的小数位数 |
|
|
|
return size+unitArr[index]; |
|
|
|
} |
|
|
|
function renderInfo(obj,accObj){ |
|
|
|
function editorFn(text,id){ |
|
|
|
console.log("----",text,id) |
|
|
|
$('#edit-td').replaceWith("<div id='edit-div' style='width:80%;display: inline-block;'><textarea id='textarea-value' rows='3' maxlength='255' style='width:80%;' id='edit-text'></textarea><i class='check icon' onclick='editorSure(\"" + text + "\",\"" + id + "\")'></i><i class='times icon' onclick='editorCancel(\"" + text + "\")'></i></div>"); |
|
|
|
|
|
|
|
} |
|
|
|
function editorCancel(text){ |
|
|
|
$('#edit-div').replaceWith('<span id="edit-td" class="iword-elipsis">'+text+'</span>') |
|
|
|
} |
|
|
|
function editorSure(text,id){ |
|
|
|
console.log("-------text,id",id) |
|
|
|
|
|
|
|
let description=$('#textarea-value').val() |
|
|
|
let data = { |
|
|
|
ID:id, |
|
|
|
Description:description |
|
|
|
} |
|
|
|
// $.put(`${url}show_model_info_api?name=${ID}`,(data)={ |
|
|
|
|
|
|
|
// }) |
|
|
|
$.ajax({ |
|
|
|
url:`${url}modify_model`, |
|
|
|
type:'PUT', |
|
|
|
data:data |
|
|
|
}).done((res)=>{console.log(res)}) |
|
|
|
|
|
|
|
} |
|
|
|
function renderInfo(obj,accObj,id){ |
|
|
|
let html = '' |
|
|
|
html += '<div class="half-table">' |
|
|
|
html += '<span class="model_header_text">基本信息</span>' |
|
|
@@ -150,7 +186,13 @@ function renderInfo(obj,accObj){ |
|
|
|
for(let key in obj){ |
|
|
|
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">${obj[key]}</td>` |
|
|
|
if(key==="Description"){ |
|
|
|
let description = obj[key] |
|
|
|
html += '<td class="ti-text-form-content" ><span id="edit-td" class="iword-elipsis">'+description+'</span><i class="pencil alternate icon" style="cursor:pointer;vertical-align: top;" id="editor" onclick="editorFn(\'' + description + '\',\'' + id + '\')"></td>' |
|
|
|
// html += '<td class="ti-text-form-content iword-elipsis"><i class="pencil alternate icon" style="cursor:pointer" id="editor" onclick="editorFn()"></i></td>' |
|
|
|
}else{ |
|
|
|
html += `<td class="ti-text-form-content word-elipsis">${obj[key]}</td>` |
|
|
|
} |
|
|
|
html += '</tr>' |
|
|
|
} |
|
|
|
|
|
|
|