mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[enh] Adapt log view to the new api, and add paste option
This commit is contained in:
parent
663cbe84d3
commit
a10c6ff33a
2 changed files with 20 additions and 10 deletions
|
@ -98,8 +98,18 @@
|
|||
// Display journals list
|
||||
app.get('#/tools/logs', function (c) {
|
||||
c.api("/logs", function(categories) {
|
||||
data = [];
|
||||
for (var category in categories) {
|
||||
if (categories.hasOwnProperty(category)) {
|
||||
data.push({
|
||||
key:category,
|
||||
value:categories[category]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
c.view('tools/tools_logs', {
|
||||
"data": categories,
|
||||
"data": data,
|
||||
formatDate: function() {
|
||||
return this.started_at.getDate();
|
||||
}
|
||||
|
|
|
@ -7,22 +7,22 @@
|
|||
<div class="separator"></div>
|
||||
|
||||
{{#if data}}
|
||||
{{#data}}
|
||||
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
|
||||
{{#data}}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading" role="tab" id="heading-uo">
|
||||
<div class="panel-heading" role="tab" id="heading-{{key}}">
|
||||
<h2 class="panel-title">
|
||||
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapse-uo" aria-expanded="true" aria-controls="collapse-uo">
|
||||
<span class="fa-fw fa-info-circle"></span>{{t 'unit_operation'}}
|
||||
<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}}
|
||||
</a>
|
||||
</h2>
|
||||
</div>
|
||||
<div id="collapse-uo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading-uo">
|
||||
<div class="list-group">{{#operations}}
|
||||
<a href="#/tools/logs/{{ name }}" class="list-group-item"><small>{{ started_at }}</small> {{ name }}</a>
|
||||
{{/operations}}</div>
|
||||
</div>
|
||||
<div id="collapse-{{key}}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading-{{key}}">
|
||||
<div class="list-group">{{#value}}
|
||||
<a href="#/tools/logs/{{ name }}" class="list-group-item"><small>{{ started_at }}</small> {{ description }}</a>
|
||||
{{/value}}</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/data}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
Loading…
Reference in a new issue