forked from pdxlocations/meshconfig
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
201 lines (188 loc) · 7.8 KB
/
index.html
File metadata and controls
201 lines (188 loc) · 7.8 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="./styles.css" />
</head>
<body>
<div class="backdrop" aria-hidden="true"></div>
<main class="shell">
<header class="hero">
<div class="hero__copy">
<p class="eyebrow" data-i18n="header.title">Meshtastic Config</p>
<h1 data-i18n="header.punchline">Download, diff, push.</h1>
<p class="lede" data-i18n="header.description">
Connect to a node, export the writable config, compare it to the YAML
you want, and upload changes back to the device.
</p>
</div>
<div class="hero__status">
<!-- Language switch -->
<div>
<button class="button button--ghost" onclick="setLang('en')">EN</button>
<button class="button button--ghost" onclick="setLang('pt')">PT</button>
<button class="button button--ghost" onclick="setLang('es')">ES</button>
</div>
<div class="status-pill" data-i18n="header.status" id="status">Disconnected</div>
<div class="mini-meta" data-i18n="header.nodeSummary" id="nodeSummary">No node connected</div>
</div>
</header>
<section class="panel panel--connect">
<div class="panel__header">
<div>
<p class="panel__kicker" data-i18n="connection.title">Connection</p>
<h2 data-i18n="connection.punchline">Node transport</h2>
</div>
<div class="panel__tools">
<button id="connectBtn" data-i18n="connection.bntconnect" class="button button--primary" type="button">
Connect
</button>
<button id="disconnectBtn" data-i18n="connection.bntdisconnect" class="button button--ghost" type="button" disabled>
Disconnect
</button>
</div>
</div>
<div class="connect-grid">
<label class="field">
<span data-i18n="connection.connectionType">Connection method</span>
<select id="connectionType">
<option value="serial">Serial (USB)</option>
<option value="bluetooth">Bluetooth (Web BLE)</option>
<option value="http">HTTP(S)</option>
</select>
</label>
<label class="field field--http" id="httpField">
<span>Host / IP</span>
<input
id="httpTarget"
type="text"
placeholder="meshtastic.local, 10.10.0.57, or 10.10.0.57:8080"
autocomplete="off"
/>
<label class="toggle" for="tlsToggle">
<input id="tlsToggle" class="toggle__input" type="checkbox" />
<span class="toggle__slider" aria-hidden="true"></span>
<span class="toggle__label" data-i18n="connection.usehttps">Use HTTPS</span>
</label>
</label>
<div class="hint-block" data-i18n="connection.description">
Chromium-based browsers are required for Web Serial and Web Bluetooth.
Those transports only work on `https://` or `localhost`.
</div>
</div>
</section>
<section class="panel panel--actions">
<div class="panel__header">
<div>
<p class="panel__kicker" data-i18n="workflow.title">Workflow</p>
<h2 data-i18n="workflow.punchline">Live and desired config</h2>
</div>
<div class="panel__tools panel__tools--wrap">
<label class="field field--preset">
<span data-i18n="workflow.desiredpreset">Desired preset</span>
<select id="desiredPreset"></select>
</label>
<button id="copyLiveBtn" class="button button--ghost" type="button" disabled data-i18n="workflow.bntuselive">
Use live as desired
</button>
<button id="uploadBtn" class="button button--danger" type="button" disabled data-i18n="workflow.bntupload">
Upload desired config
</button>
<button id="downloadLiveBtn" class="button button--ghost" type="button" disabled data-i18n="workflow.bntdownloadyaml">
Download YAML
</button>
<button id="loadDesiredBtn" class="button button--ghost" type="button" data-i18n="workflow.bntloaddesired">
Load desired file
</button>
<input id="desiredFile" type="file" accept=".yaml,.yml,.json,text/yaml,application/json" hidden />
</div>
</div>
<div class="workspace">
<section class="editor-card">
<div class="editor-card__header">
<h3 data-i18n="workflow.livenode_title">Live node export</h3>
<div class="editor-card__meta" id="liveMeta" data-i18n="workflow.livenode_status">No download yet</div>
</div>
<textarea
id="liveYaml"
class="editor"
readonly
spellcheck="false"
aria-label="Live node YAML"
data-i18n="workflow.livenode_status_msg"
>Connect to a node, then download its config.</textarea>
</section>
<section class="editor-card">
<div class="editor-card__header">
<h3 data-i18n="workflow.desired_title">Desired YAML</h3>
<div class="editor-card__meta" id="desiredMeta">Editable</div>
</div>
<textarea
id="desiredYaml"
class="editor"
spellcheck="false"
aria-label="Desired YAML"
placeholder="Paste the config you want to enforce here."
></textarea>
</section>
</div>
</section>
<section class="panel panel--diffs">
<div class="panel__header">
<div>
<p class="panel__kicker" data-i18n="diff.title">Diff</p>
<h2 data-i18n="diff.punchline">Current diff</h2>
</div>
<div class="panel__tools">
<button id="refreshDiffBtn" class="button button--ghost" type="button" disabled data-i18n="diff.bntrefresh">
Refresh diff
</button>
<div class="diff-badge" id="currentDiffBadge" data-i18n="diff.status">No comparison yet</div>
</div>
</div>
<div id="currentDiff" class="diff-output">Download the live config and compare it with your desired YAML.</div>
</section>
<section class="panel panel--log">
<div class="panel__header">
<div>
<p class="panel__kicker" data-i18n="logbox.title">Log</p>
<h2>Log</h2>
</div>
<div class="panel__tools">
<button id="clearLogBtn" class="button button--ghost" type="button" data-i18n="logbox.bntclearlog">Clear log</button>
</div>
</div>
<pre id="log" class="log"></pre>
</section>
</main>
<footer class="site-footer">
<a
class="site-footer__link"
href="https://github.com/pdxlocations/meshconfig"
target="_blank"
rel="noreferrer"
>
View project on GitHub
</a>
</footer>
<script type="module" src="./app.js"></script>
<!-- i18n system -->
<script src="i18n.js"></script>
<script>
async function start() {
await i18n.init({ path: "./i18n", fallback: "en" });
}
function setLang(lang) {
i18n.setLang(lang);
}
start();
</script>
</body>
</html>