mirror of
https://github.com/lkddi/Xboard.git
synced 2026-04-24 03:57:27 +08:00
feat: optimize settings management and admin functionality
- Add system log cleanup functionality with batch processing - Optimize v2_settings table performance by unifying value storage - Add comprehensive client support list for one-click subscription - Fix QR code subscription links for specific node types - Fix route addition issues in admin management panel - Enhance admin system controller with log management APIs
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
use App\Support\Setting;
|
||||
use Illuminate\Support\Facades\App;
|
||||
|
||||
if (! function_exists('admin_setting')) {
|
||||
/**
|
||||
@@ -11,15 +12,31 @@ if (! function_exists('admin_setting')) {
|
||||
*/
|
||||
function admin_setting($key = null, $default = null)
|
||||
{
|
||||
$setting = Setting::getInstance();
|
||||
|
||||
if ($key === null) {
|
||||
return App::make(Setting::class)->toArray();
|
||||
return $setting->toArray();
|
||||
}
|
||||
|
||||
if (is_array($key)) {
|
||||
App::make(Setting::class)->save($key);
|
||||
$setting->save($key);
|
||||
return '';
|
||||
}
|
||||
|
||||
$default = config('v2board.'. $key) ?? $default;
|
||||
return App::make(Setting::class)->get($key) ?? $default ;
|
||||
return $setting->get($key) ?? $default;
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('admin_settings_batch')) {
|
||||
/**
|
||||
* 批量获取配置参数,性能优化版本
|
||||
*
|
||||
* @param array $keys 配置键名数组
|
||||
* @return array 返回键值对数组
|
||||
*/
|
||||
function admin_settings_batch(array $keys): array
|
||||
{
|
||||
return Setting::getInstance()->getBatch($keys);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user