Display currently installed version in editor-ui

This commit is contained in:
Jan Oberhauser 2019-09-11 18:40:22 +02:00
parent 52bd08fae0
commit d6b8b9544f
6 changed files with 17 additions and 1 deletions

View file

@ -255,6 +255,7 @@ export interface IN8nUISettings {
saveManualExecutions: boolean; saveManualExecutions: boolean;
timezone: string; timezone: string;
urlBaseWebhook: string; urlBaseWebhook: string;
versionCli: string;
} }

View file

@ -6,6 +6,7 @@ import {
import * as bodyParser from 'body-parser'; import * as bodyParser from 'body-parser';
import * as history from 'connect-history-api-fallback'; import * as history from 'connect-history-api-fallback';
import * as requestPromise from 'request-promise-native'; import * as requestPromise from 'request-promise-native';
import { version as versionCli } from '../package.json';
import { import {
ActiveExecutions, ActiveExecutions,
@ -73,6 +74,7 @@ import * as config from '../config';
// @ts-ignore // @ts-ignore
import * as timezones from 'google-timezones-json'; import * as timezones from 'google-timezones-json';
import * as parseUrl from 'parseurl'; import * as parseUrl from 'parseurl';
import { version } from '@oclif/command/lib/flags';
class App { class App {
@ -989,6 +991,7 @@ class App {
saveManualExecutions: this.saveManualExecutions, saveManualExecutions: this.saveManualExecutions,
timezone: this.timezone, timezone: this.timezone,
urlBaseWebhook: WebhookHelpers.getWebhookBaseUrl(), urlBaseWebhook: WebhookHelpers.getWebhookBaseUrl(),
versionCli,
}; };
})); }));

View file

@ -389,6 +389,7 @@ export interface IN8nUISettings {
saveManualExecutions: boolean; saveManualExecutions: boolean;
timezone: string; timezone: string;
urlBaseWebhook: string; urlBaseWebhook: string;
versionCli: string;
} }
export interface IWorkflowSettings extends IWorkflowSettingsWorkflow { export interface IWorkflowSettings extends IWorkflowSettingsWorkflow {

View file

@ -16,7 +16,7 @@
<el-menu-item index="logo" class="logo-item"> <el-menu-item index="logo" class="logo-item">
<img src="/n8n-icon-small.png" class="icon" alt="n8n.io"/> <img src="/n8n-icon-small.png" class="icon" alt="n8n.io"/>
<a href="https://n8n.io" class="logo-text" target="_blank" slot="title"> <a href="https://n8n.io" class="logo-text" target="_blank" slot="title">
n8n.io n8n.io - Currently installed version {{versionCli}}
</a> </a>
</el-menu-item> </el-menu-item>
@ -205,6 +205,9 @@ export default mixins(
currentWorkflow (): string { currentWorkflow (): string {
return this.$route.params.name; return this.$route.params.name;
}, },
versionCli (): string {
return this.$store.getters.versionCli;
},
workflowExecution (): IExecutionResponse | null { workflowExecution (): IExecutionResponse | null {
return this.$store.getters.getWorkflowExecution; return this.$store.getters.getWorkflowExecution;
}, },

View file

@ -53,6 +53,7 @@ export const store = new Vuex.Store({
saveDataSuccessExecution: 'all', saveDataSuccessExecution: 'all',
saveManualExecutions: false, saveManualExecutions: false,
timezone: 'America/New_York', timezone: 'America/New_York',
versionCli: '0.0.0',
workflowExecutionData: null as IExecutionResponse | null, workflowExecutionData: null as IExecutionResponse | null,
lastSelectedNode: null as string | null, lastSelectedNode: null as string | null,
nodeIndex: [] as Array<string | null>, nodeIndex: [] as Array<string | null>,
@ -478,6 +479,9 @@ export const store = new Vuex.Store({
setTimezone (state, timezone: string) { setTimezone (state, timezone: string) {
Vue.set(state, 'timezone', timezone); Vue.set(state, 'timezone', timezone);
}, },
setVersionCli(state, version: string) {
Vue.set(state, 'versionCli', version);
},
addNodeType (state, typeData: INodeTypeDescription) { addNodeType (state, typeData: INodeTypeDescription) {
if (!typeData.hasOwnProperty('name')) { if (!typeData.hasOwnProperty('name')) {
@ -581,6 +585,9 @@ export const store = new Vuex.Store({
timezone: (state): string => { timezone: (state): string => {
return state.timezone; return state.timezone;
}, },
versionCli: (state): string => {
return state.versionCli;
},
// Push Connection // Push Connection
pushConnectionActive: (state): boolean => { pushConnectionActive: (state): boolean => {

View file

@ -1846,6 +1846,7 @@ export default mixins(
this.$store.commit('setSaveDataSuccessExecution', settings.saveDataSuccessExecution); this.$store.commit('setSaveDataSuccessExecution', settings.saveDataSuccessExecution);
this.$store.commit('setSaveManualExecutions', settings.saveManualExecutions); this.$store.commit('setSaveManualExecutions', settings.saveManualExecutions);
this.$store.commit('setTimezone', settings.timezone); this.$store.commit('setTimezone', settings.timezone);
this.$store.commit('setVersionCli', settings.versionCli);
}, },
async loadNodeTypes (): Promise<void> { async loadNodeTypes (): Promise<void> {
const nodeTypes = await this.restApi().getNodeTypes(); const nodeTypes = await this.restApi().getNodeTypes();