mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 22:18:07 +08:00
style: 网站列表增加 WAF 入口 (#825)
This commit is contained in:
parent
3b0c844f33
commit
c0a1555c73
@ -39,37 +39,29 @@ func setWebStatic(rootRouter *gin.Engine) {
|
|||||||
|
|
||||||
func Routers() *gin.Engine {
|
func Routers() *gin.Engine {
|
||||||
Router := gin.Default()
|
Router := gin.Default()
|
||||||
|
|
||||||
Router.Use(middleware.OperationLog())
|
Router.Use(middleware.OperationLog())
|
||||||
// Router.Use(middleware.CSRF())
|
// Router.Use(middleware.CSRF())
|
||||||
// Router.Use(middleware.LoadCsrfToken())
|
// Router.Use(middleware.LoadCsrfToken())
|
||||||
|
|
||||||
if global.CONF.System.IsDemo {
|
if global.CONF.System.IsDemo {
|
||||||
Router.Use(middleware.DemoHandle())
|
Router.Use(middleware.DemoHandle())
|
||||||
}
|
}
|
||||||
|
|
||||||
Router.Use(gzip.Gzip(gzip.DefaultCompression))
|
Router.Use(gzip.Gzip(gzip.DefaultCompression))
|
||||||
setWebStatic(Router)
|
setWebStatic(Router)
|
||||||
|
|
||||||
Router.Use(i18n.GinI18nLocalize())
|
Router.Use(i18n.GinI18nLocalize())
|
||||||
|
|
||||||
Router.SetFuncMap(template.FuncMap{
|
Router.SetFuncMap(template.FuncMap{
|
||||||
"Localize": ginI18n.GetMessage,
|
"Localize": ginI18n.GetMessage,
|
||||||
})
|
})
|
||||||
|
|
||||||
systemRouter := rou.RouterGroupApp
|
systemRouter := rou.RouterGroupApp
|
||||||
|
|
||||||
swaggerRouter := Router.Group("1panel")
|
swaggerRouter := Router.Group("1panel")
|
||||||
docs.SwaggerInfo.BasePath = "/api/v1"
|
docs.SwaggerInfo.BasePath = "/api/v1"
|
||||||
swaggerRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler))
|
swaggerRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler))
|
||||||
|
|
||||||
PublicGroup := Router.Group("")
|
PublicGroup := Router.Group("")
|
||||||
{
|
{
|
||||||
PublicGroup.GET("/health", func(c *gin.Context) {
|
PublicGroup.GET("/health", func(c *gin.Context) {
|
||||||
c.JSON(200, "ok")
|
c.JSON(200, "ok")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
PrivateGroup := Router.Group("/api/v1")
|
PrivateGroup := Router.Group("/api/v1")
|
||||||
PrivateGroup.Use(middleware.GlobalLoading())
|
PrivateGroup.Use(middleware.GlobalLoading())
|
||||||
{
|
{
|
||||||
|
4625
frontend/package-lock.json
generated
4625
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -79,7 +79,7 @@
|
|||||||
<span v-if="row.type === 'runtime'">[{{ row.runtimeName }}]</span>
|
<span v-if="row.type === 'runtime'">[{{ row.runtimeName }}]</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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 }">
|
<template #default="{ row }">
|
||||||
<el-button
|
<el-button
|
||||||
v-if="row.status === 'Running'"
|
v-if="row.status === 'Running'"
|
||||||
@ -95,12 +95,12 @@
|
|||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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 }">
|
<template #default="{ row }">
|
||||||
<MsgInfo :info="row.remark" width="120" />
|
<MsgInfo :info="row.remark" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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')">
|
<el-table-column :label="$t('website.expireDate')">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
<div v-show="row.showdate">
|
<div v-show="row.showdate">
|
||||||
@ -132,7 +132,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<fu-table-operations
|
<fu-table-operations
|
||||||
:ellipsis="10"
|
:ellipsis="10"
|
||||||
width="260px"
|
width="400px"
|
||||||
:buttons="buttons"
|
:buttons="buttons"
|
||||||
:label="$t('commons.table.operate')"
|
:label="$t('commons.table.operate')"
|
||||||
fixed="right"
|
fixed="right"
|
||||||
@ -255,6 +255,10 @@ const openConfig = (id: number) => {
|
|||||||
router.push({ name: 'WebsiteConfig', params: { id: id, tab: 'basic' } });
|
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 isEver = (time: string) => {
|
||||||
const expireDate = new Date(time);
|
const expireDate = new Date(time);
|
||||||
return expireDate < new Date('1970-01-02');
|
return expireDate < new Date('1970-01-02');
|
||||||
@ -325,6 +329,12 @@ const buttons = [
|
|||||||
openConfig(row.id);
|
openConfig(row.id);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'WAF',
|
||||||
|
click: function (row: Website.Website) {
|
||||||
|
openWAF(row.id);
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: i18n.global.t('database.backupList'),
|
label: i18n.global.t('database.backupList'),
|
||||||
click: (row: Website.Website) => {
|
click: (row: Website.Website) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user