diff --git a/Makefile b/Makefile
index 43d50197c..58cd633c3 100644
--- a/Makefile
+++ b/Makefile
@@ -46,3 +46,6 @@ vis:
typeahead:
$(GIT_SUBTREE) -- prefix=lib/typeahead https://github.com/twitter/typeahead.js.git master
+
+gridster:
+ $(GIT_SUBTREE) --prefix=lib/gridster https://github.com/ducksboard/gridster.js.git master
diff --git a/html/ajax_dash.php b/html/ajax_dash.php
new file mode 100644
index 000000000..5336cef76
--- /dev/null
+++ b/html/ajax_dash.php
@@ -0,0 +1,54 @@
+
+ *
+ * This program is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or (at your
+ * option) any later version. Please see LICENSE.txt at the top level of
+ * the source code distribution for details.
+ */
+
+if (isset($_REQUEST['debug'])) {
+ ini_set('display_errors', 1);
+ ini_set('display_startup_errors', 0);
+ ini_set('log_errors', 0);
+ ini_set('allow_url_fopen', 0);
+ ini_set('error_reporting', E_ALL);
+}
+
+require_once '../includes/defaults.inc.php';
+require_once '../config.php';
+require_once '../includes/definitions.inc.php';
+require_once 'includes/functions.inc.php';
+require_once '../includes/functions.php';
+require_once 'includes/authenticate.inc.php';
+
+if (!$_SESSION['authenticated']) {
+ echo 'unauthenticated';
+ exit;
+}
+
+$type = mres($_POST['type']);
+
+if ($type == 'placeholder') {
+ $output = 'Please add a Widget to get started';
+ $status = 'ok';
+}
+elseif (is_file('includes/common/'.$type.'.inc.php')) {
+
+ include 'includes/common/'.$type.'.inc.php';
+ $output = implode('', $common_output);
+ $status = 'ok';
+
+}
+
+$response = array(
+ 'status' => $status,
+ 'html' => $output,
+ );
+
+echo _json_encode($response);
diff --git a/html/css/jquery.gridster.min.css b/html/css/jquery.gridster.min.css
new file mode 120000
index 000000000..8529b9ed9
--- /dev/null
+++ b/html/css/jquery.gridster.min.css
@@ -0,0 +1 @@
+../../lib/gridster/dist/jquery.gridster.min.css
\ No newline at end of file
diff --git a/html/css/styles.css b/html/css/styles.css
index 69ae991a8..13662682f 100644
--- a/html/css/styles.css
+++ b/html/css/styles.css
@@ -1654,3 +1654,65 @@ tr.search:nth-child(odd) {
color: #FFFFFF;
}
+.gridster * {
+ margin:0;
+}
+
+.grid ul {
+ list-style-type: none;
+}
+
+.gridster li {
+ font-size: 1em;
+ font-weight: bold;
+ text-align: center;
+ line-height: 100%;
+}
+
+
+.gridster {
+ margin: 0 auto;
+
+ opacity: .8;
+
+ -webkit-transition: opacity .6s;
+ -moz-transition: opacity .6s;
+ -o-transition: opacity .6s;
+ -ms-transition: opacity .6s;
+ transition: opacity .6s;
+}
+
+.gridster .gs-w {
+ background: #ffffff;
+ box-shadow: inset 0 0 2px #000;
+ color: 000000
+ cursor: pointer;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+
+}
+
+.gridster .player {
+ background: #BBB;
+}
+
+
+.gridster .preview-holder {
+ border: none!important;
+ background: red!important;
+}
+
+.tile_header {
+ padding: 0.8em;
+ background-color: #000000;
+ color: #ffffff;
+ -webkit-border-top-left-radius: 4px;
+ -moz-border-top-right-radius: 4px;
+ border-top-left-radius: 4px;
+ border-top-right-radius: 4px;
+}
+
+.tile_body {
+ padding: 0.8em;
+}
diff --git a/html/forms/update-dashboard-config.inc.php b/html/forms/update-dashboard-config.inc.php
new file mode 100644
index 000000000..ea44f11d3
--- /dev/null
+++ b/html/forms/update-dashboard-config.inc.php
@@ -0,0 +1,45 @@
+$_SESSION['user_id'],'widget_id'=>$tile_id,'title'=>$tile['tile_title'],'content'=>$tile['tile'],'size_x'=>$x,'size_y'=>$y),'dashboard_items');
+ if (is_numeric($item_id)) {
+ $extra = array('item_id'=>$item_id,'title'=>$tile['tile_title'],'content'=>$tile['tile'],'size_x'=>$x,'size_y'=>$y);
+ $status = 'ok';
+ $message = '';
+ }
+ }
+}
+else {
+ $status = 'ok';
+ $message = '';
+
+ foreach ($data as $line) {
+ if (is_array($line)) {
+ $update = array('col'=>$line['col'],'row'=>$line['row'],'size_x'=>$line['size_x'],'size_y'=>$line['size_y']);
+ dbUpdate($update, 'dashboard_items', '`dashboard_item_id`=?', array($line['id']));
+ }
+ }
+}
+
+$response = array(
+ 'status' => $status,
+ 'message' => $message,
+ 'extra' => $extra,
+);
+echo _json_encode($response);
diff --git a/html/includes/common/alerts.inc.php b/html/includes/common/alerts.inc.php
new file mode 100644
index 000000000..7f347f916
--- /dev/null
+++ b/html/includes/common/alerts.inc.php
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
+
Status
+
Rule
+
+
Hostname
+
Timestamp
+
Severity
+
Acknowledge
+
+
+
+
+';
+
+
diff --git a/html/includes/common/availability-map.inc.php b/html/includes/common/availability-map.inc.php
new file mode 100644
index 000000000..d8c68becb
--- /dev/null
+++ b/html/includes/common/availability-map.inc.php
@@ -0,0 +1,45 @@
+
+* This program is free software: you can redistribute it and/or modify it
+* under the terms of the GNU General Public License as published by the
+* Free Software Foundation, either version 3 of the License, or (at your
+* option) any later version. Please see LICENSE.txt at the top level of
+* the source code distribution for details.
+*/
+
+$sql = "SELECT `D`.`hostname`,`D`.`device_id`,`D`.`status`,`D`.`uptime` FROM `devices` AS `D`";
+
+if (is_admin() === false && is_read() === false) {
+ $sql .= " , `devices_perms` AS P WHERE D.`device_id` = P.`device_id` AND P.`user_id` = ? AND";
+ $param = array($_SESSION['user_id']);
+}
+else {
+ $sql .= " WHERE";
+}
+
+$sql .= " `D`.`ignore` = '0' AND `D`.`disabled` = '0' ORDER BY `hostname`";
+
+$temp_output = array();
+
+foreach(dbFetchRows($sql,$param) as $device) {
+ if ($device['status'] == '1') {
+ $btn_type = 'btn-success';
+ if ($device['uptime'] < $config['uptime_warning']) {
+ $btn_type = 'btn-warning';
+ }
+ }
+ else {
+ $btn_type = 'btn-danger';
+ }
+ $temp_output[] = " 'device', 'device' => $device['device_id'])). "' role='button' class='btn " . $btn_type . " btn-xs' title='" . $device['hostname'] . "' style='min-height:25px; min-width:25px; border-radius:0px; border:0px; margin:0; padding:0;'>";
+}
+
+$temp_rows = count($temp_output);
+
+$temp_output[] = "";
+$temp_header = array("