From 5626a9d0fdfee0ed06485a8ba264037965b41428 Mon Sep 17 00:00:00 2001 From: glax Date: Thu, 8 May 2025 00:32:09 +0200 Subject: [PATCH] Remove Lunasea https://github.com/C9Glax/tranga/issues/389 --- Website/modules/Elements/Lunasea.tsx | 32 ------------------- .../Elements/NotificationConnector.tsx | 3 -- Website/modules/api/NotificationConnector.tsx | 16 ---------- 3 files changed, 51 deletions(-) delete mode 100644 Website/modules/Elements/Lunasea.tsx diff --git a/Website/modules/Elements/Lunasea.tsx b/Website/modules/Elements/Lunasea.tsx deleted file mode 100644 index b6b6b65..0000000 --- a/Website/modules/Elements/Lunasea.tsx +++ /dev/null @@ -1,32 +0,0 @@ -import {ReactElement, useState} from "react"; -import NotificationConnector from "../api/NotificationConnector"; -import Loader from "../Loader"; -import ILunaseaRecord from "../types/records/ILunaseaRecord"; - -export function LunaseaItem ({apiUri} : {apiUri: string}) : ReactElement{ - const [record, setRecord] = useState({ - id: "" - }); - const [loading, setLoading] = useState(false); - return
- -
- setRecord({...record, id: e.currentTarget.value})} /> -
- <> - - - -
; -} - -const regex = new RegExp("(?:device|user)\/[0-9a-zA-Z\-]+"); -function Validate(record: ILunaseaRecord) : boolean { - return regex.test(record.id); -} \ No newline at end of file diff --git a/Website/modules/Elements/NotificationConnector.tsx b/Website/modules/Elements/NotificationConnector.tsx index 1bb53ce..335d886 100644 --- a/Website/modules/Elements/NotificationConnector.tsx +++ b/Website/modules/Elements/NotificationConnector.tsx @@ -5,7 +5,6 @@ import NotificationConnector from "../api/NotificationConnector"; import INotificationConnector from "../types/INotificationConnector"; import {GotifyItem} from "./Gotify"; import {NtfyItem} from "./Ntfy"; -import {LunaseaItem} from "./Lunasea"; import {PushoverItem} from "./Pushover"; export default function NotificationConnectorItem({apiUri, notificationConnector} : {apiUri: string, notificationConnector: INotificationConnector | null}) : ReactElement { @@ -22,14 +21,12 @@ export default function NotificationConnectorItem({apiUri, notificationConnector case "default": setSelectedConnectorElement(); break; case "gotify": setSelectedConnectorElement(); break; case "ntfy": setSelectedConnectorElement(); break; - case "lunasea": setSelectedConnectorElement(); break; case "pushover": setSelectedConnectorElement(); break; } }}> - {selectedConnectorElement} diff --git a/Website/modules/api/NotificationConnector.tsx b/Website/modules/api/NotificationConnector.tsx index d303845..a09e5e5 100644 --- a/Website/modules/api/NotificationConnector.tsx +++ b/Website/modules/api/NotificationConnector.tsx @@ -1,7 +1,6 @@ import {deleteData, getData, putData} from "../../App"; import IGotifyRecord from "../types/records/IGotifyRecord"; import INtfyRecord from "../types/records/INtfyRecord"; -import ILunaseaRecord from "../types/records/ILunaseaRecord"; import IPushoverRecord from "../types/records/IPushoverRecord"; import INotificationConnector from "../types/INotificationConnector"; @@ -82,21 +81,6 @@ export default class NotificationConnector { }); } - static async CreateLunasea(apiUri: string, lunasea: ILunaseaRecord) : Promise { - if(lunasea === undefined || lunasea === null) { - console.error(`lunasea was not provided`); - return Promise.reject(); - } - //console.info("Getting Notification Connectors"); - return putData(`${apiUri}/v2/NotificationConnector/Lunasea`, lunasea) - .then((json) => { - //console.info("Got Notification Connectors"); - const ret = json as unknown as string; - //console.debug(ret); - return (ret); - }); - } - static async CreatePushover(apiUri: string, pushover: IPushoverRecord) : Promise { if(pushover === undefined || pushover === null) { console.error(`pushover was not provided`);