Commit f19feec1 by Bence Dányi

firewall_gui: boilerplate code removed

parent 146497db
var listControllers = {
rules: 'rule-list',
hosts: 'host-list',
vlans: 'vlan-list',
vlangroups: 'vlangroup-list',
hostgroups: 'hostgroup-list',
};
var module = angular.module('firewall', []).config( var module = angular.module('firewall', []).config(
['$routeProvider', function($routeProvider) { ['$routeProvider', function($routeProvider) {
$routeProvider.when('/rules/', { for(var i in listControllers) {
templateUrl: '/static/partials/rule-list.html', $routeProvider.when('/'+i+'/', {
controller: ListController('/firewall/rules/') templateUrl: '/static/partials/'+listControllers[i]+'.html',
}).when('/hosts/', { controller: ListController('/firewall/'+i+'/')
templateUrl: '/static/partials/host-list.html', });
controller: ListController('/firewall/hosts/') }
}).when('/vlans/', { $routeProvider.otherwise({
templateUrl: '/static/partials/vlan-list.html',
controller: ListController('/firewall/vlans/')
}).when('/vlangroups/', {
templateUrl: '/static/partials/vlangroup-list.html',
controller: ListController('/firewall/vlangroups/')
}).when('/hostgroups/', {
templateUrl: '/static/partials/hostgroup-list.html',
controller: ListController('/firewall/hostgroups/')
}).
otherwise({
redirectTo: '/rules/' redirectTo: '/rules/'
}); });
}]); }]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment