mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-10-27 17:26:03 +08:00
feat: The runtime supports offline mode. (#10481)
This commit is contained in:
parent
4e061ebcb4
commit
2f02157689
2 changed files with 8 additions and 2 deletions
|
|
@ -43,11 +43,17 @@ type App struct {
|
||||||
func (i *App) IsLocalApp() bool {
|
func (i *App) IsLocalApp() bool {
|
||||||
return i.Resource == constant.ResourceLocal
|
return i.Resource == constant.ResourceLocal
|
||||||
}
|
}
|
||||||
|
func (i *App) IsCustomApp() bool {
|
||||||
|
return i.Resource == constant.AppResourceCustom
|
||||||
|
}
|
||||||
|
|
||||||
func (i *App) GetAppResourcePath() string {
|
func (i *App) GetAppResourcePath() string {
|
||||||
if i.IsLocalApp() {
|
if i.IsLocalApp() {
|
||||||
//这里要去掉本地应用的local前缀
|
|
||||||
return filepath.Join(global.Dir.LocalAppResourceDir, strings.TrimPrefix(i.Key, "local"))
|
return filepath.Join(global.Dir.LocalAppResourceDir, strings.TrimPrefix(i.Key, "local"))
|
||||||
}
|
}
|
||||||
|
if i.IsCustomApp() {
|
||||||
|
return filepath.Join(global.Dir.CustomAppResourceDir, i.Key)
|
||||||
|
}
|
||||||
return filepath.Join(global.Dir.RemoteAppResourceDir, i.Key)
|
return filepath.Join(global.Dir.RemoteAppResourceDir, i.Key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -946,7 +946,7 @@ func handleMap(params map[string]interface{}, envParams map[string]string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func downloadApp(app model.App, appDetail model.AppDetail, appInstall *model.AppInstall, logger *log.Logger) (err error) {
|
func downloadApp(app model.App, appDetail model.AppDetail, appInstall *model.AppInstall, logger *log.Logger) (err error) {
|
||||||
if app.IsLocalApp() {
|
if app.IsLocalApp() || app.IsCustomApp() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
appResourceDir := path.Join(global.Dir.AppResourceDir, app.Resource)
|
appResourceDir := path.Join(global.Dir.AppResourceDir, app.Resource)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue