Allow using custom source URLs #421
3 changed files with 15 additions and 4 deletions
|
@ -183,6 +183,12 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
|
||||||
copyInstanceOption('renderMisskeyMarkdown')
|
copyInstanceOption('renderMisskeyMarkdown')
|
||||||
copyInstanceOption('sidebarRight')
|
copyInstanceOption('sidebarRight')
|
||||||
|
|
||||||
|
if (config.backendCommitUrl)
|
||||||
|
copyInstanceOption('backendCommitUrl')
|
||||||
|
|
||||||
|
if (config.frontendCommitUrl)
|
||||||
|
copyInstanceOption('frontendCommitUrl')
|
||||||
|
|
||||||
return store.dispatch('setTheme', config['theme'])
|
return store.dispatch('setTheme', config['theme'])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,25 @@
|
||||||
import { extractCommit } from 'src/services/version/version.service'
|
import { extractCommit } from 'src/services/version/version.service'
|
||||||
|
|
||||||
const pleromaFeCommitUrl = 'https://akkoma.dev/AkkomaGang/pleroma-fe/commit/'
|
function joinURL(base, subpath) {
|
||||||
const pleromaBeCommitUrl = 'https://akkoma.dev/AkkomaGang/akkoma/commit/'
|
return URL.parse(subpath, base)?.href || "invalid base URL"
|
||||||
|
}
|
||||||
|
|
||||||
const VersionTab = {
|
const VersionTab = {
|
||||||
data () {
|
data () {
|
||||||
const instance = this.$store.state.instance
|
const instance = this.$store.state.instance
|
||||||
return {
|
return {
|
||||||
|
backendCommitUrl: instance.backendCommitUrl,
|
||||||
backendVersion: instance.backendVersion,
|
backendVersion: instance.backendVersion,
|
||||||
|
frontendCommitUrl: instance.frontendCommitUrl,
|
||||||
frontendVersion: instance.frontendVersion
|
frontendVersion: instance.frontendVersion
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
frontendVersionLink () {
|
frontendVersionLink () {
|
||||||
return pleromaFeCommitUrl + this.frontendVersion
|
return joinURL(this.frontendCommitUrl, this.frontendVersion)
|
||||||
|
|||||||
},
|
},
|
||||||
backendVersionLink () {
|
backendVersionLink () {
|
||||||
return pleromaBeCommitUrl + extractCommit(this.backendVersion)
|
return joinURL(this.backendCommitUrl, extractCommit(this.backendVersion))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,8 @@ const defaultState = {
|
||||||
conversationOtherRepliesButton: 'below',
|
conversationOtherRepliesButton: 'below',
|
||||||
conversationTreeFadeAncestors: false,
|
conversationTreeFadeAncestors: false,
|
||||||
maxDepthInThread: 6,
|
maxDepthInThread: 6,
|
||||||
|
backendCommitUrl: 'https://akkoma.dev/AkkomaGang/akkoma/commit/',
|
||||||
|
frontendCommitUrl: 'https://akkoma.dev/AkkomaGang/pleroma-fe/commit/',
|
||||||
|
|
||||||
// Nasty stuff
|
// Nasty stuff
|
||||||
customEmoji: [],
|
customEmoji: [],
|
||||||
|
|
Loading…
Reference in a new issue
done with
URL.parse()
which won't throw exceptions itself, and since i wasn’t sure if anull
might lead to exceptions later it gets stubbed out for an invalid config