chore: build
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { Box, Button, Container, Heading, Stack, Text } from '@chakra-ui/react'
|
||||
|
||||
export function Contact() {
|
||||
return (
|
||||
<Box>
|
||||
<Box bgGradient="linear(to-b, blackAlpha.50, transparent)" py={{ base: 16, md: 24 }}>
|
||||
<Container maxW="container.lg">
|
||||
<Stack spacing={6} textAlign="center" align="center">
|
||||
<Heading size="2xl">Contactez-nous</Heading>
|
||||
<Text fontSize="xl" color="gray.600" maxW="2xl">
|
||||
Une question ? Notre équipe vous répond directement sur Telegram.
|
||||
</Text>
|
||||
<Button
|
||||
as="a"
|
||||
href="https://t.me/OMNEX_CORP"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
colorScheme="primary"
|
||||
size="lg"
|
||||
>
|
||||
Nous contacter sur Telegram
|
||||
</Button>
|
||||
</Stack>
|
||||
</Container>
|
||||
</Box>
|
||||
</Box>
|
||||
)
|
||||
}
|
||||
@@ -46,6 +46,7 @@ export function Demos() {
|
||||
const [busy, setBusy] = useState<string | null>(null)
|
||||
const [toDelete, setToDelete] = useState<Demo | null>(null)
|
||||
const [toPremium, setToPremium] = useState<Demo | null>(null)
|
||||
const [toExtend, setToExtend] = useState<Demo | null>(null)
|
||||
const [createModalOpen, setCreateModalOpen] = useState(false)
|
||||
const [editingDomain, setEditingDomain] = useState<Demo | null>(null)
|
||||
|
||||
@@ -75,11 +76,14 @@ export function Demos() {
|
||||
return () => clearInterval(id)
|
||||
}, [load])
|
||||
|
||||
const extend = async (d: Demo) => {
|
||||
const confirmExtend = async () => {
|
||||
if (!toExtend) return
|
||||
const d = toExtend
|
||||
setBusy(d.id)
|
||||
try {
|
||||
await api.extendDemo(d.id)
|
||||
toast({ status: 'success', title: 'Démo prolongée de 30 jours' })
|
||||
setToExtend(null)
|
||||
await load()
|
||||
} catch (err) {
|
||||
const msg = err instanceof ApiError ? err.message : 'Erreur'
|
||||
@@ -176,7 +180,7 @@ export function Demos() {
|
||||
isDisabled={!isAlive(d.status) || busy === d.id}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation()
|
||||
extend(d)
|
||||
setToExtend(d)
|
||||
}}
|
||||
>
|
||||
+30 j
|
||||
@@ -354,6 +358,21 @@ export function Demos() {
|
||||
</>
|
||||
)}
|
||||
|
||||
<ConfirmDialog
|
||||
isOpen={!!toExtend}
|
||||
title="Prolonger la démo de 30 jours ?"
|
||||
confirmLabel="Prolonger"
|
||||
isLoading={!!toExtend && busy === toExtend.id}
|
||||
onConfirm={confirmExtend}
|
||||
onClose={() => setToExtend(null)}
|
||||
>
|
||||
La démo{' '}
|
||||
<Text as="span" fontFamily="mono" fontWeight="semibold">
|
||||
{toExtend?.namespace}
|
||||
</Text>{' '}
|
||||
verra sa date d'expiration repoussée de 30 jours.
|
||||
</ConfirmDialog>
|
||||
|
||||
<ConfirmDialog
|
||||
isOpen={!!toDelete}
|
||||
title="Détruire la démo ?"
|
||||
|
||||
@@ -116,6 +116,7 @@ export function Profile() {
|
||||
const [telegramBotToken, setTelegramBotToken] = useState('')
|
||||
const [telegramChatId, setTelegramChatId] = useState('')
|
||||
const [savingAlerts, setSavingAlerts] = useState(false)
|
||||
const [testingAlerts, setTestingAlerts] = useState(false)
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false
|
||||
@@ -172,6 +173,46 @@ export function Profile() {
|
||||
}
|
||||
}
|
||||
|
||||
const handleTestAlertSettings = async () => {
|
||||
setTestingAlerts(true)
|
||||
try {
|
||||
const res = await api.testAlertSettings({
|
||||
discord_webhook_url: discordWebhookUrl.trim(),
|
||||
telegram_bot_token: telegramBotToken.trim(),
|
||||
telegram_chat_id: telegramChatId.trim(),
|
||||
})
|
||||
const results = [
|
||||
res.discord && { label: 'Discord', ...res.discord },
|
||||
res.telegram && { label: 'Telegram', ...res.telegram },
|
||||
].filter((r): r is { label: string; ok: boolean; error?: string } => !!r)
|
||||
|
||||
if (results.every((r) => r.ok)) {
|
||||
toast({ status: 'success', title: 'Notification de test envoyée', description: results.map((r) => r.label).join(' et ') })
|
||||
} else {
|
||||
toast({
|
||||
status: 'error',
|
||||
title: 'Échec du test',
|
||||
description: results
|
||||
.filter((r) => !r.ok)
|
||||
.map((r) => `${r.label} : ${r.error}`)
|
||||
.join(' — '),
|
||||
})
|
||||
}
|
||||
} catch (err) {
|
||||
if (err instanceof ApiError && err.status === 401) {
|
||||
navigate('/login')
|
||||
return
|
||||
}
|
||||
toast({
|
||||
status: 'warning',
|
||||
title: 'Test impossible',
|
||||
description: err instanceof ApiError ? err.message : undefined,
|
||||
})
|
||||
} finally {
|
||||
setTestingAlerts(false)
|
||||
}
|
||||
}
|
||||
|
||||
const handleUpdateUsername = async (newUsername: string) => {
|
||||
const trimmed = newUsername.trim()
|
||||
if (!me || !trimmed || trimmed === me.username) return
|
||||
@@ -469,7 +510,16 @@ export function Profile() {
|
||||
</FormControl>
|
||||
</SimpleGrid>
|
||||
|
||||
<Flex justify="flex-end">
|
||||
<Flex justify="flex-end" gap={2}>
|
||||
<Button
|
||||
size="sm"
|
||||
variant="outline"
|
||||
isDisabled={!discordWebhookUrl.trim() && !(telegramBotToken.trim() && telegramChatId.trim())}
|
||||
isLoading={testingAlerts}
|
||||
onClick={handleTestAlertSettings}
|
||||
>
|
||||
Tester les notifications
|
||||
</Button>
|
||||
<Button
|
||||
size="sm"
|
||||
colorScheme="primary"
|
||||
|
||||
Reference in New Issue
Block a user