mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 22:04:56 +00:00
- Added type annotations and class definitions in the dashboard layout, stats, and data table modules for improved type safety and documentation. - Introduced new classes for UI components, props, and configuration in the form builder, navigation menu, notification center, and UI dialogs packages. - Implemented detailed type definitions for actions, fields, and pagination components to streamline usage and enhance clarity. - Updated initialization functions in multiple packages to include versioning and installation context. - Improved structure and readability of the codebase by organizing and documenting component properties and methods.
45 lines
1.2 KiB
Lua
45 lines
1.2 KiB
Lua
-- Admin settings dialog
|
|
|
|
---@class SettingsDialog
|
|
local M = {}
|
|
|
|
---@class UIComponent
|
|
---@field type string
|
|
---@field props? table
|
|
---@field children? table
|
|
|
|
---@return UIComponent
|
|
function M.render_general()
|
|
return {
|
|
type = "dialog",
|
|
props = {
|
|
title = "General Settings",
|
|
size = "large"
|
|
},
|
|
children = {
|
|
{ type = "text_field", props = { label = "Site Name", name = "site_name" } },
|
|
{ type = "text_field", props = { label = "Admin Email", name = "admin_email", type = "email" } },
|
|
{ type = "switch", props = { label = "Maintenance Mode", name = "maintenance" } },
|
|
{ type = "switch", props = { label = "Allow Registration", name = "allow_registration" } }
|
|
}
|
|
}
|
|
end
|
|
|
|
---@return UIComponent
|
|
function M.render_security()
|
|
return {
|
|
type = "dialog",
|
|
props = {
|
|
title = "Security Settings",
|
|
size = "medium"
|
|
},
|
|
children = {
|
|
{ type = "number_field", props = { label = "Session Timeout (min)", name = "session_timeout", min = 5 } },
|
|
{ type = "number_field", props = { label = "Max Login Attempts", name = "max_attempts", min = 1 } },
|
|
{ type = "switch", props = { label = "Require 2FA", name = "require_2fa" } }
|
|
}
|
|
}
|
|
end
|
|
|
|
return M
|