aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShpuld Shpludson <shp@cock.li>2019-03-21 15:25:59 +0000
committerShpuld Shpludson <shp@cock.li>2019-03-21 15:25:59 +0000
commit57cd6f8018b87e427812ec0c460ef490c604c862 (patch)
tree04976d7807921677c9ee88b8be7a53a89312ad10 /src
parent0659d2fd3a8dca5ff93f1b23be289ef063b2e5ca (diff)
parent3c5c09c74fa80994635a6c8055c2f81c81f27318 (diff)
Merge branch 'feature/version-info' into 'develop'
Added new tab to display versions of BE/FE Closes #397 See merge request pleroma/pleroma-fe!671
Diffstat (limited to 'src')
-rw-r--r--src/boot/after_store.js6
-rw-r--r--src/components/settings/settings.js20
-rw-r--r--src/components/settings/settings.vue22
-rw-r--r--src/i18n/en.json5
-rw-r--r--src/modules/instance.js6
-rw-r--r--src/services/version/version.service.js6
6 files changed, 61 insertions, 4 deletions
diff --git a/src/boot/after_store.js b/src/boot/after_store.js
index 0a4ec857..a5f8c978 100644
--- a/src/boot/after_store.js
+++ b/src/boot/after_store.js
@@ -203,6 +203,12 @@ const getNodeInfo = async ({ store }) => {
const suggestions = metadata.suggestions
store.dispatch('setInstanceOption', { name: 'suggestionsEnabled', value: suggestions.enabled })
store.dispatch('setInstanceOption', { name: 'suggestionsWeb', value: suggestions.web })
+
+ const software = data.software
+ store.dispatch('setInstanceOption', { name: 'backendVersion', value: software.version })
+
+ const frontendVersion = window.___pleromafe_commit_hash
+ store.dispatch('setInstanceOption', { name: 'frontendVersion', value: frontendVersion })
} else {
throw (res)
}
diff --git a/src/components/settings/settings.js b/src/components/settings/settings.js
index 979457a5..b77c5197 100644
--- a/src/components/settings/settings.js
+++ b/src/components/settings/settings.js
@@ -1,8 +1,13 @@
/* eslint-env browser */
+import { filter, trim } from 'lodash'
+
import TabSwitcher from '../tab_switcher/tab_switcher.js'
import StyleSwitcher from '../style_switcher/style_switcher.vue'
import InterfaceLanguageSwitcher from '../interface_language_switcher/interface_language_switcher.vue'
-import { filter, trim } from 'lodash'
+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 = {
data () {
@@ -78,7 +83,10 @@ const settings = {
// Future spec, still not supported in Nightly 63 as of 08/2018
Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'audioTracks'),
playVideosInModal: user.playVideosInModal,
- useContainFit: user.useContainFit
+ useContainFit: user.useContainFit,
+
+ backendVersion: instance.backendVersion,
+ frontendVersion: instance.frontendVersion
}
},
components: {
@@ -96,7 +104,13 @@ const settings = {
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.frontendVersion
+ },
+ backendVersionLink () {
+ return pleromaBeCommitUrl + extractCommit(this.backendVersion)
+ }
},
watch: {
hideAttachmentsLocal (value) {
diff --git a/src/components/settings/settings.vue b/src/components/settings/settings.vue
index d2346747..17f1f1a1 100644
--- a/src/components/settings/settings.vue
+++ b/src/components/settings/settings.vue
@@ -261,6 +261,28 @@
</div>
</div>
</div>
+ <div :label="$t('settings.version.title')" >
+ <div class="setting-item">
+ <ul class="setting-list">
+ <li>
+ <p>{{$t('settings.version.backend_version')}}</p>
+ <ul class="option-list">
+ <li>
+ <a :href="backendVersionLink" target="_blank">{{backendVersion}}</a>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <p>{{$t('settings.version.frontend_version')}}</p>
+ <ul class="option-list">
+ <li>
+ <a :href="frontendVersionLink" target="_blank">{{frontendVersion}}</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+ </div>
</tab-switcher>
</keep-alive>
</div>
diff --git a/src/i18n/en.json b/src/i18n/en.json
index 01fe2fba..1fe201a4 100644
--- a/src/i18n/en.json
+++ b/src/i18n/en.json
@@ -347,6 +347,11 @@
"checkbox": "I have skimmed over terms and conditions",
"link": "a nice lil' link"
}
+ },
+ "version": {
+ "title": "Version",
+ "backend_version": "Backend Version",
+ "frontend_version": "Frontend Version"
}
},
"timeline": {
diff --git a/src/modules/instance.js b/src/modules/instance.js
index 24c52f9c..155aa2eb 100644
--- a/src/modules/instance.js
+++ b/src/modules/instance.js
@@ -48,7 +48,11 @@ const defaultState = {
// Html stuff
instanceSpecificPanelContent: '',
- tos: ''
+ tos: '',
+
+ // Version Information
+ backendVersion: '',
+ frontendVersion: ''
}
const instance = {
diff --git a/src/services/version/version.service.js b/src/services/version/version.service.js
new file mode 100644
index 00000000..a750b0dd
--- /dev/null
+++ b/src/services/version/version.service.js
@@ -0,0 +1,6 @@
+
+export const extractCommit = versionString => {
+ const regex = /-g(\w+)$/i
+ const matches = versionString.match(regex)
+ return matches ? matches[1] : ''
+}