mirror of
https://github.com/flarum/core.git
synced 2025-07-17 23:01:17 +02:00
* feat: Queue package manager commands * adjust tests * fix: force run whynot command synchronously * chore: maximize command output box's height * chore: more user instructions on background queue * feat: track command peak memory usage * feat: exit of CLI php version doesn't match web php version * chore: install deps * chore: format and typing workflow fix Signed-off-by: Sami Mazouz <ilyasmazouz@gmail.com>
41 lines
1.4 KiB
TypeScript
41 lines
1.4 KiB
TypeScript
import app from 'flarum/admin/app';
|
|
import Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';
|
|
import Task from '../models/Task';
|
|
|
|
interface TaskOutputModalAttrs extends IInternalModalAttrs {
|
|
task: Task;
|
|
}
|
|
|
|
export default class TaskOutputModal<CustomAttrs extends TaskOutputModalAttrs = TaskOutputModalAttrs> extends Modal<CustomAttrs> {
|
|
className() {
|
|
return 'Modal--large QuickModal';
|
|
}
|
|
|
|
title() {
|
|
return app.translator.trans(`flarum-package-manager.admin.sections.queue.operations.${this.attrs.task.operation()}`);
|
|
}
|
|
|
|
content() {
|
|
return (
|
|
<div className="Modal-body">
|
|
<div className="TaskOutputModal-data">
|
|
<div className="Form-group">
|
|
<label>{app.translator.trans('flarum-package-manager.admin.sections.queue.output_modal.command')}</label>
|
|
<div className="FormControl TaskOutputModal-data-command">
|
|
<code>$ composer {this.attrs.task.command()}</code>
|
|
</div>
|
|
</div>
|
|
<div className="Form-group">
|
|
<label>{app.translator.trans('flarum-package-manager.admin.sections.queue.output_modal.output')}</label>
|
|
<div className="FormControl TaskOutputModal-data-output">
|
|
<code>
|
|
<pre>{this.attrs.task.output()}</pre>
|
|
</code>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
}
|