POST = Webserver.GetPostParams(cont.Request);
if(POST.ContainsKey("user") && POST["user"] == "admin" &&
@@ -56,6 +75,9 @@ namespace Fraunhofer.Fit.IoT.LoraMap.Model.Admin {
}
private Boolean CheckAuth(HttpListenerContext cont) {
+ #if DEBUG
+ return true;
+ #endif
if(cont.Request.Url.PathAndQuery.StartsWith("/admin/login.html")) {
return true;
} else {
diff --git a/Lora-Map/Model/PositionItem.cs b/Lora-Map/Model/PositionItem.cs
index a193e6c..0f07098 100644
--- a/Lora-Map/Model/PositionItem.cs
+++ b/Lora-Map/Model/PositionItem.cs
@@ -65,13 +65,13 @@ namespace Fraunhofer.Fit.IoT.LoraMap.Model {
}
this.Recievedtime = DateTime.UtcNow;
this.Battery = Math.Round((Double)json["BatteryLevel"], 2);
- if(this.Battery < 3.59) {
+ if(this.Battery < 3.44) {
this.Batterysimple = 0;
- } else if(this.Battery < 3.69) {
+ } else if(this.Battery < 3.53) {
this.Batterysimple = 1;
- } else if(this.Battery < 3.77) {
+ } else if(this.Battery < 3.6525) {
this.Batterysimple = 2;
- } else if(this.Battery < 3.97) {
+ } else if(this.Battery < 3.8825) {
this.Batterysimple = 3;
} else {
this.Batterysimple = 4;
diff --git a/Lora-Map/resources/admin/css/global.css b/Lora-Map/resources/admin/css/global.css
new file mode 100644
index 0000000..ec50778
--- /dev/null
+++ b/Lora-Map/resources/admin/css/global.css
@@ -0,0 +1,31 @@
+html, body {
+ height: 100%;
+ margin: 0;
+ padding: 0;
+ font-family: Verdana;
+}
+
+#header {
+ font-size: 20px;
+ font-weight: bold;
+ padding: 5px;
+}
+
+#menu {
+ width: 200px;
+ font-size: 12px;
+ float: left;
+}
+#menu ul {
+ padding-left: 20px;
+}
+#menu ul li a {
+ color: black;
+}
+#menu ul li a:hover {
+ text-decoration: none;
+}
+
+#content {
+ margin-left: 210px;
+}
\ No newline at end of file
diff --git a/Lora-Map/resources/admin/index.html b/Lora-Map/resources/admin/index.html
index 2ac7b38..cbd7b26 100644
--- a/Lora-Map/resources/admin/index.html
+++ b/Lora-Map/resources/admin/index.html
@@ -2,10 +2,21 @@
-
-
+
+ Adminpannel Lora-Map
+
+
- ADMIN
+
+
+ Wilkommen im Adminbereich
\ No newline at end of file
diff --git a/Lora-Map/resources/admin/js/menu.js b/Lora-Map/resources/admin/js/menu.js
new file mode 100644
index 0000000..bce5b59
--- /dev/null
+++ b/Lora-Map/resources/admin/js/menu.js
@@ -0,0 +1,40 @@
+function menu_names() {
+ var parsenames = new XMLHttpRequest();
+ parsenames.onreadystatechange = function() {
+ if(parsenames.readyState === 4 && parsenames.status === 200) {
+ NamesEditor.parseJson(parsenames.responseText);
+ }
+ };
+ parsenames.open("GET", "http://{%REQUEST_URL_HOST%}:8080/admin/get_json_names", true);
+ parsenames.send();
+}
+
+function menu_overlay() {
+
+}
+
+function menu_export() {
+
+}
+
+function menu_import() {
+
+}
+
+var NamesEditor = {
+ parseJson: function (jsontext) {
+ document.getElementById("content").innerHTML = "";
+ var namesconfig = JSON.parse(jsontext);
+ var html = "Einträge
";
+ for (var id in namesconfig) {
+ if (namesconfig.hasOwnProperty(id)) {
+ var nameentry = namesconfig[id];
+ html += "" +
+ "" + id + "" +
+ ""+nameentry["name"]+""+
+ "
";
+ }
+ }
+ document.getElementById("content").innerHTML = html;
+ }
+};
\ No newline at end of file