Show bot-name

This commit is contained in:
Matthias 2021-01-16 11:16:13 +01:00
parent de1035545e
commit c240b6c104
3 changed files with 42 additions and 28 deletions

View File

@ -18,6 +18,9 @@
<!-- Right aligned nav items -->
<b-navbar-nav class="ml-auto">
<li class="nav-item text-secondary mr-2">
<b-nav-text class="verticalCenter small mr-2">
{{ botName }}
</b-nav-text>
<b-nav-text class="verticalCenter">
{{ isBotOnline ? 'Online' : 'Offline' }}
</b-nav-text>
@ -49,6 +52,7 @@ import { State, Action, namespace } from 'vuex-class';
import userService from '@/shared/userService';
import BootswatchThemeSelect from '@/components/BootswatchThemeSelect.vue';
import { LayoutActions } from '@/store/modules/layout';
import { BotStoreGetters } from '@/store/modules/ftbot';
const ftbot = namespace('ftbot');
const layoutNs = namespace('layout');
@ -67,6 +71,8 @@ export default class NavBar extends Vue {
@ftbot.Action ping;
@ftbot.Getter [BotStoreGetters.botName]: string;
@layoutNs.Action [LayoutActions.resetDashboardLayout];
@layoutNs.Action [LayoutActions.resetTradingLayout];

View File

@ -31,6 +31,7 @@ import {
import { showAlert } from './alerts';
export enum BotStoreGetters {
botName = 'botName',
openTrades = 'openTrades',
tradeDetail = 'tradeDetail',
selectedPair = 'selectedPair',
@ -45,37 +46,42 @@ export enum BotStoreGetters {
refreshRequired = 'refreshRequired',
}
const state = {
version: '',
lastLogs: '',
refreshRequired: true,
trades: [],
openTrades: [],
tradeCount: 0,
performanceStats: [],
whitelist: [],
blacklist: [],
profit: {},
botState: {},
balance: {},
dailyStats: [],
pairlistMethods: [],
detailTradeId: null,
selectedPair: '',
candleData: {},
history: {},
strategyPlotConfig: {},
customPlotConfig: { ...EMPTY_PLOTCONFIG },
plotConfigName: getPlotConfigName(),
availablePlotConfigNames: getAllPlotConfigNames(),
strategyList: [],
strategy: {},
pairlist: [],
currentLocks: [],
};
export default {
namespaced: true,
state: {
version: '',
lastLogs: '',
refreshRequired: true,
trades: [],
openTrades: [],
tradeCount: 0,
performanceStats: [],
whitelist: [],
blacklist: [],
profit: {},
botState: {},
balance: {},
dailyStats: [],
pairlistMethods: [],
detailTradeId: null,
selectedPair: '',
candleData: {},
history: {},
strategyPlotConfig: {},
customPlotConfig: { ...EMPTY_PLOTCONFIG },
plotConfigName: getPlotConfigName(),
availablePlotConfigNames: getAllPlotConfigNames(),
strategyList: [],
strategy: {},
pairlist: [],
currentLocks: [],
},
state,
getters: {
[BotStoreGetters.botName](state) {
return state.botState.bot_name || 'freqtrade';
},
[BotStoreGetters.plotConfig](state) {
return state.customPlotConfig[state.plotConfigName] || { ...EMPTY_PLOTCONFIG };
},

View File

@ -59,6 +59,8 @@ export interface BotState {
timeframe_ms: number;
/** Timeframe in Minutes */
timeframe_min: number;
/** Given name of the bot */
bot_name: string;
trailing_only_offset_is_reached: boolean;
trailing_stop: boolean;