Commit 798ecc32 authored by jan.koester's avatar jan.koester
Browse files

test

parent a2bad838
Loading
Loading
Loading
Loading
+1 −1
Changes for CMakeLists.txt: 1 added line, 1 removed line.
Original line number Diff line number Diff line
cmake_minimum_required(VERSION 3.16)
project(webctl VERSION 0.2.0 LANGUAGES CXX)
project(webctl VERSION 0.2.1 LANGUAGES CXX)

# webctl: a web interface for FenrirOS.
#
+3 −1
Changes for www/app.js: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -180,7 +180,9 @@ const webctl = (() => {
        body: JSON.stringify(body || {}),
      });
    } catch (e) {
      throw new Error(t('No connection to the server.'));
      const err = new Error(t('No connection to the server.'));
      err.connection = true;  // the request didn't get an answer (no server error)
      throw err;
    }
    let data = {};
    try { data = await res.json(); } catch (e) { /* empty body */ }
+15 −4
Changes for www/modules/network.js: 15 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@
      'Namen: Buchstaben, Ziffern, „-“, „_“ und „.“, höchstens 15 Zeichen.',
    'Select at least one member.': 'Mindestens ein Mitglied auswählen.',
    '{0} saved and applied.': '{0} gespeichert und angewendet.', '{0} saved.': '{0} gespeichert.',
    '{0} saved and applied; the connection was interrupted meanwhile.': '{0} gespeichert und angewendet; die Verbindung wurde dabei kurz unterbrochen.',
    '{0} saved, but applying it failed: {1}': '{0} gespeichert, aber das Anwenden ist fehlgeschlagen: {1}',
    'Delete {0}?': '{0} löschen?',
    '{0} and its configuration are removed; its members get their own configuration again (usually DHCP).':
      '{0} und seine Konfiguration werden entfernt; seine Mitglieder bekommen wieder eine eigene Konfiguration (meist DHCP).',
@@ -169,17 +171,26 @@
                          dns: d.dns.split(/[\s,]+/).filter(Boolean)};
          if (own) await call('network', 'update', Object.assign({config: iface.config}, ipArgs));
          else await call('network', 'create', ipArgs).catch(() => call('network', 'update', Object.assign({config: '10-' + name}, ipArgs)));
          if (d.apply) await call('network', 'reload', {});
        } catch (e) {
          // a new bond/bridge whose setup failed must not stay half made
          // (deleteNetdev also drops its address configuration and device)
          // a new bond/bridge whose configuration failed must not stay half
          // made (deleteNetdev also drops its address configuration)
          if (!nd) {
            await call('network', 'deleteNetdev', {netdev: name}).catch(() => {});
            if (d.apply) await call('network', 'reload', {}).catch(() => {});
            load();
          }
          throw e;
        }
        if (d.apply) {
          try {
            await call('network', 'reload', {});
          } catch (e) {
            load();
            // applying it moves the members' addresses: when this page runs
            // over one of them, the answer gets lost, but the change is made
            if (e.connection) { toast(t('{0} saved and applied; the connection was interrupted meanwhile.', name)); return; }
            throw new Error(t('{0} saved, but applying it failed: {1}', name, e.message));
          }
        }
        toast(d.apply ? t('{0} saved and applied.', name) : t('{0} saved.', name));
        load();
      },