mirror of https://github.com/abpframework/abp
parent
751ee5b779
commit
b6f4aef7ef
@ -0,0 +1,4 @@
|
||||
{
|
||||
"singleQuote": true,
|
||||
"useTabs": true
|
||||
}
|
@ -1,93 +1,108 @@
|
||||
(function () {
|
||||
var l = abp.localization.getResource('AbpTenantManagement');
|
||||
var _tenantAppService = volo.abp.tenantManagement.tenant;
|
||||
|
||||
var l = abp.localization.getResource('AbpTenantManagement');
|
||||
var _tenantAppService = volo.abp.tenantManagement.tenant;
|
||||
var _editModal = new abp.ModalManager(
|
||||
abp.appPath + 'TenantManagement/Tenants/EditModal'
|
||||
);
|
||||
var _createModal = new abp.ModalManager(
|
||||
abp.appPath + 'TenantManagement/Tenants/CreateModal'
|
||||
);
|
||||
var _featuresModal = new abp.ModalManager(
|
||||
abp.appPath + 'FeatureManagement/FeatureManagementModal'
|
||||
);
|
||||
var _connectionStringsModal = new abp.ModalManager({
|
||||
viewUrl: abp.appPath + 'TenantManagement/Tenants/ConnectionStringsModal',
|
||||
modalClass: 'TenantConnectionStringManagement',
|
||||
});
|
||||
|
||||
var _editModal = new abp.ModalManager(abp.appPath + 'TenantManagement/Tenants/EditModal');
|
||||
var _createModal = new abp.ModalManager(abp.appPath + 'TenantManagement/Tenants/CreateModal');
|
||||
var _featuresModal = new abp.ModalManager(abp.appPath + 'FeatureManagement/FeatureManagementModal');
|
||||
var _connectionStringsModal = new abp.ModalManager({
|
||||
viewUrl: abp.appPath + 'TenantManagement/Tenants/ConnectionStringsModal',
|
||||
modalClass: 'TenantConnectionStringManagement'
|
||||
});
|
||||
$(function () {
|
||||
var _$wrapper = $('#TenantsWrapper');
|
||||
|
||||
$(function () {
|
||||
var _dataTable = _$wrapper.find('table').DataTable(
|
||||
abp.libs.datatables.normalizeConfiguration({
|
||||
order: [[1, 'asc']],
|
||||
processing: true,
|
||||
paging: true,
|
||||
scrollX: true,
|
||||
serverSide: true,
|
||||
ajax: abp.libs.datatables.createAjax(_tenantAppService.getList),
|
||||
columnDefs: [
|
||||
{
|
||||
rowAction: {
|
||||
items: [
|
||||
{
|
||||
text: l('Edit'),
|
||||
visible: abp.auth.isGranted(
|
||||
'AbpTenantManagement.Tenants.Update'
|
||||
),
|
||||
action: function (data) {
|
||||
_editModal.open({
|
||||
id: data.record.id,
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
text: l('ConnectionStrings'),
|
||||
visible: abp.auth.isGranted(
|
||||
'AbpTenantManagement.Tenants.ManageConnectionStrings'
|
||||
),
|
||||
action: function (data) {
|
||||
_connectionStringsModal.open({
|
||||
id: data.record.id,
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
text: l('Features'),
|
||||
visible: abp.auth.isGranted(
|
||||
'AbpTenantManagement.Tenants.ManageFeatures'
|
||||
),
|
||||
action: function (data) {
|
||||
_featuresModal.open({
|
||||
providerName: 'T',
|
||||
providerKey: data.record.id,
|
||||
});
|
||||
},
|
||||
},
|
||||
{
|
||||
text: l('Delete'),
|
||||
visible: abp.auth.isGranted(
|
||||
'AbpTenantManagement.Tenants.Delete'
|
||||
),
|
||||
confirmMessage: function (data) {
|
||||
return l(
|
||||
'TenantDeletionConfirmationMessage',
|
||||
data.record.name
|
||||
);
|
||||
},
|
||||
action: function (data) {
|
||||
_tenantAppService.delete(data.record.id).then(function () {
|
||||
_dataTable.ajax.reload();
|
||||
});
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
data: 'name',
|
||||
},
|
||||
],
|
||||
})
|
||||
);
|
||||
|
||||
var _$wrapper = $('#TenantsWrapper');
|
||||
_createModal.onResult(function () {
|
||||
_dataTable.ajax.reload();
|
||||
});
|
||||
|
||||
var _dataTable = _$wrapper.find('table').DataTable(abp.libs.datatables.normalizeConfiguration({
|
||||
order: [[1, "asc"]],
|
||||
processing: true,
|
||||
paging: true,
|
||||
scrollX: true,
|
||||
serverSide: true,
|
||||
ajax: abp.libs.datatables.createAjax(_tenantAppService.getList),
|
||||
columnDefs: [
|
||||
{
|
||||
rowAction: {
|
||||
items:
|
||||
[
|
||||
{
|
||||
text: l('Edit'),
|
||||
visible: abp.auth.isGranted('AbpTenantManagement.Tenants.Update'),
|
||||
action: function (data) {
|
||||
_editModal.open({
|
||||
id: data.record.id
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
text: l('ConnectionStrings'),
|
||||
visible: abp.auth.isGranted('AbpTenantManagement.Tenants.ManageConnectionStrings'),
|
||||
action: function (data) {
|
||||
_connectionStringsModal.open({
|
||||
id: data.record.id
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
text: l('Features'),
|
||||
visible: abp.auth.isGranted('AbpTenantManagement.Tenants.ManageFeatures'),
|
||||
action: function (data) {
|
||||
_featuresModal.open({
|
||||
providerName: 'T',
|
||||
providerKey: data.record.id
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
text: l('Delete'),
|
||||
visible: abp.auth.isGranted('AbpTenantManagement.Tenants.Delete'),
|
||||
confirmMessage: function (data) { return l('TenantDeletionConfirmationMessage', data.record.name)},
|
||||
action: function (data) {
|
||||
_tenantAppService
|
||||
.delete(data.record.id)
|
||||
.then(function () {
|
||||
_dataTable.ajax.reload();
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
data: "name"
|
||||
}
|
||||
]
|
||||
}));
|
||||
|
||||
_createModal.onResult(function () {
|
||||
_dataTable.ajax.reload();
|
||||
});
|
||||
|
||||
_editModal.onResult(function () {
|
||||
_dataTable.ajax.reload();
|
||||
});
|
||||
|
||||
_$wrapper.find('button[name=CreateTenant]').click(function (e) {
|
||||
e.preventDefault();
|
||||
_createModal.open();
|
||||
});
|
||||
});
|
||||
_editModal.onResult(function () {
|
||||
_dataTable.ajax.reload();
|
||||
});
|
||||
|
||||
_$wrapper.find('button[name=CreateTenant]').click(function (e) {
|
||||
e.preventDefault();
|
||||
_createModal.open();
|
||||
});
|
||||
});
|
||||
})();
|
||||
|
Loading…
Reference in new issue