mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-12-14 20:06:34 +08:00
[系统设置]增加界面设置,可以定制系统名称等
This commit is contained in:
54
web/views/@default/settings/server/index.html
Normal file
54
web/views/@default/settings/server/index.html
Normal file
@@ -0,0 +1,54 @@
|
||||
{$layout}
|
||||
|
||||
<div class="ui message warning" v-if="serverIsChanged">服务配置已修改,请在命令行下重启后生效。</div>
|
||||
|
||||
<h3>HTTP <a href="/settings/server/http" v-if="!teaDemoEnabled" @click.prevent="updateHTTP()">修改</a><a v-if="teaDemoEnabled">[演示版无法修改]</a></h3>
|
||||
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td>状态</td>
|
||||
<td>
|
||||
<label-on :v-is-on="serverConfig.http.on"></label-on>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">绑定地址</td>
|
||||
<td>
|
||||
<span v-for="listen in serverConfig.http.listen" class="ui label tiny basic">{{listen}}</span>
|
||||
<p class="ui comment">如果地址中的IP是0.0.0.0,表示服务器的所有IP都可以用来使用访问此服务。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="ui divider"></div>
|
||||
|
||||
<h3>HTTPS <a href="" v-if="!teaDemoEnabled" @click.prevent="updateHTTPS()">修改</a><a v-if="teaDemoEnabled">[演示版无法修改]</a></h3>
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td>状态</td>
|
||||
<td>
|
||||
<label-on :v-is-on="serverConfig.https.on"></label-on>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">绑定地址</td>
|
||||
<td>
|
||||
<span v-for="listen in serverConfig.https.listen" class="ui label tiny basic">{{listen}}</span>
|
||||
<p class="ui comment">如果地址中的IP是0.0.0.0,表示服务器的所有IP都可以用来使用访问此服务。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>证书文件<span class="small">(Cert)</span></td>
|
||||
<td>
|
||||
<span v-if="serverConfig.https.cert.length > 0">{{serverConfig.https.cert}}</span>
|
||||
<span class="disabled" v-else>还没有设置证书</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>私钥文件<span class="small">(Key)</span></td>
|
||||
<td>
|
||||
<span v-if="serverConfig.https.key.length > 0">{{serverConfig.https.key}}</span>
|
||||
<span class="disabled" v-else>还没有设置私钥</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
19
web/views/@default/settings/server/index.js
Normal file
19
web/views/@default/settings/server/index.js
Normal file
@@ -0,0 +1,19 @@
|
||||
Tea.context(function () {
|
||||
this.updateHTTP = function () {
|
||||
teaweb.popup("/settings/server/updateHTTPPopup", {
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", teaweb.reload)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
this.updateHTTPS = function () {
|
||||
teaweb.popup("/settings/server/updateHTTPSPopup", {
|
||||
height: "26em",
|
||||
width:"50em",
|
||||
callback: function () {
|
||||
teaweb.success("保存成功", teaweb.reload)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
27
web/views/@default/settings/server/updateHTTPPopup.html
Normal file
27
web/views/@default/settings/server/updateHTTPPopup.html
Normal file
@@ -0,0 +1,27 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>修改HTTP设置</h3>
|
||||
|
||||
<form method="post" class="ui form" data-tea-action="$" data-tea-success="success">
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td>是否启用</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="isOn" value="1" v-model="serverConfig.http.on"/>
|
||||
<label></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">绑定地址</td>
|
||||
<td>
|
||||
<values-box name="listens" :values="addresses"></values-box>
|
||||
<p class="comment" style="margin-bottom:0">地址格式为:"IP:端口",比如:"127.0.0.1:7777"。</p>
|
||||
<p class="comment">如果地址中的IP是0.0.0.0,表示服务器的所有IP都可以用来使用访问此服务。</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<submit-btn></submit-btn>
|
||||
</form>
|
||||
8
web/views/@default/settings/server/updateHTTPPopup.js
Normal file
8
web/views/@default/settings/server/updateHTTPPopup.js
Normal file
@@ -0,0 +1,8 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
|
||||
this.addresses = [];
|
||||
if (this.serverConfig != null && this.serverConfig.http != null && this.serverConfig.http.listen != null) {
|
||||
this.addresses = this.serverConfig.http.listen
|
||||
}
|
||||
})
|
||||
33
web/views/@default/settings/server/updateHTTPSPopup.html
Normal file
33
web/views/@default/settings/server/updateHTTPSPopup.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{$layout "layout_popup"}
|
||||
|
||||
<h3>修改HTTPS配置</h3>
|
||||
|
||||
<form method="post" data-tea-action="$" data-tea-success="success" class="ui form">
|
||||
<table class="ui table definition selectable">
|
||||
<tr>
|
||||
<td>是否启用</td>
|
||||
<td>
|
||||
<div class="ui checkbox">
|
||||
<input type="checkbox" name="isOn" value="1" v-model="serverConfig.https.on"/>
|
||||
<label></label>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">绑定地址</td>
|
||||
<td>
|
||||
<values-box name="listens" :values="addresses"></values-box>
|
||||
<p class="comment" style="margin-bottom:0">每行一个地址,地址格式为:"IP:端口",比如:"127.0.0.1:7778"。</p>
|
||||
<p class="comment">如果地址中的IP是0.0.0.0,表示服务器的所有IP都可以用来使用访问此服务。</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr v-show="serverConfig.https.on">
|
||||
<td>选择证书文件</td>
|
||||
<td>
|
||||
<ssl-certs-box :v-certs="certConfigs" :v-protocol="'http'" :v-view-size="'mini'" :v-single-mode="true"></ssl-certs-box>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<button class="ui button primary">保存</button>
|
||||
</form>
|
||||
8
web/views/@default/settings/server/updateHTTPSPopup.js
Normal file
8
web/views/@default/settings/server/updateHTTPSPopup.js
Normal file
@@ -0,0 +1,8 @@
|
||||
Tea.context(function () {
|
||||
this.success = NotifyPopup
|
||||
|
||||
this.addresses = [];
|
||||
if (this.serverConfig != null && this.serverConfig.https != null && this.serverConfig.https.listen != null) {
|
||||
this.addresses = this.serverConfig.https.listen
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user