admin.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Admin模块配置
  6. |--------------------------------------------------------------------------
  7. |
  8. | Admin模块的基础配置选项
  9. |
  10. */
  11. // 模块基础配置
  12. 'module' => [
  13. 'name' => 'Admin',
  14. 'version' => '1.0.0',
  15. 'description' => '后台基础功能扩展模块',
  16. 'author' => 'System',
  17. ],
  18. // 仪表板配置
  19. 'dashboard' => [
  20. 'enabled' => true,
  21. 'refresh_interval' => 30, // 秒
  22. 'widgets' => [
  23. 'system_status' => true,
  24. 'quick_actions' => true,
  25. 'statistics' => true,
  26. 'performance' => true,
  27. ],
  28. ],
  29. // 缓存配置
  30. 'cache' => [
  31. 'enabled' => true,
  32. 'default_ttl' => 3600, // 秒
  33. 'types' => [
  34. 'config' => [
  35. 'ttl' => 7200,
  36. 'tags' => ['admin', 'config'],
  37. ],
  38. 'system' => [
  39. 'ttl' => 1800,
  40. 'tags' => ['admin', 'system'],
  41. ],
  42. 'stats' => [
  43. 'ttl' => 300,
  44. 'tags' => ['admin', 'stats'],
  45. ],
  46. ],
  47. ],
  48. // 日志配置
  49. 'log' => [
  50. 'enabled' => true,
  51. 'retention_days' => 30,
  52. 'max_file_size' => '10M',
  53. 'channels' => [
  54. 'admin' => [
  55. 'driver' => 'daily',
  56. 'path' => storage_path('logs/admin.log'),
  57. 'level' => 'info',
  58. 'days' => 30,
  59. ],
  60. 'action' => [
  61. 'driver' => 'daily',
  62. 'path' => storage_path('logs/admin-action.log'),
  63. 'level' => 'info',
  64. 'days' => 90,
  65. ],
  66. ],
  67. ],
  68. // 系统监控配置
  69. 'monitoring' => [
  70. 'enabled' => true,
  71. 'metrics' => [
  72. 'system' => [
  73. 'cpu_usage' => true,
  74. 'memory_usage' => true,
  75. 'disk_usage' => true,
  76. 'load_average' => true,
  77. ],
  78. 'application' => [
  79. 'response_time' => true,
  80. 'error_rate' => true,
  81. 'request_count' => true,
  82. 'database_queries' => true,
  83. ],
  84. ],
  85. 'alerts' => [
  86. 'cpu_threshold' => 80, // 百分比
  87. 'memory_threshold' => 85, // 百分比
  88. 'disk_threshold' => 90, // 百分比
  89. 'response_time_threshold' => 2000, // 毫秒
  90. ],
  91. ],
  92. // 安全配置
  93. 'security' => [
  94. 'session_timeout' => 7200, // 秒
  95. 'max_login_attempts' => 5,
  96. 'lockout_duration' => 900, // 秒
  97. 'password_requirements' => [
  98. 'min_length' => 8,
  99. 'require_uppercase' => true,
  100. 'require_lowercase' => true,
  101. 'require_numbers' => true,
  102. 'require_symbols' => false,
  103. ],
  104. ],
  105. // UI配置
  106. 'ui' => [
  107. 'theme' => 'default',
  108. 'sidebar_collapsed' => false,
  109. 'show_breadcrumbs' => true,
  110. 'items_per_page' => 20,
  111. 'date_format' => 'Y-m-d H:i:s',
  112. 'timezone' => 'Asia/Shanghai',
  113. ],
  114. // 权限配置
  115. 'permissions' => [
  116. 'super_admin' => [
  117. 'admin.dashboard',
  118. 'admin.cache.manage',
  119. 'admin.log.view',
  120. 'admin.log.export',
  121. 'admin.system.info',
  122. 'admin.system.backup',
  123. ],
  124. 'admin' => [
  125. 'admin.dashboard',
  126. 'admin.cache.view',
  127. 'admin.log.view',
  128. 'admin.system.info',
  129. ],
  130. ],
  131. // 备份配置
  132. 'backup' => [
  133. 'enabled' => true,
  134. 'storage_disk' => 'local',
  135. 'storage_path' => 'backups',
  136. 'retention_days' => 7,
  137. 'include' => [
  138. 'database' => true,
  139. 'files' => false,
  140. 'config' => true,
  141. ],
  142. ],
  143. // 维护模式配置
  144. 'maintenance' => [
  145. 'enabled' => false,
  146. 'message' => '系统维护中,请稍后再试',
  147. 'allowed_ips' => [
  148. '127.0.0.1',
  149. '::1',
  150. ],
  151. 'retry_after' => 3600, // 秒
  152. ],
  153. // 通知配置
  154. 'notifications' => [
  155. 'enabled' => true,
  156. 'channels' => [
  157. 'database' => true,
  158. 'mail' => false,
  159. 'sms' => false,
  160. ],
  161. 'events' => [
  162. 'system_error' => true,
  163. 'high_cpu_usage' => true,
  164. 'disk_space_low' => true,
  165. 'failed_login' => true,
  166. ],
  167. ],
  168. ];