mirror of
https://github.com/Buriburizaem0n/admin-frontend-domain.git
synced 2026-05-06 05:38:51 +00:00
feat: specialized UI labels for Telegram notification type
This commit is contained in:
@@ -164,6 +164,7 @@ export const NotifierCard: React.FC<NotifierCardProps> = ({ data, mutate }) => {
|
|||||||
<SelectContent>
|
<SelectContent>
|
||||||
<SelectItem value="1">Webhook</SelectItem>
|
<SelectItem value="1">Webhook</SelectItem>
|
||||||
<SelectItem value="2">SMTP (Email)</SelectItem>
|
<SelectItem value="2">SMTP (Email)</SelectItem>
|
||||||
|
<SelectItem value="3">Telegram</SelectItem>
|
||||||
</SelectContent>
|
</SelectContent>
|
||||||
</Select>
|
</Select>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
@@ -175,15 +176,18 @@ export const NotifierCard: React.FC<NotifierCardProps> = ({ data, mutate }) => {
|
|||||||
name="url"
|
name="url"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>{form.watch("type") == 2 ? "SMTP Server (host:port)" : "URL"}</FormLabel>
|
<FormLabel>
|
||||||
|
{form.watch("type") == 2 ? "SMTP Server (host:port)" :
|
||||||
|
form.watch("type") == 3 ? "Bot Token" : "URL"}
|
||||||
|
</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input {...field} />
|
<Input {...field} placeholder={form.watch("type") == 3 ? "123456:ABC-DEF" : ""} />
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
{form.watch("type") != 2 && (
|
{form.watch("type") != 2 && form.watch("type") != 3 && (
|
||||||
<>
|
<>
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
@@ -248,11 +252,17 @@ export const NotifierCard: React.FC<NotifierCardProps> = ({ data, mutate }) => {
|
|||||||
name="request_header"
|
name="request_header"
|
||||||
render={({ field }) => (
|
render={({ field }) => (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>{form.watch("type") == 2 ? "SMTP User:Pass" : t("RequestHeader")}</FormLabel>
|
<FormLabel>
|
||||||
|
{form.watch("type") == 2 ? "SMTP User:Pass" :
|
||||||
|
form.watch("type") == 3 ? "Chat ID" : t("RequestHeader")}
|
||||||
|
</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Textarea
|
<Textarea
|
||||||
className="resize-y"
|
className="resize-y"
|
||||||
placeholder={form.watch("type") == 2 ? "user:pass" : '{"User-Agent":"Nezha-Agent"}'}
|
placeholder={
|
||||||
|
form.watch("type") == 2 ? "user:pass" :
|
||||||
|
form.watch("type") == 3 ? "123456789" : '{"User-Agent":"Nezha-Agent"}'
|
||||||
|
}
|
||||||
{...field}
|
{...field}
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
@@ -260,6 +270,7 @@ export const NotifierCard: React.FC<NotifierCardProps> = ({ data, mutate }) => {
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
{form.watch("type") != 3 && (
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="request_body"
|
name="request_body"
|
||||||
@@ -277,6 +288,7 @@ export const NotifierCard: React.FC<NotifierCardProps> = ({ data, mutate }) => {
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
)}
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="verify_tls"
|
name="verify_tls"
|
||||||
|
|||||||
Reference in New Issue
Block a user