12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <!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">
- </head>
- <body>
- <div id="settings" class="ui form">
- </div>
- <div class="ui button" onclick="submit()">Update</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)
- })
- }
- </script>
- </html>
|