|
|
@@ -14,8 +14,26 @@ function showBigError (type, friendlyType, message) {
|
|
|
document.getElementById('rootGroup').appendChild(domErr)
|
|
|
}
|
|
|
|
|
|
+function showSection (name) {
|
|
|
+ for (let otherName of ["Actions", "Logs"]) {
|
|
|
+ document.getElementById('show' + otherName).classList.remove('activeSection');
|
|
|
+ document.getElementById('content' + otherName).hidden = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ document.getElementById('show' + name).classList.add('activeSection')
|
|
|
+ document.getElementById('content' + name).hidden = false;
|
|
|
+}
|
|
|
+
|
|
|
+function setupSections() {
|
|
|
+ document.getElementById('showActions').onclick = () => { showSection('Actions') };
|
|
|
+ document.getElementById('showLogs').onclick = () => { showSection('Logs') }
|
|
|
+
|
|
|
+ showSection('Actions');
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
function fetchGetButtons() {
|
|
|
- window.fetch(window.restBaseUrl + 'GetButtons', {
|
|
|
+ window.fetch(window.restBaseUrl + 'GetButtons', {
|
|
|
cors: 'cors'
|
|
|
// No fetch options
|
|
|
}).then(res => {
|
|
|
@@ -40,6 +58,8 @@ function processWebuiSettingsJson (settings) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+setupSections();
|
|
|
+
|
|
|
window.fetch('webUiSettings.json').then(res => {
|
|
|
return res.json()
|
|
|
}).then(res => {
|
|
|
@@ -51,3 +71,4 @@ window.fetch('webUiSettings.json').then(res => {
|
|
|
}).catch(err => {
|
|
|
showBigError('fetch-webui-settings', 'getting webui settings', err)
|
|
|
})
|
|
|
+
|