新增 服务端操作确认对话框

This commit is contained in:
Suwings 2021-11-09 10:54:25 +08:00
parent 625a208657
commit 71735494a9

View File

@ -5,24 +5,20 @@
<div class="PanelTitle">服务端信息</div>
<div class="PanelBody">
<div class="PanelItem">
<span class="glyphicon glyphicon-th-large" aria-hidden="true"> </span>
名称: {{ serverData.name }}
<span class="glyphicon glyphicon-th-large" aria-hidden="true"> </span> 名称: {{ serverData.name }}
</div>
<div class="PanelItem">
<span class="glyphicon glyphicon-tasks" aria-hidden="true"> </span>
CPU 使用率: {{ sysCpu }} %
<span class="glyphicon glyphicon-tasks" aria-hidden="true"> </span> CPU 使用率: {{ sysCpu }} %
</div>
<div class="PanelItem">
<span class="glyphicon glyphicon-equalizer" aria-hidden="true"> </span>
内存 使用率: {{ (100 - sysMonery).toFixed(1) }} %
<span class="glyphicon glyphicon-equalizer" aria-hidden="true"> </span> 内存 使用率: {{ (100 - sysMonery).toFixed(1) }} %
</div>
<div class="PanelItem" v-if="run">
<span class="glyphicon glyphicon-ok" aria-hidden="true"> </span>
<span style="color: #23970c"> 状态: 正在运行..</span>
</div>
<div class="PanelItem" v-else>
<span class="glyphicon glyphicon-remove" aria-hidden="true"> </span>
状态: 未运行
<span class="glyphicon glyphicon-remove" aria-hidden="true"> </span> 状态: 未运行
</div>
</div>
</div>
@ -30,28 +26,23 @@
<div class="PanelTitle">服务端操作</div>
<div class="PanelBody">
<div class="PanelItem" v-on:click="toTerminal()">
<span class="glyphicon glyphicon-unchecked" aria-hidden="true"> </span>
模拟型终端
<span class="glyphicon glyphicon-unchecked" aria-hidden="true"> </span> 模拟型终端
</div>
<transition name="slide-fade">
<div class="PanelItem" v-on:click="toOpenServer()" v-show="!run">
<span class="glyphicon glyphicon-play" aria-hidden="true"> </span>
开启服务器
<div class="PanelItem" v-on:click="toOpenServer" v-show="!run">
<span class="glyphicon glyphicon-play" aria-hidden="true"> </span> 开启服务器
</div>
</transition>
<transition name="slide-fade">
<div class="PanelItem" v-on:click="toCommand('__stop__')" v-show="run">
<span class="glyphicon glyphicon-pause" aria-hidden="true"> </span>
关闭服务器
<div class="PanelItem" v-on:click="toStopServer" v-show="run">
<span class="glyphicon glyphicon-pause" aria-hidden="true"> </span> 关闭服务器
</div>
</transition>
<div class="PanelItem" v-on:click="toCommand('__restart__')" v-show="run">
<span class="glyphicon glyphicon-refresh" aria-hidden="true"> </span>
重启服务器
<div class="PanelItem" v-on:click="toRestartServer" v-show="run">
<span class="glyphicon glyphicon-refresh" aria-hidden="true"> </span> 重启服务器
</div>
<div class="PanelItem" v-on:click="toCommand('__killserver__')" v-show="run">
<span class="glyphicon glyphicon-remove" aria-hidden="true"> </span>
强制性结束进程
<div class="PanelItem" v-on:click="toKillServer" v-show="run">
<span class="glyphicon glyphicon-remove" aria-hidden="true"> </span> 强制性结束进程
</div>
</div>
</div>
@ -59,20 +50,17 @@
<div class="PanelTitle">崩溃监视与配置</div>
<div class="PanelBody">
<div class="PanelItem" v-on:click="toProperties()">
<span class="glyphicon glyphicon-cog" aria-hidden="true"> </span>
Server.properties 配置文件
<span class="glyphicon glyphicon-cog" aria-hidden="true"> </span> Server.properties 配置文件
</div>
<transition name="slide-fade">
<div class="PanelItem" v-on:click="toAutoRestart(false)" v-show="serverData.autoRestart">
<span class="glyphicon glyphicon-retweet" aria-hidden="true"> </span>
崩溃重启:
<span class="glyphicon glyphicon-retweet" aria-hidden="true"> </span> 崩溃重启:
<span style="color: #29b90c">打开</span>
</div>
</transition>
<transition name="slide-fade">
<div class="PanelItem" v-on:click="toAutoRestart(true)" v-show="!serverData.autoRestart">
<span class="glyphicon glyphicon-retweet" aria-hidden="true"> </span>
崩溃重启:
<span class="glyphicon glyphicon-retweet" aria-hidden="true"> </span> 崩溃重启:
<span style="color: #818181">关闭</span>
</div>
</transition>
@ -83,15 +71,13 @@
<div class="PanelBody">
<transition name="slide-fade">
<div class="PanelItem" v-on:click="toAutoStart(false)" v-show="serverData.autoStart">
<span class="glyphicon glyphicon-retweet" aria-hidden="true"> </span>
服务器自启:
<span class="glyphicon glyphicon-retweet" aria-hidden="true"> </span> 服务器自启:
<span style="color: #29b90c">打开</span>
</div>
</transition>
<transition name="slide-fade">
<div class="PanelItem" v-on:click="toAutoStart(true)" v-show="!serverData.autoStart">
<span class="glyphicon glyphicon-retweet" aria-hidden="true"> </span>
服务器自启:
<span class="glyphicon glyphicon-retweet" aria-hidden="true"> </span> 服务器自启:
<span style="color: #818181">关闭</span>
</div>
</transition>
@ -101,22 +87,18 @@
<div class="PanelTitle">FTP 链接信息</div>
<div class="PanelBody">
<div class="PanelItem">
<span class="glyphicon glyphicon-user" aria-hidden="true"> </span>
账号: {{ MCSERVER.username + "." + serverData.name }}
<span class="glyphicon glyphicon-user" aria-hidden="true"> </span> 账号: {{ MCSERVER.username + "." + serverData.name }}
</div>
<div class="PanelItem">
<span class="glyphicon glyphicon-th-list" aria-hidden="true"> </span>
端口: {{ FTP_port }}
<span class="glyphicon glyphicon-th-list" aria-hidden="true"> </span> 端口: {{ FTP_port }}
</div>
<div class="PanelItem">
<span class="glyphicon glyphicon-lock" aria-hidden="true"></span>
密码:
<span class="glyphicon glyphicon-lock" aria-hidden="true"></span> 密码:
<span style="color: #666666">&lt;与登陆密码相同&gt;</span>
</div>
<div class="PanelItem">
<span class="glyphicon glyphicon-send" aria-hidden="true"></span>
模式:
<span class="glyphicon glyphicon-send" aria-hidden="true"></span> 模式:
<span style="color: #666666">&lt;被动传输模式&gt;</span>
</div>
</div>
@ -226,9 +208,22 @@
window.open(path);
},
toOpenServer: function() {
if (!confirm("是否确定执行 [开启] 操作?")) return;
this.allowedStart = !this.allowedStart;
WS.sendMsg("server/console/open", serverName);
},
toStopServer: function() {
if (!confirm("是否确定执行 [关闭] 操作?")) return;
this.toCommand('__stop__');
},
toRestartServer: function() {
if (!confirm("是否确定执行 [重启] 操作?")) return;
this.toCommand('__restart__');
},
toKillServer: function() {
if (!confirm("是否确定执行 [终止] 操作?")) return;
this.toCommand('__killserver__');
},
toCommand: function(parCommand) {
if (parCommand && typeof parCommand == "string") this.command = parCommand;
var data = {
@ -297,8 +292,7 @@
PAGE.ChartLogIs = true;
TOOLS.charts.bulider(
"ChartCPU",
24,
{},
24, {},
function(chart) {
ChartCPU = chart;
@ -315,8 +309,7 @@
//ChartRAM
TOOLS.charts.bulider(
"ChartRAM",
24,
{},
24, {},
function(chart) {
ChartRAM = chart;