mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-18 08:12:15 +00:00
ability to download log from admin
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<div class="mb-8 flex items-center">
|
||||
<edit-2-icon v-if="!icon" size="22" class="vue-feather text-theme dark-text-theme mr-3" />
|
||||
<frown-icon v-if="icon === 'frown'" size="22" class="vue-feather text-theme dark-text-theme mr-3" />
|
||||
<list-icon v-if="icon === 'list'" size="22" class="vue-feather text-theme dark-text-theme mr-3" />
|
||||
<info-icon v-if="icon === 'info'" size="22" class="vue-feather text-theme dark-text-theme mr-3" />
|
||||
<database-icon v-if="icon === 'database'" size="22" class="vue-feather text-theme dark-text-theme mr-3" />
|
||||
<file-text-icon v-if="icon === 'file-text'" size="22" class="vue-feather text-theme dark-text-theme mr-3" />
|
||||
@@ -24,6 +25,7 @@
|
||||
|
||||
<script>
|
||||
import {
|
||||
ListIcon,
|
||||
MailIcon,
|
||||
InfoIcon,
|
||||
DatabaseIcon,
|
||||
@@ -46,6 +48,7 @@ export default {
|
||||
name: 'FormLabel',
|
||||
props: ['icon'],
|
||||
components: {
|
||||
ListIcon,
|
||||
MailIcon,
|
||||
InfoIcon,
|
||||
DatabaseIcon,
|
||||
|
||||
@@ -28,6 +28,31 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--Logs-->
|
||||
<div class="card shadow-card">
|
||||
<FormLabel icon="list">Latest Server Logs</FormLabel>
|
||||
|
||||
<InfoBox v-if="!logs.length" class="!mb-0">
|
||||
<p v-html="$t('There is not any server log.')"></p>
|
||||
</InfoBox>
|
||||
|
||||
<div
|
||||
v-if="logs.length"
|
||||
v-for="(log, i) in logs"
|
||||
:key="i"
|
||||
class="md:flex md:space-y-0 space-y-3 items-center justify-between border-b border-dashed border-light py-3 dark:border-opacity-5"
|
||||
>
|
||||
<div class="text-left">
|
||||
<b class="block text-sm font-bold">
|
||||
{{ log }}
|
||||
</b>
|
||||
</div>
|
||||
<div @click="downloadLog(log)" class="flex h-8 w-8 items-center justify-center rounded-md bg-light-background transition-colors hover:bg-green-100 dark:bg-2x-dark-foreground cursor-pointer">
|
||||
<DownloadCloudIcon size="15" class="opacity-75" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--Database Backups check-->
|
||||
<div class="card shadow-card">
|
||||
<FormLabel icon="database"> Latest Database Backups </FormLabel>
|
||||
@@ -150,10 +175,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import InfoBox from '../../../../components/Others/Forms/InfoBox'
|
||||
import { CheckIcon, XIcon, DownloadCloudIcon } from 'vue-feather-icons'
|
||||
import FormLabel from '../../../../components/Others/Forms/FormLabel'
|
||||
import PageTab from '../../../../components/Others/Layout/PageTab'
|
||||
import { CheckIcon, XIcon } from 'vue-feather-icons'
|
||||
import InfoBox from '../../../../components/Others/Forms/InfoBox'
|
||||
import { mapGetters } from 'vuex'
|
||||
import axios from 'axios'
|
||||
|
||||
@@ -163,6 +188,7 @@ export default {
|
||||
FormLabel,
|
||||
InfoBox,
|
||||
PageTab,
|
||||
DownloadCloudIcon,
|
||||
CheckIcon,
|
||||
XIcon,
|
||||
},
|
||||
@@ -181,8 +207,22 @@ export default {
|
||||
phpVersion: undefined,
|
||||
apiRunning: undefined,
|
||||
backups: undefined,
|
||||
logs: undefined,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
downloadLog(log) {
|
||||
|
||||
let anchor = document.createElement('a')
|
||||
|
||||
anchor.href = `/admin/log/${log}`
|
||||
anchor.download = log
|
||||
|
||||
document.body.appendChild(anchor)
|
||||
|
||||
anchor.click()
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// Get status
|
||||
axios.get('/api/admin/status').then((response) => {
|
||||
@@ -192,6 +232,7 @@ export default {
|
||||
this.modules = response.data.modules
|
||||
this.phpVersion = response.data.php_version
|
||||
this.backups = response.data.backups
|
||||
this.logs = response.data.logs
|
||||
})
|
||||
|
||||
// Ping API
|
||||
|
||||
Reference in New Issue
Block a user