Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/components/configCommon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function CommonFields({
}}
/>

<div className="grid grid-cols-2 gap-4">
<div className="grid grid-cols-1 gap-4 md:grid-cols-2">
<ConfigField
label="Event Similarity"
description="Required event name similarity, between 0.0 - 1.0"
Expand Down
152 changes: 74 additions & 78 deletions frontend/src/components/configNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,100 +83,96 @@ export function NotificationSettings() {
</div>

{draft.ntfy && (
<>
<div className="flex gap-2">
<div className="flex-auto flex-col space-y-2">
<Label>URL</Label>
<Input
type="text"
placeholder={defaultNtfyUrl}
value={
draft.ntfy?.url === defaultNtfyUrl ? "" : draft.ntfy?.url
}
onChange={(event) => {
setDraft((prev) => ({
...prev,
ntfy: {
...(prev.ntfy || newNtfyConfig()),
url:
event.target.value === ""
? defaultNtfyUrl
: event.target.value,
},
}));
}}
/>
</div>
<div className="grid grid-cols-1 gap-2 md:grid-cols-2">
<div className="space-y-2">
<Label>URL</Label>
<Input
type="text"
placeholder={defaultNtfyUrl}
value={
draft.ntfy?.url === defaultNtfyUrl ? "" : draft.ntfy?.url
}
onChange={(event) => {
setDraft((prev) => ({
...prev,
ntfy: {
...(prev.ntfy || newNtfyConfig()),
url:
event.target.value === ""
? defaultNtfyUrl
: event.target.value,
},
}));
}}
/>
</div>

<div className="flex-auto flex-col space-y-2">
<Label>Topic</Label>
<Input
type="text"
value={draft.ntfy?.topic}
onChange={(event) => {
setDraft((prev) => ({
...prev,
ntfy: {
...(prev.ntfy || newNtfyConfig()),
topic: event.target.value,
},
}));
}}
/>
</div>
<div className="space-y-2">
<Label>Topic</Label>
<Input
type="text"
value={draft.ntfy?.topic}
onChange={(event) => {
setDraft((prev) => ({
...prev,
ntfy: {
...(prev.ntfy || newNtfyConfig()),
topic: event.target.value,
},
}));
}}
/>
</div>

<div className="flex space-x-2">
<div className="flex flex-1 flex-col space-y-2">
<Label>Username</Label>
<div className="space-y-2">
<Label>Username</Label>
<Input
type="text"
placeholder="Optional"
value={draft.ntfy?.username}
onChange={(event) => {
setDraft((prev) => ({
...prev,
ntfy: {
...(prev.ntfy || newNtfyConfig()),
username: event.target.value,
},
}));
}}
/>
</div>

<div className="space-y-2">
<Label>Password</Label>
<div className="flex">
<Input
type="text"
type={showNtfyPassword ? "text" : "password"}
placeholder="Optional"
value={draft.ntfy?.username}
value={draft.ntfy?.password}
onChange={(event) => {
setDraft((prev) => ({
...prev,
ntfy: {
...(prev.ntfy || newNtfyConfig()),
username: event.target.value,
password: event.target.value,
},
}));
}}
/>
</div>

<div className="flex flex-1 flex-col space-y-2">
<Label>Password</Label>
<div className="flex">
<Input
type={showNtfyPassword ? "text" : "password"}
placeholder="Optional"
value={draft.ntfy?.password}
onChange={(event) => {
setDraft((prev) => ({
...prev,
ntfy: {
...(prev.ntfy || newNtfyConfig()),
password: event.target.value,
},
}));
}}
/>
<Button
type="button"
variant="ghost"
onClick={toggleShowNtfyPassword}
>
{showNtfyPassword ? (
<EyeOff className="size-5" />
) : (
<Eye className="size-5" />
)}
</Button>
</div>
<Button
type="button"
variant="ghost"
onClick={toggleShowNtfyPassword}
>
{showNtfyPassword ? (
<EyeOff className="size-5" />
) : (
<Eye className="size-5" />
)}
</Button>
</div>
</div>
</>
</div>
)}
</div>
<Separator />
Expand Down