This commit is contained in:
2020-05-22 18:10:04 +00:00
parent 5ae14aa7d3
commit 800571e7c1
3 changed files with 40 additions and 14 deletions

View File

@@ -4,7 +4,6 @@ PRIORITY - ALWAYS Lowest level stuff first, i.e. TODO at server, api route chang
=-=-=-=-
todo: OPS routes CLIENT UI
- Backup, restore https://rockfish.ayanova.com/default.htm#!/rfcaseEdit/3369

View File

@@ -267,7 +267,7 @@ export default {
//http://localhost:7575/api/v8/backup/download/100?t=sssss
let url =
"attachment/download/" +
"backup/download/" +
fileName +
"?t=" +
window.$gz.store.state.downloadToken;

View File

@@ -4,14 +4,38 @@
<v-form ref="form">
<v-row>
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
<v-col cols="12" sm="6" lg="4" xl="3">
<div>
<v-col cols="12">
<v-col cols="12" lg="4">
backup files
<v-simple-table dense>
<template v-slot:default>
<thead>
<tr>
<th class="text-left">name</th>
<th class="text-left">date</th>
<th class="text-left">size</th>
</tr>
</thead>
<tbody>
<tr v-for="item in backupFileList" :key="item.id">
<td>
<a :href="item.url">{{ item.name }}</a>
</td>
<td>{{ item.created }}</td>
<td>{{ item.length }}</td>
</tr>
</tbody>
</template>
</v-simple-table>
</v-col>
<!-- <div>
<ul>
<li v-for="item in backupFileList" :key="item.id">
<a :href="item.url" target="_blank">{{ item.name }}</a>
<a :href="item.url">{{ item }}</a>
</li>
</ul>
</div>
</div> -->
<!-- <div>
<v-list color="grey lighten-5" three-line>
<v-list-item
@@ -89,7 +113,7 @@ export default {
vm.formState.ready = true;
window.$gz.eventBus.$on("menu-click", clickHandler);
vm.getDataFromApi();
vm.getBackupFileList();
vm.getBackupStatus();
})
.catch(err => {
vm.formState.ready = true;
@@ -117,6 +141,7 @@ export default {
return {
formCustomTemplateKey: null,
backupFileList: [],
backupAvailableSpace: null,
obj: {
/*{
"id": 0,
@@ -182,10 +207,10 @@ export default {
window.$gz.form.fieldValueChanged(this, ref);
}
},
getBackupFileList() {
getBackupStatus() {
let vm = this;
vm.formState.loading = true;
let url = "backup/list";
let url = "backup/status";
window.$gz.api
.get(url)
.then(res => {
@@ -204,14 +229,16 @@ export default {
} else {
//process add url dl token and id
if (res.data) {
vm.backupAvailableSpace = res.data.availableFreeSpace;
let ret = [];
for (let i = 0; i < res.data.length; i++) {
let o = res.data[i];
for (let i = 0; i < res.data.backupFiles.length; i++) {
let o = res.data.backupFiles[i];
ret.push({
id: i,
concurrency: o.concurrency,
url: window.$gz.api.backupDownloadUrl(o),
name: o
created: o.created,
url: window.$gz.api.backupDownloadUrl(o.name),
name: o.name,
length: o.length
});
}
vm.backupFileList = ret;