mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-13 17:24:44 +08:00
fix: 创建静态网站增加路径提示
This commit is contained in:
parent
ea495aaa13
commit
b72be7f8cc
@ -29,6 +29,7 @@ type AppInstalledCheck struct {
|
||||
LastBackupAt string `json:"lastBackupAt"`
|
||||
AppInstallID uint `json:"appInstallId"`
|
||||
ContainerName string `json:"containerName"`
|
||||
InstallPath string `json:"installPath"`
|
||||
}
|
||||
|
||||
type AppDetailDTO struct {
|
||||
|
@ -74,6 +74,7 @@ func (a AppInstallService) CheckExist(key string) (*response.AppInstalledCheck,
|
||||
res.Status = appInstall.Status
|
||||
res.AppInstallID = appInstall.ID
|
||||
res.IsExist = true
|
||||
res.InstallPath = path.Join(constant.AppInstallDir, appInstall.Name)
|
||||
if len(appInstall.Backups) > 0 {
|
||||
res.LastBackupAt = appInstall.Backups[0].CreatedAt.Format("2006-01-02 15:04:05")
|
||||
}
|
||||
|
@ -96,6 +96,7 @@ export namespace App {
|
||||
lastBackupAt: string;
|
||||
appInstallId: number;
|
||||
containerName: string;
|
||||
installPath: string;
|
||||
}
|
||||
|
||||
export interface AppInstallResource {
|
||||
|
@ -895,6 +895,7 @@ export default {
|
||||
deleteAppHelper: '同时删除关联应用以及应用备份',
|
||||
deleteBackupHelper: '同时删除网站备份',
|
||||
deleteConfirmHelper: '删除操作无法回滚,请输入 <span style="color:red"> "{0}" </span> 删除此网站',
|
||||
staticPath: '对应主目录:',
|
||||
},
|
||||
nginx: {
|
||||
serverNamesHashBucketSizeHelper: '服务器名字的hash表大小',
|
||||
|
@ -109,6 +109,11 @@
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('website.alias')" prop="alias">
|
||||
<el-input v-model="website.alias" :placeholder="$t('website.aliasHelper')"></el-input>
|
||||
<div>
|
||||
<span class="input-help">
|
||||
{{ $t('website.staticPath') + staticPath + '/' + website.alias }}
|
||||
</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="website.type === 'proxy'" :label="$t('website.proxyAddress')" prop="proxy">
|
||||
<el-input v-model="website.proxy" :placeholder="$t('website.proxyHelper')"></el-input>
|
||||
@ -190,6 +195,7 @@ let appDetail = ref<App.AppDetail>();
|
||||
let appParams = ref<App.AppParams>();
|
||||
let paramKey = ref(1);
|
||||
let preCheckRef = ref();
|
||||
let staticPath = ref('');
|
||||
|
||||
const em = defineEmits(['close']);
|
||||
|
||||
@ -236,10 +242,12 @@ const getAppDetail = (version: string) => {
|
||||
});
|
||||
};
|
||||
|
||||
const acceptParams = async () => {
|
||||
const acceptParams = async (installPath: string) => {
|
||||
if (websiteForm.value) {
|
||||
websiteForm.value.resetFields();
|
||||
}
|
||||
console.log(installPath);
|
||||
staticPath.value = installPath + '/www/sites';
|
||||
|
||||
await ListGroups().then((res) => {
|
||||
groups.value = res.data;
|
||||
|
@ -106,6 +106,7 @@ let openNginxConfig = ref(false);
|
||||
let nginxIsExist = ref(false);
|
||||
let containerName = ref('');
|
||||
let nginxStatus = ref('');
|
||||
let installPath = ref('');
|
||||
|
||||
const paginationConfig = reactive({
|
||||
currentPage: 1,
|
||||
@ -178,7 +179,7 @@ const openDelete = (website: Website.Website) => {
|
||||
};
|
||||
|
||||
const openCreate = () => {
|
||||
createRef.value.acceptParams();
|
||||
createRef.value.acceptParams(installPath.value);
|
||||
};
|
||||
|
||||
const openGroup = () => {
|
||||
@ -189,6 +190,7 @@ const checkExist = (data: App.CheckInstalled) => {
|
||||
nginxIsExist.value = data.isExist;
|
||||
containerName.value = data.containerName;
|
||||
nginxStatus.value = data.status;
|
||||
installPath.value = data.installPath;
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user