Commit 47529b46 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

produce warning if frontend version does not match backend version

parent e8ea2c2e
{
"name": "Fractalis",
"name": "fractalis",
"description": "The front-end component of the Fractalis visual analytics project.",
"version": "0.1.0",
"version": "0.1.2",
"author": "Sascha Herzinger <sascha.herzinger@uni.lu>",
"license": "Apache-2.0",
"bugs": {
"url": "https://git-r3lab.uni.lu/sascha.herzinger/fractal.js",
"url": "https://git-r3lab.uni.lu/Fractalis/fractal.js/issues",
"email": "sascha.herzinger@uni.lu"
},
"repository": {
"type": "git",
"url": "https://git-r3lab.uni.lu/sascha.herzinger/fractal.js"
"url": "https://git-r3lab.uni.lu/Fractalis/fractal.js"
},
"scripts": {
"build": "./node_modules/webpack/bin/webpack.js --config webpack.config.js --env production",
......
import {version} from '../package.json'
import store from './store/store'
import RequestManager from './services/request-manager'
import ChartManager from './services/chart-manager'
......@@ -8,6 +9,16 @@ class FractalJS {
store.dispatch('setRequestManager', requestManager)
store.dispatch('updateData')
this._chartManager = new ChartManager()
this._versionCheck()
}
async _versionCheck () {
const rv = await store.state.requestManager.getVersion()
const backendVersion = rv.data.version
if (backendVersion !== version) {
console.warn(`WARNING: The Fractalis backend is version ${backendVersion},
but the frontend is version ${version}. This might or might not cause issues.`)
}
}
// noinspection JSMethodCanBeStatic
......
......@@ -113,4 +113,12 @@ export default class {
store.dispatch('unsetTask', {taskID})
return this._axios.delete(`/analytics/${taskID}`)
}
/**
* Submits a GET request to retrieve the fractalis backend version.
* @returns {AxiosPromise} An ES6 promise.
*/
getVersion () {
return this._axios.get('/misc/version')
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment