AY 4 anos atrás
pai
commit
8a1ef05e0d

+ 11 - 6
mc_add.go

@@ -3,24 +3,29 @@ package main
 import (
 	"net/http"
 	"strconv"
+	"time"
 )
 
 func AddBanIP(w http.ResponseWriter, r *http.Request) {
+	t := time.Now()
+
 	IP, _ := mv(r, "IP", false)
-	Created, _ := mv(r, "Created", false)
-	Source, _ := mv(r, "Source", false)
-	Expires, _ := mv(r, "Expires", false)
+	Created := t.Format("2020-12-19 16:00:01 -0800")
+	Source := "ArOZ Minecraft Terminal"
+	Expires := "forever"
 	Reason, _ := mv(r, "Reason", false)
 	Config.WriteBannedIP(IP, Created, Source, Expires, Reason)
 	sendJSONResponse(w, "OK")
 }
 
 func AddBanPlayer(w http.ResponseWriter, r *http.Request) {
+	t := time.Now()
+
 	UUID, _ := mv(r, "UUID", false)
 	Name, _ := mv(r, "Name", false)
-	Created, _ := mv(r, "Created", false)
-	Source, _ := mv(r, "Source", false)
-	Expires, _ := mv(r, "Expires", false)
+	Created := t.Format("2020-12-19 16:00:01 -0800")
+	Source := "ArOZ Minecraft Terminal"
+	Expires := "forever"
 	Reason, _ := mv(r, "Reason", false)
 	Config.WriteBannedPlayer(UUID, Name, Created, Source, Expires, Reason)
 	sendJSONResponse(w, "OK")

+ 6 - 6
webroot/setting.html

@@ -42,22 +42,22 @@
         <a class="item" data-tab="6">EULA</a>
     </div>
     <div class="ui bottom attached tab segment active" style="height:100%;width:100%" data-tab="1">
-        <iframe src="/setting/banip.html" style="height:100%;width:100%" title=""></iframe>
+        <iframe src="/setting/banip.html" style="height: calc(100vh - 85px);width:100%" title=""></iframe>
     </div>
     <div class="ui bottom attached tab segment" style="height:100%;width:100%" data-tab="2">
-        <iframe src="/setting/banplayer.html" style="height:100%;width:100%" title=""></iframe>
+        <iframe src="/setting/banplayer.html" style="height: calc(100vh - 85px);width:100%" title=""></iframe>
     </div>
     <div class="ui bottom attached tab segment" style="height:100%;width:100%" data-tab="3">
-        <iframe src="/setting/ops.html" style="height:100%;width:100%" title=""></iframe>
+        <iframe src="/setting/ops.html" style="height: calc(100vh - 85px);width:100%" title=""></iframe>
     </div>
     <div class="ui bottom attached tab segment" style="height:100%;width:100%" data-tab="4">
-        <iframe src="/setting/properties.html" style="height:100%;width:100%" title=""></iframe>
+        <iframe src="/setting/properties.html" style="height: calc(100vh - 85px);width:100%" title=""></iframe>
     </div>
     <div class="ui bottom attached tab segment" style="height:100%;width:100%" data-tab="5">
-        <iframe src="/setting/whitelist.html" style="height:100%;width:100%" title=""></iframe>
+        <iframe src="/setting/whitelist.html" style="height: calc(100vh - 85px);width:100%" title=""></iframe>
     </div>
     <div class="ui bottom attached tab segment" style="height:100%;width:100%" data-tab="6">
-        <iframe src="/setting/eula.html" style="height:100%;width:100%" title=""></iframe>
+        <iframe src="/setting/eula.html" style="height: calc(100vh - 85px);width:100%" title=""></iframe>
     </div>
     <script>
         $('.menu .item')

+ 10 - 1
webroot/setting/banip.html

@@ -20,6 +20,16 @@
 <body>
     <div class="ui divided items" id="userlist">
     </div>
+    <div class="ui fluid input" style="position: fixed;bottom: 10px;width: 99vw;">
+        <input type="text" id="uuid" placeholder="UUID">
+        <div style="width:10px"></div>
+        <input type="text" id="name" placeholder="Name">
+        <div style="width:10px"></div>
+        <input type="text" id="reason" placeholder="Reason">
+        <div style="width:10px"></div>
+        <div class="ui button" onclick="sendCmd()">Submit</div>
+    </div>
+
 </body>
 <script>
     var refreshInfo;
@@ -57,7 +67,6 @@
                 </div>
                 `)
             })
-            currentOnlineUser = data.sample;
         });
     }
 

+ 11 - 2
webroot/setting/banplayer.html

@@ -20,6 +20,17 @@
 <body>
     <div class="ui divided items" id="userlist">
     </div>
+    <div class="ui fluid input" style="position: fixed;bottom: 10px;width: 99vw;">
+        <input type="text" id="uuid" placeholder="UUID">
+        <div style="width:10px"></div>
+        <input type="text" id="name" placeholder="Name">
+        <div style="width:10px"></div>
+        <input type="text" id="level" placeholder="Level">
+        <div style="width:10px"></div>
+        <input type="text" id="bypass" placeholder="BypassesPlayerLimit">
+        <div style="width:10px"></div>
+        <div class="ui button" onclick="sendCmd()">Submit</div>
+    </div>
 </body>
 <script>
     var refreshInfo;
@@ -60,7 +71,6 @@
                 </div>
                 `)
             })
-            currentOnlineUser = data.sample;
         });
     }
 
@@ -68,7 +78,6 @@
         var username = $(btn).parent().attr("username");
         sendCmd("ban " + username);
     }
-
 </script>
 
 </html>

+ 1 - 1
webroot/setting/eula.html

@@ -21,6 +21,7 @@
     <a href="https://account.mojang.com/documents/minecraft_eula">MINECRAFT END USER LICENSE AGREEMENT</a>
     <div id="settings" class="ui form">
     </div>
+    <div class="ui button" onclick="sendCmd()">Update</div>
 </body>
 <script>
     $.get("/eula", function(data) {
@@ -40,7 +41,6 @@
                 </div>
                 <div class="ui divider"></div>
         `)
-        currentOnlineUser = data.sample;
     });
 </script>
 

+ 9 - 2
webroot/setting/ops.html

@@ -20,6 +20,15 @@
 <body>
     <div class="ui divided items" id="userlist">
     </div>
+    <div class="ui fluid input" style="position: fixed;bottom: 10px;width: 99vw;">
+        <input type="text" id="uuid" placeholder="UUID">
+        <div style="width:10px"></div>
+        <input type="text" id="name" placeholder="Name">
+        <div style="width:10px"></div>
+        <input type="text" id="reason" placeholder="Reason">
+        <div style="width:10px"></div>
+        <div class="ui button" onclick="sendCmd()">Submit</div>
+    </div>
 </body>
 <script>
     var refreshInfo;
@@ -60,7 +69,6 @@
                 </div>
                 `)
             })
-            currentOnlineUser = data.sample;
         });
     }
 
@@ -68,7 +76,6 @@
         var username = $(btn).parent().attr("username");
         sendCmd("ban " + username);
     }
-
 </script>
 
 </html>

+ 1 - 1
webroot/setting/properties.html

@@ -20,6 +20,7 @@
 <body>
     <div id="settings" class="ui form">
     </div>
+    <div class="ui button" onclick="sendCmd()">Update</div>
 </body>
 <script>
     $.get("/properties", function(data) {
@@ -42,7 +43,6 @@
                 <div class="ui divider"></div>
             `)
         })
-        currentOnlineUser = data.sample;
     });
 </script>
 

+ 7 - 2
webroot/setting/whitelist.html

@@ -20,6 +20,13 @@
 <body>
     <div class="ui divided items" id="userlist">
     </div>
+    <div class="ui fluid input" style="position: fixed;bottom: 10px;width: 99vw;">
+        <input type="text" id="uuid" placeholder="UUID">
+        <div style="width:10px"></div>
+        <input type="text" id="name" placeholder="Name">
+        <div style="width:10px"></div>
+        <div class="ui button" onclick="sendCmd()">Submit</div>
+    </div>
 </body>
 <script>
     var refreshInfo;
@@ -60,7 +67,6 @@
                 </div>
                 `)
             })
-            currentOnlineUser = data.sample;
         });
     }
 
@@ -68,7 +74,6 @@
         var username = $(btn).parent().attr("username");
         sendCmd("ban " + username);
     }
-
 </script>
 
 </html>