123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <!DOCTYPE html>
- <html>
- <head>
- <!-- Standard Meta -->
- <meta charset="utf-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
- <!-- Site Properties -->
- <title>Minecraft Server</title>
- <script src="https://code.jquery.com/jquery-3.1.1.min.js" crossorigin="anonymous"></script>
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
- <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.js"></script>
- <!-- MC Skin-->
- <link rel="stylesheet" href="/css/minecraft-skinviewer.css">
- <!-- Semantic UI Alert-->
- <link rel="stylesheet" href="/css/Semantic-UI-Alert.css">
- <script src="/js/semantic-ui-alert.js"></script>
- <script src="/js/alert.js"></script>
- </head>
- <body>
- <div id="settings" class="ui form">
- </div>
- <div class="ui button" onclick="submit()">Update</div>
- <div style="height:30px"></div>
- </body>
- <script>
- updateInfo()
- function updateInfo() {
- $.get("/properties", function(data) {
- if (data.length == 0) {
- $("#settings").html(`
- <div class="inline field">
- <label>No item :(</label>
- </div>
- <div class="ui divider"></div>
- `)
- return
- }
- $("#settings").html("");
- $.each(data, function(i, item) {
- $("#settings").append(`
- <div class="inline field">
- <label style="width:46vw">` + item.key + `</label>
- <input style="width:46vw" type="text" id="` + item.key + `" placeholder="` + item.value + `" value="` + item.value + `">
- </div>
- <div class="ui divider"></div>
- `)
- })
- });
- }
- function submit() {
- $.each($("input"), function(i, item) {
- var key = $(item).attr("id");
- var value = $(item).val();
- $.get("/properties/change?key=" + key + "&value=" + value, function(data) {
- if (data == "OK") {
- if (i == $("input").length - 1) {
- msgbox("Action completed.");
- }
- } else {
- errmsg(item + ":" + data);
- }
- updateInfo();
- });
- })
- }
- </script>
- </html>
|