mirror of
https://github.com/flarum/framework.git
synced 2024-12-03 07:33:36 +08:00
wip
This commit is contained in:
parent
65a5ed4e86
commit
7cd67720d3
|
@ -1,12 +1,13 @@
|
||||||
import FieldSet from '../../common/components/FieldSet';
|
import FieldSet from '../../common/components/FieldSet';
|
||||||
import ItemList from '../../common/utils/ItemList';
|
import ItemList from '../../common/utils/ItemList';
|
||||||
import AdminPage from './AdminPage';
|
import AdminPage from './AdminPage';
|
||||||
|
import Alert from "../../common/components/Alert";
|
||||||
|
|
||||||
export default class AdvancedPage extends AdminPage {
|
export default class AdvancedPage extends AdminPage {
|
||||||
oninit(vnode) {
|
oninit(vnode) {
|
||||||
super.oninit(vnode);
|
super.oninit(vnode);
|
||||||
|
|
||||||
this.queueOptions = [];
|
this.queueDrivers = app.data.queueDrivers ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
headerInfo() {
|
headerInfo() {
|
||||||
|
@ -21,17 +22,26 @@ export default class AdvancedPage extends AdminPage {
|
||||||
content() {
|
content() {
|
||||||
return [
|
return [
|
||||||
<div className="Form">
|
<div className="Form">
|
||||||
{Object.keys(this.queueOptions).length > 1
|
{this.buildSettingComponent({
|
||||||
? [
|
type: 'text',
|
||||||
this.buildSettingComponent({
|
setting: 'mail_from',
|
||||||
type: 'select',
|
label: app.translator.trans('core.admin.advanced.queue_driver_heading'),
|
||||||
setting: 'default_locale',
|
className: 'AdvancedPage-QueueSettings',
|
||||||
options: this.localeOptions,
|
})}
|
||||||
label: app.translator.trans('core.admin.advanced.queue_driver_heading'),
|
{this.buildSettingComponent({
|
||||||
}),
|
type: 'select',
|
||||||
]
|
setting: 'queue_driver',
|
||||||
: ''}
|
options: Object.keys(this.driverFields).reduce((memo, val) => ({ ...memo, [val]: val }), {}),
|
||||||
|
label: app.translator.trans('core.admin.queue.driver_heading'),
|
||||||
|
className: 'AdvancedPage-QueueSettings',
|
||||||
|
})}
|
||||||
|
{this.status.sending ||
|
||||||
|
Alert.component(
|
||||||
|
{
|
||||||
|
dismissible: false,
|
||||||
|
},
|
||||||
|
app.translator.trans('core.admin.email.not_sending_message')
|
||||||
|
)}
|
||||||
{this.submitButton()}
|
{this.submitButton()}
|
||||||
</div>,
|
</div>,
|
||||||
];
|
];
|
||||||
|
|
|
@ -79,6 +79,7 @@ class AdminPayload
|
||||||
$document->payload['slugDrivers'] = array_map(function ($resourceDrivers) {
|
$document->payload['slugDrivers'] = array_map(function ($resourceDrivers) {
|
||||||
return array_keys($resourceDrivers);
|
return array_keys($resourceDrivers);
|
||||||
}, $this->container->make('flarum.http.slugDrivers'));
|
}, $this->container->make('flarum.http.slugDrivers'));
|
||||||
|
$document->payload['queueDrivers'] = array_keys($this->container->make('flarum.queue.supported_drivers'));
|
||||||
|
|
||||||
$document->payload['phpVersion'] = PHP_VERSION;
|
$document->payload['phpVersion'] = PHP_VERSION;
|
||||||
$document->payload['mysqlVersion'] = $this->db->selectOne('select version() as version')->version;
|
$document->payload['mysqlVersion'] = $this->db->selectOne('select version() as version')->version;
|
||||||
|
|
|
@ -46,7 +46,7 @@ class QueueServiceProvider extends AbstractServiceProvider
|
||||||
|
|
||||||
public function register()
|
public function register()
|
||||||
{
|
{
|
||||||
$this->container->singleton('queue.supported_drivers', function () {
|
$this->container->singleton('flarum.queue.supported_drivers', function () {
|
||||||
return [
|
return [
|
||||||
'sync' => SyncQueue::class,
|
'sync' => SyncQueue::class,
|
||||||
'database' => DatabaseQueue::class,
|
'database' => DatabaseQueue::class,
|
||||||
|
@ -55,7 +55,7 @@ class QueueServiceProvider extends AbstractServiceProvider
|
||||||
|
|
||||||
$this->container->singleton('flarum.queue.connection', function (Container $container) {
|
$this->container->singleton('flarum.queue.connection', function (Container $container) {
|
||||||
/** @var array $drivers */
|
/** @var array $drivers */
|
||||||
$drivers = $container->make('queue.supported_drivers');
|
$drivers = $container->make('flarum.queue.supported_drivers');
|
||||||
/** @var SettingsRepositoryInterface $settings */
|
/** @var SettingsRepositoryInterface $settings */
|
||||||
$settings = $container->make(SettingsRepositoryInterface::class);
|
$settings = $container->make(SettingsRepositoryInterface::class);
|
||||||
$driverName = $settings->get('queue_driver', 'sync');
|
$driverName = $settings->get('queue_driver', 'sync');
|
||||||
|
|
Loading…
Reference in New Issue
Block a user