mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-15 04:41:25 +08:00
WAF动作增加显示HTML内容
This commit is contained in:
@@ -43,6 +43,9 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
// http api
|
// http api
|
||||||
HttpAPIURL string
|
HttpAPIURL string
|
||||||
|
|
||||||
|
// html
|
||||||
|
HtmlContent string
|
||||||
|
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
CSRF *actionutils.CSRF
|
CSRF *actionutils.CSRF
|
||||||
}) {
|
}) {
|
||||||
@@ -90,6 +93,13 @@ func (this *CreatePopupAction) RunPost(params struct {
|
|||||||
actionParams = &firewallconfigs.FirewallActionHTTPAPIConfig{
|
actionParams = &firewallconfigs.FirewallActionHTTPAPIConfig{
|
||||||
URL: params.HttpAPIURL,
|
URL: params.HttpAPIURL,
|
||||||
}
|
}
|
||||||
|
case firewallconfigs.FirewallActionTypeHTML:
|
||||||
|
params.Must.
|
||||||
|
Field("htmlContent", params.HtmlContent).
|
||||||
|
Require("请输入HTML内容")
|
||||||
|
actionParams = &firewallconfigs.FirewallActionHTMLConfig{
|
||||||
|
Content: params.HtmlContent,
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
this.Fail("选择的类型'" + params.Type + "'暂时不支持")
|
this.Fail("选择的类型'" + params.Type + "'暂时不支持")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
|||||||
// http api
|
// http api
|
||||||
HttpAPIURL string
|
HttpAPIURL string
|
||||||
|
|
||||||
|
// HTML内容
|
||||||
|
HtmlContent string
|
||||||
|
|
||||||
Must *actions.Must
|
Must *actions.Must
|
||||||
CSRF *actionutils.CSRF
|
CSRF *actionutils.CSRF
|
||||||
}) {
|
}) {
|
||||||
@@ -119,6 +122,13 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
|||||||
actionParams = &firewallconfigs.FirewallActionHTTPAPIConfig{
|
actionParams = &firewallconfigs.FirewallActionHTTPAPIConfig{
|
||||||
URL: params.HttpAPIURL,
|
URL: params.HttpAPIURL,
|
||||||
}
|
}
|
||||||
|
case firewallconfigs.FirewallActionTypeHTML:
|
||||||
|
params.Must.
|
||||||
|
Field("htmlContent", params.HtmlContent).
|
||||||
|
Require("请输入HTML内容")
|
||||||
|
actionParams = &firewallconfigs.FirewallActionHTMLConfig{
|
||||||
|
Content: params.HtmlContent,
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
this.Fail("选择的类型'" + params.Type + "'暂时不支持")
|
this.Fail("选择的类型'" + params.Type + "'暂时不支持")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,25 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
|
<!-- HTML -->
|
||||||
|
<tbody v-if="type == 'html'">
|
||||||
|
<tr>
|
||||||
|
<td>HTML内容 *</td>
|
||||||
|
<td>
|
||||||
|
<textarea name="htmlContent" maxlength="128000" placeholder="完整的HTML内容"><!DOCTYPE html>
|
||||||
|
<html lang="zh">
|
||||||
|
<head>
|
||||||
|
<title></title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- 这里写提示文字 -->
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html></textarea>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<submit-btn></submit-btn>
|
<submit-btn></submit-btn>
|
||||||
</form>
|
</form>
|
||||||
@@ -92,6 +92,16 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
||||||
|
<!-- HTML -->
|
||||||
|
<tbody v-if="type == 'html'">
|
||||||
|
<tr>
|
||||||
|
<td>HTML内容 *</td>
|
||||||
|
<td>
|
||||||
|
<textarea name="htmlContent" maxlength="128000" placeholder="完整的HTML内容" v-model="action.params.content"></textarea>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<submit-btn></submit-btn>
|
<submit-btn></submit-btn>
|
||||||
</form>
|
</form>
|
||||||
Reference in New Issue
Block a user