@@ -224,12 +224,16 @@ func loadApps(fileOp fileUtils.FileOp) ([]dto.DataTree, error) {
224224 appTreeMap := make (map [string ]dto.DataTree )
225225 for _ , app := range apps {
226226 itemApp := dto.DataTree {
227- ID : uuid .NewString (),
228- Label : fmt .Sprintf ("%s - %s" , app .App .Name , app .Name ),
229- Key : app .App .Key ,
230- Name : app .Name ,
227+ ID : uuid .NewString (),
228+ Label : fmt .Sprintf ("%s - %s" , app .App .Name , app .Name ),
229+ Key : app .App .Key ,
230+ Name : app .Name ,
231+ IsLocal : app .App .Resource == "local" ,
231232 }
232233 appPath := path .Join (global .Dir .DataDir , "apps" , app .App .Key , app .Name )
234+ if itemApp .IsLocal {
235+ appPath = path .Join (global .Dir .AppDir , "local" , strings .TrimPrefix (app .App .Key , "local" ), app .Name )
236+ }
233237 itemAppData := dto.DataTree {ID : uuid .NewString (), Label : "appData" , Key : app .App .Key , Name : app .Name , IsCheck : true , Path : appPath }
234238 if app .App .Key == constant .AppOpenresty && len (websites ) != 0 {
235239 itemAppData .IsDisable = true
@@ -295,7 +299,7 @@ func loadAppImage(list []dto.DataTree) []dto.DataTree {
295299
296300 for i := 0 ; i < len (list ); i ++ {
297301 itemAppImage := dto.DataTree {ID : uuid .NewString (), Label : "appImage" }
298- stdout , err := cmd .RunDefaultWithStdoutBashCf ("cat %s | grep image: " , path . Join ( global . Dir . AppDir , list [i ].Key , list [ i ]. Name , "docker-compose.yml" ) )
302+ stdout , err := cmd .RunDefaultWithStdoutBashCf ("cat %s | grep image: " , list [i ].Path )
299303 if err != nil {
300304 list [i ].Children = append (list [i ].Children , itemAppImage )
301305 continue
0 commit comments