mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 16:29:17 +08:00
fix: 优化版本排序 (#2322)
This commit is contained in:
parent
8faa3b6e51
commit
6cd00a072d
@ -435,7 +435,7 @@ func (a *AppInstallService) GetServices(key string) ([]response.AppService, erro
|
|||||||
for _, db := range dbs {
|
for _, db := range dbs {
|
||||||
service := response.AppService{
|
service := response.AppService{
|
||||||
Label: db.Name,
|
Label: db.Name,
|
||||||
Value: strconv.Itoa(int(db.ID)),
|
Value: db.Name,
|
||||||
}
|
}
|
||||||
if db.AppInstallID > 0 {
|
if db.AppInstallID > 0 {
|
||||||
install, err := appInstallRepo.GetFirst(commonRepo.WithByID(db.AppInstallID))
|
install, err := appInstallRepo.GetFirst(commonRepo.WithByID(db.AppInstallID))
|
||||||
|
@ -24,6 +24,17 @@ func CompareVersion(version1 string, version2 string) bool {
|
|||||||
version1s := strings.Split(version1, ".")
|
version1s := strings.Split(version1, ".")
|
||||||
version2s := strings.Split(version2, ".")
|
version2s := strings.Split(version2, ".")
|
||||||
|
|
||||||
|
if len(version2s) > len(version1s) {
|
||||||
|
for i := 0; i < len(version2s)-len(version1s); i++ {
|
||||||
|
version1s = append(version1s, "0")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if len(version1s) > len(version2s) {
|
||||||
|
for i := 0; i < len(version1s)-len(version2s); i++ {
|
||||||
|
version2s = append(version2s, "0")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
n := min(len(version1s), len(version2s))
|
n := min(len(version1s), len(version2s))
|
||||||
re := regexp.MustCompile("[0-9]+")
|
re := regexp.MustCompile("[0-9]+")
|
||||||
for i := 0; i < n; i++ {
|
for i := 0; i < n; i++ {
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!data.isExist && !isDB">
|
<div v-if="!data.isExist && !isDB()">
|
||||||
<LayoutContent :title="getTitle(key)" :divider="true">
|
<LayoutContent :title="getTitle(key)" :divider="true">
|
||||||
<template #main>
|
<template #main>
|
||||||
<div class="app-warn">
|
<div class="app-warn">
|
||||||
@ -135,7 +135,7 @@ const goRouter = async (key: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isDB = () => {
|
const isDB = () => {
|
||||||
return key.value === 'mysql' || key.value === 'mysql';
|
return key.value === 'mysql' || key.value === 'mariadb';
|
||||||
};
|
};
|
||||||
|
|
||||||
const onCheck = async () => {
|
const onCheck = async () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user