diff --git a/src/_services/system.service.js b/src/_services/system.service.js index c36039f..62f6df2 100644 --- a/src/_services/system.service.js +++ b/src/_services/system.service.js @@ -17,7 +17,8 @@ export const systemService = { loadTimezones, detectTimezone, detectLocale, - getAppLinks + getAppLinks, + upgradeJar }; function loadIsActivated () { @@ -116,3 +117,10 @@ function getAppLinks (locale) { .then(util.handleBasicResponse) .then(links => { return links; }); } + +function upgradeJar() { + const requestOptions =util.postWithAuth(); + return fetch(`${config.apiUrl}/me/upgrade`, requestOptions) + .then(util.handleBasicResponse) + .then(configs => { return configs; }); +} diff --git a/src/_store/system.module.js b/src/_store/system.module.js index b8e12f9..874607b 100644 --- a/src/_store/system.module.js +++ b/src/_store/system.module.js @@ -23,11 +23,13 @@ const state = { requireSendMetrics: null, awaitingRestore: false, support: {}, - securityLevels: null + securityLevels: null, + jarVersion: null, + jarUpgradeAvailable: null }, entityConfigs: {}, searchResults: [], - status: { activating: false, searching: false, creatingEntity: false, modelSetupInProgress: false }, + status: { activating: false, searching: false, creatingEntity: false, modelSetupInProgress: false, upgrading: false }, activated: null, error: null, messages: { @@ -155,6 +157,13 @@ const actions = { links => commit('getAppLinksSuccess', links), error => commit('getAppLinksFailure', error) ) + }, + upgradeJar({ commit }) { + commit('upgradeJarRequest'); + systemService.upgradeJar(locale).then( + configs => commit('upgradeJarSuccess', configs), + error => commit('upgradeJarFailure', error) + ) } }; @@ -411,6 +420,15 @@ const mutations = { }, getAppLinksFailure(state, error) { state.error = error; + }, + + upgradeJarRequest(state) {}, + upgradeJarSuccess(state, configs) { + state.configs = configs; + state.status = Object.assign(state.status, {upgrading: true}); + }, + upgradeJarFailure(state, error) { + state.error = error; } }; diff --git a/src/account/NetworkPage.vue b/src/account/NetworkPage.vue index 3a03e2b..e0b2e66 100644 --- a/src/account/NetworkPage.vue +++ b/src/account/NetworkPage.vue @@ -13,7 +13,7 @@ -
{{messages.message_jar_upgrade_version}} {{configs.jarUpgradeAvailable.version}}
+{{messages.message_jar_current_version}} {{configs.jarVersion}}
+ + +{{messages.message_jar_upgrading}}
+