-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
266 lines (232 loc) · 8.9 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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<!doctype html>
<html lang="en" style="height: 100%;">
<head>
<meta charset="utf-8">
<link rel="manifest" href="./manifest.json">
<script src="./node_modules/blockly/blockly_compressed.js"></script>
<script src="./node_modules/blockly/blocks_compressed.js"></script>
<script src="./node_modules/blockly/javascript_compressed.js"></script>
<script src="./node_modules/blockly/msg/en.js"></script>
<script src="./node_modules/@blockly/zoom-to-fit/dist/index.js"></script>
<script src="./node_modules/dayjs/dayjs.min.js"></script>
<!-- Drag/Drop support on touch devices -->
<link rel="stylesheet" href="./node_modules/mobile-drag-drop/default.css">
<link rel="stylesheet" href="./node_modules/dock-spawn-ts/lib/css/dock-manager.css">
<link rel="stylesheet" href="./assets/main.css">
<link rel="stylesheet" href="./node_modules/toastify-js/src/toastify.css">
<title>iobroker-webui designer</title>
<script src="./node_modules/construct-style-sheets-polyfill/dist/adoptedStyleSheets.js"></script>
<script>
let storedParentUrl;
window.esmsInitOptions = {
shimMode: true,
mapOverrides: true,
resolve: (id, parentUrl, resolve) => {
if (!storedParentUrl)
storedParentUrl = parentUrl;
if (parentUrl.startsWith('blob:'))
parentUrl = storedParentUrl;
return resolve(id, parentUrl)
}
}
</script>
<script src="./node_modules/es-module-shims/dist/es-module-shims.js"></script>
<script src="/webui.0.widgets/importmap.js"></script>
<script src="./dist/importmaps/importmap-config.js"></script>
<script src="config.js"></script>
<script src="./node_modules/mobile-drag-drop/index.js"></script>
<script type="module">
try {
const scp = document.createElement('script');
scp.src = iobrokerWebRootUrl + "webui.0.widgets/importmap.js";
document.head.appendChild(scp);
await importShim(iobrokerWebRootUrl + 'webui.0.widgets/importWidgetFiles.js');
} catch (err) {
console.warn(err);
}
importShim('dock-spawn-ts/lib/js/webcomponent/DockSpawnTsWebcomponent.js');
importShim('./dist/frontend/config/IobrokerWebuiAppShell.js');
</script>
<style>
body {
margin: 0;
font-family: 'Roboto', 'Noto', sans-serif;
line-height: 1.5;
background-color: white;
-webkit-font-smoothing: antialiased;
overflow: hidden;
}
.lds-facebook {
display: inline-block;
position: relative;
width: 80px;
height: 80px;
position: absolute;
left: calc(50% - 40px);
top: calc(50% - 40px);
}
.lds-facebook div {
animation-duration: 1s !important;
animation-iteration-count: infinite !important;
display: inline-block;
position: absolute;
left: 8px;
width: 16px;
background: black;
animation: lds-facebook 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite;
}
.lds-facebook div:nth-child(1) {
left: 8px;
animation-delay: -0.24s;
}
.lds-facebook div:nth-child(2) {
left: 32px;
animation-delay: -0.12s;
}
.lds-facebook div:nth-child(3) {
left: 56px;
animation-delay: 0;
}
@keyframes lds-facebook {
0% {
top: 8px;
height: 64px;
}
50%,
100% {
top: 24px;
height: 32px;
}
}
html {
--heightTop: 38px;
--heightStatus: 20px;
}
#shell {
height: calc(100% - var(--heightTop) - var(--heightStatus));
width: 100%;
position: absolute;
}
#statusbar {
display: flex;
height: var(--heightStatus);
background: lightgray;
border-top: 1px solid gray;
width: 100%;
position: absolute;
bottom: 0;
}
#statusbar {
padding-left: 10px;
font-size: 14px;
font-family: sans-serif;
}
#statusbar>div {
font-size: 14px;
font-family: sans-serif;
}
.blocklyDropDownDiv {
z-index: 99999;
}
</style>
<style>
* {
box-sizing: border-box;
}
nav {
background: rgb(44, 46, 53);
display: flex;
height: var(--heightTop);
padding: 5px;
gap: 0;
color: #98a1a8;
}
nav div {
display: flex;
align-items: center;
font-family: monospace;
}
nav button {
border: none;
background: transparent;
position: relative;
}
/* https://codepen.io/sosuke/pen/Pjoqqp - css filter generator */
nav button img {
height: 24px;
filter: invert(68%) sepia(15%) saturate(133%) hue-rotate(169deg) brightness(91%) contrast(91%);
user-select: none;
}
nav button[disabled] img {
filter: invert(38%) sepia(1%) saturate(0%) hue-rotate(211deg) brightness(94%) contrast(85%);
}
nav button:not([disabled]) img:hover {
filter: invert(100%) sepia(2%) saturate(7432%) hue-rotate(100deg) brightness(112%) contrast(94%);
}
nav button:not([disabled]) img:active {
filter: invert(41%) sepia(92%) saturate(1090%) hue-rotate(335deg) brightness(99%) contrast(93%);
}
</style>
</head>
<body style="height: 100%;">
<nav>
<button data-command="new" title="new"><img src="./node_modules/@node-projects/web-component-designer/assets/icons/file.svg"></button>
<button data-command="new" data-command-parameter="grid" title="new grid">
<img src="./node_modules/@node-projects/web-component-designer/assets/icons/file.svg">
<img style="height: 16px; position: absolute; right: 6px; bottom: 2px;" src="./assets/icons/grid.svg">
</button>
<button data-command="new" data-command-parameter="control" title="new control">
<img src="./node_modules/@node-projects/web-component-designer/assets/icons/file.svg">
<img style="height: 16px; position: absolute; right: 6px; bottom: 2px;" src="./assets/icons/control.svg">
</button>
<button data-command="save" title="save" disabled><img src="./node_modules/@node-projects/web-component-designer/assets/icons/save.svg"></button>
<div style="margin-left: 30px;">
webui - {{VERSION}} - {{COMMIT_HASH}}
</div>
<button style="margin-left: 30px;" data-command="paste" title="paste" disabled><img
src="./node_modules/@node-projects/web-component-designer/assets/icons/paste.svg"></button>
<button data-command="cut" title="cut" disabled><img src="./node_modules/@node-projects/web-component-designer/assets/icons/cut.svg"></button>
<button data-command="copy" title="copy" disabled><img src="./node_modules/@node-projects/web-component-designer/assets/icons/copy.svg"></button>
<button data-command="delete" title="delete" disabled><img src="./node_modules/@node-projects/web-component-designer/assets/icons/delete.svg"></button>
<div style="margin-left: 10px; flex-direction: column;">
<button ondragstart="return false;" data-command="undo" disabled title="click and hold to see the undo list"><img
src="./node_modules/@node-projects/web-component-designer/assets/icons/undo.svg"></button>
<span id="undoCount" data-command="undo" disabled
style="font-family: monospace; font-size: 8px; position: relative; top: -8px; cursor: pointer;">(0/0)</span>
</div>
<div style="margin-left: 10px; flex-direction: column;">
<button ondragstart="return false;" data-command="redo" disabled title="click and hold to see the redo list"><img
src="./node_modules/@node-projects/web-component-designer/assets/icons/redo.svg"></button>
<span id="redoCount" data-command="redo" disabled
style="font-family: monospace; font-size: 8px; position: relative; top: -8px; cursor: pointer;">(0/0)</span>
</div>
<button style="margin-left: 10px;" data-command="runtime" title="runtime"><img src="./assets/icons/play.svg"></button>
</nav>
<iobroker-webui-app-shell id="shell">
</iobroker-webui-app-shell>
<div id="statusbar">
<div>npm status: </div>
<div id="npmState"></div>
<div style="margin-left: 15px; display: flex; align-items: center;">
<div id="connectionState"
style="background-color: yellow; margin-right: 5px; border-radius: 50%; border: 1px solid gray; height: 70%;aspect-ratio: 1;">
</div> Connection: <div style="margin-left: 3px;" id="connectionInfo"></div>
</div>
</div>
<div id="load"
style="position: absolute; width: 100%; height: 100%; z-index: 9999999999; top: 0; left: 0; background: white;">
<div class="lds-facebook">
<div></div>
<div></div>
<div></div>
</div>
</div>
<div id="overlayLayer"></div>
</body>
<script>
window.onload = () => {
document.getElementById('load').style.display = 'none';
}
window.appShell = document.getElementById('shell');
</script>
</html>