mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-18 13:29:03 +08:00
fix: resolve incorrect container filter condition when redirecting applications (#10971)
This commit is contained in:
parent
b9367abfb9
commit
a4d77a1cc2
5 changed files with 13 additions and 6 deletions
|
|
@ -130,6 +130,7 @@ type AppInstallDTO struct {
|
||||||
Container string `json:"container"`
|
Container string `json:"container"`
|
||||||
IsEdit bool `json:"isEdit"`
|
IsEdit bool `json:"isEdit"`
|
||||||
LinkDB bool `json:"linkDB"`
|
LinkDB bool `json:"linkDB"`
|
||||||
|
ServiceName string `json:"serviceName"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type AppInstallInfo struct {
|
type AppInstallInfo struct {
|
||||||
|
|
|
||||||
|
|
@ -450,10 +450,11 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
|
||||||
}
|
}
|
||||||
index++
|
index++
|
||||||
}
|
}
|
||||||
if app.Limit == 0 && appInstall.Name != serviceName && len(servicesMap) == 1 {
|
newServiceName := strings.ToLower(appInstall.Name)
|
||||||
servicesMap[appInstall.Name] = servicesMap[serviceName]
|
if app.Limit == 0 && newServiceName != serviceName && len(servicesMap) == 1 {
|
||||||
|
servicesMap[newServiceName] = servicesMap[serviceName]
|
||||||
delete(servicesMap, serviceName)
|
delete(servicesMap, serviceName)
|
||||||
serviceName = appInstall.Name
|
serviceName = newServiceName
|
||||||
}
|
}
|
||||||
appInstall.ServiceName = serviceName
|
appInstall.ServiceName = serviceName
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1567,8 +1567,9 @@ func handleInstalled(appInstallList []model.AppInstall, updated bool, sync bool)
|
||||||
Website: installed.App.Website,
|
Website: installed.App.Website,
|
||||||
Document: installed.App.Document,
|
Document: installed.App.Document,
|
||||||
},
|
},
|
||||||
Favorite: installed.Favorite,
|
Favorite: installed.Favorite,
|
||||||
Container: installed.ContainerName,
|
Container: installed.ContainerName,
|
||||||
|
ServiceName: strings.ToLower(installed.ServiceName),
|
||||||
}
|
}
|
||||||
if !updated {
|
if !updated {
|
||||||
installDTO.LinkDB = hasLinkDB(installed.ID)
|
installDTO.LinkDB = hasLinkDB(installed.ID)
|
||||||
|
|
|
||||||
|
|
@ -151,6 +151,7 @@ export namespace App {
|
||||||
app: App;
|
app: App;
|
||||||
webUI: string;
|
webUI: string;
|
||||||
appKey?: string;
|
appKey?: string;
|
||||||
|
serviceName: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AppInstalledInfo {
|
export interface AppInstalledInfo {
|
||||||
|
|
|
||||||
|
|
@ -702,7 +702,10 @@ const buttons = [
|
||||||
];
|
];
|
||||||
|
|
||||||
const toContainer = async (row: App.AppInstalled) => {
|
const toContainer = async (row: App.AppInstalled) => {
|
||||||
routerToNameWithQuery('ContainerItem', { filters: 'com.docker.compose.project=' + row.name, uncached: true });
|
routerToNameWithQuery('ContainerItem', {
|
||||||
|
filters: 'com.docker.compose.project=' + row.serviceName,
|
||||||
|
uncached: true,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const openBackups = (row: App.AppInstalled) => {
|
const openBackups = (row: App.AppInstalled) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue