blob: c29a904f85af4a1a74d5b77e4a0bb146d5be430c [file] [log] [blame]
Arpit Agarwal711b1ec2016-06-27 13:28:54 -07001/**
2 * Created by arpit on 7/7/2016.
3 */
4'use strict';
5
6angular.module('xos.tenant')
7.directive('siteDetail', function(){
8 return {
9 restrict: 'E',
10 scope: {},
11 bindToController: true,
12 controllerAs: 'sl',
13 templateUrl: 'templates/slicelist.html',
14 controller: function(SlicesPlus, $stateParams){
15 this.siteId = $stateParams.id;
16 this.tableConfig = {
17 columns: [
18 {
19 label: 'Slice List',
20 prop: 'name',
21 link: item => `#/site/${item.site}/slice/${item.id}`
22 },
23 {
24 label: 'Allocated',
25 prop: 'instance_total'
26 },
27 {
28 label: 'Ready',
29 prop: 'instance_total_ready'
30 }
31 ]
32 };
33
34 // retrieving user list
35 SlicesPlus.query({
36 site: $stateParams.id
37 }).$promise
38 .then((users) => {
39 this.sliceList = users;
40 })
41 .catch((e) => {
42 throw new Error(e);
43 });
44 }
45 };
46});