feat: 解决两个网站同时开启流量限制报错的BUG

This commit is contained in:
zhengkunwang223
2023-03-09 19:11:06 +08:00
committed by zhengkunwang223
parent 706a1a198f
commit a28744b907
6 changed files with 5 additions and 12 deletions
+1
View File
@@ -20,3 +20,4 @@ build
backend/__debug_bin
cmd/server/__debug_bin
cmd/server/web
frontend/auto-imports.d.ts
+1 -2
View File
@@ -46,6 +46,5 @@ var ScopeKeyMap = map[NginxKey][]string{
var StaticFileKeyMap = map[NginxKey]struct {
}{
SSL: {},
LimitConn: {},
SSL: {},
}
-3
View File
@@ -160,9 +160,6 @@ func getNginxParamsFromStaticFile(scope dto.NginxKey, newParams []dto.NginxParam
switch scope {
case dto.SSL:
newConfig = parser.NewStringParser(string(nginx_conf.SSL)).Parse()
case dto.LimitConn:
updateScope = constant.NginxScopeOut
newConfig = parser.NewStringParser(string(nginx_conf.Limit)).Parse()
}
for _, dir := range newConfig.GetDirectives() {
addParam := dto.NginxParam{
-2
View File
@@ -1,2 +0,0 @@
limit_conn_zone $binary_remote_addr zone=perip:10m;
limit_conn_zone $server_name zone=perserver:10m;
-3
View File
@@ -10,8 +10,5 @@ var SSL []byte
//go:embed website_default.conf
var WebsiteDefault []byte
//go:embed limit.conf
var Limit []byte
//go:embed index.html
var Index []byte
+3 -2
View File
@@ -94,11 +94,12 @@
v-if="row.status === 'Running'"
link
type="success"
:icon="VideoPlay"
@click="opWebsite('stop', row.id)"
>
{{ $t('commons.status.running') }}
</el-button>
<el-button v-else link type="danger" @click="opWebsite('start', row.id)">
<el-button v-else link type="danger" :icon="VideoPause" @click="opWebsite('start', row.id)">
{{ $t('commons.status.stopped') }}
</el-button>
</template>
@@ -185,7 +186,7 @@ import { ElMessageBox } from 'element-plus';
import { dateFormatSimple } from '@/utils/util';
import { MsgSuccess } from '@/utils/message';
import { useI18n } from 'vue-i18n';
import { Promotion } from '@element-plus/icons-vue';
import { Promotion, VideoPlay, VideoPause } from '@element-plus/icons-vue';
const shortcuts = [
{