mirror of https://github.com/abpframework/abp.git
14 changed files with 228 additions and 6 deletions
@ -0,0 +1,42 @@ |
|||||
|
@page |
||||
|
@model Volo.Abp.Identity.Web.Pages.Identity.Roles.IndexModel |
||||
|
@using Microsoft.AspNetCore.Mvc.Localization |
||||
|
@using Volo.Abp.Identity.Web.Localization.Resources.AbpIdentity |
||||
|
@inject IHtmlLocalizer<IdentityResource> L |
||||
|
@section styles { |
||||
|
<link rel="stylesheet" type="text/css" href="~/modules/identity/views/roles/index.css" /> |
||||
|
} |
||||
|
|
||||
|
@section scripts { |
||||
|
<script type="text/javascript" src="~/modules/identity/helpers/jquery.js"></script> |
||||
|
<script type="text/javascript" src="~/modules/identity/helpers/datatables.extensions.js"></script> |
||||
|
<script type="text/javascript" src="~/modules/identity/helpers/ResourceLoader.js"></script> |
||||
|
<script type="text/javascript" src="~/modules/identity/helpers/ModalManager.js"></script> |
||||
|
<script type="text/javascript" src="~/modules/identity/views/roles/index.js"></script> |
||||
|
} |
||||
|
|
||||
|
<abp-card id="IdentityRolesWrapper"> |
||||
|
<abp-card-header> |
||||
|
<div class="row"> |
||||
|
<div class="col-md-6"> |
||||
|
<h2>@L["Roles"]</h2> |
||||
|
</div> |
||||
|
<div class="col-md-6 text-right"> |
||||
|
<button type="button" class="btn btn-primary" v-on:click="openCreateModal"> |
||||
|
<i class="fa fa-plus" aria-hidden="true"></i> |
||||
|
@L["NewRole"] |
||||
|
</button> |
||||
|
</div> |
||||
|
</div> |
||||
|
</abp-card-header> |
||||
|
<abp-card-body> |
||||
|
<table class="table table-striped nowrap"> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th>@L["Actions"]</th> |
||||
|
<th>@L["RoleName"]</th> |
||||
|
</tr> |
||||
|
</thead> |
||||
|
</table> |
||||
|
</abp-card-body> |
||||
|
</abp-card> |
||||
@ -0,0 +1,11 @@ |
|||||
|
using Volo.Abp.AspNetCore.Mvc.RazorPages; |
||||
|
|
||||
|
namespace Volo.Abp.Identity.Web.Pages.Identity.Roles |
||||
|
{ |
||||
|
public class IndexModel : AbpPageModel |
||||
|
{ |
||||
|
public void OnGet() |
||||
|
{ |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
.dataTable { |
||||
|
width: 100% !important; |
||||
|
border-spacing: 0 !important; |
||||
|
} |
||||
|
.table td, |
||||
|
.table th { |
||||
|
padding: 8px 10px; |
||||
|
} |
||||
|
.dataTable tbody tr td button { |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
.dataTable tbody tr td div.dropdown ul.dropdown-menu li { |
||||
|
cursor: pointer; |
||||
|
padding: 5px; |
||||
|
} |
||||
|
.dataTable tbody tr td div.dropdown ul.dropdown-menu li a { |
||||
|
display: block; |
||||
|
} |
||||
|
.dataTable tbody tr td div.dropdown ul.dropdown-menu li:hover { |
||||
|
background: #f4f5f8; |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
'use strict'; |
||||
|
|
||||
|
$(function () { |
||||
|
$('#IdentityUsersTable').DataTable(); |
||||
|
}); |
||||
|
|
||||
@ -0,0 +1 @@ |
|||||
|
"use strict";$(function(){$("#IdentityUsersTable").DataTable()}); |
||||
@ -0,0 +1,79 @@ |
|||||
|
(function () { |
||||
|
|
||||
|
var l = abp.localization.getResource('AbpIdentity'); |
||||
|
var _identityRoleAppService = volo.abp.identity.identityRole; |
||||
|
|
||||
|
var _editModal = new abp.ModalManager({ |
||||
|
viewUrl: abp.appPath + 'Identity/Roles/EditModal' |
||||
|
}); |
||||
|
|
||||
|
var _createModal = new abp.ModalManager({ |
||||
|
viewUrl: abp.appPath + 'Identity/Roles/CreateModal' |
||||
|
}); |
||||
|
|
||||
|
|
||||
|
$(function () { |
||||
|
|
||||
|
var _$wrapper = $('#IdentityRolesWrapper'); |
||||
|
var _$table = _$wrapper.find('table'); |
||||
|
|
||||
|
var _dataTable = _$table.DataTable({ |
||||
|
order: [[1, "asc"]], |
||||
|
ajax: abp.libs.datatables.createAjax(_identityRoleAppService.getList), |
||||
|
columnDefs: [ |
||||
|
{ |
||||
|
targets: 0, |
||||
|
data: null, |
||||
|
orderable: false, |
||||
|
autoWidth: false, |
||||
|
defaultContent: '', |
||||
|
rowAction: { |
||||
|
text: '<i class="fa fa-cog"></i> ' + l('Actions') + ' <span class="caret"></span>', |
||||
|
items: |
||||
|
[ |
||||
|
{ |
||||
|
text: l('Edit'), |
||||
|
visible: function () { |
||||
|
return true; |
||||
|
}, |
||||
|
action: function (data) { |
||||
|
_editModal.open({ |
||||
|
id: data.record.id |
||||
|
}); |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
text: l('Delete'), |
||||
|
visible: function () { |
||||
|
return true; |
||||
|
}, |
||||
|
action: function (data) { |
||||
|
if (confirm(l('UserDeletionConfirmationMessage', data.record.userName))) { |
||||
|
_identityRoleAppService |
||||
|
.delete(data.record.id) |
||||
|
.then(function () { |
||||
|
_dataTable.ajax.reload(); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
targets: 1, |
||||
|
data: "name" |
||||
|
} |
||||
|
] |
||||
|
}); |
||||
|
|
||||
|
_createModal.onResult(function () { |
||||
|
_dataTable.ajax.reload(); |
||||
|
}); |
||||
|
|
||||
|
_editModal.onResult(function () { |
||||
|
_dataTable.ajax.reload(); |
||||
|
}); |
||||
|
}); |
||||
|
|
||||
|
})(); |
||||
@ -0,0 +1,38 @@ |
|||||
|
.dataTable { |
||||
|
width: 100% !important; |
||||
|
border-spacing: 0 !important; |
||||
|
} |
||||
|
|
||||
|
.table td, .table th { |
||||
|
padding: 8px 10px; |
||||
|
} |
||||
|
|
||||
|
.dataTable { |
||||
|
tbody { |
||||
|
tr { |
||||
|
td { |
||||
|
|
||||
|
button { |
||||
|
cursor: pointer; |
||||
|
} |
||||
|
|
||||
|
div.dropdown { |
||||
|
ul.dropdown-menu { |
||||
|
li { |
||||
|
cursor: pointer; |
||||
|
padding: 5px; |
||||
|
|
||||
|
a { |
||||
|
display: block; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
li:hover { |
||||
|
background: #f4f5f8; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1 @@ |
|||||
|
.dataTable{width:100% !important;border-spacing:0 !important;}.table td,.table th{padding:8px 10px;}.dataTable tbody tr td button{cursor:pointer;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li{cursor:pointer;padding:5px;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li a{display:block;}.dataTable tbody tr td div.dropdown ul.dropdown-menu li:hover{background:#f4f5f8;} |
||||
Loading…
Reference in new issue