Adds log files links to processes list and popup.

This commit is contained in:
mateuswetah 2018-08-05 22:22:51 -03:00
parent 06adcc4b5a
commit 0899db14b4
6 changed files with 85 additions and 41 deletions

5
package-lock.json generated
View File

@ -8580,6 +8580,11 @@
"vue-style-loader": "4.1.1"
}
},
"vue-masonry-css": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/vue-masonry-css/-/vue-masonry-css-1.0.2.tgz",
"integrity": "sha512-iiFW4laFhlsh3E5rrymX4SEvtFM8WknDFH0O09lqjqNaUO2iyVqRWT/6Js/pSKv38q4iLD0aoTmmnPanufJReQ=="
},
"vue-resize": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/vue-resize/-/vue-resize-0.4.4.tgz",

View File

@ -2,7 +2,7 @@
<div
v-if="processes.length > 0 && !isLoading"
class="table-container">
<!--
<div class="selection-control">
<div class="field select-all is-pulled-left">
<span>
@ -33,16 +33,16 @@
</b-dropdown>
</div>
</div>
-->
<div class="table-wrapper">
<table class="tainacan-table">
<thead>
<tr>
<!-- Checking list -->
<th>
&nbsp;
<!-- <th> -->
<!-- &nbsp; -->
<!-- nothing to show on header -->
</th>
<!-- </th> -->
<!-- Name -->
<th>
<div class="th-wrap">{{ $i18n.get('label_name') }}</div>
@ -59,6 +59,10 @@
<th>
<div class="th-wrap">{{ $i18n.get('label_last_processed_on') }}</div>
</th>
<!-- Logs -->
<th>
<div class="th-wrap">{{ $i18n.get('label_log_file') }}</div>
</th>
<!-- Status -->
<th>
<div class="th-wrap">{{ $i18n.get('label_status') }}</div>
@ -71,13 +75,13 @@
:key="index"
v-for="(bgProcess, index) of processes">
<!-- Checking list -->
<td
<!-- <td
:class="{ 'is-selecting': isSelecting }"
class="checkbox-cell">
<b-checkbox
size="is-small"
v-model="selected[index]"/>
</td>
</td> -->
<!-- Name -->
<td
class="column-default-width column-main-content"
@ -95,14 +99,14 @@
<td
class="column-default-width"
:label="$i18n.get('label_progress')"
:aria-label="$i18n.get('label_progress') + ': ' + bgProcess.progress_label ? bgProcess.progress_label : $i18n.get('label_no_details_of_process')">
:aria-label="$i18n.get('label_progress') + ': ' + bgProcess.progress_label ? bgProcess.progress_label + (bgProcess.progress_value ? ' (' + bgProcess.progress_value + '%)' : '') : $i18n.get('label_no_details_of_process')">
<p
v-tooltip="{
content: bgProcess.progress_label ? bgProcess.progress_label : $i18n.get('label_no_details_of_process'),
autoHide: false,
placement: 'auto-start'
}">
{{ bgProcess.progress_label ? bgProcess.progress_label : $i18n.get('label_no_details_of_process') }}</p>
{{ bgProcess.progress_label ? bgProcess.progress_label + (bgProcess.progress_value ? ' (' + bgProcess.progress_value + '%)' : '') : $i18n.get('label_no_details_of_process') }}</p>
</td>
<!-- Queued on -->
<td
@ -130,6 +134,22 @@
}">
{{ getDate(bgProcess.last_processed_on) }}</p>
</td>
<!-- Logs -->
<td
class="column-small-width"
:label="$i18n.get('label_log_file')"
:aria-label="$i18n.get('label_log_gile')">
<p>
<a
v-if="bgProcess.log"
:href="bgProcess.log">{{ $i18n.get('label_log_file') }}</a>
<span v-if="bgProcess.error_log"> | </span>
<a
v-if="bgProcess.error_log"
class="has-text-danger"
:href="bgProcess.error_log">{{ $i18n.get('label_error_log_file') }}</a>
</p>
</td>
<!-- Status-->
<td
class="actions-cell column-small-width"
@ -158,10 +178,20 @@
autoHide: false,
placement: 'auto-start'
}"
v-if="bgProcess.done > 0"
v-if="bgProcess.done > 0 && !bgProcess.error_log"
class="icon has-text-success">
<i class="mdi mdi-18px mdi-checkbox-marked-circle"/>
</span>
<span
v-tooltip="{
content: $i18n.get('label_process_failed'),
autoHide: false,
placement: 'auto-start'
}"
v-if="bgProcess.done > 0 && bgProcess.error_log"
class="icon has-text-danger">
<i class="mdi mdi-18px mdi-sync-alert" />
</span>
</div>
</td>
</tr>

View File

@ -43,8 +43,9 @@
class="mdi mdi-18px"
:class="{ 'mdi-menu-down': processesColapses[index], 'mdi-menu-right': !processesColapses[index] }" />
</span>
<p>{{ bgProcess.name ? bgProcess.name : $i18n.get('label_unamed_process') }}</p>
<span class="process-title-value">{{ (bgProcesses[0].progress_value && bgProcesses[0].progress_value >= 0) ? '(' + bgProcesses[0].progress_value + '%)' : '' }}</span>
<p>{{ bgProcess.name ? bgProcess.name : $i18n.get('label_unamed_process') }}
<span class="process-title-value">{{ (bgProcesses[0].progress_value && bgProcesses[0].progress_value >= 0) ? '(' + bgProcesses[0].progress_value + '%)' : '' }}</span>
</p>
</div>
<!-- <span
v-if="bgProcess.done <= 0"
@ -59,10 +60,15 @@
<i class="mdi mdi-18px mdi-close-circle-outline"/>
</span> -->
<span
v-if="bgProcess.done > 0"
v-if="bgProcess.done > 0 && !bgProcess.error_log"
class="icon has-text-success">
<i class="mdi mdi-18px mdi-checkbox-marked-circle"/>
</span>
<span
v-if="bgProcess.done > 0 && bgProcess.error_log"
class="icon has-text-danger">
<i class="mdi mdi-18px mdi-sync-alert" />
</span>
<span
v-if="bgProcess.done <= 0"
class="icon has-text-success loading-icon">
@ -77,6 +83,14 @@
{{ $i18n.get('label_queued_on') + ' ' + getDate(bgProcess.queued_on) }}
<br>
{{ $i18n.get('label_last_processed_on') + ' ' + getDate(bgProcess.processed_last) }}
<br>
<a
v-if="bgProcess.log"
:href="bgProcess.log">{{ $i18n.get('label_log_file') }}</a>
<a
v-if="bgProcess.error_log"
class="has-text-danger"
:href="bgProcess.error_log">{{ $i18n.get('label_error_log_file') }}</a>
</div>
</li>
</ul>
@ -231,7 +245,7 @@ export default {
.popup-list {
background-color: white;
color: black;
overflow-y: scroll;
overflow-y: auto;
overflow-x: hidden;
max-height: 222px;
animation-name: expand;

View File

@ -948,22 +948,25 @@
let creationDateMetadatumDisplay = prefsFetchOnlyObject != undefined ? (prefsFetchOnlyObject['1'] != null) : true;
let authorNameMetadatumDisplay = prefsFetchOnlyObject != undefined ? (prefsFetchOnlyObject['2'] != null) : true;
metadata.push({
name: this.$i18n.get('label_creation_date'),
metadatum: 'row_creation',
metadata_type: undefined,
slug: 'creation_date',
id: undefined,
display: creationDateMetadatumDisplay
});
metadata.push({
name: this.$i18n.get('label_created_by'),
metadatum: 'row_author',
metadata_type: undefined,
slug: 'author_name',
id: undefined,
display: authorNameMetadatumDisplay
});
if (!this.isOnTheme) {
metadata.push({
name: this.$i18n.get('label_creation_date'),
metadatum: 'row_creation',
metadata_type: undefined,
slug: 'creation_date',
id: undefined,
display: creationDateMetadatumDisplay
});
metadata.push({
name: this.$i18n.get('label_created_by'),
metadatum: 'row_author',
metadata_type: undefined,
slug: 'author_name',
id: undefined,
display: authorNameMetadatumDisplay
});
}
this.$eventBusSearch.addFetchOnly({
'0': (thumbnailMetadatumDisplay ? 'thumbnail' : null),

View File

@ -271,12 +271,15 @@ return apply_filters( 'tainacan-admin-i18n', [
'label_last_processed_on' => __( 'Last processed on:', 'tainacan' ),
'label_progress' => __( 'Progress', 'tainacan' ),
'label_process_completed' => __( 'Process completed', 'tainacan' ),
'label_process_failed' => __( 'Process failed', 'tainacan' ),
'label_max_options_to_show' => __( 'Max options to show', 'tainacan' ),
'label_unamed_process' => __( 'Unamed process', 'tainacan' ),
'label_import_collection' => __( 'Import collection', 'tainacan' ),
'label_semantic_uri' => __( 'Semantic Uri', 'tainacan' ),
'label_view_collection' => __( 'View collection', 'tainacan' ),
'label_view_more' => __( 'View more', 'tainacan' ),
'label_log_file' => __( 'Log file', 'tainacan' ),
'label_error_log_file' => __( 'Error Log file', 'tainacan' ),
// Instructions. More complex sentences to guide user and placeholders
'instruction_delete_selected_collections' => __( 'Delete selected collections', 'tainacan' ),

View File

@ -76,17 +76,6 @@
class="table-thumb"
:src="item[column.slug].thumb ? item[column.slug].thumb : thumbPlaceholderPath">
</span>
<p
v-tooltip="{
content: item[column.slug],
html: true,
autoHide: false,
placement: 'auto-start'
}"
v-if="column.metadatum == 'row_author' || column.metadatum == 'row_creation'">
{{ item[column.slug] }}
</p>
</td>
</tr>
</tbody>