mirror of
https://github.com/v2board/v2board.git
synced 2025-01-10 08:09:10 +08:00
update: add config
This commit is contained in:
parent
de045c79f5
commit
f409d89c4a
@ -21,6 +21,17 @@ class ConfigController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function getThemeTemplate()
|
||||
{
|
||||
$path = public_path('theme/');
|
||||
$files = array_map(function ($item) use ($path) {
|
||||
return str_replace($path, '', $item);
|
||||
}, glob($path . '*'));
|
||||
return response([
|
||||
'data' => $files
|
||||
]);
|
||||
}
|
||||
|
||||
public function setTelegramWebhook(Request $request)
|
||||
{
|
||||
$telegramService = new TelegramService($request->input('telegram_bot_token'));
|
||||
@ -109,6 +120,7 @@ class ConfigController extends Controller
|
||||
'epay_key' => config('v2board.epay_key'),
|
||||
],
|
||||
'frontend' => [
|
||||
'frontend_theme' => config('v2board.frontend_theme', 'v2board'),
|
||||
'frontend_theme_sidebar' => config('v2board.frontend_theme_sidebar', 'light'),
|
||||
'frontend_theme_header' => config('v2board.frontend_theme_header', 'dark'),
|
||||
'frontend_theme_color' => config('v2board.frontend_theme_color', 'default'),
|
||||
|
@ -85,6 +85,7 @@ class ConfigSave extends FormRequest
|
||||
'epay_pid' => '',
|
||||
'epay_key' => '',
|
||||
// frontend
|
||||
'frontend_theme' => '',
|
||||
'frontend_theme_sidebar' => 'in:dark,light',
|
||||
'frontend_theme_header' => 'in:dark,light',
|
||||
'frontend_theme_color' => 'in:default,darkblue,black',
|
||||
|
@ -15,6 +15,7 @@ class AdminRoute
|
||||
$router->get ('/config/fetch', 'Admin\\ConfigController@fetch');
|
||||
$router->post('/config/save', 'Admin\\ConfigController@save');
|
||||
$router->get ('/config/getEmailTemplate', 'Admin\\ConfigController@getEmailTemplate');
|
||||
$router->get ('/config/getThemeTemplate', 'Admin\\ConfigController@getThemeTemplate');
|
||||
$router->post('/config/setTelegramWebhook', 'Admin\\ConfigController@setTelegramWebhook');
|
||||
// Plan
|
||||
$router->get ('/plan/fetch', 'Admin\\PlanController@fetch');
|
||||
|
@ -23,6 +23,6 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->app['view']->addNamespace('theme', base_path() . '/public/theme');
|
||||
$this->app['view']->addNamespace('theme', public_path() . '/theme');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user