Former-commit-id: 5624723eeb939734902eeaa6c2f132c4beffa911 [formerly a83456d3eda5175e2941b2deeb58b5da323ff678] [formerly a6b3ac7942dbf48d7d9b3f8db5e5041a93143f19 [formerly 4d6b54c63ee21bd01854188b2ad82115948ff7fe]] Former-commit-id: d03621c16b2c892701d678361b6c0a7d5dbec620 [formerly d818b6751e035f283e1c8390d7993a33a459a7dd] Former-commit-id: 3539ee68532135467daa2cc175482769b1efb592
48 lines
1.2 KiB
Vue
48 lines
1.2 KiB
Vue
<template>
|
|
<div class="card floating" id="download">
|
|
<div class="card-title">
|
|
<h2>{{ $t('prompts.download') }}</h2>
|
|
</div>
|
|
|
|
<div class="card-content">
|
|
<p>{{ $t('prompts.downloadMessage') }}</p>
|
|
|
|
<button class="block cancel" @click="download('zip')" autofocus>zip</button>
|
|
<button class="block cancel" @click="download('tar')" autofocus>tar</button>
|
|
<button class="block cancel" @click="download('targz')" autofocus>tar.gz</button>
|
|
<button class="block cancel" @click="download('tarbz2')" autofocus>tar.bz2</button>
|
|
<button class="block cancel" @click="download('tarxz')" autofocus>tar.xz</button>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import {mapGetters, mapState} from 'vuex'
|
|
import * as api from '@/utils/api'
|
|
|
|
export default {
|
|
name: 'download',
|
|
computed: {
|
|
...mapState(['selected', 'req']),
|
|
...mapGetters(['selectedCount'])
|
|
},
|
|
methods: {
|
|
download: function (format) {
|
|
if (this.selectedCount === 0) {
|
|
api.download(format, this.$route.path)
|
|
} else {
|
|
let files = []
|
|
|
|
for (let i of this.selected) {
|
|
files.push(this.req.items[i].url)
|
|
}
|
|
|
|
api.download(format, ...files)
|
|
}
|
|
|
|
this.$store.commit('closeHovers')
|
|
}
|
|
}
|
|
}
|
|
</script>
|