mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
Merge branch 'stretch-unstable' of github.com:eauchat/yunohost-admin into stretch-unstable
This commit is contained in:
commit
4df9852a50
12 changed files with 70 additions and 33 deletions
|
@ -18,10 +18,10 @@
|
|||
});
|
||||
|
||||
function levelToColor(level) {
|
||||
if (level > 6) {
|
||||
if (level >= 3) {
|
||||
return 'success';
|
||||
}
|
||||
else if (level >= 2) {
|
||||
else if (level >= 1) {
|
||||
return 'warning';
|
||||
}
|
||||
else if (isNaN(level)) {
|
||||
|
@ -41,13 +41,14 @@
|
|||
}
|
||||
|
||||
function combineColors(stateColor, levelColor, installable) {
|
||||
if (stateColor === "dangers" || levelColor === "danger") {
|
||||
if (stateColor === "danger" || levelColor === "danger") {
|
||||
return 'danger';
|
||||
}
|
||||
if (stateColor === "warnings" || levelColor === "warnings" || levelColor === "default") {
|
||||
else if (stateColor === "warning" || levelColor === "warning" || levelColor === "default") {
|
||||
return 'warning';
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
return 'success';
|
||||
}
|
||||
}
|
||||
|
@ -234,10 +235,7 @@
|
|||
|
||||
// Multi Instance settings
|
||||
data.manifest.multi_instance = data.manifest.multi_instance ? y18n.t('yes') : y18n.t('no');
|
||||
|
||||
// Installation date
|
||||
var d = new Date(data.settings.install_time * 1000);
|
||||
data.install_time = d.getDate() + '/' + (d.getMonth()+1) + '/' + d.getFullYear();
|
||||
data.install_time = new Date(data.settings.install_time * 1000);
|
||||
|
||||
c.view('app/app_info', data);
|
||||
});
|
||||
|
@ -491,11 +489,36 @@
|
|||
// App installation form
|
||||
app.get('#/apps/install/:app', function (c) {
|
||||
c.api('/apps?raw', function(data) { // http://api.yunohost.org/#!/app/app_list_get_8
|
||||
c.appInstallForm(
|
||||
c.params['app'],
|
||||
data[c.params['app']].manifest,
|
||||
c.params
|
||||
);
|
||||
var state_color = stateToColor(data[c.params['app']]['state']);
|
||||
var level_color = levelToColor(parseInt(data[c.params['app']]['level']));
|
||||
var is_safe_for_install_color = combineColors(state_color, level_color);
|
||||
|
||||
if ((is_safe_for_install_color === "warning") || (is_safe_for_install_color === "danger"))
|
||||
{
|
||||
c.confirm(
|
||||
y18n.t("applications"),
|
||||
y18n.t("confirm_install_app_"+is_safe_for_install_color),
|
||||
function(){
|
||||
c.appInstallForm(
|
||||
c.params['app'],
|
||||
data[c.params['app']].manifest,
|
||||
c.params
|
||||
);
|
||||
},
|
||||
function(){
|
||||
$('div.loader').remove();
|
||||
c.redirect('#/apps/install');
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
c.appInstallForm(
|
||||
c.params['app'],
|
||||
data[c.params['app']].manifest,
|
||||
c.params
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -136,6 +136,7 @@
|
|||
data.name = c.params['archive'];
|
||||
data.system_parts = c.groupHooks(Object.keys(data['system']));
|
||||
data.items = (data['hooks']!={} || data['apps']!=[]);
|
||||
data.locale = y18n.locale
|
||||
c.view('backup/backup_info', data);
|
||||
});
|
||||
});
|
||||
|
@ -153,6 +154,7 @@
|
|||
data.archives2.unshift(info)
|
||||
});
|
||||
data.archives = data.archives2;
|
||||
data.locale = y18n.locale
|
||||
c.view('backup/backup_list', data);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -22,6 +22,10 @@
|
|||
// Translate status and loaded state
|
||||
v.status = y18n.t(v.status);
|
||||
v.loaded = y18n.t(v.loaded);
|
||||
if (v.active_at == 'unknown')
|
||||
{
|
||||
delete v.active_at;
|
||||
}
|
||||
data2.services.push(v);
|
||||
});
|
||||
|
||||
|
@ -52,6 +56,10 @@
|
|||
// Translate status and loaded state
|
||||
data2.service.active = y18n.t(data.active);
|
||||
data2.service.loaded = y18n.t(data.loaded);
|
||||
if (data.active_at != 'unknown')
|
||||
{
|
||||
data2.service.active_at = data.active_at;
|
||||
}
|
||||
store.clear('slide');
|
||||
c.view('service/service_info', data2);
|
||||
}, 'GET');
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
|
||||
c.view('tools/tools_logs', {
|
||||
"data": data,
|
||||
"locale": y18n.locale
|
||||
"locale": y18n.locale
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -134,12 +134,6 @@
|
|||
|
||||
c.api("/logs/display" + params, function(log) {
|
||||
if ('metadata' in log) {
|
||||
if ('started_at' in log.metadata) {
|
||||
log.metadata.started_at = Date.parse(log.metadata.started_at)
|
||||
}
|
||||
if ('ended_at' in log.metadata) {
|
||||
log.metadata.ended_at = Date.parse(log.metadata.ended_at)
|
||||
}
|
||||
if (!'env' in log.metadata && 'args' in log.metadata) {
|
||||
log.metadata.env = log.metadata.args
|
||||
}
|
||||
|
|
|
@ -26,10 +26,6 @@
|
|||
Handlebars.registerHelper('humanTime', function(time) {
|
||||
return Math.round(time) + 's';
|
||||
});
|
||||
Handlebars.registerHelper('timestampToDate', function(timestamp) {
|
||||
var date = new Date(timestamp * 1000);
|
||||
return date.toLocaleString();
|
||||
});
|
||||
Handlebars.registerHelper('bitRate', function(bytes, time) {
|
||||
var sizes = ['b', 'Kb', 'Mb', 'Gb', 'Tb'];
|
||||
if (time === 0) return 'n/a';
|
||||
|
|
|
@ -75,8 +75,10 @@
|
|||
"confirm_delete": "Are you sure you want to delete %s ?",
|
||||
"confirm_firewall_open": "Are you sure you want to open port %s? (protocol: %s, connection: %s)",
|
||||
"confirm_firewall_close": "Are you sure you want to close port %s? (protocol: %s, connection: %s)",
|
||||
"confirm_install_custom_app": "Installing 3rd party applications may compromise the security of your system. Use at your own risk.",
|
||||
"confirm_install_custom_app": "WARNING ! Installing 3rd party applications may compromise the integrity and security of your system. You should probably NOT install it unless you know what you are doing. Are you willing to take that risk ?",
|
||||
"confirm_install_domain_root": "You will not be able to install any other app on %s. Continue ?",
|
||||
"confirm_install_app_warning": "Warning : this application may work but is not well-integrated in YunoHost. Some features such as single sign-on and backup/restore might not be available.",
|
||||
"confirm_install_app_danger": "WARNING ! This application is still experimental (if not explicitly not working) and it is likely to break your system ! You should probably NOT install it unless you know what you are doing. Are you willing to take that risk ?",
|
||||
"confirm_migrations_skip": "Skipping migrations is not recommended. Are you sure you want to do that?",
|
||||
"confirm_postinstall": "You are about to launch the post-installation process on the domain %s. It may take a few minutes, *do not interrupt the operation*.",
|
||||
"confirm_restore": "Are you sure you want to restore %s ?",
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<dt>{{t 'url'}}</dt>
|
||||
<dd>{{appslist.url}}</dd>
|
||||
<dt>{{t 'appslists_last_update'}}</dt>
|
||||
<dd>{{timestampToDate appslist.lastUpdate}}</dd>
|
||||
<dd>{{formatTime appslist.lastUpdate day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<dt>{{t 'multi_instance'}}</dt>
|
||||
<dd>{{manifest.multi_instance}}</dd>
|
||||
<dt>{{t 'install_time'}}</dt>
|
||||
<dd>{{install_time}}</dd>
|
||||
<dd>{{formatTime install_time day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}</dd>
|
||||
<dt>{{t 'url'}}</dt>
|
||||
<dd><a href="https://{{settings.domain}}{{settings.path}}" target="_blank">https://{{settings.domain}}{{settings.path}}</a></dd>
|
||||
</dl>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<div class="panel-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>{{t 'id'}}</dt><dd>{{ name }}</dd>
|
||||
<dt>{{t 'created_at'}}</dt><dd>{{ created_at }}</dd>
|
||||
<dt>{{t 'created_at'}}</dt><dd>{{formatTime created_at day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}</dd>
|
||||
<dt>{{t 'size'}}</dt><dd>{{ humanSize size}}</dd>
|
||||
<dt>{{t 'path'}}</dt><dd>{{ path }}</dd>
|
||||
</dl>
|
||||
|
|
|
@ -12,11 +12,12 @@
|
|||
|
||||
<div class="separator"></div>
|
||||
|
||||
{{#intl locales=locale}}
|
||||
<div class="list-group">
|
||||
{{#each archives}}
|
||||
<a href="#/backup/{{../storage.id}}/{{name}}" class="list-group-item slide clearfix">
|
||||
<a href="#/backup/{{../storage.id}}/{{name}}" class="list-group-item slide clearfix" title='{{formatTime created_at day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}'>
|
||||
<span class="pull-right fa-chevron-right"></span>
|
||||
<h2 class="list-group-item-heading">{{created_at}} <small>{{name}} ({{humanSize size}})</small></h2>
|
||||
<h2 class="list-group-item-heading">{{formatRelative created_at}} <small>{{name}} ({{humanSize size}})</small></h2>
|
||||
<p class="list-group-item-text">{{path}}</p>
|
||||
</a>
|
||||
{{/each}}
|
||||
|
@ -28,6 +29,7 @@
|
|||
{{/archives}}
|
||||
|
||||
</div>
|
||||
{{/intl}}
|
||||
|
||||
<!--<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
|
|
@ -43,7 +43,12 @@
|
|||
</span>
|
||||
<br>
|
||||
{{t 'started_at'}}
|
||||
{{active_at.human}}
|
||||
{{#active_at}}
|
||||
{{formatTime . day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}
|
||||
{{/active_at}}
|
||||
{{^active_at}}
|
||||
{{t 'unknown'}}
|
||||
{{/active_at}}
|
||||
</div>
|
||||
|
||||
<div class="pull-right">
|
||||
|
|
|
@ -17,7 +17,12 @@
|
|||
</span>
|
||||
<br>
|
||||
{{t 'started_at'}}
|
||||
{{active_at.human}}
|
||||
{{#active_at}}
|
||||
{{formatTime . day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}
|
||||
{{/active_at}}
|
||||
{{^active_at}}
|
||||
{{t 'unknown'}}
|
||||
{{/active_at}}
|
||||
</div>
|
||||
</a>
|
||||
{{/services}}
|
||||
|
|
Loading…
Reference in a new issue