mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-19 05:49:02 +08:00
feat: Offline version supports creating PHP (#10585)
This commit is contained in:
parent
e7b1aadb0e
commit
f977a2488d
4 changed files with 24 additions and 23 deletions
|
|
@ -40,6 +40,7 @@ type SystemDir struct {
|
|||
LocalAppInstallDir string
|
||||
RemoteAppResourceDir string
|
||||
CustomAppResourceDir string
|
||||
OfflineAppResourceDir string
|
||||
RuntimeDir string
|
||||
RecycleBinDir string
|
||||
SSLLogDir string
|
||||
|
|
|
|||
|
|
@ -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"))
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
v-model="runtime.resource"
|
||||
@change="changeResource(runtime.resource)"
|
||||
>
|
||||
<el-radio :value="'appstore'">
|
||||
<el-radio :value="'appstore'" v-if="!globalStore.isOffLine">
|
||||
{{ $t('menu.apps') }}
|
||||
</el-radio>
|
||||
<el-radio :value="'local'">
|
||||
|
|
@ -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));
|
||||
if (globalStore.isOffLine) {
|
||||
runtime.resource = 'local';
|
||||
} else {
|
||||
searchAppList(null);
|
||||
}
|
||||
} else {
|
||||
searchAppList(props.appID);
|
||||
getRuntime(props.id);
|
||||
|
|
|
|||
|
|
@ -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' });
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue