mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-07 23:30:26 +08:00
特殊页面改为自定义页面
This commit is contained in:
@@ -108,7 +108,7 @@ func InitGroup(parent *actionutils.ParentAction, groupId int64, menuItem string)
|
|||||||
"isOn": configInfoResp.HasCompressionConfig,
|
"isOn": configInfoResp.HasCompressionConfig,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "特殊页面",
|
"name": "自定义页面",
|
||||||
"url": urlPrefix + "/pages?groupId=" + types.String(groupId),
|
"url": urlPrefix + "/pages?groupId=" + types.String(groupId),
|
||||||
"isActive": menuItem == "pages",
|
"isActive": menuItem == "pages",
|
||||||
"isOn": configInfoResp.HasPagesConfig,
|
"isOn": configInfoResp.HasPagesConfig,
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ func (this *LocationHelper) createMenus(serverIdString string, locationIdString
|
|||||||
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.Compression != nil && locationConfig.Web.Compression.IsPrior,
|
"isOn": locationConfig != nil && locationConfig.Web != nil && locationConfig.Web.Compression != nil && locationConfig.Web.Compression.IsPrior,
|
||||||
})
|
})
|
||||||
menuItems = append(menuItems, maps.Map{
|
menuItems = append(menuItems, maps.Map{
|
||||||
"name": "特殊页面",
|
"name": "自定义页面",
|
||||||
"url": "/servers/server/settings/locations/pages?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
"url": "/servers/server/settings/locations/pages?serverId=" + serverIdString + "&locationId=" + locationIdString,
|
||||||
"isActive": secondMenuItem == "pages",
|
"isActive": secondMenuItem == "pages",
|
||||||
"isOn": locationConfig != nil && locationConfig.Web != nil && (len(locationConfig.Web.Pages) > 0 || (locationConfig.Web.Shutdown != nil && locationConfig.Web.Shutdown.IsPrior)),
|
"isOn": locationConfig != nil && locationConfig.Web != nil && (len(locationConfig.Web.Pages) > 0 || (locationConfig.Web.Shutdown != nil && locationConfig.Web.Shutdown.IsPrior)),
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ func (this *IndexAction) RunPost(params struct {
|
|||||||
ShutdownJSON string
|
ShutdownJSON string
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
}) {
|
}) {
|
||||||
defer this.CreateLogInfo("修改Web %d 的特殊页面设置", params.WebId)
|
defer this.CreateLogInfo("修改Web %d 的自定义页面设置", params.WebId)
|
||||||
|
|
||||||
// TODO 检查配置
|
// TODO 检查配置
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
this.Data["page"] = pageConfig
|
this.Data["page"] = pageConfig
|
||||||
|
|
||||||
// 日志
|
// 日志
|
||||||
defer this.CreateLog(oplogs.LevelInfo, "创建特殊页面 %d", pageId)
|
defer this.CreateLog(oplogs.LevelInfo, "创建自定义页面 %d", pageId)
|
||||||
|
|
||||||
this.Success()
|
this.Success()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
|||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
}) {
|
}) {
|
||||||
// 日志
|
// 日志
|
||||||
defer this.CreateLog(oplogs.LevelInfo, "修改特殊页面 %d", params.PageId)
|
defer this.CreateLog(oplogs.LevelInfo, "修改自定义页面 %d", params.PageId)
|
||||||
|
|
||||||
params.Must.
|
params.Must.
|
||||||
Field("status", params.Status).
|
Field("status", params.Status).
|
||||||
|
|||||||
@@ -333,7 +333,7 @@ func (this *ServerHelper) createSettingsMenu(secondMenuItem string, serverIdStri
|
|||||||
"isOn": serverConfig.Web != nil && serverConfig.Web.Compression != nil && serverConfig.Web.Compression.IsOn,
|
"isOn": serverConfig.Web != nil && serverConfig.Web.Compression != nil && serverConfig.Web.Compression.IsOn,
|
||||||
})
|
})
|
||||||
menuItems = append(menuItems, maps.Map{
|
menuItems = append(menuItems, maps.Map{
|
||||||
"name": "特殊页面",
|
"name": "自定义页面",
|
||||||
"url": "/servers/server/settings/pages?serverId=" + serverIdString,
|
"url": "/servers/server/settings/pages?serverId=" + serverIdString,
|
||||||
"isActive": secondMenuItem == "pages",
|
"isActive": secondMenuItem == "pages",
|
||||||
"isOn": serverConfig.Web != nil && (len(serverConfig.Web.Pages) > 0 || (serverConfig.Web.Shutdown != nil && serverConfig.Web.Shutdown.IsOn)),
|
"isOn": serverConfig.Web != nil && (len(serverConfig.Web.Pages) > 0 || (serverConfig.Web.Shutdown != nil && serverConfig.Web.Shutdown.IsOn)),
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ Vue.component("http-location-labels", {
|
|||||||
<!-- 请求脚本 -->
|
<!-- 请求脚本 -->
|
||||||
<http-location-labels-label v-if="location.web != null && location.web.requestScripts != null && ((location.web.requestScripts.initGroup != null && location.web.requestScripts.initGroup.isPrior) || (location.web.requestScripts.requestGroup != null && location.web.requestScripts.requestGroup.isPrior))" :href="url('/requestScripts')">请求脚本</http-location-labels-label>
|
<http-location-labels-label v-if="location.web != null && location.web.requestScripts != null && ((location.web.requestScripts.initGroup != null && location.web.requestScripts.initGroup.isPrior) || (location.web.requestScripts.requestGroup != null && location.web.requestScripts.requestGroup.isPrior))" :href="url('/requestScripts')">请求脚本</http-location-labels-label>
|
||||||
|
|
||||||
<!-- 特殊页面 -->
|
<!-- 自定义页面 -->
|
||||||
<div v-if="location.web != null && location.web.pages != null && location.web.pages.length > 0">
|
<div v-if="location.web != null && location.web.pages != null && location.web.pages.length > 0">
|
||||||
<div v-for="page in location.web.pages" :key="page.id"><http-location-labels-label :href="url('/pages')">PAGE [状态码{{page.status[0]}}] -> {{page.url}}</http-location-labels-label></div>
|
<div v-for="page in location.web.pages" :key="page.id"><http-location-labels-label :href="url('/pages')">PAGE [状态码{{page.status[0]}}] -> {{page.url}}</http-location-labels-label></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ Vue.component("http-pages-and-shutdown-box", {
|
|||||||
<input type="hidden" name="shutdownJSON" :value="JSON.stringify(shutdownConfig)"/>
|
<input type="hidden" name="shutdownJSON" :value="JSON.stringify(shutdownConfig)"/>
|
||||||
<table class="ui table selectable definition">
|
<table class="ui table selectable definition">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="title">特殊页面</td>
|
<td class="title">自定义页面</td>
|
||||||
<td>
|
<td>
|
||||||
<div v-if="pages.length > 0">
|
<div v-if="pages.length > 0">
|
||||||
<div class="ui label small basic" v-for="(page,index) in pages">
|
<div class="ui label small basic" v-for="(page,index) in pages">
|
||||||
@@ -103,7 +103,7 @@ Vue.component("http-pages-and-shutdown-box", {
|
|||||||
<div>
|
<div>
|
||||||
<button class="ui button small" type="button" @click.prevent="addPage()">+</button>
|
<button class="ui button small" type="button" @click.prevent="addPage()">+</button>
|
||||||
</div>
|
</div>
|
||||||
<p class="comment">根据响应状态码返回一些特殊页面,比如404,500等错误页面。</p>
|
<p class="comment">根据响应状态码返回一些自定义页面,比如404,500等错误页面。</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{$layout "layout_popup"}
|
{$layout "layout_popup"}
|
||||||
<h3>添加特殊页面</h3>
|
<h3>添加自定义页面</h3>
|
||||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||||
<table class="ui table selectable definition">
|
<table class="ui table selectable definition">
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{$layout "layout_popup"}
|
{$layout "layout_popup"}
|
||||||
<h3>修改特殊页面</h3>
|
<h3>修改自定义页面</h3>
|
||||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||||
<input type="hidden" name="pageId" :value="pageConfig.id"/>
|
<input type="hidden" name="pageId" :value="pageConfig.id"/>
|
||||||
<table class="ui table selectable definition">
|
<table class="ui table selectable definition">
|
||||||
|
|||||||
Reference in New Issue
Block a user