feat: new telegram UI

This commit is contained in:
peaklabs-dev
2024-12-09 16:49:09 +01:00
parent b4b48692af
commit bc726ddd6e
2 changed files with 186 additions and 95 deletions

View File

@@ -12,7 +12,7 @@
@if ($telegramEnabled)
<x-forms.button class="normal-case dark:text-white btn btn-xs no-animation btn-primary"
wire:click="sendTestNotification">
Send Test Notifications
Send Test Notification
</x-forms.button>
@endif
</div>
@@ -20,7 +20,6 @@
<x-forms.checkbox instantSave="instantSaveTelegramEnabled" id="telegramEnabled" label="Enabled" />
</div>
<div class="flex gap-2">
<x-forms.input type="password" autocomplete="new-password"
helper="Get it from the <a class='inline-block underline dark:text-white' href='https://t.me/botfather' target='_blank'>BotFather Bot</a> on Telegram."
required id="telegramToken" label="Token" />
@@ -28,51 +27,80 @@
id="telegramChatId" label="Chat ID" />
</div>
@if ($telegramEnabled)
<h2 class="mt-4">Subscribe to events</h2>
<div class="flex flex-col gap-4 w-96">
@if (isDev())
<div class="flex flex-col">
<h4>Test Notification</h4>
<x-forms.checkbox instantSave="saveModel" id="telegramNotificationsTest" label="Enabled" />
<x-forms.input
helper="If you are using Group chat with Topics, you can specify the topics ID. If empty, General topic will be used."
id="telegramNotificationsTestMessageThreadId" label="Custom Topic ID" />
<h2 class="mt-8 mb-4">Notification Settings</h2>
<p class="mb-4">
Select events for which you would like to receive Telegram notifications.
</p>
<div class="flex flex-col gap-4 max-w-2xl">
<div class="border dark:border-coolgray-300 p-4 rounded-lg">
<h3 class="text-lg font-medium mb-3">Backups</h3>
<div class="flex flex-col gap-1.5 pl-1">
<h4 class="font-medium mt-2">Backup Success</h4>
<div class="pl-1">
<x-forms.checkbox instantSave="saveModel" id="backupSuccessTelegramNotifications" label="Enabled" />
<x-forms.input helper="Topic ID for backup success notifications"
id="telegramNotificationsBackupSuccessTopicId" label="Success Topic ID" />
</div>
<h4 class="font-medium mt-3">Backup Failure</h4>
<div class="pl-1">
<x-forms.checkbox instantSave="saveModel" id="backupFailureTelegramNotifications" label="Enabled" />
<x-forms.input helper="Topic ID for backup failure notifications"
id="telegramNotificationsBackupFailureTopicId" label="Failure Topic ID" />
</div>
</div>
@endif
<div class="flex flex-col">
<h4>Container Status Changes</h4>
<x-forms.checkbox instantSave="saveModel" id="telegramNotificationsStatusChanges" label="Enabled" />
<x-forms.input
helper="If you are using Group chat with Topics, you can specify the topics ID. If empty, General topic will be used."
id="telegramNotificationsStatusChangesMessageThreadId" label="Custom Topic ID" />
</div>
<div class="flex flex-col">
<h4>Application Deployments</h4>
<x-forms.checkbox instantSave="saveModel" id="telegramNotificationsDeployments" label="Enabled" />
<x-forms.input
helper="If you are using Group chat with Topics, you can specify the topics ID. If empty, General topic will be used."
id="telegramNotificationsDeploymentsMessageThreadId" label="Custom Topic ID" />
<div class="border dark:border-coolgray-300 p-4 rounded-lg">
<h3 class="text-lg font-medium mb-3">Scheduled Tasks</h3>
<div class="flex flex-col gap-1.5 pl-1">
<h4 class="font-medium mt-2">Scheduled Task Success</h4>
<div class="pl-1">
<x-forms.checkbox instantSave="saveModel" id="scheduledTaskSuccessTelegramNotifications" label="Enabled" />
<x-forms.input helper="Topic ID for scheduled task success notifications"
id="telegramNotificationsScheduledTaskSuccessTopicId" label="Success Topic ID" />
</div>
<h4 class="font-medium mt-3">Scheduled Task Failure</h4>
<div class="pl-1">
<x-forms.checkbox instantSave="saveModel" id="scheduledTaskFailureTelegramNotifications" label="Enabled" />
<x-forms.input helper="Topic ID for scheduled task failure notifications"
id="telegramNotificationsScheduledTaskFailureTopicId" label="Failure Topic ID" />
</div>
</div>
</div>
<div class="flex flex-col">
<h4>Database Backup Status</h4>
<x-forms.checkbox instantSave="saveModel" id="telegramNotificationsDatabaseBackups"
label="Enabled" />
<x-forms.input
helper="If you are using Group chat with Topics, you can specify the topics ID. If empty, General topic will be used."
id="telegramNotificationsDatabaseBackupsMessageThreadId" label="Custom Topic ID" />
</div>
<div class="flex flex-col">
<h4>Scheduled Tasks Status</h4>
<x-forms.checkbox instantSave="saveModel" id="telegramNotificationsScheduledTasks"
label="Enabled" />
<x-forms.input
helper="If you are using Group chat with Topics, you can specify the topics ID. If empty, General topic will be used."
id="telegramNotificationsScheduledTasksMessageThreadId" label="Custom Topic ID" />
</div>
<div class="flex flex-col">
<h4>Server Disk Usage</h4>
<x-forms.checkbox instantSave="saveModel" id="telegramNotificationsServerDiskUsage"
label="Enabled" />
<div class="border dark:border-coolgray-300 p-4 rounded-lg">
<h3 class="text-lg font-medium mb-3">Server</h3>
<div class="flex flex-col gap-1.5 pl-1">
<h4 class="font-medium mt-2">Docker Cleanup</h4>
<div class="pl-1">
<x-forms.checkbox instantSave="saveModel" id="dockerCleanupTelegramNotifications" label="Enabled" />
<x-forms.input helper="Topic ID for Docker cleanup notifications"
id="telegramNotificationsDockerCleanupTopicId" label="Docker Cleanup Topic ID" />
</div>
<h4 class="font-medium mt-3">Server Disk Usage</h4>
<div class="pl-1">
<x-forms.checkbox instantSave="saveModel" id="serverDiskUsageTelegramNotifications" label="Enabled" />
<x-forms.input helper="Topic ID for disk usage notifications"
id="telegramNotificationsServerDiskUsageTopicId" label="Disk Usage Topic ID" />
</div>
<h4 class="font-medium mt-3">Server Reachable</h4>
<div class="pl-1">
<x-forms.checkbox instantSave="saveModel" id="serverReachableTelegramNotifications" label="Enabled" />
<x-forms.input helper="Topic ID for server reachable notifications"
id="telegramNotificationsServerReachableTopicId" label="Server Reachable Topic ID" />
</div>
<h4 class="font-medium mt-3">Server Unreachable</h4>
<div class="pl-1">
<x-forms.checkbox instantSave="saveModel" id="serverUnreachableTelegramNotifications" label="Enabled" />
<x-forms.input helper="Topic ID for server unreachable notifications"
id="telegramNotificationsServerUnreachableTopicId" label="Server Unreachable Topic ID" />
</div>
</div>
</div>
</div>
@endif