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

feat(settings): clear history data include all messages #1409

Merged
merged 1 commit into from
Sep 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/components/ClearUpHistoryData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@ export default class ClearUpHistoryData extends Vue {
}

private async cleanHistoryData() {
const { connectionService, historyMessageHeaderService, historyMessagePayloadService } = useServices()
await connectionService.cleanLeatest()
await historyMessageHeaderService.clean()
await historyMessagePayloadService.clean()
const { connectionService, historyMessageHeaderService, historyMessagePayloadService, messageService } =
useServices()

await Promise.all([
connectionService.cleanLeatest(),
historyMessageHeaderService.clean(),
historyMessagePayloadService.clean(),
messageService.cleanAll(),
])

this.$message.success(this.$tc('connections.cleanHistorySuccess'))
this.$log.info('Clear history successfully')
this.resetData()
Expand Down
4 changes: 4 additions & 0 deletions src/database/services/MessageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,8 @@ export default class MessageService {
.where('connectionId = :connectionId', { connectionId })
.execute()
}

public async cleanAll(): Promise<void> {
await this.messageRepository.clear()
}
}
10 changes: 5 additions & 5 deletions src/lang/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ export default {
hu: 'Újracsatlakozáskor az előfizetési lista automatikusan újra feliratkozik',
},
cleanHistoryDialogMessage: {
zh: '将会清除历史建议信息,包括历史 Payload/QoS/Retain/Topic/Connection 数据',
en: 'It will clear the historical suggestion information, including historical Payload/QoS/Retain/Topic/Connection',
tr: 'Geçmiş Yük/QoS/Saklama/Konu/Bağlantı dahil olmak üzere geçmiş öneri bilgilerini temizleyecektir.',
ja: 'ペイロード/ QoS /保持/トピック/接続を含む過去の提案情報をクリアします',
hu: 'It will clear the historical suggestion information, including historical Payload/QoS/Retain/Topic/Connection',
zh: '即将删除所有连接中的历史消息记录、发送端记录的发布消息、主题、保留标志及历史连接配置。确定吗?',
en: 'This will delete all historical message records in connections, messages published by the sender, topics, retain flags, and past connection configurations. Confirm?',
tr: 'Bağlantılardaki tüm geçmiş mesaj kayıtlarını, gönderen tarafından yayınlanan mesajları, konuları, saklama bayraklarını ve geçmiş bağlantı yapılandırmalarını silmek üzeresiniz. Onaylıyor musunuz?',
ja: '接続内のすべての過去のメッセージ記録、送信者によって公開されたメッセージ、トピック、保持フラグ、および過去の接続設定を削除しようとしています。確認してください。',
hu: 'Az összes kapcsolatban lévő történelmi üzenetnyilvántartást, az elküldő által közzétett üzeneteket, témákat, megőrzési jelzéseket és a korábbi kapcsolatkonfigurációkat készül törölni. Megerősíti?',
},
syncOsTheme: {
zh: '同步操作系统主题',
Expand Down