Allow to filter and sort by site.

This commit is contained in:
baldo 2017-08-13 18:18:40 +02:00
parent 3b78215b5d
commit 683937539b
5 changed files with 20 additions and 3 deletions

View file

@ -158,6 +158,7 @@ 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.name`** Name der Freifunk-Community, z. B.: `"Freifunk Musterstadt"`
* **`client.community.domain`** Domain der Freifunk-Community, z. B.: `"musterstadt.freifunk.net"` * **`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.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.map.mapUrl`** URL der Knotenkarte, z. B.: `"http://map.musterstadt.freifunk.net"` * **`client.map.mapUrl`** URL der Knotenkarte, z. B.: `"http://map.musterstadt.freifunk.net"`

View file

@ -46,6 +46,15 @@ angular.module('ffffngAdmin').config(function(NgAdminConfigurationProvider, Rest
var pathPrefix = config.rootPath === '/' ? '' : config.rootPath; var pathPrefix = config.rootPath === '/' ? '' : config.rootPath;
var siteChoices = [];
for (var i = 0; i < config.community.sites.length; i++) {
var site = config.community.sites[i];
siteChoices.push({
label: site,
value: site
});
}
admin admin
.header( .header(
'<div class="navbar-header">' + '<div class="navbar-header">' +
@ -90,7 +99,6 @@ angular.module('ffffngAdmin').config(function(NgAdminConfigurationProvider, Rest
} }
} }
var nodes = nga.entity('nodes').label('Nodes').identifier(nga.field('token')); var nodes = nga.entity('nodes').label('Nodes').identifier(nga.field('token'));
nodes nodes
.listView() .listView()
@ -140,6 +148,10 @@ angular.module('ffffngAdmin').config(function(NgAdminConfigurationProvider, Rest
'<div class="input-group">' + '<div class="input-group">' +
'<input type="text" ng-model="value" placeholder="Search" class="form-control"></input>' + '<input type="text" ng-model="value" placeholder="Search" class="form-control"></input>' +
'<span class="input-group-addon"><i class="fa fa-search"></i></span></div>'), '<span class="input-group-addon"><i class="fa fa-search"></i></span></div>'),
nga.field('site', 'choice')
.label('Site')
.pinned(false)
.choices(siteChoices),
nga.field('hasKey', 'choice') nga.field('hasKey', 'choice')
.label('VPN key') .label('VPN key')
.pinned(false) .pinned(false)

View file

@ -41,7 +41,8 @@
"community": { "community": {
"name": "Freifunk Musterstadt", "name": "Freifunk Musterstadt",
"domain": "musterstadt.freifunk.net", "domain": "musterstadt.freifunk.net",
"contactEmail": "kontakt@musterstadt.freifunk.net" "contactEmail": "kontakt@musterstadt.freifunk.net",
"sites": ["ffms-domain1", "ffms-domain2"]
}, },
"map": { "map": {
"mapUrl": "http://map.musterstadt.freifunk.net" "mapUrl": "http://map.musterstadt.freifunk.net"

View file

@ -96,7 +96,8 @@ var defaultConfig = {
community: { community: {
name: 'Freifunk Musterstadt', name: 'Freifunk Musterstadt',
domain: 'musterstadt.freifunk.net', domain: 'musterstadt.freifunk.net',
contactEmail: 'kontakt@musterstadt.freifunk.net' contactEmail: 'kontakt@musterstadt.freifunk.net',
sites: []
}, },
map: { map: {
mapUrl: 'http://map.musterstadt.freifunk.net' mapUrl: 'http://map.musterstadt.freifunk.net'

View file

@ -143,6 +143,7 @@ angular.module('ffffng').factory('NodeResource', function (
'email', 'email',
'token', 'token',
'mac', 'mac',
'site',
'key', 'key',
'onlineState' 'onlineState'
], ],
@ -159,6 +160,7 @@ angular.module('ffffng').factory('NodeResource', function (
'token', 'token',
'mac', 'mac',
'key', 'key',
'site',
'coords', 'coords',
'onlineState', 'onlineState',
'monitoringState' 'monitoringState'