2022-07-09 05:27:02 +02:00
|
|
|
<template>
|
|
|
|
<modals-modal v-model="show" name="changelog" :width="800" :height="'unset'">
|
|
|
|
<template #outer>
|
|
|
|
<div class="absolute top-0 left-0 p-5 w-2/3 overflow-hidden">
|
2023-02-11 22:02:56 +01:00
|
|
|
<p class="text-3xl text-white truncate">Changelog</p>
|
2022-07-09 05:27:02 +02:00
|
|
|
</div>
|
|
|
|
</template>
|
2022-07-10 00:27:30 +02:00
|
|
|
<div class="px-8 py-6 w-full rounded-lg bg-bg shadow-lg border border-black-300 relative overflow-y-scroll" style="max-height: 80vh">
|
2024-07-06 23:28:36 +02:00
|
|
|
<p class="text-xl font-bold pb-4">
|
|
|
|
Changelog <a :href="currentTagUrl" target="_blank" class="hover:underline">v{{ currentVersionNumber }}</a> ({{ currentVersionPubDate }})
|
|
|
|
</p>
|
2022-07-09 05:27:02 +02:00
|
|
|
<div class="custom-text" v-html="compiledMarkedown" />
|
|
|
|
</div>
|
|
|
|
</modals-modal>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-07-10 00:27:30 +02:00
|
|
|
import { marked } from '@/static/libs/marked/index.js'
|
|
|
|
|
2022-07-09 05:27:02 +02:00
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
value: Boolean,
|
2024-07-06 23:28:36 +02:00
|
|
|
versionData: {
|
|
|
|
type: Object,
|
|
|
|
default: () => {}
|
2022-07-09 05:27:02 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
show: {
|
|
|
|
get() {
|
|
|
|
return this.value
|
|
|
|
},
|
|
|
|
set(val) {
|
|
|
|
this.$emit('input', val)
|
|
|
|
}
|
|
|
|
},
|
2024-07-06 23:28:36 +02:00
|
|
|
dateFormat() {
|
|
|
|
return this.$store.state.serverSettings.dateFormat
|
|
|
|
},
|
|
|
|
changelog() {
|
|
|
|
return this.versionData?.currentVersionChangelog || 'No Changelog Available'
|
|
|
|
},
|
2022-07-09 05:27:02 +02:00
|
|
|
compiledMarkedown() {
|
2022-07-10 00:27:30 +02:00
|
|
|
return marked.parse(this.changelog, { gfm: true, breaks: true })
|
2022-07-09 05:27:02 +02:00
|
|
|
},
|
2024-07-06 18:21:06 +02:00
|
|
|
currentVersionPubDate() {
|
2024-07-06 23:28:36 +02:00
|
|
|
if (!this.versionData?.currentVersionPubDate) return 'Unknown release date'
|
|
|
|
return `${this.$formatDate(this.versionData.currentVersionPubDate, this.dateFormat)}`
|
|
|
|
},
|
|
|
|
currentTagUrl() {
|
|
|
|
return this.versionData?.currentTagUrl
|
2024-07-06 18:21:06 +02:00
|
|
|
},
|
2022-07-09 05:27:02 +02:00
|
|
|
currentVersionNumber() {
|
2024-07-06 23:28:36 +02:00
|
|
|
return this.$config.version
|
2022-07-09 05:27:02 +02:00
|
|
|
}
|
|
|
|
},
|
2024-07-06 23:28:36 +02:00
|
|
|
methods: {},
|
2022-07-09 05:27:02 +02:00
|
|
|
mounted() {}
|
|
|
|
}
|
|
|
|
</script>
|
2022-07-10 00:27:30 +02:00
|
|
|
|
2022-07-09 05:27:02 +02:00
|
|
|
<style scoped>
|
2022-07-09 05:45:09 +02:00
|
|
|
/*
|
|
|
|
1. we need to manually define styles to apply to the parsed markdown elements,
|
2024-07-06 18:21:06 +02:00
|
|
|
since we don't have access to the actual elements in this component
|
2022-07-09 05:45:09 +02:00
|
|
|
|
|
|
|
2. v-deep allows these to take effect on the content passed in to the v-html in the div above
|
|
|
|
*/
|
2022-07-09 05:34:32 +02:00
|
|
|
.custom-text ::v-deep > h2 {
|
2022-07-10 00:27:30 +02:00
|
|
|
@apply text-lg font-bold;
|
2022-07-09 05:34:32 +02:00
|
|
|
}
|
2022-07-09 05:27:02 +02:00
|
|
|
.custom-text ::v-deep > h3 {
|
2022-07-10 00:27:30 +02:00
|
|
|
@apply text-lg font-bold;
|
2022-07-09 05:27:02 +02:00
|
|
|
}
|
|
|
|
.custom-text ::v-deep > ul {
|
2022-07-10 00:27:30 +02:00
|
|
|
@apply list-disc list-inside pb-4;
|
2022-07-09 05:27:02 +02:00
|
|
|
}
|
2024-07-06 18:21:06 +02:00
|
|
|
</style>
|