Compare commits
1 Commits
develop
...
backend-re
Author | SHA1 | Date |
---|---|---|
Haelwenn (lanodan) Monnier | 84cab03a1d |
|
@ -242,7 +242,7 @@ const resolveStaffAccounts = ({ store, accounts }) => {
|
|||
|
||||
const getNodeInfo = async ({ store }) => {
|
||||
try {
|
||||
const res = await preloadFetch('/nodeinfo/2.0.json')
|
||||
const res = await preloadFetch('/nodeinfo/2.1.json')
|
||||
if (res.ok) {
|
||||
const data = await res.json()
|
||||
const metadata = data.metadata
|
||||
|
@ -277,6 +277,7 @@ const getNodeInfo = async ({ store }) => {
|
|||
|
||||
const software = data.software
|
||||
store.dispatch('setInstanceOption', { name: 'backendVersion', value: software.version })
|
||||
store.dispatch('setInstanceOption', { name: 'backendRepository', value: software.repository })
|
||||
store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: software.name === 'pleroma' })
|
||||
|
||||
const priv = metadata.private
|
||||
|
|
|
@ -1,22 +1,17 @@
|
|||
import { extractCommit } from 'src/services/version/version.service'
|
||||
|
||||
const pleromaFeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma-fe/commit/'
|
||||
const pleromaBeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma/commit/'
|
||||
|
||||
const VersionTab = {
|
||||
data () {
|
||||
const instance = this.$store.state.instance
|
||||
return {
|
||||
backendVersion: instance.backendVersion,
|
||||
backendRepository: instance.backendRepository,
|
||||
frontendVersion: instance.frontendVersion
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
frontendVersionLink () {
|
||||
return pleromaFeCommitUrl + this.frontendVersion
|
||||
},
|
||||
backendVersionLink () {
|
||||
return pleromaBeCommitUrl + extractCommit(this.backendVersion)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<ul class="option-list">
|
||||
<li>
|
||||
<a
|
||||
:href="backendVersionLink"
|
||||
:href="backendRepository"
|
||||
target="_blank"
|
||||
>{{ backendVersion }}</a>
|
||||
</li>
|
||||
|
|
|
@ -141,6 +141,7 @@ const defaultState = {
|
|||
|
||||
// Version Information
|
||||
backendVersion: '',
|
||||
backendRepository: '',
|
||||
frontendVersion: '',
|
||||
|
||||
pollsAvailable: false,
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
|
||||
export const extractCommit = versionString => {
|
||||
const regex = /-g(\w+)/i
|
||||
const matches = versionString.match(regex)
|
||||
return matches ? matches[1] : ''
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
import { extractCommit } from 'src/services/version/version.service.js'
|
||||
|
||||
describe('extractCommit', () => {
|
||||
it('return short commit hash following "-g" characters', () => {
|
||||
expect(extractCommit('1.0.0-45-g5e7aeebc')).to.eql('5e7aeebc')
|
||||
})
|
||||
|
||||
it('return short commit hash without branch name', () => {
|
||||
expect(extractCommit('1.0.0-45-g5e7aeebc-branch')).to.eql('5e7aeebc')
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue