-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathIndex.js
More file actions
107 lines (98 loc) · 2.88 KB
/
Index.js
File metadata and controls
107 lines (98 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
(function () {
const l = abp.localization.getResource('GrantManager');
let createModal = new abp.ModalManager(abp.appPath + 'EndpointManagement/Endpoints/CreateModal');
let updateModal = new abp.ModalManager(abp.appPath + 'EndpointManagement/Endpoints/UpdateModal');
/**
* Intakes: List All
*/
$.fn.dataTable.Buttons.defaults.dom.button.className = 'btn flex-none';
let actionButtons = [
{
text: '<i class="fl fl-add-to align-middle"></i> <span>' + l('Common:Command:Create') + '</span>',
titleAttr: l('Common:Command:Create'),
id: 'CreateButton',
className: 'btn-light rounded-1',
action: (e, dt, node, config) => createBtn(e)
}
];
const listColumns = [
{
title: "Key Name",
name: "keyName",
data: "keyName",
index: 0
},
{
title: "Url",
name: "url",
data: "url",
index: 1
},
{
title: "Description",
name: "description",
data: "description",
index: 2
},
{
title: l('Actions'),
data: 'id',
orderable: false,
className: 'notexport text-center',
name: 'rowActions',
index: 3,
rowAction: {
items:
[
{
text: l('Common:Command:Edit'),
action: (data) => updateModal.open({ id: data.record.id })
}
]
}
}
];
const defaultVisibleColumns = [
'keyName',
'url',
'description',
'rowActions'
];
let responseCallback = function (result) {
return {
recordsTotal: result.totalCount,
recordsFiltered: result.items.length,
data: result.items
};
};
let dt = $('#EndpointsTable');
let dataTable = initializeDataTable({
dt,
defaultVisibleColumns,
listColumns,
maxRowsPerPage: 25,
defaultSortColumn: 0,
dataEndpoint: unity.grantManager.integrations.endpoints.endpointManagement.getList,
data: {},
responseCallback,
actionButtons,
pagingEnabled: true,
reorderEnabled: false,
languageSetValues: {},
dataTableName: 'EndpointsTable',
dynamicButtonContainerId: 'dynamicButtonContainerId',
useNullPlaceholder: true,
externalSearchId: 'search-endpoints',
fixedHeaders: true
});
createModal.onResult(function () {
dataTable.ajax.reload();
});
updateModal.onResult(function () {
dataTable.ajax.reload();
});
function createBtn(e) {
e.preventDefault();
createModal.open();
};
})();