style: add menu Data RT role Admin

main-dlh
Yuri Dimas 2025-11-09 22:58:51 +07:00
parent a0b48a2ae2
commit 4e831ede3f
3 changed files with 143 additions and 1 deletions

View File

@ -0,0 +1,78 @@
using Microsoft.AspNetCore.Mvc;
namespace BpsRwApp.Areas.Admin.Controllers
{
[Area("Admin")]
public class DataRtController : Controller
{
public IActionResult Index()
{
return View();
}
[HttpGet]
public IActionResult Table()
{
var data = new[]
{
new {
rt = "001",
rw = "001",
kecamatan = "Kebayoran",
},
new {
rt = "002",
rw = "001",
kecamatan = "Tebet",
},
new {
rt = "003",
rw = "001",
kecamatan = "Menteng",
},
new {
rt = "004",
rw = "001",
kecamatan = "Cilandak",
},
new {
rt = "005",
rw = "001",
kecamatan = "Setiabudi",
},
new {
rt = "006",
rw = "001",
kecamatan = "Gambir",
},
new {
rt = "007",
rw = "001",
kecamatan = "Cakung",
},
new {
rt = "008",
rw = "001",
kecamatan = "Kelapa Gading",
},
new {
rt = "009",
rw = "001",
kecamatan = "Pancoran",
},
new {
rt = "010",
rw = "001",
kecamatan = "Tanah Abang",
},
};
var response = new
{
data = data
};
return Json(response);
}
}
}

View File

@ -0,0 +1,64 @@
@{
ViewData["Title"] = "Data RT";
}
<div class="breadcrumbs text-sm">
<ul>
<li class="text-gray-500"><a>Data RT</a></li>
</ul>
</div>
<!-- Header -->
<div class="grid grid-cols-1 gap-4 lg:grid-cols-2">
<div class="prose">
<h3 class="mb-2">Data RT</h3>
</div>
<div class="justify-self-end lg:self-center">
<a class="btn rounded-full bg-white" href="#">
<span class="icon icon-fill me-2">filter_list</span>
Filter
</a>
</div>
</div>
<div class="h-8"></div>
<div class="card bg-white shadow-sm">
<div class="card-body p-0">
<table class="table-zebra table" id="example">
<thead>
<tr>
<th class="w-[5%]">No</th>
<th class="w-[5%]">RT</th>
<th class="w-[5%]">RW</th>
<th class="w-[85%]">Kecamatan</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script src="https://cdn.datatables.net/2.3.4/js/dataTables.js"></script>
<script src="/plugins/datatables/dataTables.tailwindcss.js"></script>
<script type="text/javascript">
var table;
$(document).ready(function () {
table = new DataTable('#example', {
ajax: '/Admin/DataRt/Table',
scrollX: true,
autoWidth: false,
initComplete: function () {
$('div.dt-scroll-body thead').css('visibility', 'collapse');
},
columns: [
{ data: null, render: (d, t, r, m) => m.row + 1, orderable: false, searchable: false },
{ data: 'rt' },
{ data: 'rw' },
{ data: 'kecamatan' },
]
});
});
</script>

View File

@ -71,7 +71,7 @@
</a> </a>
</li> </li>
<li> <li>
<a> <a asp-area="Admin" asp-controller="DataRt" asp-action="Index" class="@(controller == "DataRt" ? "menu-active" : "")">
<span class="icon icon-fill">list</span> <span class="icon icon-fill">list</span>
Data RT Data RT
</a> </a>