mirror of https://github.com/nocodb/nocodb
Wing-Kam Wong
2 years ago
3 changed files with 67 additions and 47 deletions
@ -0,0 +1,22 @@
|
||||
<script setup lang="ts"> |
||||
import { message } from 'ant-design-vue' |
||||
const { api } = useApi() |
||||
|
||||
async function deleteCache() { |
||||
try { |
||||
await api.utils.cacheDelete() |
||||
message.info('Deleted Cache Successfully') |
||||
} catch (e: any) { |
||||
message.error(e.message) |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<template> |
||||
<a-tooltip> |
||||
<template #title> |
||||
<span> Delete Cache </span> |
||||
</template> |
||||
<mdi-delete class="cursor-pointer mx-3" @click="deleteCache" /> |
||||
</a-tooltip> |
||||
</template> |
@ -0,0 +1,33 @@
|
||||
<script setup lang="ts"> |
||||
import { message } from 'ant-design-vue' |
||||
import FileSaver from 'file-saver' |
||||
|
||||
const { api } = useApi() |
||||
|
||||
async function exportCache() { |
||||
try { |
||||
const data = await api.utils.cacheGet() |
||||
if (!data) { |
||||
message.info('Cache is empty') |
||||
return |
||||
} |
||||
const blob = new Blob([JSON.stringify(data)], { |
||||
type: 'text/plain;charset=utf-8', |
||||
}) |
||||
FileSaver.saveAs(blob, 'cache_exported.json') |
||||
message.info('Exported Cache Successfully') |
||||
} catch (e: any) { |
||||
message.error(e.message) |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<template> |
||||
<!-- Export Cache --> |
||||
<a-tooltip> |
||||
<template #title> |
||||
<span> Export Cache </span> |
||||
</template> |
||||
<mdi-export class="cursor-pointer mx-3" @click="exportCache" /> |
||||
</a-tooltip> |
||||
</template> |
Loading…
Reference in new issue