Front-end module yii2-shell-task for launching yii2 console-commands.
Frontend for module "idfly/yii2-shell-task"
. Allows start and stop the
tasks through the interface and also see the command work logs.
-
To the project file
composer.json
add to therequire
section:"idfly/yii2-shell-task-ui": "dev-master"
-
To the
repositories
section:{ "type": "git", "url": "[email protected]:idfly/yii2-shell-task-ui.git" }
-
Run
composer update
-
Add a module to the project's configuration list:
`$config['modules']['shellTaskUi'] = [ 'class' => 'idfly\shellTaskUi\Module', 'params' => [ 'authorization_callback' => function() { $admin = \app\models\Admin::getCurrent(); if(empty($admin)) { Yii::$app->getResponse()->redirect('/admin/login'); } }, 'layout' => '@app/admin/views/layouts/admin.php' ], 'tasks' => [ [ 'name' => 'Updating similar wares', 'description' => 'Made an update of the similar wares', 'command' => 'wares/update-similar', ], ], ];`
-
List the commands in the module configuration list in an array
tasks
. -
In a route configuration file set user-friendly route for module:
'/admin/shell-task-ui' => 'shellTaskUi/default/index',
After installation go to the page http://your-site-domain/shellTaskUi
, log
in with data from configuration file. After authorization opens the page with
command list.