mirror of
				https://github.com/TeaOSLab/EdgeAdmin.git
				synced 2025-11-04 13:10:26 +08:00 
			
		
		
		
	提交components.js
This commit is contained in:
		@@ -7906,7 +7906,7 @@ Vue.component("uam-config-box", {
 | 
			
		||||
			<td>限制URL</td>
 | 
			
		||||
			<td>
 | 
			
		||||
				<url-patterns-box v-model="config.onlyURLPatterns"></url-patterns-box>
 | 
			
		||||
				<p class="comment">如果填写了支持URL,表示只对这些URL进行5秒盾处理;如果不填则表示支持所有的URL。</p>
 | 
			
		||||
				<p class="comment">如果填写了限制URL,表示只对这些URL进行5秒盾处理;如果不填则表示支持所有的URL。</p>
 | 
			
		||||
			</td>
 | 
			
		||||
		</tr>	
 | 
			
		||||
	</tr>
 | 
			
		||||
@@ -10115,7 +10115,7 @@ Vue.component("http-pages-and-shutdown-box", {
 | 
			
		||||
		let shutdownConfig = {
 | 
			
		||||
			isPrior: false,
 | 
			
		||||
			isOn: false,
 | 
			
		||||
			bodyType: "url",
 | 
			
		||||
			bodyType: "html",
 | 
			
		||||
			url: "",
 | 
			
		||||
			body: "",
 | 
			
		||||
			status: 0
 | 
			
		||||
@@ -10125,7 +10125,7 @@ Vue.component("http-pages-and-shutdown-box", {
 | 
			
		||||
				this.vShutdownConfig.body = ""
 | 
			
		||||
			}
 | 
			
		||||
			if (this.vShutdownConfig.bodyType == null) {
 | 
			
		||||
				this.vShutdownConfig.bodyType = "url"
 | 
			
		||||
				this.vShutdownConfig.bodyType = "html"
 | 
			
		||||
			}
 | 
			
		||||
			shutdownConfig = this.vShutdownConfig
 | 
			
		||||
		}
 | 
			
		||||
@@ -10236,8 +10236,8 @@ Vue.component("http-pages-and-shutdown-box", {
 | 
			
		||||
							<td>显示内容类型 *</td>
 | 
			
		||||
							<td>
 | 
			
		||||
								<select class="ui dropdown auto-width" v-model="shutdownConfig.bodyType">
 | 
			
		||||
									<option value="url">读取URL</option>
 | 
			
		||||
									<option value="html">HTML</option>
 | 
			
		||||
									<option value="url">读取URL</option>
 | 
			
		||||
								</select>
 | 
			
		||||
							</td>
 | 
			
		||||
						</tr>
 | 
			
		||||
@@ -10682,7 +10682,7 @@ Vue.component("http-cc-config-box", {
 | 
			
		||||
			<td>限制URL</td>
 | 
			
		||||
			<td>
 | 
			
		||||
				<url-patterns-box v-model="config.onlyURLPatterns"></url-patterns-box>
 | 
			
		||||
				<p class="comment">如果填写了支持URL,表示只对这些URL进行CC防护处理;如果不填则表示支持所有的URL。</p>
 | 
			
		||||
				<p class="comment">如果填写了限制URL,表示只对这些URL进行CC防护处理;如果不填则表示支持所有的URL。</p>
 | 
			
		||||
			</td>
 | 
			
		||||
		</tr>	
 | 
			
		||||
		<tr>
 | 
			
		||||
@@ -11038,8 +11038,8 @@ Vue.component("http-access-log-box", {
 | 
			
		||||
		<a v-if="accessLog.node != null && accessLog.node.nodeCluster != null" :href="'/clusters/cluster/node?nodeId=' + accessLog.node.id + '&clusterId=' + accessLog.node.nodeCluster.id" title="点击查看节点详情" target="_top"><span class="grey">[{{accessLog.node.name}}<span v-if="!accessLog.node.name.endsWith('节点')">节点</span>]</span></a>
 | 
			
		||||
		
 | 
			
		||||
		<!-- 服务 -->
 | 
			
		||||
		<a :href="'/servers/server/log?serverId=' + accessLog.serverId" title="点击到网站" v-if="vShowServerLink && accessLog.serverId > 0"><span class="grey">[服务]</span></a>
 | 
			
		||||
		<span v-if="vShowServerLink && (accessLog.serverId == null || accessLog.serverId == 0)" @click.prevent="mismatch()"><span class="disabled">[服务]</span></span>
 | 
			
		||||
		<a :href="'/servers/server/log?serverId=' + accessLog.serverId" title="点击到网站" v-if="vShowServerLink && accessLog.serverId > 0"><span class="grey">[网站]</span></a>
 | 
			
		||||
		<span v-if="vShowServerLink && (accessLog.serverId == null || accessLog.serverId == 0)" @click.prevent="mismatch()"><span class="disabled">[网站]</span></span>
 | 
			
		||||
		
 | 
			
		||||
		<span v-if="accessLog.region != null && accessLog.region.length > 0" class="grey"><ip-box :v-ip="accessLog.remoteAddr">[{{accessLog.region}}]</ip-box></span> 
 | 
			
		||||
		<ip-box><keyword :v-word="vKeyword">{{accessLog.remoteAddr}}</keyword></ip-box> [{{accessLog.timeLocal}}] <em>"<keyword :v-word="vKeyword">{{accessLog.requestMethod}}</keyword> {{accessLog.scheme}}://<keyword :v-word="vKeyword">{{accessLog.host}}</keyword><keyword :v-word="vKeyword">{{accessLog.requestURI}}</keyword> <a :href="accessLog.scheme + '://' + accessLog.host + accessLog.requestURI" target="_blank" title="新窗口打开" class="disabled"><i class="external icon tiny"></i> </a> {{accessLog.proto}}" </em> <keyword :v-word="vKeyword">{{accessLog.status}}</keyword> 
 | 
			
		||||
@@ -12839,23 +12839,34 @@ Vue.component("metric-keys-config-box", {
 | 
			
		||||
Vue.component("http-web-root-box", {
 | 
			
		||||
	props: ["v-root-config", "v-is-location", "v-is-group"],
 | 
			
		||||
	data: function () {
 | 
			
		||||
		let rootConfig = this.vRootConfig
 | 
			
		||||
		if (rootConfig == null) {
 | 
			
		||||
			rootConfig = {
 | 
			
		||||
		let config = this.vRootConfig
 | 
			
		||||
		if (config == null) {
 | 
			
		||||
			config = {
 | 
			
		||||
				isPrior: false,
 | 
			
		||||
				isOn: false,
 | 
			
		||||
				dir: "",
 | 
			
		||||
				indexes: [],
 | 
			
		||||
				stripPrefix: "",
 | 
			
		||||
				decodePath: false,
 | 
			
		||||
				isBreak: false
 | 
			
		||||
				isBreak: false,
 | 
			
		||||
				exceptHiddenFiles: true,
 | 
			
		||||
				onlyURLPatterns: [],
 | 
			
		||||
				exceptURLPatterns: []
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		if (rootConfig.indexes == null) {
 | 
			
		||||
			rootConfig.indexes = []
 | 
			
		||||
		if (config.indexes == null) {
 | 
			
		||||
			config.indexes = []
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (config.onlyURLPatterns == null) {
 | 
			
		||||
			config.onlyURLPatterns = []
 | 
			
		||||
		}
 | 
			
		||||
		if (config.exceptURLPatterns == null) {
 | 
			
		||||
			config.exceptURLPatterns = []
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		return {
 | 
			
		||||
			rootConfig: rootConfig,
 | 
			
		||||
			config: config,
 | 
			
		||||
			advancedVisible: false
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
@@ -12868,27 +12879,27 @@ Vue.component("http-web-root-box", {
 | 
			
		||||
			teaweb.popup("/servers/server/settings/web/createIndex", {
 | 
			
		||||
				height: "10em",
 | 
			
		||||
				callback: function (resp) {
 | 
			
		||||
					that.rootConfig.indexes.push(resp.data.index)
 | 
			
		||||
					that.config.indexes.push(resp.data.index)
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		removeIndex: function (i) {
 | 
			
		||||
			this.rootConfig.indexes.$remove(i)
 | 
			
		||||
			this.config.indexes.$remove(i)
 | 
			
		||||
		},
 | 
			
		||||
		isOn: function () {
 | 
			
		||||
			return ((!this.vIsLocation && !this.vIsGroup) || this.rootConfig.isPrior) && this.rootConfig.isOn
 | 
			
		||||
			return ((!this.vIsLocation && !this.vIsGroup) || this.config.isPrior) && this.config.isOn
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	template: `<div>
 | 
			
		||||
	<input type="hidden" name="rootJSON" :value="JSON.stringify(rootConfig)"/>
 | 
			
		||||
	<input type="hidden" name="rootJSON" :value="JSON.stringify(config)"/>
 | 
			
		||||
	<table class="ui table selectable definition">
 | 
			
		||||
		<prior-checkbox :v-config="rootConfig" v-if="vIsLocation || vIsGroup"></prior-checkbox>
 | 
			
		||||
		<tbody v-show="(!vIsLocation && !vIsGroup) || rootConfig.isPrior">
 | 
			
		||||
		<prior-checkbox :v-config="config" v-if="vIsLocation || vIsGroup"></prior-checkbox>
 | 
			
		||||
		<tbody v-show="(!vIsLocation && !vIsGroup) || config.isPrior">
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td class="title">启用静态资源分发</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<div class="ui checkbox">
 | 
			
		||||
						<input type="checkbox" v-model="rootConfig.isOn"/>
 | 
			
		||||
						<input type="checkbox" v-model="config.isOn"/>
 | 
			
		||||
						<label></label>
 | 
			
		||||
					</div>
 | 
			
		||||
				</td>
 | 
			
		||||
@@ -12898,7 +12909,7 @@ Vue.component("http-web-root-box", {
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td class="title">静态资源根目录</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<input type="text" name="root" v-model="rootConfig.dir" ref="focus" placeholder="类似于 /home/www"/>
 | 
			
		||||
					<input type="text" name="root" v-model="config.dir" ref="focus" placeholder="类似于 /home/www"/>
 | 
			
		||||
					<p class="comment">可以访问此根目录下的静态资源。</p>
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
@@ -12910,8 +12921,8 @@ Vue.component("http-web-root-box", {
 | 
			
		||||
				<td>首页文件</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<!-- TODO 支持排序 -->
 | 
			
		||||
					<div v-if="rootConfig.indexes.length > 0">
 | 
			
		||||
						<div v-for="(index, i) in rootConfig.indexes" class="ui label tiny">
 | 
			
		||||
					<div v-if="config.indexes.length > 0">
 | 
			
		||||
						<div v-for="(index, i) in config.indexes" class="ui label small basic">
 | 
			
		||||
							{{index}} <a href="" title="删除" @click.prevent="removeIndex(i)"><i class="icon remove"></i></a>
 | 
			
		||||
						</div>
 | 
			
		||||
						<div class="ui divider"></div>
 | 
			
		||||
@@ -12920,10 +12931,31 @@ Vue.component("http-web-root-box", {
 | 
			
		||||
					<p class="comment">在URL中只有目录没有文件名时默认查找的首页文件。</p>
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>例外URL</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<url-patterns-box v-model="config.exceptURLPatterns"></url-patterns-box>
 | 
			
		||||
					<p class="comment">如果填写了例外URL,表示不支持通过这些URL访问。</p>
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>限制URL</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<url-patterns-box v-model="config.onlyURLPatterns"></url-patterns-box>
 | 
			
		||||
					<p class="comment">如果填写了限制URL,表示仅支持通过这些URL访问。</p>
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>	
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>排除隐藏文件</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<checkbox v-model="config.exceptHiddenFiles"></checkbox>
 | 
			
		||||
					<p class="comment">排除以点(.)符号开头的隐藏目录或文件,比如<code-label>/.git/logs/HEAD</code-label></p>
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>去除URL前缀</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<input type="text" v-model="rootConfig.stripPrefix" placeholder="/PREFIX"/>
 | 
			
		||||
					<input type="text" v-model="config.stripPrefix" placeholder="/PREFIX"/>
 | 
			
		||||
					<p class="comment">可以把请求的路径部分前缀去除后再查找文件,比如把 <span class="ui label tiny">/web/app/index.html</span> 去除前缀 <span class="ui label tiny">/web</span> 后就变成 <span class="ui label tiny">/app/index.html</span>。 </p>
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
@@ -12931,17 +12963,17 @@ Vue.component("http-web-root-box", {
 | 
			
		||||
				<td>路径解码</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<div class="ui checkbox">
 | 
			
		||||
						<input type="checkbox" v-model="rootConfig.decodePath"/>
 | 
			
		||||
						<input type="checkbox" v-model="config.decodePath"/>
 | 
			
		||||
						<label></label>	
 | 
			
		||||
					</div>
 | 
			
		||||
					<p class="comment">是否对请求路径进行URL解码,比如把 <span class="ui label tiny">/Web+App+Browser.html</span> 解码成 <span class="ui label tiny">/Web App Browser.html</span> 再查找文件。</p>
 | 
			
		||||
				</td>
 | 
			
		||||
			</tr>
 | 
			
		||||
			<tr>
 | 
			
		||||
				<td>是否终止请求</td>
 | 
			
		||||
				<td>终止请求</td>
 | 
			
		||||
				<td>
 | 
			
		||||
					<div class="ui checkbox">
 | 
			
		||||
						<input type="checkbox" v-model="rootConfig.isBreak"/>
 | 
			
		||||
						<input type="checkbox" v-model="config.isBreak"/>
 | 
			
		||||
						<label></label>	
 | 
			
		||||
					</div>
 | 
			
		||||
					<p class="comment">在找不到要访问的文件的情况下是否终止请求并返回404,如果选择终止请求,则不再尝试反向代理等设置。</p>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user