fix: resolve incorrect container filter condition when redirecting applications (#10971)

This commit is contained in:
CityFun 2025-11-17 11:44:32 +08:00 committed by GitHub
parent b9367abfb9
commit a4d77a1cc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 13 additions and 6 deletions

View file

@ -130,6 +130,7 @@ type AppInstallDTO struct {
Container string `json:"container"`
IsEdit bool `json:"isEdit"`
LinkDB bool `json:"linkDB"`
ServiceName string `json:"serviceName"`
}
type AppInstallInfo struct {

View file

@ -450,10 +450,11 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
}
index++
}
if app.Limit == 0 && appInstall.Name != serviceName && len(servicesMap) == 1 {
servicesMap[appInstall.Name] = servicesMap[serviceName]
newServiceName := strings.ToLower(appInstall.Name)
if app.Limit == 0 && newServiceName != serviceName && len(servicesMap) == 1 {
servicesMap[newServiceName] = servicesMap[serviceName]
delete(servicesMap, serviceName)
serviceName = appInstall.Name
serviceName = newServiceName
}
appInstall.ServiceName = serviceName

View file

@ -1567,8 +1567,9 @@ func handleInstalled(appInstallList []model.AppInstall, updated bool, sync bool)
Website: installed.App.Website,
Document: installed.App.Document,
},
Favorite: installed.Favorite,
Container: installed.ContainerName,
Favorite: installed.Favorite,
Container: installed.ContainerName,
ServiceName: strings.ToLower(installed.ServiceName),
}
if !updated {
installDTO.LinkDB = hasLinkDB(installed.ID)

View file

@ -151,6 +151,7 @@ export namespace App {
app: App;
webUI: string;
appKey?: string;
serviceName: string;
}
export interface AppInstalledInfo {

View file

@ -702,7 +702,10 @@ const buttons = [
];
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) => {