blob: ff8ec7172aabcf6157b97b5275b266b95e0f70a8 [file] [log] [blame]
Matteo Scandoloeccf4972016-06-13 11:32:05 -07001/**
2 * © OpenCORD
3 *
4 * Visit http://guide.xosproject.org/devguide/addview/ for more information
5 *
6 * Created by teone on 6/13/16.
7 */
8
9(function () {
10 'use strict';
11 angular.module('mCord')
12 .directive('imsiList', function ($uibModal) {
13 return {
14 restrict: 'E',
15 scope: {},
16 controllerAs: 'vm',
17 templateUrl: 'app/view/imsi-list/imsi-list.tpl.html',
18 controller: function ($log, Imsi) {
19
20 Imsi.query().$promise
21 .then((imsi) => {
22 console.log(imsi);
23 this.imsi = imsi;
24 });
25
26 this.tableConfig = {
27 order: true,
28 filter: 'field',
29 columns: [
30 {
31 label: '#',
32 prop: 'IMSI',
33 link: item => `#/imsi/${item.IMSI}`
34 },
35 {
36 label: 'Enodeb',
37 prop: 'Enodeb'
38 },
39 {
40 label: 'DlMeasBitRate',
41 prop: 'DlMeasBitRate'
42 },
43 {
44 label: 'UlMeasBitRate',
45 prop: 'UlMeasBitRate'
46 },
47 {
48 label: 'Status',
49 prop: 'UeStatus',
50 type: 'boolean'
51 }
Matteo Scandolo76b29ae2016-07-14 13:47:51 -070052 ],
53 actions: [
54 {
55 label: 'delete',
56 icon: 'remove',
57 cb: (item) => {
58 item.$delete()
59 .then(() => {
60 _.remove(this.imsi, item);
61 })
62 .catch(e => {
63 console.log(e);
64 })
65 },
66 color: 'red'
67 }
Matteo Scandoloeccf4972016-06-13 11:32:05 -070068 ]
69 };
Matteo Scandoloed9e3ec2016-06-13 15:20:11 -070070
71 this.addImsi = () => {
72 this.modalInstance = $uibModal.open({
73 animation: true,
74 templateUrl: 'addEnode',
75 controllerAs: 'vm',
76 controller: function($uibModalInstance){
77 this.modal = $uibModalInstance;
78 }
79 });
80 }
Matteo Scandoloeccf4972016-06-13 11:32:05 -070081 }
82 }
83 });
84})();
85