mirror of https://github.com/abpframework/abp.git
3 changed files with 120 additions and 103 deletions
@ -0,0 +1,4 @@ |
|||||
|
{ |
||||
|
"singleQuote": true, |
||||
|
"useTabs": true |
||||
|
} |
||||
@ -1,20 +1,18 @@ |
|||||
(function ($) { |
(function ($) { |
||||
|
abp.modals.TenantConnectionStringManagement = function () { |
||||
|
var initModal = function (publicApi, args) { |
||||
|
publicApi |
||||
|
.getModal() |
||||
|
.find('input[name="Tenant.UseSharedDatabase"]') |
||||
|
.change(function () { |
||||
|
var $this = $(this); |
||||
|
$('#Tenant_DefaultConnectionString_Wrap').toggleClass('d-none'); |
||||
|
$this.val($this.prop('checked')); |
||||
|
}); |
||||
|
}; |
||||
|
|
||||
abp.modals.TenantConnectionStringManagement = function() { |
return { |
||||
|
initModal: initModal, |
||||
var initModal = function (publicApi, args) { |
}; |
||||
publicApi.getModal() |
}; |
||||
.find('input[name="Tenant.UseSharedDatabase"]') |
})(jQuery); |
||||
.change(function () { |
|
||||
var $this = $(this); |
|
||||
$("#Tenant_DefaultConnectionString_Wrap").toggleClass("d-none"); |
|
||||
$this.val($this.prop("checked")); |
|
||||
}); |
|
||||
}; |
|
||||
|
|
||||
return { |
|
||||
initModal: initModal |
|
||||
}; |
|
||||
}; |
|
||||
|
|
||||
})(jQuery); |
|
||||
|
|||||
@ -1,93 +1,108 @@ |
|||||
(function () { |
(function () { |
||||
|
var l = abp.localization.getResource('AbpTenantManagement'); |
||||
|
var _tenantAppService = volo.abp.tenantManagement.tenant; |
||||
|
|
||||
var l = abp.localization.getResource('AbpTenantManagement'); |
var _editModal = new abp.ModalManager( |
||||
var _tenantAppService = volo.abp.tenantManagement.tenant; |
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'); |
$(function () { |
||||
var _createModal = new abp.ModalManager(abp.appPath + 'TenantManagement/Tenants/CreateModal'); |
var _$wrapper = $('#TenantsWrapper'); |
||||
var _featuresModal = new abp.ModalManager(abp.appPath + 'FeatureManagement/FeatureManagementModal'); |
|
||||
var _connectionStringsModal = new abp.ModalManager({ |
|
||||
viewUrl: abp.appPath + 'TenantManagement/Tenants/ConnectionStringsModal', |
|
||||
modalClass: 'TenantConnectionStringManagement' |
|
||||
}); |
|
||||
|
|
||||
$(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({ |
_editModal.onResult(function () { |
||||
order: [[1, "asc"]], |
_dataTable.ajax.reload(); |
||||
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(); |
|
||||
}); |
|
||||
}); |
|
||||
|
|
||||
|
_$wrapper.find('button[name=CreateTenant]').click(function (e) { |
||||
|
e.preventDefault(); |
||||
|
_createModal.open(); |
||||
|
}); |
||||
|
}); |
||||
})(); |
})(); |
||||
|
|||||
Loading…
Reference in new issue