mirror of https://github.com/Fabio286/antares.git
feat: processes list exportation
This commit is contained in:
parent
85f625daf7
commit
13aa47cd44
|
@ -22,34 +22,55 @@
|
||||||
<a class="btn btn-clear c-hand" @click.stop="closeModal" />
|
<a class="btn btn-clear c-hand" @click.stop="closeModal" />
|
||||||
</div>
|
</div>
|
||||||
<div class="processes-toolbar py-2 px-4">
|
<div class="processes-toolbar py-2 px-4">
|
||||||
<div class="dropdown">
|
<div class="workspace-query-buttons">
|
||||||
<div class="btn-group">
|
<div class="dropdown pr-1">
|
||||||
<button
|
<div class="btn-group">
|
||||||
class="btn btn-dark btn-sm mr-0 pr-1 d-flex"
|
<button
|
||||||
:class="{'loading':isQuering}"
|
class="btn btn-dark btn-sm mr-0 pr-1 d-flex"
|
||||||
title="F5"
|
:class="{'loading':isQuering}"
|
||||||
@click="getProcessesList"
|
title="F5"
|
||||||
>
|
@click="getProcessesList"
|
||||||
<i v-if="!+autorefreshTimer" class="mdi mdi-24px mdi-refresh mr-1" />
|
|
||||||
<i v-else class="mdi mdi-24px mdi-history mdi-flip-h mr-1" />
|
|
||||||
<span>{{ $t('word.refresh') }}</span>
|
|
||||||
</button>
|
|
||||||
<div class="btn btn-dark btn-sm dropdown-toggle pl-0 pr-0" tabindex="0">
|
|
||||||
<i class="mdi mdi-24px mdi-menu-down" />
|
|
||||||
</div>
|
|
||||||
<div class="menu px-3">
|
|
||||||
<span>{{ $t('word.autoRefresh') }}: <b>{{ +autorefreshTimer ? `${autorefreshTimer}s` : 'OFF' }}</b></span>
|
|
||||||
<input
|
|
||||||
v-model="autorefreshTimer"
|
|
||||||
class="slider no-border"
|
|
||||||
type="range"
|
|
||||||
min="0"
|
|
||||||
max="15"
|
|
||||||
step="0.5"
|
|
||||||
@change="setRefreshInterval"
|
|
||||||
>
|
>
|
||||||
|
<i v-if="!+autorefreshTimer" class="mdi mdi-24px mdi-refresh mr-1" />
|
||||||
|
<i v-else class="mdi mdi-24px mdi-history mdi-flip-h mr-1" />
|
||||||
|
<span>{{ $t('word.refresh') }}</span>
|
||||||
|
</button>
|
||||||
|
<div class="btn btn-dark btn-sm dropdown-toggle pl-0 pr-0" tabindex="0">
|
||||||
|
<i class="mdi mdi-24px mdi-menu-down" />
|
||||||
|
</div>
|
||||||
|
<div class="menu px-3">
|
||||||
|
<span>{{ $t('word.autoRefresh') }}: <b>{{ +autorefreshTimer ? `${autorefreshTimer}s` : 'OFF' }}</b></span>
|
||||||
|
<input
|
||||||
|
v-model="autorefreshTimer"
|
||||||
|
class="slider no-border"
|
||||||
|
type="range"
|
||||||
|
min="0"
|
||||||
|
max="15"
|
||||||
|
step="0.5"
|
||||||
|
@change="setRefreshInterval"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="dropdown table-dropdown">
|
||||||
|
<button
|
||||||
|
:disabled="isQuering"
|
||||||
|
class="btn btn-dark btn-sm dropdown-toggle d-flex mr-0 pr-0"
|
||||||
|
tabindex="0"
|
||||||
|
>
|
||||||
|
<i class="mdi mdi-24px mdi-file-export mr-1" />
|
||||||
|
<span>{{ $t('word.export') }}</span>
|
||||||
|
<i class="mdi mdi-24px mdi-menu-down" />
|
||||||
|
</button>
|
||||||
|
<ul class="menu text-left">
|
||||||
|
<li class="menu-item">
|
||||||
|
<a class="c-hand" @click="downloadTable('json')">JSON</a>
|
||||||
|
</li>
|
||||||
|
<li class="menu-item">
|
||||||
|
<a class="c-hand" @click="downloadTable('csv')">CSV</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="workspace-query-info">
|
<div class="workspace-query-info">
|
||||||
<div v-if="sortedResults.length">
|
<div v-if="sortedResults.length">
|
||||||
|
@ -113,6 +134,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters, mapActions } from 'vuex';
|
import { mapGetters, mapActions } from 'vuex';
|
||||||
|
import arrayToFile from '../libs/arrayToFile';
|
||||||
import Schema from '@/ipc-api/Schema';
|
import Schema from '@/ipc-api/Schema';
|
||||||
import BaseVirtualScroll from '@/components/BaseVirtualScroll';
|
import BaseVirtualScroll from '@/components/BaseVirtualScroll';
|
||||||
import ModalProcessesListRow from '@/components/ModalProcessesListRow';
|
import ModalProcessesListRow from '@/components/ModalProcessesListRow';
|
||||||
|
@ -303,6 +325,14 @@ export default {
|
||||||
closeModal () {
|
closeModal () {
|
||||||
this.$emit('close');
|
this.$emit('close');
|
||||||
},
|
},
|
||||||
|
downloadTable (format) {
|
||||||
|
if (!this.sortedResults) return;
|
||||||
|
arrayToFile({
|
||||||
|
type: format,
|
||||||
|
content: this.sortedResults,
|
||||||
|
filename: 'processes'
|
||||||
|
});
|
||||||
|
},
|
||||||
onKey (e) {
|
onKey (e) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
if (e.key === 'Escape')
|
if (e.key === 'Escape')
|
||||||
|
|
Loading…
Reference in New Issue