chg: [migration] Added support of plugin migrations
parent
0458bbc76f
commit
8df647cdb9
|
@ -9,6 +9,8 @@ use Migrations\Migrations;
|
||||||
|
|
||||||
class InstanceTable extends AppTable
|
class InstanceTable extends AppTable
|
||||||
{
|
{
|
||||||
|
protected $activePlugins = ['Tags'];
|
||||||
|
|
||||||
public function initialize(array $config): void
|
public function initialize(array $config): void
|
||||||
{
|
{
|
||||||
parent::initialize($config);
|
parent::initialize($config);
|
||||||
|
@ -23,6 +25,16 @@ class InstanceTable extends AppTable
|
||||||
{
|
{
|
||||||
$migrations = new Migrations();
|
$migrations = new Migrations();
|
||||||
$status = $migrations->status();
|
$status = $migrations->status();
|
||||||
|
foreach ($this->activePlugins as $pluginName) {
|
||||||
|
$pluginStatus = $migrations->status([
|
||||||
|
'plugin' => $pluginName
|
||||||
|
]);
|
||||||
|
$pluginStatus = array_map(function ($entry) use ($pluginName) {
|
||||||
|
$entry['plugin'] = $pluginName;
|
||||||
|
return $entry;
|
||||||
|
}, $pluginStatus);
|
||||||
|
$status = array_merge($status, $pluginStatus);
|
||||||
|
}
|
||||||
$status = array_reverse($status);
|
$status = array_reverse($status);
|
||||||
|
|
||||||
$updateAvailables = array_filter($status, function ($update) {
|
$updateAvailables = array_filter($status, function ($update) {
|
||||||
|
|
|
@ -27,6 +27,10 @@ foreach ($status as $i => &$update) {
|
||||||
} else if ($update['status'] == 'down') {
|
} else if ($update['status'] == 'down') {
|
||||||
$update['_rowVariant'] = 'danger';
|
$update['_rowVariant'] = 'danger';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($update['plugin'])) {
|
||||||
|
$update['name'] = "{$update['plugin']}.{$update['name']}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo $this->Bootstrap->table([], [
|
echo $this->Bootstrap->table([], [
|
||||||
|
|
Loading…
Reference in New Issue