feat: 默认网站日志开启

This commit is contained in:
zhengkunwang223 2023-01-03 18:37:57 +08:00 committed by zhengkunwang223
parent cb90cd1a10
commit 62e806b1ba
5 changed files with 11 additions and 2 deletions

View file

@ -119,6 +119,8 @@ func (w WebsiteService) CreateWebsite(create request.WebsiteCreate) error {
WebsiteGroupID: create.WebsiteGroupID,
Protocol: constant.ProtocolHTTP,
Proxy: create.Proxy,
AccessLog: true,
ErrorLog: true,
}
tx, ctx := getTxAndContext()
@ -545,7 +547,9 @@ func (w WebsiteService) OpWebsiteHTTPS(ctx context.Context, req request.WebsiteH
if err := deleteListenAndServerName(website, []int{443}, []string{}); err != nil {
return response.WebsiteHTTPS{}, err
}
if err := deleteNginxConfig(constant.NginxScopeServer, getKeysFromStaticFile(dto.SSL), &website); err != nil {
keys := getKeysFromStaticFile(dto.SSL)
keys = append(keys, "if")
if err := deleteNginxConfig(constant.NginxScopeServer, keys, &website); err != nil {
return response.WebsiteHTTPS{}, err
}
if err := websiteRepo.Save(ctx, &website); err != nil {

View file

@ -167,6 +167,7 @@ export namespace Website {
issuerName: string;
expireDate: string;
startDate: string;
provider: string;
}
export interface SSLCreate {

View file

@ -998,6 +998,7 @@ export default {
key: '私钥',
startDate: '生效时间',
organization: '签发机构',
renewConfirm: '是否确定续签',
},
firewall: {
ccDeny: 'CC 防护',

View file

@ -101,6 +101,9 @@ const buttons = [
},
{
label: i18n.global.t('website.renewSSL'),
disabled: function (row: Website.SSL) {
return row.provider === 'manual';
},
click: function (row: Website.SSL) {
openRenewSSL(row.id);
},

View file

@ -8,7 +8,7 @@
:before-close="handleClose"
>
<div style="text-align: center">
<span>是否确定续签?</span>
<span>{{ $t('ssl.renewConfirm') }}</span>
</div>
<template #footer>
<span class="dialog-footer">