mirror of
https://github.com/flarum/core.git
synced 2025-08-02 14:37:49 +02:00
Make StatusWidget tools extensible (#3189)
This commit is contained in:
@@ -26,7 +26,7 @@ export default class StatusWidget extends DashboardWidget {
|
|||||||
buttonClassName="Button"
|
buttonClassName="Button"
|
||||||
menuClassName="Dropdown-menu--right"
|
menuClassName="Dropdown-menu--right"
|
||||||
>
|
>
|
||||||
<Button onclick={this.handleClearCache.bind(this)}>{app.translator.trans('core.admin.dashboard.clear_cache_button')}</Button>
|
{this.toolsItems().toArray()}
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -37,6 +37,17 @@ export default class StatusWidget extends DashboardWidget {
|
|||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toolsItems() {
|
||||||
|
const items = new ItemList();
|
||||||
|
|
||||||
|
items.add(
|
||||||
|
'clearCache',
|
||||||
|
<Button onclick={this.handleClearCache.bind(this)}>{app.translator.trans('core.admin.dashboard.clear_cache_button')}</Button>
|
||||||
|
);
|
||||||
|
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
handleClearCache(e) {
|
handleClearCache(e) {
|
||||||
app.modal.show(LoadingModal);
|
app.modal.show(LoadingModal);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user