From 84b20b209e627c72ece29139682c5e2c091308f6 Mon Sep 17 00:00:00 2001 From: baldo Date: Mon, 17 Dec 2018 20:06:39 +0100 Subject: [PATCH] Splitting site field: Now we track site and domain. --- README.md | 3 ++- admin/js/main.js | 15 +++++++++++++++ config.json.example | 3 ++- server/config.js | 3 ++- server/db/patches/007_add_domain.sql | 1 + server/resources/nodeResource.js | 3 +++ server/services/monitoringService.js | 19 ++++++++++++++++--- shared/validation/constraints.js | 5 +++++ 8 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 server/db/patches/007_add_domain.sql diff --git a/README.md b/README.md index e62481b..a2cbe9a 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,8 @@ Dann die `config.json` anpassen nach belieben. Es gibt die folgenden Konfigurati * **`client.community.name`** Name der Freifunk-Community, z. B.: `"Freifunk Musterstadt"` * **`client.community.domain`** Domain der Freifunk-Community, z. B.: `"musterstadt.freifunk.net"` * **`client.community.contactEmail`** Kontakt-E-Mail-Adresse der Freifunk-Community, z. B.: `"kontakt@musterstadt.freifunk.net"` -* **`client.community.sites`** Liste der gültige Site-Codes in der `nodes.json`, z. B.: `["ffms-domain1", "ffms-domain2"]` +* **`client.community.sites`** Liste der gültige Site-Codes in der `nodes.json`, z. B.: `["ffms-site1", "ffms-site2"]` +* **`client.community.domains`** Liste der gültige Domänen-Codes in der `nodes.json`, z. B.: `["ffms-domain1", "ffms-domain2"]` * **`client.legal.privacyUrl`** optional: URL zum Impressum, z. B.: `"http://map.musterstadt.freifunk.net/impressum"` * **`client.legal.imprintUrl`** optional: URL zur Datenschutzerklärung, z. B.: `"http://map.musterstadt.freifunk.net/datenschutz"` diff --git a/admin/js/main.js b/admin/js/main.js index 7f5c22e..5d408fc 100644 --- a/admin/js/main.js +++ b/admin/js/main.js @@ -55,6 +55,15 @@ angular.module('ffffngAdmin').config(function(NgAdminConfigurationProvider, Rest }); } + var domainChoices = []; + for (var i = 0; i < config.community.domains.length; i++) { + var domain = config.community.domains[i]; + domainChoices.push({ + label: domain, + value: domain + }); + } + var header = '