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