|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | +<meta charset="UTF-8"> |
| 5 | +<title>freeboard</title> |
| 6 | +<meta name="apple-mobile-web-app-capable" content="yes" /> |
| 7 | +<meta name="apple-mobile-web-app-status-bar-style" content="black" /> |
| 8 | +<meta name="viewport" |
| 9 | + content="width = device-width, initial-scale = 1, user-scalable = no" /> |
| 10 | +<link href="css/jquery.gridster.min.css" rel="stylesheet" /> |
| 11 | +<link href="css/styles.css" rel="stylesheet" /> |
| 12 | +<script src="js/head.js"></script> |
| 13 | +<script type="text/javascript"> |
| 14 | + head |
| 15 | + .js( |
| 16 | + "js/knockout.js", |
| 17 | + "js/jquery.js", |
| 18 | + "js/jquery-ui.js", |
| 19 | + "js/underscore.js", |
| 20 | + "js/jquery.gridster.js", |
| 21 | + "js/jquery.sparkline.min.js", |
| 22 | + "js/jquery.caret.js", |
| 23 | + "js/raphael.2.1.0.min.js", |
| 24 | + "js/justgage.1.0.1.js", |
| 25 | + "js/freeboard/freeboard.js", |
| 26 | + "js/freeboard/plugins/freeboard.datasources.js", |
| 27 | + "js/freeboard/plugins/freeboard.widgets.js", |
| 28 | + "js/freeboard/plugins/plugin_node.js", |
| 29 | + // *** Load more plugins here *** |
| 30 | + function() { |
| 31 | + $(function() { //DOM Ready |
| 32 | + freeboard.initialize(true); |
| 33 | + freeboard |
| 34 | + .loadDashboard({ |
| 35 | + "allow_edit": true, |
| 36 | + "plugins": [], |
| 37 | + "panes": [ |
| 38 | + { |
| 39 | + "title": "Houses", |
| 40 | + "width": 1, |
| 41 | + "row": { |
| 42 | + "2": 1, |
| 43 | + "3": 1 |
| 44 | + }, |
| 45 | + "col": { |
| 46 | + "2": 1, |
| 47 | + "3": 1 |
| 48 | + }, |
| 49 | + "widgets": [ |
| 50 | + { |
| 51 | + "type": "text_widget", |
| 52 | + "settings": { |
| 53 | + "title": "House of Stark - Jon", |
| 54 | + "size": "regular", |
| 55 | + "value": "datasources[\"Jon\"].value", |
| 56 | + "sparkline": true, |
| 57 | + "animate": true |
| 58 | + } |
| 59 | + }, |
| 60 | + { |
| 61 | + "type": "text_widget", |
| 62 | + "settings": { |
| 63 | + "title": "House of Lannister - Tyrion", |
| 64 | + "size": "regular", |
| 65 | + "value": "datasources[\"Tyrion\"].value", |
| 66 | + "sparkline": true, |
| 67 | + "animate": true |
| 68 | + } |
| 69 | + } |
| 70 | + ] |
| 71 | + }, |
| 72 | + { |
| 73 | + "title": "Timezones", |
| 74 | + "width": 1, |
| 75 | + "row": { |
| 76 | + "3": 1 |
| 77 | + }, |
| 78 | + "col": { |
| 79 | + "3": 2 |
| 80 | + }, |
| 81 | + "widgets": [ |
| 82 | + { |
| 83 | + "type": "text_widget", |
| 84 | + "settings": { |
| 85 | + "title": "House of Stark - Jon", |
| 86 | + "size": "regular", |
| 87 | + "value": "new Date(datasources[\"Jon\"].time_stamp).toLocaleTimeString();", |
| 88 | + "animate": false |
| 89 | + } |
| 90 | + }, |
| 91 | + { |
| 92 | + "type": "text_widget", |
| 93 | + "settings": { |
| 94 | + "title": "House of Lannister - Tyrion", |
| 95 | + "size": "regular", |
| 96 | + "value": "new Date(datasources[\"Tyrion\"].time_stamp).toLocaleTimeString();", |
| 97 | + "animate": false |
| 98 | + } |
| 99 | + } |
| 100 | + ] |
| 101 | + } |
| 102 | + ], |
| 103 | + "datasources": [ |
| 104 | + { |
| 105 | + "name": "Jon", |
| 106 | + "type": "node_js", |
| 107 | + "settings": { |
| 108 | + "url": "http://localhost:8989/shows", |
| 109 | + "rooms": [ |
| 110 | + { |
| 111 | + "roomName": "got", |
| 112 | + "roomEvent": "subscribe" |
| 113 | + } |
| 114 | + ], |
| 115 | + "events": [ |
| 116 | + { |
| 117 | + "eventName": "house.stark.jon" |
| 118 | + } |
| 119 | + ] |
| 120 | + } |
| 121 | + }, |
| 122 | + { |
| 123 | + "name": "Tyrion", |
| 124 | + "type": "node_js", |
| 125 | + "settings": { |
| 126 | + "url": "http://localhost:8989/shows", |
| 127 | + "rooms": [ |
| 128 | + { |
| 129 | + "roomName": "got", |
| 130 | + "roomEvent": "subscribe" |
| 131 | + } |
| 132 | + ], |
| 133 | + "events": [ |
| 134 | + { |
| 135 | + "eventName": "house.lannister.tyrion" |
| 136 | + } |
| 137 | + ] |
| 138 | + } |
| 139 | + } |
| 140 | + ] |
| 141 | + }); |
| 142 | + }); |
| 143 | + }); |
| 144 | +</script> |
| 145 | +</head> |
| 146 | +<body> |
| 147 | + <div id="board-content"> |
| 148 | + <img id="dash-logo" |
| 149 | + data-bind="attr:{src: header_image}, visible:header_image()"> |
| 150 | + <div class="gridster"> |
| 151 | + <ul data-bind="grid: true"> |
| 152 | + </ul> |
| 153 | + </div> |
| 154 | + </div> |
| 155 | + <header id="main-header" data-bind="if:allow_edit"> |
| 156 | + <div id="admin-bar"> |
| 157 | + <div id="admin-menu"> |
| 158 | + <div id="board-tools"> |
| 159 | + <h1 id="board-logo" class="title bordered">freeboard</h1> |
| 160 | + <div id="board-actions"> |
| 161 | + <ul class="board-toolbar vertical"> |
| 162 | + <li data-bind="click: loadDashboardFromLocalFile"><i |
| 163 | + id="full-screen-icon" class="icon-folder-open icon-white"></i><label |
| 164 | + id="full-screen">Load Freeboard</label></li> |
| 165 | + <li data-bind="click: saveDashboard"><i |
| 166 | + class="icon-download-alt icon-white"></i><label>Save |
| 167 | + Freeboard</label></li> |
| 168 | + <li id="add-pane" data-bind="click: createPane"><i |
| 169 | + class="icon-plus icon-white"></i><label>Add Pane</label></li> |
| 170 | + </ul> |
| 171 | + </div> |
| 172 | + </div> |
| 173 | + <div id="datasources"> |
| 174 | + <h2 class="title">DATASOURCES</h2> |
| 175 | + |
| 176 | + <div class="datasource-list-container"> |
| 177 | + <table class="table table-condensed sub-table" |
| 178 | + id="datasources-list" data-bind="if: datasources().length"> |
| 179 | + <thead> |
| 180 | + <tr> |
| 181 | + <th>Name</th> |
| 182 | + <th>Last Updated</th> |
| 183 | + <th> </th> |
| 184 | + </tr> |
| 185 | + </thead> |
| 186 | + <tbody data-bind="foreach: datasources"> |
| 187 | + <tr> |
| 188 | + <td><span class="text-button datasource-name" |
| 189 | + data-bind="text: name, pluginEditor: {operation: 'edit', type: 'datasource'}"></span> |
| 190 | + </td> |
| 191 | + <td data-bind="text: last_updated"></td> |
| 192 | + <td> |
| 193 | + <ul class="board-toolbar"> |
| 194 | + <li data-bind="click: updateNow"><i |
| 195 | + class="icon-refresh icon-white"></i></li> |
| 196 | + <li |
| 197 | + data-bind="pluginEditor: {operation: 'delete', type: 'datasource'}"> |
| 198 | + <i class="icon-trash icon-white"></i> |
| 199 | + </li> |
| 200 | + </ul> |
| 201 | + </td> |
| 202 | + </tr> |
| 203 | + </tbody> |
| 204 | + </table> |
| 205 | + </div> |
| 206 | + <span class="text-button table-operation" |
| 207 | + data-bind="pluginEditor: {operation: 'add', type: 'datasource'}">ADD</span> |
| 208 | + </div> |
| 209 | + </div> |
| 210 | + </div> |
| 211 | + <div id="toggle-header" data-bind="click: toggleEditing"> |
| 212 | + <i id="toggle-header-icon" class="icon-wrench icon-white"></i> |
| 213 | + </div> |
| 214 | + </header> |
| 215 | + |
| 216 | + <div style="display: hidden"> |
| 217 | + <ul data-bind="template: { name: 'pane-template', foreach: panes}"> |
| 218 | + </ul> |
| 219 | + </div> |
| 220 | + |
| 221 | + <script type="text/html" id="pane-template"> |
| 222 | + <li data-bind="pane: true"> |
| 223 | + <header> |
| 224 | + <h1 data-bind="text: title"></h1> |
| 225 | + <ul class="board-toolbar pane-tools"> |
| 226 | + <li data-bind="pluginEditor: {operation: 'add', type: 'widget'}"> |
| 227 | + <i class="icon-plus icon-white"></i> |
| 228 | + </li> |
| 229 | + <li data-bind="pluginEditor: {operation: 'edit', type: 'pane'}"> |
| 230 | + <i class="icon-wrench icon-white"></i> |
| 231 | + </li> |
| 232 | + <li data-bind="pluginEditor: {operation: 'delete', type: 'pane'}"> |
| 233 | + <i class="icon-trash icon-white"></i> |
| 234 | + </li> |
| 235 | + </ul> |
| 236 | + </header> |
| 237 | + <section data-bind="foreach: widgets"> |
| 238 | + <div class="sub-section" data-bind="css: 'sub-section-height-' + height()"> |
| 239 | + <div class="widget" data-bind="widget: true, css:{fillsize:fillSize}"></div> |
| 240 | + <div class="sub-section-tools"> |
| 241 | + <ul class="board-toolbar"> |
| 242 | + <!-- ko if:$parent.widgetCanMoveUp($data) --> |
| 243 | + <li data-bind="click:$parent.moveWidgetUp"><i class="icon-chevron-up icon-white"></i></li> |
| 244 | + <!-- /ko --> |
| 245 | + <!-- ko if:$parent.widgetCanMoveDown($data) --> |
| 246 | + <li data-bind="click:$parent.moveWidgetDown"><i class="icon-chevron-down icon-white"></i></li> |
| 247 | + <!-- /ko --> |
| 248 | + <li data-bind="pluginEditor: {operation: 'edit', type: 'widget'}"><i class="icon-wrench icon-white"></i></li> |
| 249 | + <li data-bind="pluginEditor: {operation: 'delete', type: 'widget'}"><i class="icon-trash icon-white"></i></li> |
| 250 | + </ul> |
| 251 | + </div> |
| 252 | + </div> |
| 253 | + </section> |
| 254 | + </li> |
| 255 | +</script> |
| 256 | + |
| 257 | +</body> |
| 258 | +</html> |
0 commit comments