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 }) => {
|
const getNodeInfo = async ({ store }) => {
|
||||||
try {
|
try {
|
||||||
const res = await preloadFetch('/nodeinfo/2.0.json')
|
const res = await preloadFetch('/nodeinfo/2.1.json')
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
const data = await res.json()
|
const data = await res.json()
|
||||||
const metadata = data.metadata
|
const metadata = data.metadata
|
||||||
|
@ -277,6 +277,7 @@ const getNodeInfo = async ({ store }) => {
|
||||||
|
|
||||||
const software = data.software
|
const software = data.software
|
||||||
store.dispatch('setInstanceOption', { name: 'backendVersion', value: software.version })
|
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' })
|
store.dispatch('setInstanceOption', { name: 'pleromaBackend', value: software.name === 'pleroma' })
|
||||||
|
|
||||||
const priv = metadata.private
|
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 pleromaFeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma-fe/commit/'
|
||||||
const pleromaBeCommitUrl = 'https://git.pleroma.social/pleroma/pleroma/commit/'
|
|
||||||
|
|
||||||
const VersionTab = {
|
const VersionTab = {
|
||||||
data () {
|
data () {
|
||||||
const instance = this.$store.state.instance
|
const instance = this.$store.state.instance
|
||||||
return {
|
return {
|
||||||
backendVersion: instance.backendVersion,
|
backendVersion: instance.backendVersion,
|
||||||
|
backendRepository: instance.backendRepository,
|
||||||
frontendVersion: instance.frontendVersion
|
frontendVersion: instance.frontendVersion
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
frontendVersionLink () {
|
frontendVersionLink () {
|
||||||
return pleromaFeCommitUrl + this.frontendVersion
|
return pleromaFeCommitUrl + this.frontendVersion
|
||||||
},
|
|
||||||
backendVersionLink () {
|
|
||||||
return pleromaBeCommitUrl + extractCommit(this.backendVersion)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<ul class="option-list">
|
<ul class="option-list">
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
:href="backendVersionLink"
|
:href="backendRepository"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
>{{ backendVersion }}</a>
|
>{{ backendVersion }}</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -141,6 +141,7 @@ const defaultState = {
|
||||||
|
|
||||||
// Version Information
|
// Version Information
|
||||||
backendVersion: '',
|
backendVersion: '',
|
||||||
|
backendRepository: '',
|
||||||
frontendVersion: '',
|
frontendVersion: '',
|
||||||
|
|
||||||
pollsAvailable: false,
|
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