Add latest version check and update prompt to UI

Introduces backend and frontend logic to fetch the latest NapCat version tag from multiple sources, exposes a new API endpoint, and adds a UI prompt to notify users of new versions with an update button. Also includes minor code style improvements in dialog context.
This commit is contained in:
手瓜一十雪 committed 2025-11-22 13:52:49 +08:00
1 parent d525f9b03d
commit 173a165c4b
6 files changed
+182 -11

No files matched your search

@@ -6,30 +6,30 @@ import type { ModalProps } from '@/components/modal';
export interface AlertProps
extends Omit<ModalProps, 'onCancel' | 'showCancel' | 'cancelText'> {
onConfirm?: () => void
onConfirm?: () => void;
}
export interface ConfirmProps extends ModalProps {
onConfirm?: () => void
onCancel?: () => void
onConfirm?: () => void;
onCancel?: () => void;
}
export interface ModalItem extends ModalProps {
id: number
id: number;
}
export interface DialogContextProps {
alert: (config: AlertProps) => void
confirm: (config: ConfirmProps) => void
alert: (config: AlertProps) => void;
confirm: (config: ConfirmProps) => void;
}
export interface DialogProviderProps {
children: React.ReactNode
children: React.ReactNode;
}
export const DialogContext = React.createContext<DialogContextProps>({
alert: () => {},
confirm: () => {},
alert: () => { },
confirm: () => { },
});
const DialogProvider: React.FC<DialogProviderProps> = ({ children }) => {