초기 커밋
This commit is contained in:
31
app/admin/views/system_admin.py
Normal file
31
app/admin/views/system_admin.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from sqladmin import ModelView
|
||||
|
||||
from app.models.mariadb.system import AuditLog, SystemConfig
|
||||
|
||||
|
||||
class SystemConfigAdmin(ModelView, model=SystemConfig):
|
||||
column_list = [SystemConfig.id, SystemConfig.key, SystemConfig.value, SystemConfig.is_secret]
|
||||
column_searchable_list = [SystemConfig.key]
|
||||
can_create = True
|
||||
can_edit = True
|
||||
can_delete = True
|
||||
name = "System Config"
|
||||
name_plural = "System Configs"
|
||||
icon = "fa-solid fa-gear"
|
||||
|
||||
|
||||
class AuditLogAdmin(ModelView, model=AuditLog):
|
||||
column_list = [
|
||||
AuditLog.id, AuditLog.user_id, AuditLog.action,
|
||||
AuditLog.resource_type, AuditLog.resource_id, AuditLog.created_at,
|
||||
]
|
||||
column_sortable_list = [AuditLog.id, AuditLog.created_at]
|
||||
column_default_sort = ("id", True)
|
||||
can_create = False
|
||||
can_edit = False
|
||||
can_delete = False
|
||||
name = "Audit Log"
|
||||
name_plural = "Audit Logs"
|
||||
icon = "fa-solid fa-clipboard-list"
|
||||
Reference in New Issue
Block a user