This repository has been archived by the owner on Apr 28, 2024. It is now read-only.
forked from Freeboard/freeboard
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
executable file
·218 lines (190 loc) · 9.48 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>freeboard</title>
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="width = device-width, initial-scale = 1, user-scalable = no" />
<link href="css/freeboard.min.css" rel="stylesheet" />
<style>
</style>
<script src="js/freeboard.thirdparty.min.js"></script>
<script type="text/javascript">
function showFreeboardHelp() {
freeboard.showDialog(generateFreeboardHelp(), "Help", "Close")
}
function showFreeboadTemplatesMenu() {
freeboard.showTemplatesPage()
}
function showEmoji() {
freeboard.showDialog(generateFreeboardEmojiCheats(), "Help", "Close")
}
function showPages() {
freeboard.showPageManager();
}
head.js("js/freeboard_plugins.min.js",
// *** Load more plugins here ***
function () {
$(function () { //DOM Ready
freeboard.initialize(true);
var hashpattern = window.location.hash.match(/(&|#)source=([^&]+)/);
if (hashpattern !== null) {
$.getJSON(hashpattern[2], function (data) {
freeboard.loadDashboard(data, function () {
freeboard.setEditing(false);
});
});
}
GlobalSettingsEditor = new JSONEditor(document.getElementById('fb-global-settings-editor'), {
schema: globalSettingsSchema
});
GlobalSettingsEditor.setValue(freeboard.globalSettings)
//External changes, like if we upload a new board
freeboard.globalSettingsHandlers['gs-editor'] = function (a) { GlobalSettingsEditor.setValue(a) }
document.getElementById('gs-submit').addEventListener('click', function () {
// Get the value from the editor
freeboard.setGlobalSettings(GlobalSettingsEditor.getValue());
freeboard.unsaved["Board Definition"]=true
});
});
});
</script>
</head>
<body>
<div style="position: absolute;height: 100vh; width: 100vw;" id="bg_particle_fx"></div>
<div id="globalSettingsDialog"
style="position: absolute; z-index: 100; background-color: var(--box-bg-color); display: none; height: 100%; width: 45%;">
<h2> Global Settings</h2>
<p> Click object properties to see more settings</p>
<button onclick="$('#globalSettingsDialog').css({display:'none'})"> Close</button>
<div id="fb-global-settings-editor"></div>
<button id="gs-submit"> Update</button>
</div>
<div id="board-content">
<img id="dash-logo" data-bind="attr:{src: header_image}, visible:header_image()">
<div class="gridster responsive-column-width">
<ul data-bind="grid: true">
</ul>
</div>
</div>
<header id="main-header" data-bind="if:allow_edit">
<div id="main-header-inner">
<div id="admin-bar">
<div id="admin-menu">
<div id="board-tools">
<div id="board-logo" class="title freeboard-branding"> freeboard </div>
<div id="board-actions">
<ul class="board-toolbar vertical">
<li data-bind="click: showFreeboadTemplatesMenu"><label> Load Example</label></li>
<li data-bind="click: showFreeboardHelp"><label> Show Help</label></li>
<li data-bind="click: showEmoji"><label> Show Emoji</label></li>
<li data-bind="click: loadDashboardFromLocalFile"><label id="full-screen"> Upload a
board</label></li>
<li>
<label data-bind="click: downloadDashboardClicked"> Download this board</label>
<label style="display: none;" data-bind="click: downloadDashboard"
data-pretty="true">[Pretty]</label>
<label style="display: none;" data-bind="click: downloadDashboard"
data-pretty="false">[Minified]</label>
</li>
<li id="add-pane" data-bind="click: createPane"><label> Add Pane to Page</label></li>
<li data-bind="click: showPages"><label> Show Page Manager</label></li>
<li onclick="$('#globalSettingsDialog').css({display:'block'})"><label> Board Settings</label></li>
</ul>
</div>
</div>
<div id="datasources">
<h2 class="title"> Data Sources</h2>
<div class="datasource-list-container">
<table class="table table-condensed sub-table" id="datasources-list"
data-bind="if: datasources().length">
<thead>
<tr>
<th>Name</th>
<th>Last Updated</th>
<th> </th>
</tr>
</thead>
<tbody data-bind="foreach: datasources">
<tr>
<td>
<span class="text-button datasource-name"
data-bind="text: name, pluginEditor: {operation: 'edit', type: 'datasource'}"></span>
</td>
<td data-bind="text: last_updated"></td>
<td>
<ul class="board-toolbar">
<li data-bind="click: updateNow">
</li>
<li data-bind="pluginEditor: {operation: 'delete', type: 'datasource'}">
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<span class="text-button table-operation"
data-bind="pluginEditor: {operation: 'add', type: 'datasource'}"> Add Datasource</span>
</div>
</div>
</div>
<div id="column-tools" class="responsive-column-width">
<ul class="board-toolbar left-columns">
<li class="column-tool add" data-bind="click: addGridColumnLeft"></li>
<li class="column-tool sub" data-bind="click: subGridColumnLeft"></li>
</ul>
<ul class="board-toolbar right-columns">
<li class="column-tool sub" data-bind="click: subGridColumnRight"></li>
<li class="column-tool add" data-bind="click: addGridColumnRight"></li>
</ul>
</div>
<div id="toggle-header" data-bind="click: toggleEditing">
</div>
</div>
</header>
<div style="display:hidden">
<ul data-bind="template: { name: 'pane-template', foreach: panes}">
</ul>
</div>
<script type="text/html" id="pane-template">
<li data-bind="pane: true">
<header>
<h1 data-bind="text: title"></h1>
<ul class="board-toolbar pane-tools">
<li data-bind="pluginEditor: {operation: 'add', type: 'widget'}">
</li>
<li data-bind="pluginEditor: {operation: 'edit', type: 'pane'}">
</i>
</li>
<li data-bind="pluginEditor: {operation: 'delete', type: 'pane'}">
</li>
</ul>
</header>
<section data-bind="foreach: widgets">
<div class="sub-section" data-bind="css: 'sub-section-height-' + height()">
<div class="widget" data-bind="widget: true, css:{fillsize:fillSize}"></div>
<div class="sub-section-tools">
<ul class="board-toolbar">
<!-- ko if:$parent.widgetCanMoveUp($data) -->
<li data-bind="click:$parent.moveWidgetUp"></li>
<!-- /ko -->
<!-- ko if:$parent.widgetCanMoveDown($data) -->
<li data-bind="click:$parent.moveWidgetDown"></li>
<!-- /ko -->
<li data-bind="pluginEditor: {operation: 'edit', type: 'widget'}"></i></li>
<li data-bind="pluginEditor: {operation: 'delete', type: 'widget'}"></li>
</ul>
</div>
</div>
</section>
</li>
</script>
<div id="freeboard-extra-tools"></div>
<div id="globaloverlay"></div>
</body>
</html>