mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[enh] Display date in timezone of browser
This commit is contained in:
parent
5b19e7974a
commit
7da64b8e7e
7 changed files with 24 additions and 16 deletions
|
@ -60,7 +60,8 @@
|
|||
|
||||
c.view('app/app_appslists_list', {
|
||||
appslists: list,
|
||||
has_community_list: has_community_list
|
||||
has_community_list: has_community_list,
|
||||
locale: y18n.locale
|
||||
});
|
||||
}, 'GET');
|
||||
});
|
||||
|
@ -88,7 +89,10 @@
|
|||
'lastUpdate': data[c.params['appslist']]['lastUpdate'],
|
||||
'removable' : (c.params['appslist'] !== 'yunohost') ? true : false // Do not remove default apps list
|
||||
};
|
||||
c.view('app/app_appslists_info', {appslist: list});
|
||||
c.view('app/app_appslists_info', {
|
||||
appslist: list,
|
||||
locale: y18n.locale
|
||||
});
|
||||
}
|
||||
else {
|
||||
c.flash('warning', y18n.t('appslists_unknown_list', [c.params['appslist']]));
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
// 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 +54,8 @@
|
|||
// 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');
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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…
Add table
Reference in a new issue