mirror of
https://github.com/crocofied/CoreControl.git
synced 2025-12-29 16:14:43 +00:00
Add Echobell provider
This commit is contained in:
@@ -22,13 +22,12 @@ interface AddRequest {
|
||||
pushoverToken?: string;
|
||||
pushoverUser?: string;
|
||||
echobellURL?: string;
|
||||
echobellData?: string;
|
||||
}
|
||||
|
||||
export async function POST(request: NextRequest) {
|
||||
try {
|
||||
const body: AddRequest = await request.json();
|
||||
const { type, name, smtpHost, smtpPort, smtpSecure, smtpUsername, smtpPassword, smtpFrom, smtpTo, telegramToken, telegramChatId, discordWebhook, gotifyUrl, gotifyToken, ntfyUrl, ntfyToken, pushoverUrl, pushoverToken, pushoverUser, echobellURL, echobellData } = body;
|
||||
const { type, name, smtpHost, smtpPort, smtpSecure, smtpUsername, smtpPassword, smtpFrom, smtpTo, telegramToken, telegramChatId, discordWebhook, gotifyUrl, gotifyToken, ntfyUrl, ntfyToken, pushoverUrl, pushoverToken, pushoverUser, echobellURL } = body;
|
||||
|
||||
const notification = await prisma.notification.create({
|
||||
data: {
|
||||
@@ -51,8 +50,7 @@ export async function POST(request: NextRequest) {
|
||||
pushoverUrl: pushoverUrl,
|
||||
pushoverToken: pushoverToken,
|
||||
pushoverUser: pushoverUser,
|
||||
echobellURL: echobellURL,
|
||||
echobellData: echobellData,
|
||||
echobellURL: echobellURL
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -83,7 +83,6 @@ export default function Settings() {
|
||||
const [pushoverToken, setPushoverToken] = useState<string>("")
|
||||
const [pushoverUser, setPushoverUser] = useState<string>("")
|
||||
const [echobellURL, setEchobellURL] = useState<string>("")
|
||||
const [echobellData, setEchobellData] = useState<string>("")
|
||||
const [language, setLanguage] = useState<string>("english")
|
||||
const [notifications, setNotifications] = useState<any[]>([])
|
||||
|
||||
@@ -193,7 +192,6 @@ export default function Settings() {
|
||||
pushoverToken: pushoverToken,
|
||||
pushoverUser: pushoverUser,
|
||||
echobellURL: echobellURL,
|
||||
echobellData: echobellData,
|
||||
})
|
||||
getNotifications()
|
||||
} catch (error: any) {
|
||||
@@ -701,17 +699,7 @@ export default function Settings() {
|
||||
onChange={(e) => setEchobellURL(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<div className="grid w-full items-center gap-1.5">
|
||||
<Label>{t('Settings.Notifications.AddNotification.Echobell.Data')}</Label>
|
||||
<Textarea
|
||||
placeholder={`e.g.:
|
||||
"title": "Server Status",
|
||||
"message": "Server is online"
|
||||
`}
|
||||
onChange={(e: React.ChangeEvent<HTMLTextAreaElement>) => setEchobellData(e.target.value)}
|
||||
rows={4}
|
||||
/>
|
||||
</div>
|
||||
<span className="text-xs text-muted-foreground">Add in Echobell the "message" field.</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user