diff --git a/agent/global/config.go b/agent/global/config.go index 34d6e2eed..90f2253d6 100644 --- a/agent/global/config.go +++ b/agent/global/config.go @@ -32,19 +32,20 @@ type SystemDir struct { TmpDir string LocalBackupDir string - AppDir string - ResourceDir string - AppResourceDir string - AppInstallDir string - LocalAppResourceDir string - LocalAppInstallDir string - RemoteAppResourceDir string - CustomAppResourceDir string - RuntimeDir string - RecycleBinDir string - SSLLogDir string - McpDir string - ConvertLogDir string + AppDir string + ResourceDir string + AppResourceDir string + AppInstallDir string + LocalAppResourceDir string + LocalAppInstallDir string + RemoteAppResourceDir string + CustomAppResourceDir string + OfflineAppResourceDir string + RuntimeDir string + RecycleBinDir string + SSLLogDir string + McpDir string + ConvertLogDir string } type LogConfig struct { diff --git a/agent/init/dir/dir.go b/agent/init/dir/dir.go index a31bc39da..1d26cb47b 100644 --- a/agent/init/dir/dir.go +++ b/agent/init/dir/dir.go @@ -27,6 +27,7 @@ func Init() { global.Dir.LocalAppInstallDir, _ = fileOp.CreateDirWithPath(true, path.Join(baseDir, "1panel/apps/local")) global.Dir.RemoteAppResourceDir, _ = fileOp.CreateDirWithPath(true, path.Join(baseDir, "1panel/resource/apps/remote")) global.Dir.CustomAppResourceDir, _ = fileOp.CreateDirWithPath(true, path.Join(baseDir, "1panel/resource/apps/custom")) + global.Dir.OfflineAppResourceDir, _ = fileOp.CreateDirWithPath(true, path.Join(baseDir, "1panel/resource/offline")) global.Dir.RuntimeDir, _ = fileOp.CreateDirWithPath(true, path.Join(baseDir, "1panel/runtime")) global.Dir.RecycleBinDir, _ = fileOp.CreateDirWithPath(true, "/.1panel_clash") global.Dir.SSLLogDir, _ = fileOp.CreateDirWithPath(true, path.Join(baseDir, "1panel/log/ssl")) diff --git a/frontend/src/views/website/runtime/php/create/index.vue b/frontend/src/views/website/runtime/php/create/index.vue index 1991cf768..3a8ccadb9 100644 --- a/frontend/src/views/website/runtime/php/create/index.vue +++ b/frontend/src/views/website/runtime/php/create/index.vue @@ -24,7 +24,7 @@ v-model="runtime.resource" @change="changeResource(runtime.resource)" > - + {{ $t('menu.apps') }} @@ -195,9 +195,9 @@ import i18n from '@/lang'; import { MsgSuccess } from '@/utils/message'; import { FormInstance } from 'element-plus'; import { reactive, ref } from 'vue'; -import { GlobalStore } from '@/store'; import { getLabel } from '@/utils/util'; -const globalStore = GlobalStore(); +import { useGlobalStore } from '@/composables/useGlobalStore'; +const { globalStore } = useGlobalStore(); interface OperateRrops { id?: number; @@ -472,7 +472,11 @@ const acceptParams = async (props: OperateRrops) => { initParam.value = false; if (props.mode === 'create') { Object.assign(runtime, initData(props.type)); - searchAppList(null); + if (globalStore.isOffLine) { + runtime.resource = 'local'; + } else { + searchAppList(null); + } } else { searchAppList(props.appID); getRuntime(props.id); diff --git a/frontend/src/views/website/runtime/php/index.vue b/frontend/src/views/website/runtime/php/index.vue index 723300599..ec2aa4fad 100644 --- a/frontend/src/views/website/runtime/php/index.vue +++ b/frontend/src/views/website/runtime/php/index.vue @@ -153,9 +153,8 @@ import { disabledButton } from '@/utils/runtime'; import DockerStatus from '@/views/container/docker-status/index.vue'; import { operateRuntime, updateRuntimeRemark } from '../common/utils'; import { routerToFileWithPath } from '@/utils/router'; -import { MsgWarning } from '@/utils/message'; import { useGlobalStore } from '@/composables/useGlobalStore'; -const { globalStore, isOffLine } = useGlobalStore(); +const { globalStore } = useGlobalStore(); const mobile = computed(() => { return globalStore.isMobile(); @@ -286,10 +285,6 @@ const search = async () => { }; const openCreate = () => { - if (isOffLine.value) { - MsgWarning(i18n.global.t('commons.msg.offlineTips')); - return; - } createRef.value.acceptParams({ type: 'php', mode: 'create' }); };