feat: 网站设置增加网站目录TAB

This commit is contained in:
zhengkunwang223 2022-12-26 18:32:13 +08:00 committed by zhengkunwang223
parent 43ba468b82
commit 68228305f8
8 changed files with 72 additions and 7 deletions

View File

@ -8,6 +8,7 @@ type WebsiteDTO struct {
model.Website
ErrorLogPath string `json:"errorLogPath"`
AccessLogPath string `json:"accessLogPath"`
SitePath string `json:"sitePath"`
}
type WebsitePreInstallCheck struct {

View File

@ -273,6 +273,7 @@ func (w WebsiteService) GetWebsite(id uint) (response.WebsiteDTO, error) {
sitePath := path.Join(constant.AppInstallDir, constant.AppNginx, nginxInstall.Name, "www", "sites", website.Alias)
res.ErrorLogPath = path.Join(sitePath, "log", "error.log")
res.AccessLogPath = path.Join(sitePath, "log", "access.log")
res.SitePath = sitePath
return res, nil
}

View File

@ -18,6 +18,7 @@ export namespace Website {
export interface WebsiteDTO extends Website {
errorLogPath: string;
accessLogPath: string;
sitePath: string;
}
export interface NewAppInstall {

View File

@ -910,6 +910,14 @@ export default {
accessLog: '网站日志',
stopHelper: '停止站点后将无法正常访问用户访问会显示当前站点停止页面是否继续操作',
startHelper: '启用站点后用户可以正常访问网站内容是否继续操作',
sitePath: '网站目录',
siteAlias: '网站代号',
primaryPath: '主目录',
folderTitle: '网站主目录主要包含四个文件夹',
wafFolder: '防火墙规则',
indexFolder: '静态网站root目录',
logFoler: '网站日志',
sslFolder: '网站证书',
},
nginx: {
serverNamesHashBucketSizeHelper: '服务器名字的hash表大小',

View File

@ -3,17 +3,20 @@
<el-tab-pane :label="$t('website.domainConfig')">
<Doamin :id="id" v-if="index == '0'"></Doamin>
</el-tab-pane>
<el-tab-pane :label="$t('website.sitePath')">
<SitePath :id="id" v-if="index == '1'"></SitePath>
</el-tab-pane>
<el-tab-pane :label="$t('website.defaultDoc')">
<Default :id="id" v-if="index == '1'"></Default>
<Default :id="id" v-if="index == '2'"></Default>
</el-tab-pane>
<el-tab-pane :label="$t('website.rate')">
<LimitConn :id="id" v-if="index == '2'"></LimitConn>
<LimitConn :id="id" v-if="index == '3'"></LimitConn>
</el-tab-pane>
<el-tab-pane :label="'HTTPS'">
<HTTPS :id="id" v-if="index == '3'"></HTTPS>
<HTTPS :id="id" v-if="index == '4'"></HTTPS>
</el-tab-pane>
<el-tab-pane :label="$t('website.other')">
<Other :id="id" v-if="index == '4'"></Other>
<Other :id="id" v-if="index == '5'"></Other>
</el-tab-pane>
</el-tabs>
</template>
@ -26,6 +29,7 @@ import Default from './default-doc/index.vue';
import LimitConn from './limit-conn/index.vue';
import Other from './other/index.vue';
import HTTPS from './https/index.vue';
import SitePath from './site-folder/index.vue';
const props = defineProps({
id: {

View File

@ -95,12 +95,13 @@ const limitRules = [
{ key: i18n.global.t('website.videoSite'), values: [150, 4, 1024] },
];
let ruleKey = limitRules[0].key;
let ruleKey = ref('');
const search = (scopeReq: Website.NginxScopeReq) => {
loading.value = true;
GetNginxConfig(scopeReq)
.then((res) => {
ruleKey.value = limitRules[0].key;
if (res.data) {
enable.value = res.data.enable;
if (res.data.enable == false) {

View File

@ -1,6 +1,6 @@
<template>
<el-row :gutter="20">
<el-col :span="8" :offset="2">
<el-col :span="8" :offset="1">
<el-form
ref="websiteForm"
label-position="right"
@ -88,7 +88,6 @@ const search = () => {
ListGroups().then((res) => {
groups.value = res.data;
GetWebsite(websiteId.value).then((res) => {
// form.id = res.data.id;
form.primaryDomain = res.data.primaryDomain;
form.remark = res.data.remark;
form.webSiteGroupId = res.data.webSiteGroupId;

View File

@ -0,0 +1,50 @@
<template>
<el-row :gutter="20">
<el-col :span="8" :offset="1">
<br />
<el-descriptions :column="1" border v-loading="loading">
<el-descriptions-item :label="$t('website.siteAlias')">{{ website.alias }}</el-descriptions-item>
<el-descriptions-item :label="$t('website.primaryPath')">{{ website.sitePath }}</el-descriptions-item>
</el-descriptions>
<br />
<el-descriptions :title="$t('website.folderTitle')" :column="1" border>
<el-descriptions-item label="waf">{{ $t('website.wafFolder') }}</el-descriptions-item>
<el-descriptions-item label="ssl">{{ $t('website.sslFolder') }}</el-descriptions-item>
<el-descriptions-item label="log">{{ $t('website.logFoler') }}</el-descriptions-item>
<el-descriptions-item label="index">{{ $t('website.indexFolder') }}</el-descriptions-item>
</el-descriptions>
</el-col>
</el-row>
</template>
<script lang="ts" setup>
import { GetWebsite } from '@/api/modules/website';
import { computed, onMounted, ref } from 'vue';
const props = defineProps({
id: {
type: Number,
default: 0,
},
});
const websiteId = computed(() => {
return Number(props.id);
});
let website = ref<any>({});
let loading = ref(false);
const search = () => {
loading.value = true;
GetWebsite(websiteId.value)
.then((res) => {
website.value = res.data;
})
.finally(() => {
loading.value = false;
});
};
onMounted(() => {
search();
});
</script>