Commit 5ace5f81 authored by Jan Koester's avatar Jan Koester
Browse files

test

parent 4d7a9801
Loading
Loading
Loading
Loading
+2 −0
Changes for modules/network/network.cpp: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -108,6 +108,8 @@ json_object *netdevJson(const sysbus::NetDevInfo &n) {
    json_object_object_add(o, "config", jstr(n.config));
    json_object_object_add(o, "configPath", jstr(n.configPath));
    json_object_object_add(o, "exists", json_object_new_boolean(n.exists));
    json_object_object_add(o, "address", jstr(n.configAddress));
    json_object_object_add(o, "error", jstr(n.applyError));
    json_object *m = json_object_new_array();
    for (auto &x : n.members) json_object_array_add(m, jstr(x));
    json_object_object_add(o, "members", m);
+10 −6
Changes for www/modules/network.js: 10 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@
    '{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).',
    '{0} deleted.': '{0} gelöscht.',
    'wireguard': 'WireGuard', 'active': 'aktiv', 'down': 'aus', 'WireGuard': 'WireGuard', 'New WireGuard interface': 'Neues WireGuard-Interface',
    'wireguard': 'WireGuard', 'active': 'aktiv', 'down': 'aus', 'Error': 'Fehler', 'WireGuard': 'WireGuard', 'New WireGuard interface': 'Neues WireGuard-Interface',
    'No WireGuard interfaces.': 'Keine WireGuard-Interfaces.', 'Name (e.g. wg0)': 'Name (z. B. wg0)',
    'Address of the interface (CIDR)': 'Adresse des Interfaces (CIDR)',
    'The tunnel network: the peers get addresses from it.': 'Das Tunnelnetz: daraus bekommen die Peers ihre Adressen.',
@@ -297,7 +297,7 @@
  function netdevPanel() {
    const ifState = nd => {
      const i = interfaces.find(x => x.name === nd.name);
      return i ? state(i) : h('span', {class: 'badge warn'}, t('not created yet'));
      return [i ? state(i) : h('span', {class: 'badge warn'}, t('not created yet')), netdevError(nd)];
    };
    const settingsText = nd => nd.kind === 'bond'
      ? (bondModes.find(m => m[0] === nd.mode) || [nd.mode, nd.mode])[0]
@@ -349,14 +349,17 @@
    return intToIp(ip - (ip % size)) + '/' + m[5];
  }

  // the interface's address (its configuration's, else the current IPv4 one)
  // the interface's address: its configuration's (known also while the
  // device isn't there), else the current IPv4 one
  function wgAddress(nd) {
    if (nd.address) return nd.address;
    const i = interfaces.find(x => x.name === nd.name);
    if (!i) return '';
    if (ownConfig(i) && i.address) return i.address;
    return (i.addresses || []).find(a => ipv4.test(a)) || '';
    return i ? (i.addresses || []).find(a => ipv4.test(a)) || '' : '';
  }

  // why syslite couldn't create or configure it
  const netdevError = nd => nd.error ? h('div', {class: 'badge danger', title: nd.error}, nd.error) : null;

  // the first address of the tunnel network no one has, as /32
  function nextPeerAddress(nd) {
    const address = wgAddress(nd);
@@ -560,6 +563,7 @@
        h('button', {class: 'small', onclick: () => wgDialog(nd)}, t('Edit')),
        h('button', {class: 'small danger', onclick: () => deleteNetdev(nd)}, t('Delete'))),
      h('dl', {class: 'wg-info'},
        nd.error ? h('dt', {}, t('Error')) : null, nd.error ? h('dd', {}, netdevError(nd)) : null,
        h('dt', {}, t('Address')), h('dd', {class: 'mono'}, address || '–'),
        h('dt', {}, t('Listen port')), h('dd', {}, nd.listenPort ? 'UDP ' + nd.listenPort : t('random')),
        h('dt', {}, t('Public key')), h('dd', {},