mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[enh] Add context in log paste feature
This commit is contained in:
parent
6a04b57ca6
commit
07d2e1c3bd
2 changed files with 12 additions and 19 deletions
|
@ -395,7 +395,7 @@
|
|||
$.ajax({
|
||||
type: "POST",
|
||||
url: 'https://paste.yunohost.org/documents',
|
||||
data: preElement[0].innerHTML,
|
||||
data: preElement.text(),
|
||||
})
|
||||
.success(function(data, textStatus, jqXHR) {
|
||||
window.open('https://paste.yunohost.org/' + data.key, '_blank');
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
</div>
|
||||
|
||||
<div class="actions-group">
|
||||
<a data-paste-content="#log" class="btn btn-success">
|
||||
<a data-paste-content="#description, #metadata, #env, #log" class="btn btn-success">
|
||||
<span class="fa-cloud-upload"></span> {{t 'upload'}}
|
||||
</a>
|
||||
</div>
|
||||
|
@ -16,19 +16,14 @@
|
|||
{{#if log.metadata}}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h2 class="panel-title"><span class="fa-fw fa-info-circle"></span> {{ log.description }}</h2>
|
||||
<!-- PLEASE DON'T INDENT THIS CODE, IT IS PASTED ON YUNOPASTE -->
|
||||
<h2 class="panel-title" id="description"><span class="fa-fw fa-info-circle"></span> {{ log.description }}</h2>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<dl class="dl-horizontal">
|
||||
<dt>{{t 'path'}}</dt> <dd>{{ log.log_path }}</dd>
|
||||
{{#if log.metadata.started_at}}
|
||||
<dt>{{t 'started_at'}}</dt>
|
||||
<dd>{{formatTime log.metadata.started_at day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}</dd>
|
||||
{{/if}}
|
||||
{{#if log.metadata.ended_at}}
|
||||
<dt>{{t 'ended_at'}}</dt>
|
||||
<dd>{{formatTime log.metadata.ended_at day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}</dd>
|
||||
{{/if}}
|
||||
<dl class="dl-horizontal" id="metadata">
|
||||
<dt>{{t 'path'}}</dt> <dd>{{ log.log_path }}</dd>
|
||||
{{#if log.metadata.started_at}}<dt>{{t 'started_at'}}</dt> <dd>{{formatTime log.metadata.started_at day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}</dd>
|
||||
{{/if}}{{#if log.metadata.ended_at}}<dt>{{t 'ended_at'}}</dt> <dd>{{formatTime log.metadata.ended_at day="numeric" month="long" year="numeric" hour="numeric" minute="numeric"}}</dd>{{/if}}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -43,11 +38,9 @@
|
|||
</div>
|
||||
<div id="collapse-context" class="panel-collapse collapse" role="tabpanel" aria-labelledby="heading-context">
|
||||
<div class="panel-body">
|
||||
<dl class="dl-horizontal">
|
||||
{{#each log.metadata.env}}
|
||||
<dt>{{@key}}</dt>
|
||||
<dd>{{.}}</dd>
|
||||
{{/each}}
|
||||
<dl class="dl-horizontal" id="env">
|
||||
{{#each log.metadata.env}}<dt>{{@key}}</dt> <dd>{{.}}</dd>
|
||||
{{/each}}
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -63,8 +56,8 @@
|
|||
{{#if log.metadata.error}}
|
||||
<div class="alert alert-warning" role="alert"><span class="fas fa-exclamation-triangle"></span> <strong>{{t 'Error'}}</strong>: {{log.metadata.error}}</div>
|
||||
{{/if}}
|
||||
{{#if next_number}}<a href="#/tools/logs/{{#if log.name}}{{ log.name }}{{else}}{{ log.log_path }}{{/if}}?number={{ next_number }}">MORE</a>{{/if}}
|
||||
<!-- no indent because pre is sensible to whitespaces -->
|
||||
{{#if next_number}}<a href="#/tools/logs/{{ log.log_path }}?number={{ next_number }}">MORE</a>{{/if}}
|
||||
<pre id="log" class="full-width">{{#log.logs}}{{.}}
|
||||
{{/log.logs}}</pre>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue