Commit 5b106c85 authored by nanahira's avatar nanahira

add reboot button

parent 348cdf12
......@@ -52,6 +52,7 @@
<button class="btn btn-default" id="kick_button" data-toggle="tooltip" title="Terminate a room. Input the room ID for a specific room, or 'all' for all rooms.">Terminate</button>
<button class="btn btn-default" id="death_button" data-toggle="tooltip" title="Start Extra Duel. Input the room ID for a specific room, or leave blank for all rooms.">Extra Duel</button>
<button class="btn btn-default" id="deathcancel_button" data-toggle="tooltip" title="Cancel Extra Duel. Input the room ID for a specific room, or leave blank for all rooms.">Cancel Extra Duel</button>
<button class="btn btn-default" id="reboot_button" data-toggle="tooltip" title="Terminate all rooms and reboot the server.">Reboot Server</button>
<span id="message_callback"></span>
</div>
</div>
......
......@@ -11,6 +11,7 @@ $(function(){
$("#kick_button").click(kick_room);
$("#death_button").click(start_death);
$("#deathcancel_button").click(cancel_death);
$("#reboot_button").click(reboot);
var params=parseQueryString();
$("#ip").val(params["ip"]);
$("#port").val(params["port"]);
......@@ -209,6 +210,13 @@ function cancel_death() {
}
}
}
function reboot() {
if (confirm("Are you sure to reboot server?")) {
$("#message_callback").text('...');
var url=get_http() + "/api/message?reboot=1&pass=" + get_value("#password") + "&username="+get_value("#username") + "&callback=?";
$.getJSON(url, shoutcallback);
}
}
function shoutcallback(data) {
$("#message_callback").text(data[0]);
......
......@@ -52,6 +52,7 @@
<button class="btn btn-default" id="kick_button" data-toggle="tooltip" title="中止指定房间的决斗,输入房间号为指定房间,输入 all 为全部房间">中止</button>
<button class="btn btn-default" id="death_button" data-toggle="tooltip" title="开始加时赛,输入房间号为指定房间,不输入为全部房间">加时赛</button>
<button class="btn btn-default" id="deathcancel_button" data-toggle="tooltip" title="取消加时赛,输入房间号为指定房间,不输入为全部房间">取消加时赛</button>
<button class="btn btn-default" id="reboot_button" data-toggle="tooltip" title="强制重启服务器,中断所有房间">重启服务器</button>
<span id="message_callback"></span>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment