Compare commits
4 Commits
v1.0.0
...
kotlinjssu
Author | SHA1 | Date | |
---|---|---|---|
8a0396ab2d | |||
b3960653ca | |||
af321c8aad | |||
16939c7b6a |
94
WebServer/build.gradle
Normal file
94
WebServer/build.gradle
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
//plugins {
|
||||||
|
// id 'org.jetbrains.kotlin.js' version '1.3.70-eap-184'
|
||||||
|
//}
|
||||||
|
|
||||||
|
//group 'org.example'
|
||||||
|
version '1.0-SNAPSHOT'
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
ext.kotlin_version = '1.3.61'
|
||||||
|
ext.web_dir = '../src/resources/wwwroot/js/'
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'kotlin2js'
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main.java.srcDirs = ["src/js/"]
|
||||||
|
test.java.srcDirs = ["src/js/test"]
|
||||||
|
}
|
||||||
|
|
||||||
|
compileKotlin2Js {
|
||||||
|
kotlinOptions.outputFile = "${projectDir}/build/web/WasteInformationServer.js"
|
||||||
|
kotlinOptions.moduleKind = "plain"
|
||||||
|
kotlinOptions.sourceMap = true
|
||||||
|
}
|
||||||
|
|
||||||
|
compileTestKotlin2Js {
|
||||||
|
kotlinOptions.moduleKind = "plain"
|
||||||
|
kotlinOptions.sourceMap = true
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
maven {
|
||||||
|
url "http://dl.bintray.com/kotlin/kotlin-eap-1.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
compile "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
|
||||||
|
testCompile "org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
|
||||||
|
}
|
||||||
|
|
||||||
|
clean.doFirst() {
|
||||||
|
delete("${web_dir}")
|
||||||
|
}
|
||||||
|
|
||||||
|
build.doLast() {
|
||||||
|
// Copy kotlin.js and kotlin-meta.js from jar into web directory
|
||||||
|
configurations.compile.each { File file ->
|
||||||
|
copy {
|
||||||
|
includeEmptyDirs = false
|
||||||
|
|
||||||
|
from zipTree(file.absolutePath)
|
||||||
|
into "${projectDir}/${web_dir}/lib"
|
||||||
|
include { fileTreeElement ->
|
||||||
|
def path = fileTreeElement.path
|
||||||
|
path.endsWith(".js") && (path.startsWith("META-INF/resources/") || !path.startsWith("META-INF/"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unpack build contents
|
||||||
|
// TODO Remove this step when a CDN link is available.
|
||||||
|
copy {
|
||||||
|
File artifact = new File("build/libs/${project.name}-${project.version}.jar")
|
||||||
|
includeEmptyDirs = false
|
||||||
|
|
||||||
|
from zipTree(artifact)
|
||||||
|
into "${web_dir}"
|
||||||
|
include { fileTreeElement ->
|
||||||
|
def path = fileTreeElement.path
|
||||||
|
!(path.startsWith("META-INF/") || path.startsWith("${project.name}"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Copy scripts to web directory
|
||||||
|
copy {
|
||||||
|
includeEmptyDirs = false
|
||||||
|
from new File("build/classes/main")
|
||||||
|
into "${web_dir}/lib"
|
||||||
|
}
|
||||||
|
|
||||||
|
copy {
|
||||||
|
includeEmptyDirs = false
|
||||||
|
from new File("build/classes/test")
|
||||||
|
into "${web_dir}/lib"
|
||||||
|
}
|
||||||
|
}
|
1
WebServer/settings.gradle
Normal file
1
WebServer/settings.gradle
Normal file
@ -0,0 +1 @@
|
|||||||
|
rootProject.name = 'WebServer'
|
26
WebServer/src/js/Dashboard.kt
Normal file
26
WebServer/src/js/Dashboard.kt
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import org.w3c.fetch.RequestInit
|
||||||
|
import kotlin.browser.document
|
||||||
|
import kotlin.browser.window
|
||||||
|
import kotlin.js.Json
|
||||||
|
|
||||||
|
class Dashboard {
|
||||||
|
init {
|
||||||
|
window.fetch("/senddata/wastedata", RequestInit(method = "POST", body = "action=getStartHeaderData")).then { it -> it.text().then {
|
||||||
|
println("response text is: "+it)
|
||||||
|
val json = JSON.parse<Json>(it)
|
||||||
|
document.getElementById("total-connection-labels")?.innerHTML = json["collectionnumber"] as String
|
||||||
|
document.getElementById("planed-collection-label")?.innerHTML = json["futurecollections"] as String
|
||||||
|
|
||||||
|
document.getElementById("finished-collection-label")?.innerHTML = json["finshedcollections"] as String
|
||||||
|
|
||||||
|
document.getElementById("total-city-number-label")?.innerHTML = json["citynumber"] as String
|
||||||
|
} }
|
||||||
|
|
||||||
|
window.fetch("/senddata/wastedata", RequestInit(method = "POST", body = "action=getversionandbuildtime")).then { it -> it.text().then {
|
||||||
|
val json = JSON.parse<Json>(it)
|
||||||
|
document.getElementById("version-footer-label")?.innerHTML = "<b>Version</b> " + json["version"] + " <b>Build</b> " + json["buildtime"] as String
|
||||||
|
} }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
39
WebServer/src/js/Index.kt
Normal file
39
WebServer/src/js/Index.kt
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
import org.w3c.dom.HTMLInputElement
|
||||||
|
import org.w3c.fetch.RequestInit
|
||||||
|
import kotlin.browser.document
|
||||||
|
import kotlin.browser.window
|
||||||
|
import kotlin.js.Json
|
||||||
|
|
||||||
|
class Index {
|
||||||
|
init {
|
||||||
|
document.getElementById("loginbtn")?.addEventListener("click", {
|
||||||
|
it.preventDefault()
|
||||||
|
println("clicked!!!")
|
||||||
|
|
||||||
|
val username = document.getElementById("userfield") as HTMLInputElement
|
||||||
|
val passfield = document.getElementById("passfield") as HTMLInputElement
|
||||||
|
println(username.value)
|
||||||
|
|
||||||
|
console.log("fetch 'data.json' with 'post'")
|
||||||
|
window.fetch("/senddata/loginget", RequestInit(method = "POST", body = "username=${username.value}&password=${passfield.value}")).then { response ->
|
||||||
|
response.text().then { text ->
|
||||||
|
val json = JSON.parse<Json>(text)
|
||||||
|
if (json["status"] == "nodbconn") {
|
||||||
|
js("""Swal.fire({
|
||||||
|
type: "error",
|
||||||
|
title: 'No connection to Database',
|
||||||
|
html: 'Setup DB here --> <a href="index.html">click<a/>.'
|
||||||
|
})""")
|
||||||
|
}
|
||||||
|
|
||||||
|
if (json["accept"] == true) {
|
||||||
|
println("successfully logged in!")
|
||||||
|
document.cookie = "username=$username"
|
||||||
|
window.location.replace("dashboard.html")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// todo register pwa correctly
|
||||||
|
}
|
18
WebServer/src/js/Main.kt
Normal file
18
WebServer/src/js/Main.kt
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import kotlin.browser.window
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
val callurl = window.document.URL
|
||||||
|
window.onload = {
|
||||||
|
if (callurl.endsWith("/") || callurl.contains("index.html")) {
|
||||||
|
println("loaded sucessfully")
|
||||||
|
Index()
|
||||||
|
}
|
||||||
|
else if (callurl.contains("dashboard.html")) {
|
||||||
|
Dashboard()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
println("js called from undefined html file")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
15
WebServer/src/js/Requester.kt
Normal file
15
WebServer/src/js/Requester.kt
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import org.w3c.xhr.XMLHttpRequest
|
||||||
|
|
||||||
|
class Requester {
|
||||||
|
fun request(){
|
||||||
|
val test = XMLHttpRequest()
|
||||||
|
|
||||||
|
test.open("GET","https://api.ipify.org?format=json")
|
||||||
|
|
||||||
|
test.onload = {
|
||||||
|
println(test.responseText)
|
||||||
|
}
|
||||||
|
|
||||||
|
test.send()
|
||||||
|
}
|
||||||
|
}
|
@ -6,7 +6,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group 'com.wasteinformationserver'
|
group 'com.wasteinformationserver'
|
||||||
version '1.0.0'
|
version '0.3.1-Beta'
|
||||||
|
|
||||||
sourceCompatibility = 1.8
|
sourceCompatibility = 1.8
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ sourceSets {
|
|||||||
dependencies {
|
dependencies {
|
||||||
compile group: 'org.eclipse.paho', name: 'org.eclipse.paho.client.mqttv3', version: '1.2.2'
|
compile group: 'org.eclipse.paho', name: 'org.eclipse.paho.client.mqttv3', version: '1.2.2'
|
||||||
compile group: 'mysql',name:'mysql-connector-java',version: '8.0.18'
|
compile group: 'mysql',name:'mysql-connector-java',version: '8.0.18'
|
||||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
|
||||||
}
|
}
|
||||||
|
|
||||||
task run (type: JavaExec){
|
task run (type: JavaExec){
|
||||||
@ -49,6 +49,8 @@ task createProperties(dependsOn: processResources) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.processResources.dependsOn("WebServer:build")
|
||||||
|
|
||||||
task myJavadocs(type: Javadoc) {
|
task myJavadocs(type: Javadoc) {
|
||||||
title = "JAVADOC WasteInformationServer"
|
title = "JAVADOC WasteInformationServer"
|
||||||
source = sourceSets.main.allJava
|
source = sourceSets.main.allJava
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
rootProject.name = 'WasteInformationServer'
|
rootProject.name = 'WasteInformationServer'
|
||||||
|
|
||||||
|
include 'WebServer'
|
@ -28,19 +28,19 @@ class DeviceRequest : PostRequest() {
|
|||||||
val deviceid = deviceset.getInt("DeviceID")
|
val deviceid = deviceset.getInt("DeviceID")
|
||||||
val cityid = deviceset.getInt("CityID")
|
val cityid = deviceset.getInt("CityID")
|
||||||
if (cityid == -1) {
|
if (cityid == -1) {
|
||||||
sb.append("{\"deviceid\":").append(deviceid).append(",\"cityid\":").append(cityid).append("}")
|
sb.append("{\"deviceid\":\"").append(deviceid).append("\",\"cityid\":\"").append(cityid).append("\"}")
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
val devicename = deviceset.getString("DeviceName")
|
val devicename = deviceset.getString("DeviceName")
|
||||||
val devicelocation = deviceset.getString("DeviceLocation")
|
val devicelocation = deviceset.getString("DeviceLocation")
|
||||||
sb.append("{\"deviceid\":").append(deviceid).append(",\"devicename\":\"").append(devicename).append("\",\"devicelocation\":\"").append(devicelocation).append("\",\"devices\":[")
|
sb.append("{\"deviceid\":\"").append(deviceid).append("\",\"devicename\":\"").append(devicename).append("\",\"devicelocation\":\"").append(devicelocation).append("\",\"devices\":[")
|
||||||
val devicecities = jdbc.executeQuery("SELECT * FROM `device_city` INNER JOIN `cities` ON device_city.CityID=cities.id WHERE `DeviceID`='$deviceid'")
|
val devicecities = jdbc.executeQuery("SELECT * FROM `device_city` INNER JOIN `cities` ON device_city.CityID=cities.id WHERE `DeviceID`='$deviceid'")
|
||||||
while (devicecities.next()) {
|
while (devicecities.next()) {
|
||||||
val cityidd = devicecities.getInt("id")
|
val cityidd = devicecities.getInt("id")
|
||||||
val cityname = devicecities.getString("name")
|
val cityname = devicecities.getString("name")
|
||||||
val wastetype = devicecities.getString("wastetype")
|
val wastetype = devicecities.getString("wastetype")
|
||||||
val zone = devicecities.getString("zone")
|
val zone = devicecities.getString("zone")
|
||||||
sb.append("{\"cityid\":").append(cityidd).append(",\"cityname\":\"").append(cityname).append("\",\"wastetype\":\"").append(wastetype).append("\",\"zone\":\"").append(zone).append("\"}")
|
sb.append("{\"cityid\":\"").append(cityidd).append("\",\"cityname\":\"").append(cityname).append("\",\"wastetype\":\"").append(wastetype).append("\",\"zone\":\"").append(zone).append("\"}")
|
||||||
if (!devicecities.isLast) {
|
if (!devicecities.isLast) {
|
||||||
sb.append(",")
|
sb.append(",")
|
||||||
}
|
}
|
||||||
@ -142,6 +142,14 @@ class DeviceRequest : PostRequest() {
|
|||||||
}
|
}
|
||||||
sb.append("{\"status\":\"success\"}")
|
sb.append("{\"status\":\"success\"}")
|
||||||
}
|
}
|
||||||
|
"getDeviceNumber" -> try {
|
||||||
|
val numberset = jdbc!!.executeQuery("SELECT * FROM devices")
|
||||||
|
numberset.last()
|
||||||
|
val devicenr = numberset.row
|
||||||
|
sb.append("{\"devicenr\":\"$devicenr\"}")
|
||||||
|
} catch (e: SQLException) {
|
||||||
|
e.printStackTrace()
|
||||||
|
}
|
||||||
"addtodb" -> {
|
"addtodb" -> {
|
||||||
var cityid = -1
|
var cityid = -1
|
||||||
try {
|
try {
|
||||||
@ -154,21 +162,6 @@ class DeviceRequest : PostRequest() {
|
|||||||
}
|
}
|
||||||
sb.append("{\"success\":true}")
|
sb.append("{\"success\":true}")
|
||||||
}
|
}
|
||||||
"getheader" -> {
|
|
||||||
try {
|
|
||||||
var numberset = jdbc!!.executeQuery("SELECT * FROM devices")
|
|
||||||
numberset.last()
|
|
||||||
val devicenr = numberset.row
|
|
||||||
|
|
||||||
numberset = jdbc!!.executeQuery("SELECT * FROM devices WHERE CityID=-1")
|
|
||||||
numberset.last()
|
|
||||||
val unconfigureddevices = numberset.row
|
|
||||||
|
|
||||||
sb.append("{\"success\":true,\"devicenumber\":$devicenr, \"unconfigureddevices\":$unconfigureddevices}")
|
|
||||||
} catch (e: SQLException) {
|
|
||||||
e.printStackTrace()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return sb.toString()
|
return sb.toString()
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ public class LoginState {
|
|||||||
private String email;
|
private String email;
|
||||||
private int permission;
|
private int permission;
|
||||||
|
|
||||||
boolean loggedin = false;
|
boolean loggedin = true;
|
||||||
|
|
||||||
public void logIn() {
|
public void logIn() {
|
||||||
loggedin = true;
|
loggedin = true;
|
||||||
|
@ -1,511 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<title>WasteInformation Server</title>
|
|
||||||
<!-- Tell the browser to be responsive to screen width -->
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<!-- Font Awesome -->
|
|
||||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/fontawesome-free/css/all.min.css">
|
|
||||||
<!-- Ionicons -->
|
|
||||||
<link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
|
|
||||||
<!-- DataTables -->
|
|
||||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/datatables-bs4/css/dataTables.bootstrap4.css">
|
|
||||||
<!-- Tempusdominus Bbootstrap 4 -->
|
|
||||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css">
|
|
||||||
<!-- iCheck -->
|
|
||||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/icheck-bootstrap/icheck-bootstrap.min.css">
|
|
||||||
<!-- JQVMap -->
|
|
||||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/jqvmap/jqvmap.min.css">
|
|
||||||
<!-- Theme style -->
|
|
||||||
<link rel="stylesheet" href="lib/AdminLTE/dist/css/adminlte.min.css">
|
|
||||||
<!-- overlayScrollbars -->
|
|
||||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
|
|
||||||
<!-- Daterange picker -->
|
|
||||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/daterangepicker/daterangepicker.css">
|
|
||||||
<!-- summernote -->
|
|
||||||
<link rel="stylesheet" href="lib/AdminLTE/plugins/summernote/summernote-bs4.css">
|
|
||||||
<!-- Google Font: Source Sans Pro -->
|
|
||||||
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
|
|
||||||
|
|
||||||
<!-- Bootstrap Date-Picker Plugin -->
|
|
||||||
|
|
||||||
<link rel="stylesheet"
|
|
||||||
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/css/bootstrap-datepicker3.css"/>
|
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/dashboard.css">
|
|
||||||
<link rel="stylesheet" type="text/css" href="css/general.css">
|
|
||||||
|
|
||||||
<link rel="icon" type="image/png" href="/favicon.png">
|
|
||||||
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body class="hold-transition sidebar-mini layout-fixed">
|
|
||||||
<div class="wrapper">
|
|
||||||
<!-- Main Sidebar Container -->
|
|
||||||
<aside class="main-sidebar sidebar-dark-primary elevation-4">
|
|
||||||
<!-- Brand Logo -->
|
|
||||||
<a href="ShedulePickUp.html" class="brand-link">
|
|
||||||
<img src="/favicon.png" alt="AdminLTE Logo"
|
|
||||||
class="brand-image img-circle elevation-3"
|
|
||||||
style="opacity: .8">
|
|
||||||
<span class="brand-text font-weight-light">Waste Control</span>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<!-- Sidebar -->
|
|
||||||
<div class="sidebar">
|
|
||||||
<!-- Sidebar user panel (optional) -->
|
|
||||||
<div class="user-panel mt-3 pb-3 mb-3 d-flex">
|
|
||||||
<div class="image">
|
|
||||||
<!-- <img src="lib/AdminLTE/dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image"> -->
|
|
||||||
<i class="nav-icon fas fa-user img-circle elevation-2" style="color:white"></i>
|
|
||||||
</div>
|
|
||||||
<!-- <i class="nav-icon fas fa-tachometer-alt"></i> -->
|
|
||||||
<div class="info">
|
|
||||||
<a href="user.html" class="d-block" id="userlabel">Username to set!</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Sidebar Menu -->
|
|
||||||
<nav class="mt-2">
|
|
||||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
|
|
||||||
data-accordion="false">
|
|
||||||
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="ShedulePickUp.html" class="nav-link">
|
|
||||||
<i class="nav-icon fas fa-calendar-alt"></i>
|
|
||||||
<p>
|
|
||||||
Shedule Pick-up
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="dashboard.html" class="nav-link">
|
|
||||||
<i class="nav-icon fas fa-columns"></i>
|
|
||||||
<p>
|
|
||||||
Dashboard
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li id="devicepanel" class="nav-item">
|
|
||||||
<a href="device.html" class="nav-link">
|
|
||||||
<i class="nav-icon fas fa-desktop"></i>
|
|
||||||
<p>
|
|
||||||
Devices
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="#todo" class="nav-link">
|
|
||||||
<i class="nav-icon fas fa-plus-circle"></i>
|
|
||||||
<p>
|
|
||||||
New Entry
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li id="adminpanel" class="nav-item hideit">
|
|
||||||
<a href="adminpanel.html" class="nav-link">
|
|
||||||
<i class="nav-icon fas fa-plus-circle"></i>
|
|
||||||
<p>
|
|
||||||
Admin panel
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="#todo" class="nav-link">
|
|
||||||
<i class="nav-icon fas fa-cog"></i>
|
|
||||||
<p>
|
|
||||||
Settings
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="index.html" class="nav-link" id="logoutbtn">
|
|
||||||
<i class="nav-icon fas fa-sign-out-alt"></i>
|
|
||||||
<p>
|
|
||||||
Logout
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
<!-- /.sidebar-menu -->
|
|
||||||
</div>
|
|
||||||
<!-- /.sidebar -->
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
<!-- Content Wrapper. Contains page content -->
|
|
||||||
<div class="content-wrapper">
|
|
||||||
<!-- Content Header (Page header) -->
|
|
||||||
<div class="content-header">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="row mb-2">
|
|
||||||
<div class="col-sm-6">
|
|
||||||
<h1 class="m-0 text-dark">Dashboard</h1>
|
|
||||||
</div><!-- /.col -->
|
|
||||||
<div class="col-sm-6">
|
|
||||||
<ol class="breadcrumb float-sm-right">
|
|
||||||
<li class="breadcrumb-item"><a href="#">Home</a></li>
|
|
||||||
<li class="breadcrumb-item active">Shedule Puck-up</li>
|
|
||||||
</ol>
|
|
||||||
</div><!-- /.col -->
|
|
||||||
</div><!-- /.row -->
|
|
||||||
</div><!-- /.container-fluid -->
|
|
||||||
</div>
|
|
||||||
<!-- /.content-header -->
|
|
||||||
|
|
||||||
<!-- Main content -->
|
|
||||||
<section class="content">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<!-- Small boxes (Stat box) -->
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-3 col-6">
|
|
||||||
<!-- small box -->
|
|
||||||
<div class="small-box bg-info">
|
|
||||||
<div class="inner">
|
|
||||||
<h3 id="total-connection-labels">42</h3>
|
|
||||||
|
|
||||||
<p>Total collections</p>
|
|
||||||
</div>
|
|
||||||
<div class="icon">
|
|
||||||
<i class="ion ion-bag"></i>
|
|
||||||
</div>
|
|
||||||
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- ./col -->
|
|
||||||
<div class="col-lg-3 col-6">
|
|
||||||
<!-- small box -->
|
|
||||||
<div class="small-box bg-gray">
|
|
||||||
<div class="inner">
|
|
||||||
<h3 id="total-city-number-label">42</h3>
|
|
||||||
|
|
||||||
<p>total collect zones</p>
|
|
||||||
</div>
|
|
||||||
<div class="icon">
|
|
||||||
<i class="ion ion-android-globe" style="color: lightgrey"></i>
|
|
||||||
</div>
|
|
||||||
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- ./col -->
|
|
||||||
<div class="col-lg-3 col-6">
|
|
||||||
<!-- small box -->
|
|
||||||
<div class="small-box bg-warning">
|
|
||||||
<div class="inner">
|
|
||||||
<h3 id="planed-collection-label">44</h3>
|
|
||||||
|
|
||||||
<p>Planned Collections</p>
|
|
||||||
</div>
|
|
||||||
<div class="icon">
|
|
||||||
<i class="ion ion-calendar"></i>
|
|
||||||
</div>
|
|
||||||
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- ./col -->
|
|
||||||
<div class="col-lg-3 col-6">
|
|
||||||
<!-- small box -->
|
|
||||||
<div class="small-box bg-success">
|
|
||||||
<div class="inner">
|
|
||||||
<h3 id="finished-collection-label">65</h3>
|
|
||||||
|
|
||||||
<p>Finished Collections</p>
|
|
||||||
</div>
|
|
||||||
<div class="icon">
|
|
||||||
<i class="ion ion-android-checkmark-circle"></i>
|
|
||||||
</div>
|
|
||||||
<a href="#" class="small-box-footer">More info <i class="fas fa-arrow-circle-right"></i></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- ./col -->
|
|
||||||
</div>
|
|
||||||
<!-- /.row -->
|
|
||||||
<!-- Main row -->
|
|
||||||
<div class="row">
|
|
||||||
<!-- Left col -->
|
|
||||||
<section class="col-lg-7 connectedSortable">
|
|
||||||
<!-- Custom tabs (Charts with tabs)-->
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
<h3 class="card-title">
|
|
||||||
<i class="fas fa-chart-pie mr-1"></i>
|
|
||||||
All pickupdats
|
|
||||||
</h3>
|
|
||||||
</div><!-- /.card-header -->
|
|
||||||
<div class="card-body">
|
|
||||||
<table id="table-pickupdates" class="table table-bordered table-hover">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>
|
|
||||||
<i class="fas fa-city"></i>
|
|
||||||
City</th>
|
|
||||||
<th><i class="fas fa-search-location"></i>
|
|
||||||
Zone</th>
|
|
||||||
<th><i class="fas fa-recycle"></i>
|
|
||||||
Waste Type</th>
|
|
||||||
<th><i class="fas fa-calendar-alt"></i>
|
|
||||||
Date</th>
|
|
||||||
<th><i class="fas fa-trash-alt"></i>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody id="picupdates-tablebody">
|
|
||||||
</tbody>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<th>
|
|
||||||
<i class="fas fa-city"></i>
|
|
||||||
City</th>
|
|
||||||
<th><i class="fas fa-search-location"></i>
|
|
||||||
Zone</th>
|
|
||||||
<th><i class="fas fa-recycle"></i>
|
|
||||||
Waste Type</th>
|
|
||||||
<th><i class="fas fa-calendar-alt"></i>
|
|
||||||
Date</th>
|
|
||||||
<th><i class="fas fa-trash-alt"></i>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
</div><!-- /.card-body -->
|
|
||||||
</div>
|
|
||||||
<!-- /.card -->
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
<h3 class="card-title">
|
|
||||||
<i class="fas fa-chart-pie mr-1"></i>
|
|
||||||
New City
|
|
||||||
</h3>
|
|
||||||
<button id="btn-savecity" type="button" class="btn btn-success"
|
|
||||||
style="float:right;">Save
|
|
||||||
</button>
|
|
||||||
</div><!-- /.card-header -->
|
|
||||||
<div class="card-body">
|
|
||||||
<div class="form-group" style="margin-top: 15px; width: 10cm;">
|
|
||||||
<label for="new_city_cityname">City/Village name</label>
|
|
||||||
<input type="email" class="form-control" id="new_city_cityname"
|
|
||||||
aria-describedby="emailHelp" placeholder="Enter city name here">
|
|
||||||
<small class="form-text text-muted">Please try to use no special
|
|
||||||
characters</small>
|
|
||||||
</div>
|
|
||||||
<div class="form-group" style="width: 10cm;">
|
|
||||||
<label for="new_city_zonename">Zone Name</label>
|
|
||||||
<input type="email" class="form-control" id="new_city_zonename"
|
|
||||||
aria-describedby="emailHelp" placeholder="Enter Zone name here">
|
|
||||||
<small class="form-text text-muted">Please try to use no special
|
|
||||||
characters</small>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<button id="dropdown-wastetype" type="button"
|
|
||||||
class="btn btn-outline-dark dropdown-toggle"
|
|
||||||
data-toggle="dropdown">
|
|
||||||
Select waste type
|
|
||||||
</button>
|
|
||||||
<div class="dropdown-menu">
|
|
||||||
<a class="wastetype-citynew-item dropdown-item" href="#">Plastic</a>
|
|
||||||
<a class="wastetype-citynew-item dropdown-item" href="#">Metal</a>
|
|
||||||
<a class="wastetype-citynew-item dropdown-item" href="#">Residual waste</a>
|
|
||||||
<a class="wastetype-citynew-item dropdown-item" href="#">Biowaste</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div><!-- /.card-body -->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Custom tabs (Charts with tabs)-->
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
<h3 class="card-title">
|
|
||||||
<i class="fas fa-chart-pie mr-1"></i>
|
|
||||||
New Pick up date
|
|
||||||
</h3>
|
|
||||||
</div><!-- /.card-header -->
|
|
||||||
<div class="card-body">
|
|
||||||
<form>
|
|
||||||
|
|
||||||
<h4>Add Data:</h4>
|
|
||||||
<div class="input-group mt-3 mb-3" style="width: 100%;">
|
|
||||||
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<button id="dropdown-city" type="button"
|
|
||||||
class="btn btn-outline-dark dropdown-toggle"
|
|
||||||
data-toggle="dropdown">
|
|
||||||
Select city
|
|
||||||
</button>
|
|
||||||
<div id="dropdown-city-data" class="dropdown-menu">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<button id="dropdown-zone" type="button"
|
|
||||||
class="btn btn-outline-dark dropdown-toggle"
|
|
||||||
data-toggle="dropdown">
|
|
||||||
Select Zone
|
|
||||||
</button>
|
|
||||||
<div id="dropdown-zone-data" class="dropdown-menu">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="input-group-prepend">
|
|
||||||
<button id="dropdown-type-data" type="button"
|
|
||||||
class="btn btn-outline-dark dropdown-toggle"
|
|
||||||
data-toggle="dropdown">
|
|
||||||
Select waste type
|
|
||||||
</button>
|
|
||||||
<div id="dropdown-type-drops" class="dropdown-menu">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<input id="input-wastetime" style="width: 50px;" class="form-control" id="date"
|
|
||||||
name="date" placeholder="MM/DD/YYY" type="text"/>
|
|
||||||
<button type="button" class="btn-savelist btn btn-success"
|
|
||||||
style="float:right;">Save
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div><!-- /.card-body -->
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- /.Left col -->
|
|
||||||
<!-- right col (We are only adding the ID to make the widgets sortable)-->
|
|
||||||
<section class="col-lg-5 connectedSortable">
|
|
||||||
|
|
||||||
<div class="card">
|
|
||||||
<div class="card-header">
|
|
||||||
<h3 class="card-title">
|
|
||||||
<i class="fas fa-chart-pie mr-1"></i>
|
|
||||||
Pick up locations
|
|
||||||
</h3>
|
|
||||||
</div><!-- /.card-header -->
|
|
||||||
<!-- /.card-header -->
|
|
||||||
<div class="card-body">
|
|
||||||
<table id="example2" class="table table-bordered table-hover">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>
|
|
||||||
<i class="fas fa-city"></i>
|
|
||||||
City</th>
|
|
||||||
<th><i class="fas fa-search-location"></i>
|
|
||||||
Zone</th>
|
|
||||||
<th><i class="fas fa-recycle"></i>
|
|
||||||
Waste Type</th>
|
|
||||||
<th><i class="fas fa-calendar-alt"></i>
|
|
||||||
Date</th>
|
|
||||||
<th><i class="fas fa-trash-alt"></i>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody id="location-table-data">
|
|
||||||
</tbody>
|
|
||||||
<tfoot>
|
|
||||||
<tr>
|
|
||||||
<th>
|
|
||||||
<i class="fas fa-city"></i>
|
|
||||||
City</th>
|
|
||||||
<th><i class="fas fa-search-location"></i>
|
|
||||||
Zone</th>
|
|
||||||
<th><i class="fas fa-recycle"></i>
|
|
||||||
Waste Type</th>
|
|
||||||
<th><i class="fas fa-calendar-alt"></i>
|
|
||||||
Date</th>
|
|
||||||
<th><i class="fas fa-trash-alt"></i>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</tfoot>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- /.card-body -->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- /.card -->
|
|
||||||
</section>
|
|
||||||
<!-- right col -->
|
|
||||||
</div>
|
|
||||||
<!-- /.row (main row) -->
|
|
||||||
</div><!-- /.container-fluid -->
|
|
||||||
</section>
|
|
||||||
<!-- /.content -->
|
|
||||||
</div>
|
|
||||||
<!-- /.content-wrapper -->
|
|
||||||
<footer class="main-footer">
|
|
||||||
<strong>By Gregor Dutzler & Lukas Heiligenbrunner & Emil Meindl</strong>
|
|
||||||
<div id="version-footer-label" class="float-right d-none d-sm-inline-block">
|
|
||||||
<b>Version</b> 3.0.0
|
|
||||||
<b>Build</b> 2019-8-8 9:30
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</footer>
|
|
||||||
|
|
||||||
<!-- Control Sidebar -->
|
|
||||||
<aside class="control-sidebar control-sidebar-dark">
|
|
||||||
<!-- Control sidebar content goes here -->
|
|
||||||
</aside>
|
|
||||||
<!-- /.control-sidebar -->
|
|
||||||
</div>
|
|
||||||
<!-- ./wrapper -->
|
|
||||||
|
|
||||||
<!-- jQuery -->
|
|
||||||
<script src="lib/AdminLTE/plugins/jquery/jquery.min.js"></script>
|
|
||||||
<!-- jQuery UI 1.11.4 -->
|
|
||||||
<script src="lib/AdminLTE/plugins/jquery-ui/jquery-ui.min.js"></script>
|
|
||||||
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
|
|
||||||
<script>
|
|
||||||
$.widget.bridge('uibutton', $.ui.button)
|
|
||||||
</script>
|
|
||||||
<!-- Bootstrap 4 -->
|
|
||||||
<script src="lib/AdminLTE/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
|
|
||||||
<!-- ChartJS -->
|
|
||||||
<script src="lib/AdminLTE/plugins/chart.js/Chart.min.js"></script>
|
|
||||||
<!-- Sparkline -->
|
|
||||||
<script src="lib/AdminLTE/plugins/sparklines/sparkline.js"></script>
|
|
||||||
<!-- JQVMap -->
|
|
||||||
<script src="lib/AdminLTE/plugins/jqvmap/jquery.vmap.min.js"></script>
|
|
||||||
<script src="lib/AdminLTE/plugins/jqvmap/maps/jquery.vmap.usa.js"></script>
|
|
||||||
<!-- jQuery Knob Chart -->
|
|
||||||
<script src="lib/AdminLTE/plugins/jquery-knob/jquery.knob.min.js"></script>
|
|
||||||
<!-- daterangepicker -->
|
|
||||||
<script src="lib/AdminLTE/plugins/moment/moment.min.js"></script>
|
|
||||||
<script src="lib/AdminLTE/plugins/daterangepicker/daterangepicker.js"></script>
|
|
||||||
<!-- Tempusdominus Bootstrap 4 -->
|
|
||||||
<script src="lib/AdminLTE/plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
|
|
||||||
<!-- Summernote -->
|
|
||||||
<script src="lib/AdminLTE/plugins/summernote/summernote-bs4.min.js"></script>
|
|
||||||
<!-- overlayScrollbars -->
|
|
||||||
<script src="lib/AdminLTE/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
|
|
||||||
<!-- AdminLTE App -->
|
|
||||||
<script src="lib/AdminLTE/dist/js/adminlte.js"></script>
|
|
||||||
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
|
|
||||||
<script src="lib/AdminLTE/dist/js/pages/dashboard.js"></script>
|
|
||||||
<!-- AdminLTE for demo purposes -->
|
|
||||||
<script src="lib/AdminLTE/dist/js/demo.js"></script>
|
|
||||||
|
|
||||||
<script type="text/javascript"
|
|
||||||
src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/js/bootstrap-datepicker.min.js"></script>
|
|
||||||
|
|
||||||
<!-- DataTables -->
|
|
||||||
<script src="lib/AdminLTE/plugins/datatables/jquery.dataTables.js"></script>
|
|
||||||
<script src="lib/AdminLTE/plugins/datatables-bs4/js/dataTables.bootstrap4.js"></script>
|
|
||||||
|
|
||||||
<script src="lib/AdminLTE/plugins/sweetalert2/sweetalert2.all.js"></script>
|
|
||||||
|
|
||||||
<!-- OWN -->
|
|
||||||
|
|
||||||
<script type="text/javascript" src="js/dashboard.js"></script>
|
|
||||||
<script src="js/userManager.js"></script>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -70,36 +70,6 @@
|
|||||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
|
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
|
||||||
data-accordion="false">
|
data-accordion="false">
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="dashboard.html" class="nav-link">
|
|
||||||
<i class="nav-icon fas fa-columns"></i>
|
|
||||||
<p>
|
|
||||||
Dashboard
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li id="devicepanel" class="nav-item">
|
|
||||||
<a href="device.html" class="nav-link">
|
|
||||||
<i class="nav-icon fas fa-desktop"></i>
|
|
||||||
<p>
|
|
||||||
Devices
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li id="adminpanel" class="nav-item hideit">
|
|
||||||
<a href="adminpanel.html" class="nav-link">
|
|
||||||
<i class="nav-icon fas fa-plus-circle"></i>
|
|
||||||
<p>
|
|
||||||
Admin panel
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#todo" class="nav-link">
|
<a href="#todo" class="nav-link">
|
||||||
<i class="nav-icon fas fa-cog"></i>
|
<i class="nav-icon fas fa-cog"></i>
|
||||||
@ -109,7 +79,6 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="index.html" class="nav-link" id="logoutbtn">
|
<a href="index.html" class="nav-link" id="logoutbtn">
|
||||||
<i class="nav-icon fas fa-sign-out-alt"></i>
|
<i class="nav-icon fas fa-sign-out-alt"></i>
|
||||||
@ -119,7 +88,23 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="#todo" class="nav-link">
|
||||||
|
<i class="nav-icon fas fa-plus-circle"></i>
|
||||||
|
<p>
|
||||||
|
New Entry
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li id="adminpanel" class="nav-item hideit">
|
||||||
|
<a href="adminpanel.html" class="nav-link">
|
||||||
|
<i class="nav-icon fas fa-plus-circle"></i>
|
||||||
|
<p>
|
||||||
|
Admin panel
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<!-- /.sidebar-menu -->
|
<!-- /.sidebar-menu -->
|
||||||
|
@ -73,23 +73,22 @@
|
|||||||
data-accordion="false">
|
data-accordion="false">
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="dashboard.html" class="nav-link">
|
<a href="#todo" class="nav-link">
|
||||||
<i class="nav-icon fas fa-columns"></i>
|
<i class="nav-icon fas fa-cog"></i>
|
||||||
<p>
|
<p>
|
||||||
Dashboard
|
Settings
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li id="devicepanel" class="nav-item">
|
|
||||||
<a href="device.html" class="nav-link">
|
|
||||||
<i class="nav-icon fas fa-desktop"></i>
|
|
||||||
<p>
|
|
||||||
Devices
|
|
||||||
</p>
|
</p>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="index.html" class="nav-link" id="logoutbtn">
|
||||||
|
<i class="nav-icon fas fa-sign-out-alt"></i>
|
||||||
|
<p>
|
||||||
|
Logout
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li id="adminpanel" class="nav-item hideit">
|
<li id="adminpanel" class="nav-item hideit">
|
||||||
<a href="adminpanel.html" class="nav-link">
|
<a href="adminpanel.html" class="nav-link">
|
||||||
@ -100,21 +99,11 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li class="nav-item">
|
<li id="devicepanel" class="nav-item">
|
||||||
<a href="#todo" class="nav-link">
|
<a href="device.html" class="nav-link">
|
||||||
<i class="nav-icon fas fa-cog"></i>
|
<i class="nav-icon fas fa-plus-circle"></i>
|
||||||
<p>
|
|
||||||
Settings
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="index.html" class="nav-link" id="logoutbtn">
|
|
||||||
<i class="nav-icon fas fa-sign-out-alt"></i>
|
|
||||||
<p>
|
<p>
|
||||||
Logout
|
Devices
|
||||||
</p>
|
</p>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@ -228,23 +217,22 @@
|
|||||||
<table id="table-pickupdates" class="table table-bordered table-hover">
|
<table id="table-pickupdates" class="table table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><i class="fas fa-city"></i>City</th>
|
<th>City</th>
|
||||||
<th><i class="fas fa-search-location"></i>Zone</th>
|
<th>Zone</th>
|
||||||
<th><i class="fas fa-recycle"></i>Waste Type</th>
|
<th>Waste Type</th>
|
||||||
<th><i class="fas fa-calendar-alt"></i>Date</th>
|
<th>Date</th>
|
||||||
<th><i class="fas fa-trash-alt"></i></th>
|
<th>X</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="picupdates-tablebody">
|
<tbody id="picupdates-tablebody">
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<th><i class="fas fa-city"></i>City</th>
|
<th>City</th>
|
||||||
<th><i class="fas fa-search-location"></i>Zone</th>
|
<th>Zone</th>
|
||||||
<th><i class="fas fa-recycle"></i>Waste Type</th>
|
<th>Waste Type</th>
|
||||||
<th><i class="fas fa-calendar-alt"></i>Date</th>
|
<th>Date</th>
|
||||||
<th><i class="fas fa-trash-alt"></i>
|
<th>X</th>
|
||||||
</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
@ -334,7 +322,6 @@
|
|||||||
data-toggle="dropdown">
|
data-toggle="dropdown">
|
||||||
Select waste type
|
Select waste type
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div id="dropdown-type-drops" class="dropdown-menu">
|
<div id="dropdown-type-drops" class="dropdown-menu">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -366,25 +353,20 @@
|
|||||||
<table id="example2" class="table table-bordered table-hover">
|
<table id="example2" class="table table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>City</th>
|
||||||
<i class="fas fa-city"></i>
|
<th>Zone</th>
|
||||||
City</th>
|
<th>Waste Type</th>
|
||||||
<th><i class="fas fa-search-location"></i>
|
<th>X</th>
|
||||||
Zone</th>
|
|
||||||
<th><i class="fas fa-recycle"></i>
|
|
||||||
Waste Type</th>
|
|
||||||
<th><i class="fas fa-trash-alt"></i>
|
|
||||||
</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="location-table-data">
|
<tbody id="location-table-data">
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<th><i class="fas fa-city"></i>City</th>
|
<th>City</th>
|
||||||
<th><i class="fas fa-search-location"></i>Zone</th>
|
<th>Zone</th>
|
||||||
<th><i class="fas fa-recycle"></i>Waste Type</th>
|
<th>Waste Type</th>
|
||||||
<th><i class="fas fa-trash-alt"></i></th>
|
<th>X</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
@ -466,8 +448,8 @@
|
|||||||
|
|
||||||
<!-- OWN -->
|
<!-- OWN -->
|
||||||
|
|
||||||
<script type="text/javascript" src="js/dashboard.js"></script>
|
<script type="text/javascript" src="js/lib/kotlin.js"></script>
|
||||||
<script src="js/userManager.js"></script>
|
<script type="text/javascript" src="js/WasteInformationServer.js"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -51,7 +51,6 @@
|
|||||||
<span class="brand-text font-weight-light">Waste Control</span>
|
<span class="brand-text font-weight-light">Waste Control</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
||||||
<!-- Sidebar -->
|
<!-- Sidebar -->
|
||||||
<div class="sidebar">
|
<div class="sidebar">
|
||||||
<!-- Sidebar user panel (optional) -->
|
<!-- Sidebar user panel (optional) -->
|
||||||
@ -71,36 +70,6 @@
|
|||||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
|
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
|
||||||
data-accordion="false">
|
data-accordion="false">
|
||||||
|
|
||||||
<li class="nav-item">
|
|
||||||
<a href="dashboard.html" class="nav-link">
|
|
||||||
<i class="nav-icon fas fa-columns"></i>
|
|
||||||
<p>
|
|
||||||
Dashboard
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
<li id="devicepanel" class="nav-item">
|
|
||||||
<a href="device.html" class="nav-link">
|
|
||||||
<i class="nav-icon fas fa-desktop"></i>
|
|
||||||
<p>
|
|
||||||
Devices
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li id="adminpanel" class="nav-item hideit">
|
|
||||||
<a href="adminpanel.html" class="nav-link">
|
|
||||||
<i class="nav-icon fas fa-plus-circle"></i>
|
|
||||||
<p>
|
|
||||||
Admin panel
|
|
||||||
</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="#todo" class="nav-link">
|
<a href="#todo" class="nav-link">
|
||||||
<i class="nav-icon fas fa-cog"></i>
|
<i class="nav-icon fas fa-cog"></i>
|
||||||
@ -110,7 +79,6 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a href="index.html" class="nav-link" id="logoutbtn">
|
<a href="index.html" class="nav-link" id="logoutbtn">
|
||||||
<i class="nav-icon fas fa-sign-out-alt"></i>
|
<i class="nav-icon fas fa-sign-out-alt"></i>
|
||||||
@ -120,6 +88,23 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li id="adminpanel" class="nav-item hideit">
|
||||||
|
<a href="adminpanel.html" class="nav-link">
|
||||||
|
<i class="nav-icon fas fa-plus-circle"></i>
|
||||||
|
<p>
|
||||||
|
Admin panel
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li id="devicepanel" class="nav-item">
|
||||||
|
<a href="device.html" class="nav-link">
|
||||||
|
<i class="nav-icon fas fa-plus-circle"></i>
|
||||||
|
<p>
|
||||||
|
Devices
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<!-- /.sidebar-menu -->
|
<!-- /.sidebar-menu -->
|
||||||
@ -156,9 +141,9 @@
|
|||||||
<!-- small box -->
|
<!-- small box -->
|
||||||
<div class="small-box bg-info">
|
<div class="small-box bg-info">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h3 id="devicenr-label">-1</h3>
|
<h3>TODO</h3>
|
||||||
|
|
||||||
<p>Devices</p>
|
<p>Todo</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="ion ion-bag"></i>
|
<i class="ion ion-bag"></i>
|
||||||
@ -171,9 +156,9 @@
|
|||||||
<!-- small box -->
|
<!-- small box -->
|
||||||
<div class="small-box bg-success">
|
<div class="small-box bg-success">
|
||||||
<div class="inner">
|
<div class="inner">
|
||||||
<h3 id="unconfigured-devices-label">-1</h3>
|
<h3>TODO</h3>
|
||||||
|
|
||||||
<p>Not Configured Devices</p>
|
<p>Devices</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<i class="ion ion-stats-bars"></i>
|
<i class="ion ion-stats-bars"></i>
|
||||||
@ -201,22 +186,22 @@
|
|||||||
<table id="table-devices" class="table table-bordered table-hover">
|
<table id="table-devices" class="table table-bordered table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><i class="fas fa-id-card"></i> Device ID</th>
|
<th>Device ID</th>
|
||||||
<th><i class="fas fa-signature"></i> Devicename</th>
|
<th>Devicename</th>
|
||||||
<th><i class="fas fa-search-location"></i> Devicelocation</th>
|
<th>Devicelocation</th>
|
||||||
<th><i class="fas fa-recycle"></i> WasteType</th>
|
<th>WasteType</th>
|
||||||
<th><i class="fas fa-edit"></i> Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="devices-tablebody">
|
<tbody id="devices-tablebody">
|
||||||
</tbody>
|
</tbody>
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<th><i class="fas fa-id-card"></i> Device ID</th>
|
<th>Device ID</th>
|
||||||
<th><i class="fas fa-signature"></i> Devicename</th>
|
<th>Devicename</th>
|
||||||
<th><i class="fas fa-search-location"></i> Devicelocation</th>
|
<th>Devicelocation</th>
|
||||||
<th><i class="fas fa-recycle"></i> WasteType</th>
|
<th>WasteType</th>
|
||||||
<th><i class="fas fa-edit"></i> Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
@ -24,13 +24,15 @@
|
|||||||
<!--Custom styles-->
|
<!--Custom styles-->
|
||||||
<link rel="stylesheet" type="text/css" href="css/index.css">
|
<link rel="stylesheet" type="text/css" href="css/index.css">
|
||||||
|
|
||||||
<script type="text/javascript" src="js/index.js"></script>
|
|
||||||
|
|
||||||
<script src="lib/AdminLTE/plugins/sweetalert2/sweetalert2.all.js"></script>
|
<script src="lib/AdminLTE/plugins/sweetalert2/sweetalert2.all.js"></script>
|
||||||
|
|
||||||
<link rel="manifest" href="/manifest.json">
|
<link rel="manifest" href="/manifest.json">
|
||||||
|
|
||||||
<link rel="icon" type="image/png" href="/favicon.png">
|
<link rel="icon" type="image/png" href="/favicon.png">
|
||||||
|
|
||||||
|
<script type="text/javascript" src="js/lib/kotlin.js"></script>
|
||||||
|
<script type="text/javascript" src="js/WasteInformationServer.js"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
$(function () {
|
$(document).ready(function () {
|
||||||
new Device();
|
new Device();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
class Device {
|
class Device {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.reloadDevices();
|
this.reloadDevices()
|
||||||
this.loadHeader();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
devicetable = null;
|
devicetable = null;
|
||||||
@ -37,6 +36,7 @@ class Device {
|
|||||||
var devicelocation = data.data[i].devicelocation;
|
var devicelocation = data.data[i].devicelocation;
|
||||||
|
|
||||||
var row = "<tr><td>" + id + "</td><td>" + devicename + "</td><td>" + devicelocation + "</td><td>";
|
var row = "<tr><td>" + id + "</td><td>" + devicename + "</td><td>" + devicelocation + "</td><td>";
|
||||||
|
|
||||||
for (var n = 0; n < data.data[i].devices.length; n++) {
|
for (var n = 0; n < data.data[i].devices.length; n++) {
|
||||||
var cityname = data.data[i].devices[n].cityname;
|
var cityname = data.data[i].devices[n].cityname;
|
||||||
var cityzone = data.data[i].devices[n].zone;
|
var cityzone = data.data[i].devices[n].zone;
|
||||||
@ -51,9 +51,9 @@ class Device {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_this._addDeleteButton();
|
_this.addDeleteButton();
|
||||||
_this._addAddButton();
|
_this.addAddButton();
|
||||||
_this._addConfigDialog();
|
_this.addConfigDialog();
|
||||||
_this.devicetable = $('#table-devices').DataTable();
|
_this.devicetable = $('#table-devices').DataTable();
|
||||||
}, 'json');
|
}, 'json');
|
||||||
}
|
}
|
||||||
@ -61,8 +61,7 @@ class Device {
|
|||||||
/**
|
/**
|
||||||
* add click listener to add button to add new city entries to current device
|
* add click listener to add button to add new city entries to current device
|
||||||
*/
|
*/
|
||||||
_addAddButton() {
|
addAddButton() {
|
||||||
var _this = this;
|
|
||||||
$('.addbtn').click(function (event) {
|
$('.addbtn').click(function (event) {
|
||||||
var id = event.target.getAttribute("dataid");
|
var id = event.target.getAttribute("dataid");
|
||||||
var cityname;
|
var cityname;
|
||||||
@ -85,6 +84,8 @@ class Device {
|
|||||||
}
|
}
|
||||||
]).then((result) => {
|
]).then((result) => {
|
||||||
if (result.value) {
|
if (result.value) {
|
||||||
|
console.log(result.value);
|
||||||
|
const answers = JSON.stringify(result.value);
|
||||||
cityname = result.value[0];
|
cityname = result.value[0];
|
||||||
|
|
||||||
console.log("cityname=" + cityname);
|
console.log("cityname=" + cityname);
|
||||||
@ -103,6 +104,7 @@ class Device {
|
|||||||
}
|
}
|
||||||
]).then((result) => {
|
]).then((result) => {
|
||||||
if (result.value) {
|
if (result.value) {
|
||||||
|
console.log(result.value);
|
||||||
zone = result.value[0];
|
zone = result.value[0];
|
||||||
$.post('/senddata/Devicedata', 'action=gettypes&cityname=' + cityname + '&zonename=' + zone, function (data) {
|
$.post('/senddata/Devicedata', 'action=gettypes&cityname=' + cityname + '&zonename=' + zone, function (data) {
|
||||||
Swal.mixin({
|
Swal.mixin({
|
||||||
@ -119,8 +121,11 @@ class Device {
|
|||||||
}
|
}
|
||||||
]).then((result) => {
|
]).then((result) => {
|
||||||
if (result.value) {
|
if (result.value) {
|
||||||
|
console.log(result.value);
|
||||||
wastetype = result.value[0];
|
wastetype = result.value[0];
|
||||||
|
|
||||||
|
|
||||||
|
//todo add to db
|
||||||
$.post('/senddata/Devicedata', 'action=addtodb&deviceid=' + id + '&cityname=' + cityname + '&zonename=' + zone + '&wastetype=' + wastetype, function (data) {
|
$.post('/senddata/Devicedata', 'action=addtodb&deviceid=' + id + '&cityname=' + cityname + '&zonename=' + zone + '&wastetype=' + wastetype, function (data) {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
@ -129,7 +134,8 @@ class Device {
|
|||||||
html: 'This alert closes added.',
|
html: 'This alert closes added.',
|
||||||
timer: 1000,
|
timer: 1000,
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
_this.reloadDevices();
|
console.log('Popup closed. ');
|
||||||
|
reloadDevices();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -148,7 +154,7 @@ class Device {
|
|||||||
/**
|
/**
|
||||||
* add click listener to delete button to delete this device entry
|
* add click listener to delete button to delete this device entry
|
||||||
*/
|
*/
|
||||||
_addDeleteButton() {
|
addDeleteButton() {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
$(".delbtn").click(function (event) {
|
$(".delbtn").click(function (event) {
|
||||||
var id = event.target.getAttribute("dataid");
|
var id = event.target.getAttribute("dataid");
|
||||||
@ -185,8 +191,7 @@ class Device {
|
|||||||
/**
|
/**
|
||||||
* add click listener to unconfigured device to show configure dialog
|
* add click listener to unconfigured device to show configure dialog
|
||||||
*/
|
*/
|
||||||
_addConfigDialog() {
|
addConfigDialog() {
|
||||||
var _this = this;
|
|
||||||
$(".configuredevicebutton").click(function (event) {
|
$(".configuredevicebutton").click(function (event) {
|
||||||
var id = event.target.getAttribute("deviceid");
|
var id = event.target.getAttribute("deviceid");
|
||||||
var cityname;
|
var cityname;
|
||||||
@ -267,7 +272,7 @@ class Device {
|
|||||||
timer: 1000,
|
timer: 1000,
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
console.log('Popup closed. ');
|
console.log('Popup closed. ');
|
||||||
_this.reloadDevices();
|
reloadDevices();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -280,18 +285,10 @@ class Device {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load header tiles
|
console.log("click..." + id);
|
||||||
*/
|
|
||||||
loadHeader(){
|
|
||||||
$.post('/senddata/Devicedata', 'action=getheader', function (data) {
|
|
||||||
if (data.success) {
|
|
||||||
$("#devicenr-label").html(data.devicenumber);
|
|
||||||
$("#unconfigured-devices-label").html(data.unconfigureddevices);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -88,7 +88,14 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li class="nav-item">
|
||||||
|
<a href="#todo" class="nav-link">
|
||||||
|
<i class="nav-icon fas fa-plus-circle"></i>
|
||||||
|
<p>
|
||||||
|
New Entry
|
||||||
|
</p>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
<!-- /.sidebar-menu -->
|
<!-- /.sidebar-menu -->
|
||||||
|
Reference in New Issue
Block a user