mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-01 03:24:14 +08:00
fix: Fix the problem of duplicate content display in the model list (#7872)
This commit is contained in:
parent
53b1a7af4c
commit
367a74503f
@ -3,7 +3,6 @@ package service
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/1Panel-dev/1Panel/backend/app/dto/request"
|
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
@ -11,6 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/1Panel-dev/1Panel/backend/app/dto"
|
"github.com/1Panel-dev/1Panel/backend/app/dto"
|
||||||
|
"github.com/1Panel-dev/1Panel/backend/app/dto/request"
|
||||||
"github.com/1Panel-dev/1Panel/backend/buserr"
|
"github.com/1Panel-dev/1Panel/backend/buserr"
|
||||||
"github.com/1Panel-dev/1Panel/backend/constant"
|
"github.com/1Panel-dev/1Panel/backend/constant"
|
||||||
"github.com/1Panel-dev/1Panel/backend/global"
|
"github.com/1Panel-dev/1Panel/backend/global"
|
||||||
@ -56,7 +56,7 @@ func (u *AIToolService) Search(req dto.SearchWithPage) (int64, []dto.OllamaModel
|
|||||||
if parts[0] == "NAME" {
|
if parts[0] == "NAME" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
modelMaps[parts[0]] = struct{}{}
|
modelMaps[strings.ReplaceAll(parts[0], ":", "-")] = struct{}{}
|
||||||
list = append(list, dto.OllamaModelInfo{Name: parts[0], Size: parts[2] + " " + parts[3], Modified: strings.Join(parts[4:], " ")})
|
list = append(list, dto.OllamaModelInfo{Name: parts[0], Size: parts[2] + " " + parts[3], Modified: strings.Join(parts[4:], " ")})
|
||||||
}
|
}
|
||||||
entries, _ := os.ReadDir(path.Join(global.CONF.System.DataDir, "log", "AITools"))
|
entries, _ := os.ReadDir(path.Join(global.CONF.System.DataDir, "log", "AITools"))
|
||||||
|
@ -1150,17 +1150,17 @@ func GetAllowIps(website model.Website) []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ConfigAIProxy(website model.Website) error {
|
func ConfigAIProxy(website model.Website) error {
|
||||||
nginxFull, err := getNginxFull(&website)
|
// nginxFull, err := getNginxFull(&website)
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
return nil
|
// return nil
|
||||||
}
|
// }
|
||||||
config := nginxFull.SiteConfig.Config
|
// config := nginxFull.SiteConfig.Config
|
||||||
server := config.FindServers()[0]
|
// server := config.FindServers()[0]
|
||||||
dirs := server.GetDirectives()
|
// dirs := server.GetDirectives()
|
||||||
for _, dir := range dirs {
|
// for _, dir := range dirs {
|
||||||
if dir.GetName() == "location" && dir.GetParameters()[0] == "/" {
|
// if dir.GetName() == "location" && dir.GetParameters()[0] == "/" {
|
||||||
server.UpdateRootProxy()
|
// // server.UpdateRootProxy()
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -58,9 +58,15 @@
|
|||||||
>
|
>
|
||||||
<el-table-column :label="$t('commons.table.name')" prop="name" min-width="90">
|
<el-table-column :label="$t('commons.table.name')" prop="name" min-width="90">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-text type="primary" class="cursor-pointer" @click="onLoad(row.name)">
|
<el-text
|
||||||
|
v-if="row.size !== '-'"
|
||||||
|
type="primary"
|
||||||
|
class="cursor-pointer"
|
||||||
|
@click="onLoad(row.name)"
|
||||||
|
>
|
||||||
{{ row.name }}
|
{{ row.name }}
|
||||||
</el-text>
|
</el-text>
|
||||||
|
<span v-else>{{ row.name }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('file.size')" prop="size" />
|
<el-table-column :label="$t('file.size')" prop="size" />
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
:placeholder="'172.16.10.10:8081'"
|
:placeholder="'172.16.10.10:8081'"
|
||||||
></el-input>
|
></el-input>
|
||||||
<span v-if="dialogData.rowData!.downloadUrl" class="input-help">
|
<span v-if="dialogData.rowData!.downloadUrl" class="input-help">
|
||||||
Pull example: docker pull {{ dialogData.rowData!.downloadUrl }}/nginx
|
docker pull {{ dialogData.rowData!.downloadUrl }}/nginx
|
||||||
</span>
|
</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('commons.table.protocol')" prop="protocol">
|
<el-form-item :label="$t('commons.table.protocol')" prop="protocol">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user