mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-02-16 10:53:05 +08:00
fix: Fix the problem of duplicate content display in the model list (#7872)
Some checks failed
SonarCloud Scan / SonarCloud (push) Failing after 1s
Some checks failed
SonarCloud Scan / SonarCloud (push) Failing after 1s
This commit is contained in:
parent
53b1a7af4c
commit
367a74503f
4 changed files with 22 additions and 16 deletions
|
@ -3,7 +3,6 @@ package service
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/1Panel-dev/1Panel/backend/app/dto/request"
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
|
@ -11,6 +10,7 @@ import (
|
|||
"strings"
|
||||
|
||||
"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/constant"
|
||||
"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" {
|
||||
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:], " ")})
|
||||
}
|
||||
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 {
|
||||
nginxFull, err := getNginxFull(&website)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
config := nginxFull.SiteConfig.Config
|
||||
server := config.FindServers()[0]
|
||||
dirs := server.GetDirectives()
|
||||
for _, dir := range dirs {
|
||||
if dir.GetName() == "location" && dir.GetParameters()[0] == "/" {
|
||||
server.UpdateRootProxy()
|
||||
}
|
||||
}
|
||||
// nginxFull, err := getNginxFull(&website)
|
||||
// if err != nil {
|
||||
// return nil
|
||||
// }
|
||||
// config := nginxFull.SiteConfig.Config
|
||||
// server := config.FindServers()[0]
|
||||
// dirs := server.GetDirectives()
|
||||
// for _, dir := range dirs {
|
||||
// if dir.GetName() == "location" && dir.GetParameters()[0] == "/" {
|
||||
// // server.UpdateRootProxy()
|
||||
// }
|
||||
// }
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -58,9 +58,15 @@
|
|||
>
|
||||
<el-table-column :label="$t('commons.table.name')" prop="name" min-width="90">
|
||||
<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 }}
|
||||
</el-text>
|
||||
<span v-else>{{ row.name }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('file.size')" prop="size" />
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
:placeholder="'172.16.10.10:8081'"
|
||||
></el-input>
|
||||
<span v-if="dialogData.rowData!.downloadUrl" class="input-help">
|
||||
Pull example: docker pull {{ dialogData.rowData!.downloadUrl }}/nginx
|
||||
docker pull {{ dialogData.rowData!.downloadUrl }}/nginx
|
||||
</span>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('commons.table.protocol')" prop="protocol">
|
||||
|
|
Loading…
Reference in a new issue