hoàn thành trang settings
This commit is contained in:
@@ -218,6 +218,24 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<!-- Nav Item - Tools Collapse Menu -->
|
||||
<li class="nav-item">
|
||||
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapseTools"
|
||||
aria-expanded="true" aria-controls="collapseTools">
|
||||
<i class="fas fa-fw fa-wrench"></i>
|
||||
<span>Tools</span>
|
||||
</a>
|
||||
<div id="collapseTools" class="collapse" aria-labelledby="headingTools"
|
||||
data-parent="#accordionSidebar">
|
||||
<div class="bg-white py-2 collapse-inner rounded">
|
||||
<h6 class="collapse-header">System Tools:</h6>
|
||||
<a class="collapse-item" th:href="@{/manage/tools/import-export}">Import / Export</a>
|
||||
<a class="collapse-item" th:href="@{/manage/tools/site-health}">Site Health</a>
|
||||
<a class="collapse-item" th:href="@{/manage/tools/personal-data}">Personal Data (GDPR)</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<!-- Divider -->
|
||||
<hr class="sidebar-divider d-none d-md-block">
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{fragments/manage-layout}">
|
||||
<head>
|
||||
<title>Import / Export Data</title>
|
||||
</head>
|
||||
<body>
|
||||
<div layout:fragment="content">
|
||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||
<h1 class="h3 mb-0 text-gray-800">Import / Export</h1>
|
||||
</div>
|
||||
|
||||
<!-- Success/Error Messages -->
|
||||
<div th:if="${successMessage}" class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<span th:text="${successMessage}"></span>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div th:if="${errorMessage}" class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||
<span th:text="${errorMessage}"></span>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Export Data Form -->
|
||||
<div class="col-lg-6">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Export Content</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>Export all your Posts, Pages, and Media metadata to an XML file. You can use this file to back up your data or migrate it to another server.</p>
|
||||
<form th:action="@{/manage/tools/import-export/export}" method="post">
|
||||
<button type="submit" class="btn btn-primary"><i class="fas fa-file-export mr-2"></i> Export to XML</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Import Data Form -->
|
||||
<div class="col-lg-6">
|
||||
<div class="card shadow mb-4 border-left-success">
|
||||
<div class="card-header py-3 bg-success text-white">
|
||||
<h6 class="m-0 font-weight-bold">Import Content</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>Import Posts and Pages from a previously generated XML file. If a Post or Page with the same slug already exists, it will be skipped.</p>
|
||||
<form th:action="@{/manage/tools/import-export/import}" method="post" enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<label for="importFile">Choose XML File</label>
|
||||
<input type="file" class="form-control-file" id="importFile" name="file" accept=".xml" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-success"><i class="fas fa-file-import mr-2"></i> Import from XML</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,76 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{fragments/manage-layout}">
|
||||
<head>
|
||||
<title>Export / Erase Personal Data</title>
|
||||
</head>
|
||||
<body>
|
||||
<div layout:fragment="content">
|
||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||
<h1 class="h3 mb-0 text-gray-800">Personal Data (GDPR)</h1>
|
||||
</div>
|
||||
|
||||
<!-- Success/Error Messages -->
|
||||
<div th:if="${successMessage}" class="alert alert-success alert-dismissible fade show" role="alert">
|
||||
<span th:text="${successMessage}"></span>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div th:if="${errorMessage}" class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||
<span th:text="${errorMessage}"></span>
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- Export Data Form -->
|
||||
<div class="col-lg-6">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<h6 class="m-0 font-weight-bold text-primary">Export Personal Data</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p>Enter the user's email address to export their personal data into a secure `.zip` file containing JSON data of their profile, posts, and pages.</p>
|
||||
<form th:action="@{/manage/tools/personal-data/export-form}" method="post">
|
||||
<div class="form-group">
|
||||
<label for="exportEmail">User Email Address</label>
|
||||
<input type="email" class="form-control" id="exportEmail" name="email" required placeholder="user@example.com">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary"><i class="fas fa-download mr-2"></i> Download Export</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Erase Data Form -->
|
||||
<div class="col-lg-6">
|
||||
<div class="card shadow mb-4 border-left-danger">
|
||||
<div class="card-header py-3 bg-danger text-white">
|
||||
<h6 class="m-0 font-weight-bold">Erase Personal Data</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<p class="text-danger font-weight-bold">Warning: This action is permanent and cannot be undone.</p>
|
||||
<p>Entering an email address below will:</p>
|
||||
<ul>
|
||||
<li>Anonymize all posts and pages authored by this user (assign to `anonymous`).</li>
|
||||
<li>Permanently delete their user account and profile data.</li>
|
||||
</ul>
|
||||
<form th:action="@{/manage/tools/personal-data/erase}" method="post">
|
||||
<div class="form-group">
|
||||
<label for="eraseEmail">User Email Address</label>
|
||||
<input type="email" class="form-control" id="eraseEmail" name="email" required placeholder="user@example.com">
|
||||
</div>
|
||||
<div class="form-group form-check">
|
||||
<input type="checkbox" class="form-check-input" id="confirmErase" name="confirm" required>
|
||||
<label class="form-check-label text-danger" for="confirmErase">I confirm I want to permanently erase this user's data.</label>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-danger"><i class="fas fa-trash-alt mr-2"></i> Erase Personal Data</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,93 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{fragments/manage-layout}">
|
||||
<head>
|
||||
<title>Site Health</title>
|
||||
</head>
|
||||
<body>
|
||||
<div layout:fragment="content">
|
||||
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
||||
<h1 class="h3 mb-0 text-gray-800">Site Health</h1>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<!-- System Information -->
|
||||
<div class="col-lg-6">
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<h6 class="m-0 font-weight-bold text-primary"><i class="fas fa-server mr-2"></i>System Information</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
Java Version
|
||||
<span class="font-weight-bold" th:text="${javaVersion}">17.0.1</span>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
Java Vendor
|
||||
<span class="font-weight-bold" th:text="${javaVendor}">Oracle</span>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
Operating System
|
||||
<span class="font-weight-bold" th:text="${osName} + ' (' + ${osVersion} + ')'">Linux</span>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
Architecture
|
||||
<span class="font-weight-bold" th:text="${osArch}">amd64</span>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
Timezone
|
||||
<span class="font-weight-bold" th:text="${timezone}">UTC</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Database Health -->
|
||||
<div class="col-lg-6">
|
||||
<div class="card shadow mb-4" th:classappend="${isDbHealthy} ? 'border-left-success' : 'border-left-danger'">
|
||||
<div class="card-header py-3" th:classappend="${isDbHealthy} ? 'bg-success text-white' : 'bg-danger text-white'">
|
||||
<h6 class="m-0 font-weight-bold"><i class="fas fa-database mr-2"></i>Database Health</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
Status
|
||||
<span class="badge badge-pill" th:classappend="${isDbHealthy} ? 'badge-success' : 'badge-danger'" th:text="${dbStatus}">Connected</span>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
Product Version
|
||||
<span class="font-weight-bold text-right" th:text="${dbProduct}">MySQL 8.0</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Memory Usage -->
|
||||
<div class="card shadow mb-4">
|
||||
<div class="card-header py-3">
|
||||
<h6 class="m-0 font-weight-bold text-primary"><i class="fas fa-memory mr-2"></i>Memory Usage (JVM)</h6>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<h4 class="small font-weight-bold">Used Memory: <span th:text="${usedMemory} + ' MB / ' + ${totalMemory} + ' MB'"></span> <span class="float-right" th:text="${#numbers.formatDecimal((usedMemory * 100.0) / totalMemory, 1, 1)} + '%'">50%</span></h4>
|
||||
<div class="progress mb-4">
|
||||
<div class="progress-bar" th:classappend="${(usedMemory * 100.0) / totalMemory > 80} ? 'bg-danger' : 'bg-info'" role="progressbar" th:style="'width: ' + ${(usedMemory * 100.0) / totalMemory} + '%'"></div>
|
||||
</div>
|
||||
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
Free Memory
|
||||
<span class="font-weight-bold" th:text="${freeMemory} + ' MB'">100 MB</span>
|
||||
</li>
|
||||
<li class="list-group-item d-flex justify-content-between align-items-center">
|
||||
Max Memory Available
|
||||
<span class="font-weight-bold" th:text="${maxMemory} + ' MB'">500 MB</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user