2023-01-11 04:54:25 -05:00
|
|
|
import { defineStore } from 'pinia'
|
|
|
|
|
|
|
|
export const useIndex = defineStore('index', {
|
|
|
|
state: () => ({
|
2024-04-06 17:12:06 -04:00
|
|
|
darkMode: false,
|
2023-01-11 04:54:25 -05:00
|
|
|
showAlert: false,
|
2024-04-09 09:45:17 -04:00
|
|
|
alertVariant: 'success',
|
2023-01-11 04:54:25 -05:00
|
|
|
alertMsg: '',
|
2024-04-25 08:49:57 -04:00
|
|
|
sseConnected: false,
|
2024-09-03 10:12:29 -04:00
|
|
|
severityLevels: {
|
|
|
|
DEBUG: 1,
|
|
|
|
INFO: 2,
|
|
|
|
WARN: 3,
|
|
|
|
ERROR: 4,
|
|
|
|
} as { [key: string]: number }
|
2023-01-11 04:54:25 -05:00
|
|
|
}),
|
|
|
|
|
|
|
|
getters: {},
|
|
|
|
actions: {
|
2024-02-21 08:23:20 -05:00
|
|
|
msgAlert(variance: string, text: string, seconds: number = 3) {
|
|
|
|
this.alertVariant = variance
|
|
|
|
this.alertMsg = text
|
|
|
|
this.showAlert = true
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
this.showAlert = false
|
2024-04-09 09:45:17 -04:00
|
|
|
this.alertVariant = 'success'
|
2024-02-21 08:23:20 -05:00
|
|
|
this.alertMsg = ''
|
2024-04-09 09:45:17 -04:00
|
|
|
}, seconds * 1000)
|
2023-01-11 04:54:25 -05:00
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|