add GRPCHost config

This commit is contained in:
Zhu Rengen
2021-08-10 14:04:21 +08:00
parent 0ace140df7
commit 39cdfbf6cd
6 changed files with 82 additions and 3 deletions

View File

@@ -155,7 +155,7 @@ function addOrEditNotification(notification) {
);
}
function addOrEditServer(server) {
function addOrEditServer(server, conf) {
const modal = $(".server.modal");
modal.children(".header").text((server ? "修改" : "添加") + "服务器");
modal
@@ -172,9 +172,14 @@ function addOrEditServer(server) {
modal.find("textarea[name=Note]").val(server ? server.Note : null);
if (server) {
modal.find(".secret.field").attr("style", "");
modal.find(".command.field").attr("style", "");
modal.find(".command.hostSecret").text(server.Secret);
modal.find(".command.GRPCHost").text(conf.GRPCHost);
modal.find(".command.GRPCPort").text(conf.GRPCPort);
modal.find("input[name=secret]").val(server.Secret);
} else {
modal.find(".secret.field").attr("style", "display:none");
modal.find(".command.field").attr("style", "display:none");
modal.find("input[name=secret]").val("");
}
showFormModal(".server.modal", "#serverForm", "/api/server");

View File

@@ -32,7 +32,7 @@
Shell推荐
</div>
<div class="ui segment">
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh <code class="command host"></code> 5555 <code class="command hostSecret"></code>
curl -L https://raw.githubusercontent.com/cloverzrg/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh <code class="command GRPCHost"></code> <code class="command GRPCPort"></code> <code class="command hostSecret"></code>
</div>
</div>
</div>

View File

@@ -35,7 +35,7 @@
<td style="word-break: break-word;">{{$server.Note}}</td>
<td>
<div class="ui mini icon buttons">
<button class="ui button" onclick="addOrEditServer({{$server.Marshal}})">
<button class="ui button" onclick="addOrEditServer({{$server.Marshal}},{{$.Conf}})">
<i class="edit icon"></i>
</button>
<button class="ui button"