mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-27 05:25:17 +00:00
Move botname to the title
This commit is contained in:
parent
e6ccb4ebfe
commit
171c608ea8
|
@ -1,8 +1,8 @@
|
||||||
import { AlertSeverity } from '@/types/alertTypes';
|
import { AlertSeverity } from '@/types/alertTypes';
|
||||||
import { useToast } from 'bootstrap-vue-next';
|
import { useToast } from 'bootstrap-vue-next';
|
||||||
|
|
||||||
export function showAlert(message: string, severity: AlertSeverity = 'warning') {
|
export function showAlert(message: string, severity: AlertSeverity = 'warning', bot: string = '') {
|
||||||
const { show } = useToast();
|
const { show } = useToast();
|
||||||
|
|
||||||
show(message, { title: 'Msg', variant: severity });
|
show(message, { title: `${bot ? 'Bot: ' + bot : 'Notification'}`, variant: severity });
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,25 +8,19 @@ export function showNotification(msg: FTWsMessage, botname: string) {
|
||||||
switch (msg.type) {
|
switch (msg.type) {
|
||||||
case FtWsMessageTypes.entryFill:
|
case FtWsMessageTypes.entryFill:
|
||||||
console.log('entryFill', msg);
|
console.log('entryFill', msg);
|
||||||
showAlert(`${botname}: Entry fill for ${msg.pair} at ${msg.open_rate}`, 'success');
|
showAlert(`Entry fill for ${msg.pair} at ${msg.open_rate}`, 'success', botname);
|
||||||
break;
|
break;
|
||||||
case FtWsMessageTypes.exitFill:
|
case FtWsMessageTypes.exitFill:
|
||||||
console.log('exitFill', msg);
|
console.log('exitFill', msg);
|
||||||
showAlert(`${botname}: Exit fill for ${msg.pair} at ${msg.open_rate}`, 'success');
|
showAlert(`Exit fill for ${msg.pair} at ${msg.open_rate}`, 'success', botname);
|
||||||
break;
|
break;
|
||||||
case FtWsMessageTypes.exitCancel:
|
case FtWsMessageTypes.exitCancel:
|
||||||
console.log('exitCancel', msg);
|
console.log('exitCancel', msg);
|
||||||
showAlert(
|
showAlert(`Exit order cancelled for ${msg.pair} due to ${msg.reason}`, 'warning', botname);
|
||||||
`${botname}: Exit order cancelled for ${msg.pair} due to ${msg.reason}`,
|
|
||||||
'warning',
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
case FtWsMessageTypes.entryCancel:
|
case FtWsMessageTypes.entryCancel:
|
||||||
console.log('entryCancel', msg);
|
console.log('entryCancel', msg);
|
||||||
showAlert(
|
showAlert(`Entry order cancelled for ${msg.pair} due to ${msg.reason}`, 'warning', botname);
|
||||||
`${botname}: Entry order cancelled for ${msg.pair} due to ${msg.reason}`,
|
|
||||||
'warning',
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user