Initial commit (code only without large binaries)

This commit is contained in:
robin
2026-02-15 18:58:44 +08:00
commit 35df75498f
9442 changed files with 1495866 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
<first-menu>
<menu-item :href="'/servers/server/settings/reverseProxy?serverId=' + serverId" code="index">源站列表</menu-item>
<menu-item :href="'/servers/server/settings/reverseProxy/scheduling?serverId=' + serverId" code="scheduling">调度算法</menu-item>
<menu-item :href="'/servers/server/settings/reverseProxy/setting?serverId=' + serverId" code="setting">更多设置</menu-item>
</first-menu>

View File

@@ -0,0 +1,23 @@
{$layout}
{$template "../settings_menu"}
{$template "/left_menu_with_menu"}
<div class="right-box with-menu">
{$template "menu"}
<div v-if="hasGroupConfig">
<div class="margin"></div>
<warning-message>由于已经在当前<a :href="groupSettingURL">网站分组</a>中进行了对应的配置,在这里的配置将不会生效。</warning-message>
</div>
<div :class="{'opacity-mask': hasGroupConfig}">
<div v-if="!reverseProxyRef.isOn">
<div class="margin"></div>
<warning-message>当前源站没有启用,可以通过点击 <a :href="'/servers/server/settings/reverseProxy/setting?serverId=' + serverId">[更多设置]</a> 开启 。</warning-message>
</div>
<origin-list-box :v-primary-origins="primaryOrigins" :v-backup-origins="backupOrigins"
:v-server-type="serverType"
:v-params="'type=server&serverId=' + serverId + '&reverseProxyId=' + reverseProxyConfig.id"></origin-list-box>
</div>
</div>

View File

@@ -0,0 +1,9 @@
{$layout}
{$template "../settings_menu"}
{$template "/left_menu_with_menu"}
<div class="right-box with-menu">
{$template "menu"}
<origin-scheduling-view-box :v-scheduling="scheduling" :v-params="'type=server&serverId=' + serverId + '&reverseProxyId=' + reverseProxyId"></origin-scheduling-view-box>
</div>

View File

@@ -0,0 +1,15 @@
{$layout}
{$template "../settings_menu"}
{$template "/left_menu_with_menu"}
<div class="right-box with-menu">
{$template "menu"}
<div class="margin"></div>
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="serverId" :value="serverId"/>
<input type="hidden" name="reverseProxyRefJSON" :value="JSON.stringify(reverseProxyRef)"/>
<reverse-proxy-box :v-reverse-proxy-ref="reverseProxyRef" :v-reverse-proxy-config="reverseProxyConfig" :v-family="serverFamily"></reverse-proxy-box>
<submit-btn></submit-btn>
</form>
</div>

View File

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

View File

@@ -0,0 +1,60 @@
{$layout "layout_popup"}
<h3>修改调度算法</h3>
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
<input type="hidden" name="dataType" :value="dataType"/>
<input type="hidden" name="serverId" :value="serverId"/>
<input type="hidden" name="reverseProxyId" :value="reverseProxyId"/>
<table class="ui table selectable definition">
<tr>
<td class="title">选择调度算法</td>
<td>
<select class="ui dropdown auto-width" name="type" v-model="selectedType"
@change="changeSchedulingType()">
<option v-for="schedulingType in schedulingTypes"
:value="schedulingType.code">{{schedulingType.name}}</option>
</select>
<p class="comment">{{schedulingTypeDescription}}</p>
</td>
</tr>
<tr v-if="selectedType == 'hash'">
<td>
Key
</td>
<td>
<input type="text" name="hashKey" v-model="hashKey" maxlength="500"/>
<p class="comment">用来计算Hash的字符串其中可以使用变量。</p>
</td>
</tr>
<tr v-if="selectedType == 'hash'">
<td>常用变量</td>
<td>
<select class="ui dropdown" style="width:12em" v-model="hashVar" @change="changeHashVar()">
<option></option>
<option value="${remoteAddr}">客户端IP</option>
<option value="${host}${requestURI}">请求URL</option>
</select>
</td>
</tr>
<tr v-if="selectedType == 'sticky'">
<td>参数类型</td>
<td>
<select class="ui dropdown" style="width:12em" name="stickyType" v-model="stickyType">
<option value="cookie">Cookie</option>
<option value="header">HTTP Header</option>
<option value="argument">URL参数</option>
</select>
</td>
</tr>
<tr v-if="selectedType == 'sticky'">
<td>参数名</td>
<td>
<input type="text" name="stickyParam" v-model="stickyParam" maxlength="50"/>
<p class="comment">记录或指定源站的参数名只能是英文字母和数字的组合不允许有下划线因为在HTTP Header中下划线是不标准的</p>
</td>
</tr>
</table>
<submit-btn></submit-btn>
</form>

View File

@@ -0,0 +1,39 @@
Tea.context(function () {
var that = this;
this.success = NotifyPopup
this.selectedType = this.scheduling.code;
this.schedulingTypeDescription = null;
this.changeSchedulingType = function () {
this.schedulingTypeDescription = this.schedulingTypes.$find(function (k, v) {
return v.code == that.selectedType;
}).description;
};
this.changeSchedulingType();
// hash
this.hashKey = "";
this.hashVar = "";
if (this.scheduling.code == "hash") {
this.hashKey = this.scheduling.options.key;
} else {
this.hashKey = "${remoteAddr}";
}
this.changeHashVar = function () {
if (this.hashVar.length > 0) {
this.hashKey = this.hashVar;
}
};
// sticky
if (this.scheduling.code == "sticky") {
this.stickyType = this.scheduling.options.type;
this.stickyParam = this.scheduling.options.param;
} else {
this.stickyType = "cookie";
this.stickyParam = "Origin";
}
});