🚀 dashboard v0.14.4 hide the server from guests

This commit is contained in:
naiba
2022-09-30 22:40:56 +08:00
parent ad4c0a15ab
commit d1f3c47cee
11 changed files with 65 additions and 14 deletions

View File

@@ -292,6 +292,11 @@ function addOrEditServer(server, conf) {
modal.find(".command.field").attr("style", "display:none");
modal.find("input[name=secret]").val("");
}
if (server && server.HideForGuest) {
modal.find(".ui.hideforguest.checkbox").checkbox("set checked");
} else {
modal.find(".ui.hideforguest.checkbox").checkbox("set unchecked");
}
showFormModal(".server.modal", "#serverForm", "/api/server");
}

View File

@@ -10,7 +10,7 @@
<script src="https://cdn.staticfile.org/semantic-ui/2.4.1/semantic.min.js"></script>
<script src="/static/semantic-ui-alerts.min.js"></script>
<script src="https://cdn.staticfile.org/vue/2.6.14/vue.min.js"></script>
<script src="/static/main.js?v20220917"></script>
<script src="/static/main.js?v20220930"></script>
<script>
(function () {
updateLang({{.LANG }});

View File

@@ -20,11 +20,16 @@
<label>{{tr "Secret"}}</label>
<input type="text" name="secret">
</div>
<div class="field">
<div class="ui hideforguest checkbox">
<input name="HideForGuest" type="checkbox" tabindex="0" class="hidden" />
<label>{{tr "HideForGuest"}}</label>
</div>
</div>
<div class="field">
<label>{{tr "Note"}}</label>
<textarea name="Note"></textarea>
</div>
<div class="command field">
<label>{{tr "LinuxOneKeyInstall"}}</label>
<div class="ui message">

View File

@@ -25,6 +25,7 @@
<th>{{tr "ServerGroup"}}</th>
<th>IP</th>
<th>{{tr "VersionNumber"}}</th>
<th>{{tr "HideForGuest"}}</th>
<th>{{tr "Secret"}}</th>
<th>{{tr "OneKeyInstall"}}</th>
<th>{{tr "Note"}}</th>
@@ -40,7 +41,12 @@
<td>{{$server.Tag}}</td>
<td>{{$server.Host.IP}}</td>
<td>{{$server.Host.Version}}</td>
<td>{{$server.Secret}}</td>
<td>{{$server.HideForGuest}}</td>
<td>
<button class="ui icon green mini button" data-clipboard-text="{{$server.Secret}}">
<i class="copy icon"></i>
</button>
</td>
<td>
<button class="ui icon green mini button"
data-clipboard-text="{{if $.Conf.GRPCHost}}{{if eq $.Conf.Language "zh-CN"}}curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh{{else}}curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install_en.sh{{end}} -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh install_agent {{$.Conf.GRPCHost}} {{if $.Conf.ProxyGRPCPort}}{{$.Conf.ProxyGRPCPort}}{{else}}{{$.Conf.GRPCPort}}{{end}} {{$server.Secret}}{{if $.Conf.TLS}} --tls{{end}}{{else}}{{tr "NoDomainAlert"}}{{end}}"