forked from srxl/akkoma-fe
Version links to BE/FE
This commit is contained in:
parent
068c9724e4
commit
8952761370
3 changed files with 15 additions and 18 deletions
|
@ -4,7 +4,10 @@ import { filter, trim } from 'lodash'
|
||||||
import TabSwitcher from '../tab_switcher/tab_switcher.js'
|
import TabSwitcher from '../tab_switcher/tab_switcher.js'
|
||||||
import StyleSwitcher from '../style_switcher/style_switcher.vue'
|
import StyleSwitcher from '../style_switcher/style_switcher.vue'
|
||||||
import InterfaceLanguageSwitcher from '../interface_language_switcher/interface_language_switcher.vue'
|
import InterfaceLanguageSwitcher from '../interface_language_switcher/interface_language_switcher.vue'
|
||||||
import { parseBackendVersionString, parseFrontendVersionString } from '../../services/version/version.service'
|
import { extractCommit } from '../../services/version/version.service'
|
||||||
|
|
||||||
|
const pleromaFeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma-fe/commit/'
|
||||||
|
const pleromaBeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma/commit/'
|
||||||
|
|
||||||
const settings = {
|
const settings = {
|
||||||
data () {
|
data () {
|
||||||
|
@ -101,14 +104,12 @@ const settings = {
|
||||||
postFormats () {
|
postFormats () {
|
||||||
return this.$store.state.instance.postFormats || []
|
return this.$store.state.instance.postFormats || []
|
||||||
},
|
},
|
||||||
instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel }
|
instanceSpecificPanelPresent () { return this.$store.state.instance.showInstanceSpecificPanel },
|
||||||
|
frontendVersionLink () {
|
||||||
|
return pleromaFeCommitUrl + this.$store.state.instance.frontendVersion
|
||||||
},
|
},
|
||||||
methods: {
|
backendVersionLink () {
|
||||||
parseBackendVersion (versionString) {
|
return pleromaBeCommitUrl + extractCommit(this.$store.state.instance.backendVersion)
|
||||||
return parseBackendVersionString(versionString)
|
|
||||||
},
|
|
||||||
parseFrontendVersion (versionString) {
|
|
||||||
return parseFrontendVersionString(versionString)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
|
@ -268,7 +268,7 @@
|
||||||
<p>{{$t('settings.version.backend_version')}}</p>
|
<p>{{$t('settings.version.backend_version')}}</p>
|
||||||
<ul class="option-list">
|
<ul class="option-list">
|
||||||
<li>
|
<li>
|
||||||
<div v-html="parseBackendVersion(backendVersion)"></div>
|
<a :href="backendVersionLink" target="_blank">{{backendVersion}}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
@ -276,7 +276,7 @@
|
||||||
<p>{{$t('settings.version.frontend_version')}}</p>
|
<p>{{$t('settings.version.frontend_version')}}</p>
|
||||||
<ul class="option-list">
|
<ul class="option-list">
|
||||||
<li>
|
<li>
|
||||||
<div v-html="parseFrontendVersion(frontendVersion)"></div>
|
<a :href="frontendVersionLink" target="_blank">{{frontendVersion}}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
|
|
||||||
export const parseBackendVersionString = versionString => {
|
export const extractCommit = versionString => {
|
||||||
const regex = /(-g)(\w+)$/i
|
const regex = /-g(\w+)$/i
|
||||||
const replacer = '$1<a href="https://git.pleroma.social/pleroma/pleroma/commit/$2" target="_blank">$2</a>'
|
const matches = versionString.match(regex)
|
||||||
return versionString.replace(regex, replacer)
|
return matches ? matches[1] : ''
|
||||||
}
|
|
||||||
|
|
||||||
export const parseFrontendVersionString = versionString => {
|
|
||||||
return `<a href="https://git.pleroma.social/pleroma/pleroma-fe/commit/${versionString}" target="_blank">#${versionString}</a>`
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue