(`${this.baseUrl}/audit-logs`, {
+ params,
+ withCredentials: true
+ });
+ }
}
diff --git a/frontend/admin/src/app/app.component.css b/frontend/admin/src/app/app.component.css
index fe4b188..bdad29a 100644
--- a/frontend/admin/src/app/app.component.css
+++ b/frontend/admin/src/app/app.component.css
@@ -23,25 +23,6 @@ button:disabled {
opacity: 0.5;
}
-.upload-button {
- display: inline-flex;
- align-items: center;
- justify-content: center;
- border-radius: 0.7em;
- background: #fff;
- color: #2f4a63;
- cursor: pointer;
- padding: 0.72em 1.15em;
-}
-
-.upload-button:hover {
- background: #f1f3f5;
-}
-
-.upload-button input {
- display: none;
-}
-
.link-button {
background: transparent;
color: #2f4a63;
@@ -312,6 +293,19 @@ textarea {
padding: 0 1em;
}
+.log-actions {
+ max-width: 100%;
+ flex-wrap: wrap;
+ justify-content: flex-end;
+}
+
+.log-actions input {
+ width: min(20em, 100%);
+ min-height: 2.55em;
+ border-radius: 0.65em;
+ font-size: 0.9em;
+}
+
.editor-head h1 {
display: flex;
align-items: center;
@@ -371,6 +365,39 @@ textarea {
background: #fafafa;
}
+.log-table {
+ overflow-x: auto;
+}
+
+.log-table-head,
+.log-table-row {
+ min-width: 58em;
+ display: grid;
+ grid-template-columns: 10em 7em 8em 14em minmax(14em, 1fr) 8em;
+ align-items: center;
+ gap: 1em;
+ border-bottom: 1px solid #eee;
+ padding: 0.9em 0.75em;
+}
+
+.log-table-head {
+ color: #777b82;
+ font-size: 0.78em;
+ line-height: 1.2;
+}
+
+.log-table-row {
+ color: #777b82;
+ font-size: 0.86em;
+}
+
+.log-details {
+ overflow: hidden;
+ color: #3d3d3f;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
.post-row-title {
overflow: hidden;
font-weight: 700;
@@ -461,8 +488,7 @@ textarea {
box-shadow: 0 0.08em 0.35em rgb(35 36 40 / 4%);
}
-.editor-actions button,
-.editor-actions .upload-button {
+.editor-actions button {
min-height: 2.45em;
border-radius: 0.62em;
padding: 0 0.9em;
@@ -470,14 +496,12 @@ textarea {
white-space: nowrap;
}
-.editor-actions .upload-button,
.editor-actions .save-button,
.editor-actions .build-button {
background: transparent;
color: #2f4a63;
}
-.editor-actions .upload-button:hover,
.editor-actions .save-button:hover,
.editor-actions .build-button:hover {
background: #243b53;
@@ -791,8 +815,7 @@ textarea {
align-items: stretch;
}
- .editor-actions button,
- .editor-actions .upload-button {
+ .editor-actions button {
width: 100%;
}
diff --git a/frontend/admin/src/app/app.component.html b/frontend/admin/src/app/app.component.html
index e8a4b12..2d66273 100644
--- a/frontend/admin/src/app/app.component.html
+++ b/frontend/admin/src/app/app.component.html
@@ -35,6 +35,10 @@
/
@if (view === 'list') {
文章
+ } @else if (view === 'logs') {
+
+ /
+ 日志
} @else {
/
@@ -45,6 +49,7 @@
@@ -135,6 +140,82 @@
+
+
+ } @else if (view === 'logs') {
+
+
+
+
+
+
+
+
+
+
+
+
+ @if (auditLogs.length === 0) {
+
暂无日志
+ } @else {
+
+ 时间
+ 用户
+ 动作
+ 资源
+ 详情
+ IP
+
+ @for (log of auditLogs; track log.id) {
+
+ {{ formatDate(log.createdAt) }}
+ {{ log.actorUsername || '匿名' }}
+ {{ actionText(log.action) }}
+ {{ log.resourceType || '-' }} {{ log.resourceId || '' }}
+ {{ detailsText(log) }}
+ {{ log.ipAddress || '-' }}
+
+ }
+ }
+
+
+
@@ -152,10 +233,6 @@
-
@@ -248,7 +325,6 @@
@if (editorMode !== 'preview') {