feat(irc): add bouncer/znc support (#951)

* feat(irc): add initial bouncer support

* feat(irc): add bouncer fields to irc update form

* fix: make fields optional

* feat(db): add migrations
This commit is contained in:
ze0s 2023-06-14 21:06:28 +02:00 committed by GitHub
parent 28f0b878e1
commit 2677c16ff8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 79 additions and 29 deletions

View file

@ -235,6 +235,8 @@ interface IrcNetworkUpdateFormValues {
nick: string;
auth?: IrcAuth;
invite_command: string;
use_bouncer: boolean;
bouncer_addr: string;
channels: Array<IrcChannel>;
}
@ -288,6 +290,8 @@ export function IrcNetworkUpdateForm({
pass: network.pass,
auth: network.auth,
invite_command: network.invite_command,
use_bouncer: network.use_bouncer,
bouncer_addr: network.bouncer_addr,
channels: network.channels
};
@ -340,6 +344,15 @@ export function IrcNetworkUpdateForm({
required={true}
/>
<SwitchGroupWide name="use_bouncer" label="Bouncer (BNC)" />
{values.use_bouncer && (
<TextFieldWide
name="bouncer_addr"
label="Bouncer address"
help="Address: Eg bouncer.server.net:6697"
/>
)}
<div className="border-t border-gray-200 dark:border-gray-700 py-5">
<div className="px-4 space-y-1 mb-8">
<Dialog.Title className="text-lg font-medium text-gray-900 dark:text-white">Identification</Dialog.Title>

View file

@ -14,6 +14,8 @@ interface IrcNetwork {
pass: string;
auth: IrcAuth; // optional
invite_command: string;
use_bouncer: boolean;
bouncer_addr: string;
channels: IrcChannel[];
connected: boolean;
connected_since: string;
@ -29,6 +31,8 @@ interface IrcNetworkCreate {
nick: string;
auth: IrcAuth; // optional
invite_command: string;
use_bouncer?: boolean;
bouncer_addr?: string;
channels: IrcChannel[];
connected: boolean;
}
@ -58,6 +62,8 @@ interface IrcNetworkWithHealth {
nick: string;
auth: IrcAuth; // optional
invite_command: string;
use_bouncer: boolean;
bouncer_addr: string;
channels: IrcChannelWithHealth[];
connected: boolean;
connected_since: string;