mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
refactor: remove dokploy restart on notifications
This commit is contained in:
@@ -109,7 +109,7 @@ export type NotificationSchema = z.infer<typeof notificationSchema>;
|
|||||||
export const AddNotification = () => {
|
export const AddNotification = () => {
|
||||||
const utils = api.useUtils();
|
const utils = api.useUtils();
|
||||||
const [visible, setVisible] = useState(false);
|
const [visible, setVisible] = useState(false);
|
||||||
|
const { data: isCloud } = api.settings.isCloud.useQuery();
|
||||||
const { mutateAsync: testSlackConnection, isLoading: isLoadingSlack } =
|
const { mutateAsync: testSlackConnection, isLoading: isLoadingSlack } =
|
||||||
api.notification.testSlackConnection.useMutation();
|
api.notification.testSlackConnection.useMutation();
|
||||||
|
|
||||||
@@ -660,26 +660,28 @@ export const AddNotification = () => {
|
|||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<FormField
|
{!isCloud && (
|
||||||
control={form.control}
|
<FormField
|
||||||
name="dokployRestart"
|
control={form.control}
|
||||||
render={({ field }) => (
|
name="dokployRestart"
|
||||||
<FormItem className=" flex flex-row items-center justify-between rounded-lg border p-3 shadow-sm gap-2">
|
render={({ field }) => (
|
||||||
<div className="space-y-0.5">
|
<FormItem className=" flex flex-row items-center justify-between rounded-lg border p-3 shadow-sm gap-2">
|
||||||
<FormLabel>Dokploy Restart</FormLabel>
|
<div className="space-y-0.5">
|
||||||
<FormDescription>
|
<FormLabel>Dokploy Restart</FormLabel>
|
||||||
Trigger the action when a dokploy is restarted.
|
<FormDescription>
|
||||||
</FormDescription>
|
Trigger the action when a dokploy is restarted.
|
||||||
</div>
|
</FormDescription>
|
||||||
<FormControl>
|
</div>
|
||||||
<Switch
|
<FormControl>
|
||||||
checked={field.value}
|
<Switch
|
||||||
onCheckedChange={field.onChange}
|
checked={field.value}
|
||||||
/>
|
onCheckedChange={field.onChange}
|
||||||
</FormControl>
|
/>
|
||||||
</FormItem>
|
</FormControl>
|
||||||
)}
|
</FormItem>
|
||||||
/>
|
)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export const UpdateNotification = ({ notificationId }: Props) => {
|
|||||||
const telegramMutation = api.notification.updateTelegram.useMutation();
|
const telegramMutation = api.notification.updateTelegram.useMutation();
|
||||||
const discordMutation = api.notification.updateDiscord.useMutation();
|
const discordMutation = api.notification.updateDiscord.useMutation();
|
||||||
const emailMutation = api.notification.updateEmail.useMutation();
|
const emailMutation = api.notification.updateEmail.useMutation();
|
||||||
|
const { data: isCloud } = api.settings.isCloud.useQuery();
|
||||||
const form = useForm<NotificationSchema>({
|
const form = useForm<NotificationSchema>({
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
type: "slack",
|
type: "slack",
|
||||||
@@ -618,27 +618,29 @@ export const UpdateNotification = ({ notificationId }: Props) => {
|
|||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<FormField
|
{!isCloud && (
|
||||||
control={form.control}
|
<FormField
|
||||||
defaultValue={form.control._defaultValues.dokployRestart}
|
control={form.control}
|
||||||
name="dokployRestart"
|
defaultValue={form.control._defaultValues.dokployRestart}
|
||||||
render={({ field }) => (
|
name="dokployRestart"
|
||||||
<FormItem className=" flex flex-row items-center justify-between rounded-lg border p-3 shadow-sm gap-2">
|
render={({ field }) => (
|
||||||
<div className="space-y-0.5">
|
<FormItem className=" flex flex-row items-center justify-between rounded-lg border p-3 shadow-sm gap-2">
|
||||||
<FormLabel>Dokploy Restart</FormLabel>
|
<div className="space-y-0.5">
|
||||||
<FormDescription>
|
<FormLabel>Dokploy Restart</FormLabel>
|
||||||
Trigger the action when a dokploy is restarted.
|
<FormDescription>
|
||||||
</FormDescription>
|
Trigger the action when a dokploy is restarted.
|
||||||
</div>
|
</FormDescription>
|
||||||
<FormControl>
|
</div>
|
||||||
<Switch
|
<FormControl>
|
||||||
checked={field.value}
|
<Switch
|
||||||
onCheckedChange={field.onChange}
|
checked={field.value}
|
||||||
/>
|
onCheckedChange={field.onChange}
|
||||||
</FormControl>
|
/>
|
||||||
</FormItem>
|
</FormControl>
|
||||||
)}
|
</FormItem>
|
||||||
/>
|
)}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user