mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-17 15:29:38 +00:00
perf: Optimize file audit download prompt
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
<script>
|
||||
import GenericListPage from '@/layout/components/GenericListPage'
|
||||
import { download } from '@/utils/common'
|
||||
import store from '@/store'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -36,7 +37,24 @@ export default {
|
||||
return row.has_file
|
||||
},
|
||||
tip: ({ row }) => {
|
||||
return row.has_file ? this.$t('Download') : this.$t('DownloadFTPFileTip')
|
||||
const ftpFileMaxStore = store.getters.publicSettings['FTP_FILE_MAX_STORE']
|
||||
|
||||
const downloadTip = this.$t('Download')
|
||||
const fileNotStoredTip = this.$t('FTPFileNotStored')
|
||||
const storageNotEnabledTip = this.$t('FTPStorageNotEnabled')
|
||||
const unknownStorageStateTip = this.$t('FTPUnknownStorageState')
|
||||
|
||||
if (row.has_file) {
|
||||
return downloadTip
|
||||
}
|
||||
|
||||
if (ftpFileMaxStore === 0) {
|
||||
return storageNotEnabledTip
|
||||
} else if (ftpFileMaxStore > 0) {
|
||||
return fileNotStoredTip
|
||||
} else {
|
||||
return unknownStorageStateTip
|
||||
}
|
||||
},
|
||||
callback: function({ row }) {
|
||||
// 跳转下载页面
|
||||
|
||||
Reference in New Issue
Block a user