Spaces:
Paused
Paused
ML Intern deploy
Deploy httpSMS gateway to Hugging Face Spaces (Docker SDK): nginx :7860 -> Go API :8000, Nuxt SPA, Android APK, bootstrap-mode entrypoint
83a59ca Download web/app/stores/notifications.ts from red-kit/httpsms-gateway: direct link, hf CLI and curl.
- Browser
- Download file 938 Bytes
-
https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/web/app/stores/notifications.ts
- Command line
-
hf download hf://spaces/red-kit/httpsms-gateway/web/app/stores/notifications.ts
-
curl -L -o notifications.ts https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/web/app/stores/notifications.ts
938 Bytes
| import { defineStore } from 'pinia' | |
| export type NotificationType = 'error' | 'success' | 'info' | |
| export interface Notification { | |
| message: string | |
| timeout: number | |
| active: boolean | |
| type: NotificationType | |
| } | |
| export interface NotificationRequest { | |
| message: string | |
| type: NotificationType | |
| } | |
| const DEFAULT_TIMEOUT = 3000 | |
| export const useNotificationsStore = defineStore('notifications', () => { | |
| const notification = ref<Notification>({ | |
| active: false, | |
| message: '', | |
| type: 'success', | |
| timeout: DEFAULT_TIMEOUT, | |
| }) | |
| function addNotification(request: NotificationRequest) { | |
| notification.value = { | |
| active: true, | |
| message: request.message, | |
| type: request.type, | |
| timeout: Math.floor(Math.random() * 100) + DEFAULT_TIMEOUT, | |
| } | |
| } | |
| function disableNotification() { | |
| notification.value.active = false | |
| } | |
| return { | |
| notification, | |
| addNotification, | |
| disableNotification, | |
| } | |
| }) | |