This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
<first-menu>
<menu-item :href="'.?clusterId=' + clusterId" code="index">设置</menu-item>
<menu-item :href="'.test?clusterId=' + clusterId" code="test">测试</menu-item>
</first-menu>

View File

@@ -0,0 +1,38 @@
{$layout}
{$template "../menu"}
{$template "/left_menu_with_menu"}
<div class="right-box with-menu">
{$template "menu"}
<form class="ui form" method="post" data-tea-action="$" data-tea-success="success">
<csrf-token></csrf-token>
<input type="hidden" name="clusterId" :value="clusterId"/>
<table class="ui table definition selectable">
<tr>
<td class="title">启用HTTP/3功能</td>
<td>
<checkbox name="isOn" v-model="http3Policy.isOn"></checkbox>
<p class="comment">选中后表示当前集群下的网站可以使用HTTP/3功能单个网站可以在HTTPS设置页面里启用HTTP/3。</p>
</td>
</tr>
<tbody v-show="http3Policy.isOn">
<tr>
<td>UDP端口</td>
<td>
<input type="text" style="width: 5em" maxlength="4" name="port" v-model="http3Policy.port"/>
<p class="comment">HTTP/3通讯使用的UDP端口范围在1-1024请在服务器安全策略或者防火墙中设置此端口为通过。</p>
</td>
</tr>
<tr>
<td>支持手机浏览器</td>
<td>
<checkbox name="supportMobileBrowsers" v-model="http3Policy.supportMobileBrowsers"></checkbox>
<p class="comment">在手机浏览器上也尝试开启HTTP/3当下部分手机浏览器对HTTP/3支持的并不完善请根据自己的需要决定是否启用。</p>
</td>
</tr>
</tbody>
</table>
<submit-btn></submit-btn>
</form>
</div>

View File

@@ -0,0 +1,3 @@
Tea.context(function () {
this.success = NotifyReloadSuccess("保存成功")
})

View File

@@ -0,0 +1,59 @@
{$layout}
{$template "../menu"}
{$template "/left_menu_with_menu"}
<div class="right-box with-menu">
{$template "menu"}
<div v-show="!http3Policy.isOn">
<div class="margin"></div>
<p class="ui message">当前集群尚未启用HTTP/3功能不需要做任何测试。</p>
</div>
<div v-show="http3Policy.isOn">
<div class="margin"></div>
<form class="ui form" data-tea-action="$" data-tea-before="before" data-tea-done="done" data-tea-success="success" data-tea-timeout="1800">
<input type="hidden" name="clusterId" :value="clusterId"/>
<input type="hidden" name="port" :value="http3Policy.port"/>
<table class="ui table definition selectable">
<tr>
<td class="title">测试网址 *</td>
<td>
<input type="text" name="url" ref="focus" placeholder="https://..."/>
<p class="comment">即待测试的网址,<strong>需要确保对应的网站已经启用了HTTP/3功能</strong>系统会自动访问每个节点上的网址内容以便确定HTTP/3是否在此节点上工作正常。</p>
</td>
</tr>
</table>
<submit-btn v-if="!isRequesting">开始测试</submit-btn>
<button class="ui button disabled" type="button" v-if="isRequesting">测试中,请耐心等待...</button>
</form>
<!-- 测试结果 -->
<div v-if="isTested">
<h4>测试结果 &nbsp; <a href="" @click.prevent="resetResults" style="font-size: 0.8em">[清除]</a> </h4>
<p class="comment" v-if="results.length == 0">暂时还没有任何可以测试的节点。</p>
<div v-if="results.length > 0">
<table class="ui table celled selectable" style="width: 40em">
<thead>
<tr>
<th style="width: 18em">节点</th>
<th style="width: 18em">IP</th>
<th>测试结果</th>
</tr>
</thead>
<tbody>
<tr v-for="result in results">
<td>{{result.nodeName}} <link-icon :href="'/clusters/cluster/node?clusterId=' + clusterId + '&nodeId=' + result.nodeId"></link-icon></td>
<td>{{result.ip}}</td>
<td>
<span class="green" v-if="result.isOk">成功</span>
<span v-else class="red">失败 <tip-icon :content="result.error"></tip-icon></span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,26 @@
Tea.context(function () {
this.isRequesting = false
this.isTested = false
this.results = []
this.before = function () {
this.isRequesting = true
this.isTested = false
this.results = []
}
this.success = function (resp) {
this.isTested = true
this.results = resp.data.results
}
this.done = function () {
this.isRequesting = false
}
this.resetResults = function () {
this.isTested = false
this.results = []
}
})