2026-01-23 00:17:27 +02:00
|
|
|
import { mapState } from 'pinia'
|
2026-01-06 16:23:17 +02:00
|
|
|
import { cacheKey, clearCache, emojiCacheKey } from 'src/services/sw/sw.js'
|
2026-01-23 00:17:27 +02:00
|
|
|
import { useInstanceStore } from 'src/stores/instance.js'
|
2025-11-24 20:05:38 +02:00
|
|
|
import BooleanSetting from '../helpers/boolean_setting.vue'
|
|
|
|
|
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
|
|
|
|
|
2026-01-06 16:22:52 +02:00
|
|
|
const pleromaFeCommitUrl =
|
|
|
|
|
'https://git.pleroma.social/pleroma/pleroma-fe/commit/'
|
2020-05-10 06:46:06 +03:00
|
|
|
|
|
|
|
|
const VersionTab = {
|
2025-11-24 20:05:38 +02:00
|
|
|
components: {
|
2026-01-06 16:22:52 +02:00
|
|
|
BooleanSetting,
|
2025-11-24 20:05:38 +02:00
|
|
|
},
|
2020-05-10 06:46:06 +03:00
|
|
|
computed: {
|
2026-01-06 16:22:52 +02:00
|
|
|
frontendVersionLink() {
|
2020-05-10 06:46:06 +03:00
|
|
|
return pleromaFeCommitUrl + this.frontendVersion
|
2025-11-24 20:05:38 +02:00
|
|
|
},
|
|
|
|
|
...SharedComputedObject(),
|
2026-01-23 00:17:27 +02:00
|
|
|
...mapState(useInstanceStore, [
|
|
|
|
|
'backendVersion',
|
|
|
|
|
'backendRepository',
|
|
|
|
|
'frontendVersion',
|
|
|
|
|
])
|
2025-11-25 19:35:52 +02:00
|
|
|
},
|
|
|
|
|
methods: {
|
2026-01-06 16:22:52 +02:00
|
|
|
clearAssetCache() {
|
2025-11-25 19:35:52 +02:00
|
|
|
this.clearCache(cacheKey)
|
|
|
|
|
},
|
2026-01-06 16:22:52 +02:00
|
|
|
clearEmojiCache() {
|
2025-11-25 19:35:52 +02:00
|
|
|
this.clearCache(emojiCacheKey)
|
|
|
|
|
},
|
2026-01-06 16:22:52 +02:00
|
|
|
clearCache(key) {
|
2025-11-25 19:35:52 +02:00
|
|
|
clearCache(key)
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.$store.dispatch('settingsSaved', { success: true })
|
|
|
|
|
})
|
2026-01-06 16:22:52 +02:00
|
|
|
.catch((error) => {
|
2025-11-25 19:35:52 +02:00
|
|
|
this.$store.dispatch('settingsSaved', { error })
|
|
|
|
|
})
|
2026-01-06 16:22:52 +02:00
|
|
|
},
|
|
|
|
|
},
|
2020-05-10 06:46:06 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default VersionTab
|