1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-19 08:19:15 +08:00

style: 网站列表增加 WAF 入口 (#825)

This commit is contained in:
zhengkunwang223 2023-04-28 15:18:19 +08:00 committed by GitHub
parent 3b0c844f33
commit c0a1555c73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2566 additions and 2087 deletions

View File

@ -39,37 +39,29 @@ func setWebStatic(rootRouter *gin.Engine) {
func Routers() *gin.Engine {
Router := gin.Default()
Router.Use(middleware.OperationLog())
// Router.Use(middleware.CSRF())
// Router.Use(middleware.LoadCsrfToken())
if global.CONF.System.IsDemo {
Router.Use(middleware.DemoHandle())
}
Router.Use(gzip.Gzip(gzip.DefaultCompression))
setWebStatic(Router)
Router.Use(i18n.GinI18nLocalize())
Router.SetFuncMap(template.FuncMap{
"Localize": ginI18n.GetMessage,
})
systemRouter := rou.RouterGroupApp
swaggerRouter := Router.Group("1panel")
docs.SwaggerInfo.BasePath = "/api/v1"
swaggerRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler))
PublicGroup := Router.Group("")
{
PublicGroup.GET("/health", func(c *gin.Context) {
c.JSON(200, "ok")
})
}
PrivateGroup := Router.Group("/api/v1")
PrivateGroup.Use(middleware.GlobalLoading())
{

File diff suppressed because it is too large Load Diff

View File

@ -79,7 +79,7 @@
<span v-if="row.type === 'runtime'">[{{ row.runtimeName }}]</span>
</template>
</el-table-column>
<el-table-column :label="$t('commons.table.status')" prop="status">
<el-table-column :label="$t('commons.table.status')" prop="status" width="100px">
<template #default="{ row }">
<el-button
v-if="row.status === 'Running'"
@ -95,12 +95,12 @@
</el-button>
</template>
</el-table-column>
<el-table-column :label="$t('website.remark')" fix prop="remark">
<el-table-column :label="$t('website.remark')" prop="remark">
<template #default="{ row }">
<MsgInfo :info="row.remark" width="120" />
<MsgInfo :info="row.remark" />
</template>
</el-table-column>
<el-table-column :label="$t('website.protocol')" prop="protocol"></el-table-column>
<el-table-column :label="$t('website.protocol')" prop="protocol" width="90px"></el-table-column>
<el-table-column :label="$t('website.expireDate')">
<template #default="{ row, $index }">
<div v-show="row.showdate">
@ -132,7 +132,7 @@
</el-table-column>
<fu-table-operations
:ellipsis="10"
width="260px"
width="400px"
:buttons="buttons"
:label="$t('commons.table.operate')"
fixed="right"
@ -255,6 +255,10 @@ const openConfig = (id: number) => {
router.push({ name: 'WebsiteConfig', params: { id: id, tab: 'basic' } });
};
const openWAF = (id: number) => {
router.push({ name: 'WebsiteConfig', params: { id: id, tab: 'safety' } });
};
const isEver = (time: string) => {
const expireDate = new Date(time);
return expireDate < new Date('1970-01-02');
@ -325,6 +329,12 @@ const buttons = [
openConfig(row.id);
},
},
{
label: 'WAF',
click: function (row: Website.Website) {
openWAF(row.id);
},
},
{
label: i18n.global.t('database.backupList'),
click: (row: Website.Website) => {