blob: fa22dfe6547744596315aa628366be9a48840669 [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('profilesList', function ($uibModal) {
13 return {
14 restrict: 'E',
15 scope: {},
16 controllerAs: 'vm',
17 templateUrl: 'app/view/profiles-list/profiles-list.tpl.html',
18 controller: function ($log, Profile) {
19 Profile.query().$promise
20 .then((profiles) => {
21 this.profiles = profiles;
22 });
23
24 this.tableConfig = {
25 order: true,
26 filter: 'field',
27 columns: [
28 {
29 label: '#',
30 prop: 'Name',
31 link: item => `#/profile/${item.Name}`
32 },
33 {
34 label: 'DlSchedType',
35 prop: 'DlSchedType'
36 },
37 {
38 label: 'DlAllocRBRate',
39 prop: 'DlAllocRBRate'
40 },
41 {
42 label: 'UlSchedType',
43 prop: 'UlSchedType'
44 },
45 {
46 label: 'UlAllocRBRate',
47 prop: 'UlAllocRBRate'
48 },
49 {
50 label: 'Start',
Matteo Scandolof25db3b2016-06-29 17:41:27 -070051 prop: 'jsStart',
52 type: 'date'
Matteo Scandoloeccf4972016-06-13 11:32:05 -070053 },
54 {
55 label: 'End',
Matteo Scandolof25db3b2016-06-29 17:41:27 -070056 prop: 'jsEnd',
57 type: 'date'
Matteo Scandoloeccf4972016-06-13 11:32:05 -070058 }
Matteo Scandolo76b29ae2016-07-14 13:47:51 -070059 ],
60 actions: [
61 {
62 label: 'delete',
63 icon: 'remove',
64 cb: (item) => {
65 item.$delete()
66 .then(() => {
67 _.remove(this.profiles, item);
68 })
69 .catch(e => {
70 console.log(e);
71 })
72 },
73 color: 'red'
74 }
Matteo Scandoloeccf4972016-06-13 11:32:05 -070075 ]
76 };
77 }
78 }
79 });
80})();
81