mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[enh] Icon and i18n for logs categories
This commit is contained in:
parent
a10c6ff33a
commit
f7ec1274bf
4 changed files with 39 additions and 5 deletions
|
@ -99,10 +99,20 @@
|
|||
app.get('#/tools/logs', function (c) {
|
||||
c.api("/logs", function(categories) {
|
||||
data = [];
|
||||
icons = {
|
||||
'operation': 'wrench',
|
||||
'history': 'history',
|
||||
'package': 'puzzle-piece',
|
||||
'system': 'cogs',
|
||||
'access': 'ban',
|
||||
'service': 'cog',
|
||||
'app': 'cubes'
|
||||
}
|
||||
for (var category in categories) {
|
||||
if (categories.hasOwnProperty(category)) {
|
||||
data.push({
|
||||
key:category,
|
||||
icon:(category in icons)?icons[category]:'info-circle',
|
||||
value:categories[category]
|
||||
});
|
||||
}
|
||||
|
|
|
@ -39,6 +39,15 @@
|
|||
return new Handlebars.SafeString(result);
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('concat', function() {
|
||||
var outStr = '';
|
||||
for(var arg in arguments){
|
||||
if(typeof arguments[arg]!='object'){
|
||||
outStr += arguments[arg];
|
||||
}
|
||||
}
|
||||
return outStr;
|
||||
});
|
||||
|
||||
// Look for supported type of storage to use
|
||||
/**
|
||||
|
|
|
@ -307,5 +307,14 @@
|
|||
"diagnosis" : "Diagnosis",
|
||||
"diagnosis_with_private" : "Diagnosis with private data",
|
||||
"diagnosis_view_private" : "Show diagnosis with private data",
|
||||
"diagnosis_hide_private" : "Show diagnosis without private data"
|
||||
"diagnosis_hide_private" : "Show diagnosis without private data",
|
||||
"logs": "Logs",
|
||||
"logs_operation": "Operations made on system with YunoHost",
|
||||
"logs_history": "History of command run on system",
|
||||
"logs_package": "Debian packages management history",
|
||||
"logs_system": "Kernel logs and others low level events",
|
||||
"logs_access": "List of access and bans",
|
||||
"logs_service": "Services logs",
|
||||
"logs_app": "Apps logs",
|
||||
"logs_no_logs_registered": "No log registered for this category"
|
||||
}
|
||||
|
|
|
@ -13,14 +13,20 @@
|
|||
<div class="panel-heading" role="tab" id="heading-{{key}}">
|
||||
<h2 class="panel-title">
|
||||
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse-{{key}}" aria-expanded="true" aria-controls="collapse-{{key}}">
|
||||
<span class="fa-fw fa-info-circle"></span>{{t key}}
|
||||
<span class="fa-fw fa-{{icon}}"></span>{{t (concat 'logs_' key)}}
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
<div id="collapse-{{key}}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading-{{key}}">
|
||||
<div class="list-group">{{#value}}
|
||||
<div class="list-group">
|
||||
{{#if value}}
|
||||
{{#value}}
|
||||
<a href="#/tools/logs/{{ name }}" class="list-group-item"><small>{{ started_at }}</small> {{ description }}</a>
|
||||
{{/value}}</div>
|
||||
{{/value}}
|
||||
{{else}}
|
||||
<div class="list-group"><span class="list-group-item">{{t 'logs_no_logs_registered'}}</span></div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/data}}
|
||||
|
|
Loading…
Add table
Reference in a new issue