mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-06 23:04:21 +00:00
Add dashboard audit log and configuration management
- Implemented dashboard audit logging with InsertAuditLog, GetRecentAuditLogs, GetAuditLogsByIP, and CleanupOldAuditLogs methods. - Created dashboard configuration management with GetDashboardConfig and SetDashboardConfig methods. - Added new tables for dashboard_audit_log and dashboard_config in both MySQL and SQLite migrations. - Updated CMakeLists to include Crow and ASIO for dashboard server functionality. - Enhanced existing database classes to support new dashboard features, including character, play key, and property management. - Added new methods for retrieving and managing play keys, properties, and pet names. - Updated TestSQLDatabase to include stubs for new dashboard-related methods. - Modified shared and dashboard configuration files for new settings.
This commit is contained in:
@@ -1,8 +1,55 @@
|
||||
add_subdirectory(blueprints)
|
||||
|
||||
set(DDASHBOARDSERVER_SOURCES
|
||||
"DashboardWeb.cpp"
|
||||
# Explicitly include blueprint sources to ensure they are compiled into the library
|
||||
"blueprints/AuthBlueprint.cpp"
|
||||
"blueprints/ApiBlueprint.cpp"
|
||||
"blueprints/PageBlueprint.cpp"
|
||||
"blueprints/PlayKeysBlueprint.cpp"
|
||||
"blueprints/CharactersBlueprint.cpp"
|
||||
"blueprints/MailBlueprint.cpp"
|
||||
"blueprints/BugReportsBlueprint.cpp"
|
||||
"blueprints/ModerationBlueprint.cpp"
|
||||
)
|
||||
|
||||
add_executable(DashboardServer "DashboardServer.cpp" "DashboardWeb.cpp")
|
||||
target_link_libraries(DashboardServer ${COMMON_LIBRARIES} dServer dWeb)
|
||||
target_include_directories(DashboardServer PRIVATE ${PROJECT_SOURCE_DIR}/dServer ${PROJECT_SOURCE_DIR}/dWeb)
|
||||
# Create dDashboardServer library
|
||||
add_library(dDashboardServer ${DDASHBOARDSERVER_SOURCES})
|
||||
target_include_directories(dDashboardServer PRIVATE ${PROJECT_SOURCE_DIR}/dServer)
|
||||
find_package(CURL)
|
||||
if (CURL_FOUND)
|
||||
target_link_libraries(dDashboardServer ${COMMON_LIBRARIES} dServer Crow::Crow bcrypt CURL::libcurl)
|
||||
else()
|
||||
message(WARNING "libcurl not found; building dDashboardServer without CURL::libcurl. Some features may be disabled.")
|
||||
target_link_libraries(dDashboardServer ${COMMON_LIBRARIES} dServer Crow::Crow bcrypt)
|
||||
endif()
|
||||
|
||||
add_executable(DashboardServer "DashboardServer.cpp")
|
||||
if (CURL_FOUND)
|
||||
target_link_libraries(DashboardServer ${COMMON_LIBRARIES} dServer Crow::Crow bcrypt CURL::libcurl dDashboardServer)
|
||||
else()
|
||||
target_link_libraries(DashboardServer ${COMMON_LIBRARIES} dServer Crow::Crow bcrypt dDashboardServer)
|
||||
endif()
|
||||
target_include_directories(DashboardServer PRIVATE ${PROJECT_SOURCE_DIR}/dServer)
|
||||
add_compile_definitions(DashboardServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"")
|
||||
|
||||
# Define Windows version for ASIO/Crow compatibility (Windows 10)
|
||||
if(WIN32)
|
||||
target_compile_definitions(DashboardServer PRIVATE _WIN32_WINNT=0x0A00)
|
||||
target_compile_definitions(dDashboardServer PRIVATE _WIN32_WINNT=0x0A00)
|
||||
endif()
|
||||
|
||||
# Copy static files and templates to build directory
|
||||
add_custom_command(TARGET DashboardServer POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/static
|
||||
$<TARGET_FILE_DIR:DashboardServer>/static
|
||||
COMMENT "Copying static files to build directory"
|
||||
)
|
||||
|
||||
add_custom_command(TARGET DashboardServer POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/templates
|
||||
$<TARGET_FILE_DIR:DashboardServer>/templates
|
||||
COMMENT "Copying templates to build directory"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user