特殊页面可以直接使用HTML

This commit is contained in:
刘祥超
2021-10-10 10:35:14 +08:00
parent dbc60ccca4
commit 32b8c91113
7 changed files with 164 additions and 16 deletions

View File

@@ -9,13 +9,28 @@
<p class="comment">比如404或者50x。</p>
</td>
</tr>
<tr>
<tr>
<td>内容类型 *</td>
<td>
<select class="ui dropdown auto-width" name="bodyType" v-model="bodyType">
<option v-for="bodyType in bodyTypes" :value="bodyType.code">{{bodyType.name}}</option>
</select>
</td>
</tr>
<tr v-show="bodyType == 'url'">
<td>URL *</td>
<td>
<input type="text" name="url" maxlength="500" placeholder="页面文件路径或者完整的URL"/>
<p class="comment">页面文件是相对于节点安装目录的页面文件比如web/pages/40x.html或者一个完整的URL。</p>
</td>
</tr>
<tr v-show="bodyType == 'html'">
<td>HTML *</td>
<td>
<textarea name="body" ref="htmlBody"></textarea>
<p class="comment"><a href="" @click.prevent="addHTMLTemplate">[使用模板]</a>。填写页面的HTML内容支持请求变量。</p>
</td>
</tr>
<tr>
<td>新状态码</td>
<td>

View File

@@ -0,0 +1,21 @@
Tea.context(function () {
this.bodyType = this.bodyTypes[0].code
this.addHTMLTemplate = function () {
this.$refs.htmlBody.value = `<!DOCTYPE html>
<html>
<head>
\t<title>页面标题</title>
\t<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<h3>内容标题</h3>
<p>内容</p>
<footer>Powered by GoEdge.</footer>
</body>
</html>`
}
})

View File

@@ -10,13 +10,28 @@
<p class="comment">比如404或者50x。</p>
</td>
</tr>
<tr>
<tr>
<td>内容类型 *</td>
<td>
<select class="ui dropdown auto-width" name="bodyType" v-model="bodyType">
<option v-for="bodyType in bodyTypes" :value="bodyType.code">{{bodyType.name}}</option>
</select>
</td>
</tr>
<tr v-show="bodyType == 'url'">
<td>URL *</td>
<td>
<input type="text" name="url" maxlength="500" placeholder="页面文件路径或者完整的URL" v-model="pageConfig.url"/>
<p class="comment">页面文件是相对于节点安装目录的页面文件比如web/pages/40x.html或者一个完整的URL。</p>
</td>
</tr>
<tr v-show="bodyType == 'html'">
<td>HTML *</td>
<td>
<textarea name="body" ref="htmlBody" v-model="pageConfig.body"></textarea>
<p class="comment"><a href="" @click.prevent="addHTMLTemplate">[使用模板]</a>。填写页面的HTML内容支持请求变量。</p>
</td>
</tr>
<tr>
<td>新状态码</td>
<td>

View File

@@ -1,8 +1,28 @@
Tea.context(function () {
this.success = NotifyPopup
this.bodyType = this.pageConfig.bodyType
this.newStatus = ""
if (this.pageConfig.newStatus > 0) {
this.newStatus = this.pageConfig.newStatus
}
this.addHTMLTemplate = function () {
this.$refs.htmlBody.value = `<!DOCTYPE html>
<html>
<head>
\t<title>页面标题</title>
\t<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<h3>内容标题</h3>
<p>内容</p>
<footer>Powered by GoEdge.</footer>
</body>
</html>`
}
})