mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[wip] Dirty draft of interface for migrations
This commit is contained in:
parent
2d1678a468
commit
c770e72beb
4 changed files with 112 additions and 0 deletions
|
@ -250,4 +250,31 @@
|
|||
});
|
||||
});
|
||||
|
||||
// Reboot or shutdown button
|
||||
app.get('#/tools/migrations', function (c) {
|
||||
c.api('/migrations', function(migrations) {
|
||||
c.api('/migrations/state', function(state) {
|
||||
|
||||
var lastRunMigration = state.last_run_migration.number;
|
||||
var migrationsLength = migrations.migrations.length;
|
||||
var upToDate = true;
|
||||
|
||||
for(var i = 0; i < migrationsLength; i++) {
|
||||
var thisMigration = migrations.migrations[i];
|
||||
thisMigration.name = thisMigration.name.replace(/_/g, ' ')
|
||||
thisMigration.todo = (thisMigration.number == lastRunMigration);
|
||||
if (thisMigration.todo) { upToDate = false; }
|
||||
};
|
||||
|
||||
|
||||
c.view('tools/tools_migrations', {
|
||||
'migrations' : migrations.migrations.reverse(),
|
||||
'upToDate' : upToDate
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
})();
|
||||
|
|
|
@ -184,6 +184,7 @@
|
|||
"manage_users": "Manage users",
|
||||
"memory": "Memory",
|
||||
"menu": "Menu",
|
||||
"migrations": "Migrations",
|
||||
"mode": "Mode",
|
||||
"monitoring": "Monitoring",
|
||||
"monitoring_check_glances": "Check <a href='#/services/glances'>glances</a> service status.",
|
||||
|
@ -231,6 +232,7 @@
|
|||
"refresh_app_list": "Refresh list",
|
||||
"remove_access": "Remove access",
|
||||
"restore": "Restore",
|
||||
"run": "Run",
|
||||
"running": "Running",
|
||||
"save": "Save",
|
||||
"select_user": "Select user",
|
||||
|
@ -241,6 +243,7 @@
|
|||
"services_list": "Service list",
|
||||
"set_default": "Set default",
|
||||
"size": "Size",
|
||||
"skip": "Skip",
|
||||
"start": "Start",
|
||||
"status": "Status",
|
||||
"stop": "Stop",
|
||||
|
|
|
@ -11,6 +11,10 @@
|
|||
<span class="pull-right fa-chevron-right"></span>
|
||||
<h2 class="list-group-item-heading">{{t 'diagnosis'}}</h2>
|
||||
</a>
|
||||
<a href="#/tools/migrations" class="list-group-item slide clearfix">
|
||||
<span class="pull-right fa-chevron-right"></span>
|
||||
<h2 class="list-group-item-heading">{{t 'migrations'}}</h2>
|
||||
</a>
|
||||
<a href="#/tools/monitor" class="list-group-item slide clearfix">
|
||||
<span class="pull-right fa-chevron-right"></span>
|
||||
<h2 class="list-group-item-heading">{{t 'monitoring'}}</h2>
|
||||
|
|
78
src/views/tools/tools_migrations.ms
Normal file
78
src/views/tools/tools_migrations.ms
Normal file
|
@ -0,0 +1,78 @@
|
|||
<div class="btn-breadcrumb">
|
||||
<a href="#/" ><i class="fa-home"></i><span class="sr-only">{{t 'home'}}</span></a>
|
||||
<a href="#/tools">{{t 'tools'}}</a>
|
||||
<a href="#/tools/migrations">{{t 'migrations'}}</a>
|
||||
</div>
|
||||
|
||||
<div class="separator"></div>
|
||||
|
||||
{{#if upToDate}}
|
||||
<div class="alert alert-success">
|
||||
<span class="fa-fw fa-check-circle"></span> No migrations to be run !
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="alert alert-warning">
|
||||
<span class="fa-fw fa-exclamation-triangle"></span> There are pending migrations that need to be ran.
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h2 class="panel-title"><span class="fa-fw fa-cogs"></span> {{t 'pending_migrations'}}
|
||||
<div class="btn-toolbar pull-right">
|
||||
<a href="#" class="btn btn-success" style="margin-top: -3px"><span class="fa-fw fa-play"></span> {{t 'run'}}</a>
|
||||
<a href="#" class="btn btn-warning" style="margin-top: -3px"><span class="fa-fw fa-close"></span> {{t 'skip'}}</a>
|
||||
</div>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
{{#if migrations}}
|
||||
<div class="list-group">
|
||||
{{#migrations}}
|
||||
<div class="list-group-item clearfix">
|
||||
<h3 class="list-group-item-heading" style="text-transform: capitalize;">
|
||||
{{ number }}. {{ name }}
|
||||
</h3>
|
||||
<p id="description-migration-{{number}}" class="list-group-item-text">
|
||||
(No description available)
|
||||
</p>
|
||||
</div>
|
||||
{{/migrations}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="panel-body">
|
||||
<span class="text-success"><span class="fa-fw fa-check-circle"></span> No pending migrations !</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h2 class="panel-title"><span class="fa-fw fa-cogs"></span> {{t 'previous_migrations'}}
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
{{#if previous_migrations}}
|
||||
<div class="list-group">
|
||||
{{#previous_migrations}}
|
||||
<div class="list-group-item clearfix">
|
||||
<h3 class="list-group-item-heading" style="text-transform: capitalize;">
|
||||
<a data-toggle="collapse" href="#description-migration-{{number}}">
|
||||
{{ number }}. {{ name }}
|
||||
</a>
|
||||
</h3>
|
||||
<p id="description-migration-{{number}}" class="list-group-item-text collapse">
|
||||
(No description available)
|
||||
</p>
|
||||
</div>
|
||||
{{/previous_migrations}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="panel-body">
|
||||
<span class="text-info">No previous migrations.</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
|
||||
|
Loading…
Add table
Reference in a new issue