Justin Pomeroy 75fc881f7f Add angular Load Balancers V2 panel
This adds an angular version of the Load Balancers V2 panel,
including the Load Balancers table and config to get karma working.
The karma config assumes the horizon directory is a sibling of
neutron-lbaas-dashboard.

To use, copy the _1481_project_ng_loadbalancersv2_panel.py file from
neutron_lbaas_dashboard/enabled into openstack_dashboard/enabled.

Partially-Implements: blueprint horizon-lbaas-v2-ui
Change-Id: I99c4ec705433385c19256c887944706472642a25
2015-11-12 15:38:21 +00:00

59 lines
1.5 KiB
JavaScript

/*
* Copyright 2015 IBM Corp.
*
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
(function() {
'use strict';
angular
.module('horizon.dashboard.project.lbaasv2.loadbalancers')
.controller('loadBalancersTableController', LoadBalancersTableController);
LoadBalancersTableController.$inject = [
'horizon.dashboard.project.lbaasv2.loadbalancers.basePath',
'horizon.app.core.openstack-service-api.lbaasv2'
];
/**
* @ngdoc controller
* @name LoadBalancersTableController
*
* @description
* Controller for the LBaaS v2 load balancers table.
* Serves as the focal point for table actions.
*/
function LoadBalancersTableController(basepath, api) {
var ctrl = this;
ctrl.items = [];
ctrl.src = [];
ctrl.checked = {};
ctrl.path = basepath;
init();
////////////////////////////////
function init() {
api.getLoadBalancers().success(success);
}
function success(response) {
ctrl.src = response.items;
}
}
})();