mirror of
https://github.com/Fabio286/antares.git
synced 2025-04-24 06:57:19 +02:00
perf: added more notifications in debug console
This commit is contained in:
parent
6365e07534
commit
dfa7cf9905
@ -1,6 +1,8 @@
|
|||||||
import { uidGen } from 'common/libs/uidGen';
|
import { uidGen } from 'common/libs/uidGen';
|
||||||
import { defineStore } from 'pinia';
|
import { defineStore } from 'pinia';
|
||||||
|
|
||||||
|
import { useConsoleStore } from './console';
|
||||||
|
|
||||||
export interface Notification {
|
export interface Notification {
|
||||||
uid: string;
|
uid: string;
|
||||||
status: string;
|
status: string;
|
||||||
@ -15,6 +17,13 @@ export const useNotificationsStore = defineStore('notifications', {
|
|||||||
addNotification (payload: { status: string; message: string }) {
|
addNotification (payload: { status: string; message: string }) {
|
||||||
const notification: Notification = { uid: uidGen('N'), ...payload };
|
const notification: Notification = { uid: uidGen('N'), ...payload };
|
||||||
this.notifications.unshift(notification);
|
this.notifications.unshift(notification);
|
||||||
|
|
||||||
|
useConsoleStore().putLog('debug', {
|
||||||
|
level: notification.status,
|
||||||
|
process: 'renderer',
|
||||||
|
message: notification.message,
|
||||||
|
date: new Date()
|
||||||
|
});
|
||||||
},
|
},
|
||||||
removeNotification (uid: string) {
|
removeNotification (uid: string) {
|
||||||
this.notifications = (this.notifications as Notification[]).filter(item => item.uid !== uid);
|
this.notifications = (this.notifications as Notification[]).filter(item => item.uid !== uid);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user