mirror of
https://github.com/acepanel/panel.git
synced 2026-02-04 09:13:49 +08:00
feat: 添加项目默认目录配置及目录跳转功能 (#1233)
* Initial plan * feat: 添加项目默认目录配置及目录跳转功能 Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com> * fix: 为项目默认目录添加回退默认值 Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: devhaozi <115467771+devhaozi@users.noreply.github.com>
This commit is contained in:
@@ -16,14 +16,17 @@ const model = defineModel<any>('model', { type: Object, required: true })
|
||||
// 目录选择器
|
||||
const showPathSelector = ref(false)
|
||||
const pathSelectorPath = ref('/opt/ace')
|
||||
const pathSelectorTarget = ref<'website' | 'backup'>('website')
|
||||
const pathSelectorTarget = ref<'website' | 'backup' | 'project'>('website')
|
||||
|
||||
const handleSelectPath = (target: 'website' | 'backup') => {
|
||||
const handleSelectPath = (target: 'website' | 'backup' | 'project') => {
|
||||
pathSelectorTarget.value = target
|
||||
pathSelectorPath.value =
|
||||
target === 'website'
|
||||
? model.value.website_path || '/opt/ace/sites'
|
||||
: model.value.backup_path || '/opt/ace/backup'
|
||||
if (target === 'website') {
|
||||
pathSelectorPath.value = model.value.website_path || '/opt/ace/sites'
|
||||
} else if (target === 'backup') {
|
||||
pathSelectorPath.value = model.value.backup_path || '/opt/ace/backup'
|
||||
} else {
|
||||
pathSelectorPath.value = model.value.project_path || '/opt/ace/projects'
|
||||
}
|
||||
showPathSelector.value = true
|
||||
}
|
||||
|
||||
@@ -31,8 +34,10 @@ watch(showPathSelector, (val) => {
|
||||
if (!val && pathSelectorPath.value) {
|
||||
if (pathSelectorTarget.value === 'website') {
|
||||
model.value.website_path = pathSelectorPath.value
|
||||
} else {
|
||||
} else if (pathSelectorTarget.value === 'backup') {
|
||||
model.value.backup_path = pathSelectorPath.value
|
||||
} else {
|
||||
model.value.project_path = pathSelectorPath.value
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -138,6 +143,19 @@ const menus = computed<TreeSelectOption[]>(() => {
|
||||
</n-button>
|
||||
</n-input-group>
|
||||
</n-form-item>
|
||||
<n-form-item :label="$gettext('Default Project Directory')">
|
||||
<n-input-group>
|
||||
<n-input
|
||||
v-model:value="model.project_path"
|
||||
:placeholder="$gettext('/opt/ace/projects')"
|
||||
/>
|
||||
<n-button @click="handleSelectPath('project')">
|
||||
<template #icon>
|
||||
<i-mdi-folder-open />
|
||||
</template>
|
||||
</n-button>
|
||||
</n-input-group>
|
||||
</n-form-item>
|
||||
<n-form-item :label="$gettext('Custom Logo')">
|
||||
<n-input
|
||||
v-model:value="model.custom_logo"
|
||||
|
||||
Reference in New Issue
Block a user