mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
fix(irc): rewrite handler pipeline (#399)
* fix(irc): rewrite handler pipeline This might be overkill but the pipeline has been made event driven. I've tested on a couple networks, and bouncing nicks / connections brings it back every time. creating the a different branch from https://github.com/autobrr/autobrr/pull/398 because it's pretty intrusive (and I didn't apply the GUI changes). * fix(irc): couple adjustments * fix(irc): deadlocks * fix: add missing dependency * fix(irc): remove more locks from connect cmds * feat(irc): conditional monitoring message * feat(irc): show unhealthy network in ui * feat(irc): improve logs and comments
This commit is contained in:
parent
4c93cac248
commit
7deac6a781
7 changed files with 317 additions and 281 deletions
|
@ -86,7 +86,7 @@ const ListItem = ({ idx, network }: ListItemProps) => {
|
|||
|
||||
return (
|
||||
<li key={idx}>
|
||||
<div className="grid grid-cols-12 gap-2 lg:gap-4 items-center hover:bg-gray-50 dark:hover:bg-gray-700 py-4">
|
||||
<div className={classNames("grid grid-cols-12 gap-2 lg:gap-4 items-center py-4", network.enabled && !network.healthy ? "bg-red-50 dark:bg-red-900 hover:bg-red-100 dark:hover:bg-red-800" : "hover:bg-gray-50 dark:hover:bg-gray-700 ")}>
|
||||
<IrcNetworkUpdateForm
|
||||
isOpen={updateIsOpen}
|
||||
toggle={toggleUpdate}
|
||||
|
@ -100,7 +100,7 @@ const ListItem = ({ idx, network }: ListItemProps) => {
|
|||
<div className="flex">
|
||||
<span className="relative inline-flex items-center ml-1">
|
||||
{network.enabled ? (
|
||||
IsNetworkHealthy(network) ? (
|
||||
network.healthy ? (
|
||||
<span
|
||||
className="mr-3 flex h-3 w-3 relative"
|
||||
title={`Connected since: ${simplifyDate(network.connected_since)}`}
|
||||
|
@ -113,7 +113,7 @@ const ListItem = ({ idx, network }: ListItemProps) => {
|
|||
className="mr-3 flex items-center"
|
||||
title={network.connection_errors.toString()}
|
||||
>
|
||||
<ExclamationCircleIcon className="h-4 w-4 text-red-400 hover:text-red-600" />
|
||||
<ExclamationCircleIcon className="h-4 w-4 text-yellow-400 hover:text-yellow-600" />
|
||||
</span>
|
||||
)
|
||||
) : (
|
||||
|
@ -238,6 +238,3 @@ const ListItem = ({ idx, network }: ListItemProps) => {
|
|||
</li>
|
||||
);
|
||||
};
|
||||
|
||||
const IsNetworkHealthy = (network: IrcNetworkWithHealth) =>
|
||||
network.connection_errors.length <= 0;
|
||||
|
|
1
web/src/types/Irc.d.ts
vendored
1
web/src/types/Irc.d.ts
vendored
|
@ -54,6 +54,7 @@ interface IrcNetworkWithHealth {
|
|||
connected: boolean;
|
||||
connected_since: string;
|
||||
connection_errors: string[];
|
||||
healthy: boolean;
|
||||
}
|
||||
|
||||
interface NickServ {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue