diff --git a/src/shared/alerts.ts b/src/shared/alerts.ts index 1c836d25..478cb0de 100644 --- a/src/shared/alerts.ts +++ b/src/shared/alerts.ts @@ -1,8 +1,8 @@ import { AlertSeverity } from '@/types/alertTypes'; 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(); - show(message, { title: 'Msg', variant: severity }); + show(message, { title: `${bot ? 'Bot: ' + bot : 'Notification'}`, variant: severity }); } diff --git a/src/shared/notifications.ts b/src/shared/notifications.ts index fd78c41c..33ef768e 100644 --- a/src/shared/notifications.ts +++ b/src/shared/notifications.ts @@ -8,25 +8,19 @@ export function showNotification(msg: FTWsMessage, botname: string) { switch (msg.type) { case FtWsMessageTypes.entryFill: 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; case FtWsMessageTypes.exitFill: 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; case FtWsMessageTypes.exitCancel: console.log('exitCancel', msg); - showAlert( - `${botname}: Exit order cancelled for ${msg.pair} due to ${msg.reason}`, - 'warning', - ); + showAlert(`Exit order cancelled for ${msg.pair} due to ${msg.reason}`, 'warning', botname); break; case FtWsMessageTypes.entryCancel: console.log('entryCancel', msg); - showAlert( - `${botname}: Entry order cancelled for ${msg.pair} due to ${msg.reason}`, - 'warning', - ); + showAlert(`Entry order cancelled for ${msg.pair} due to ${msg.reason}`, 'warning', botname); break; } } else {