Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Optimize file audit download prompt #4378

Merged
merged 1 commit into from
Sep 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/views/sessions/FTPLogList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<script>
import GenericListPage from '@/layout/components/GenericListPage'
import { download } from '@/utils/common'
import store from '@/store'

export default {
components: {
Expand Down Expand Up @@ -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 }) {
// 跳转下载页面
Expand Down