Browse Source

解决相关问题

Signed-off-by: zouap <zouap@pcl.ac.cn>
pull/2682/head
zouap 2 years ago
parent
commit
402194e455
2 changed files with 17 additions and 18 deletions
  1. +16
    -17
      routers/search.go
  2. +1
    -1
      templates/repo/modelmanage/showinfo.tmpl

+ 16
- 17
routers/search.go View File

@@ -349,25 +349,24 @@ func searchRepo(ctx *context.Context, TableName string, Key string, Page int, Pa

func setForkRepoOrder(esresult *SearchRes, SortBy string) {
if SortBy == "default" || SortBy == "" {
return
}
forkidMap := make(map[string]int, 0)
for index, re := range esresult.Result {
if re["fork_id"] != nil {
fork_id := re["fork_id"].(string)
if _, ok := forkidMap[fork_id]; !ok {
forkidMap[fork_id] = index
forkidMap := make(map[string]int, 0)
for index, re := range esresult.Result {
if re["fork_id"] != nil {
fork_id := re["fork_id"].(string)
if _, ok := forkidMap[fork_id]; !ok {
forkidMap[fork_id] = index
}
}
}
}
for key, value := range forkidMap {
for index, re := range esresult.Result {
if re["id"].(string) == key {
if value < index { //swap
tmp := esresult.Result[index]
esresult.Result[index] = esresult.Result[value]
esresult.Result[value] = tmp
break
for key, value := range forkidMap {
for index, re := range esresult.Result {
if re["id"].(string) == key {
if value < index { //swap
tmp := esresult.Result[index]
esresult.Result[index] = esresult.Result[value]
esresult.Result[value] = tmp
break
}
}
}
}


+ 1
- 1
templates/repo/modelmanage/showinfo.tmpl View File

@@ -127,7 +127,7 @@
<tr>
<td class="ti-text-form-label text-width80">训练任务</td>
<td class="ti-text-form-content word-elipsis">
<a id="DisplayJobNameHref" class="title" style="font-size: 14px;">
<a id="DisplayJobNameHref" class="title" style="font-size: 14px;" target="_blank">
<span id="DisplayJobName" class="fitted" style="width: 90%;vertical-align: middle;"></span>
</a>
</td>


Loading…
Cancel
Save