Refactor GitHub tag fetching and mirror management

Replaces legacy tag fetching logic in napcat-common with a new mirror.ts module that centralizes GitHub mirror configuration, selection, and tag retrieval. Updates helper.ts to use the new mirror system and semver comparison, and exports compareSemVer for broader use. Updates workflows and scripts to generate and propagate build version information, and improves build status comment formatting for PRs. Also updates release workflow to use a new OpenAI key and model.
This commit is contained in:
手瓜一十雪
2026-01-03 14:42:24 +08:00
parent 2d3f4e696b
commit 8eb1aa2fb4
18 changed files with 2199 additions and 451 deletions

View File

@@ -10,18 +10,19 @@ import {
import React from 'react';
export interface ModalProps {
content: React.ReactNode
title?: React.ReactNode
size?: React.ComponentProps<typeof NextUIModal>['size']
scrollBehavior?: React.ComponentProps<typeof NextUIModal>['scrollBehavior']
onClose?: () => void
onConfirm?: () => void
onCancel?: () => void
backdrop?: 'opaque' | 'blur' | 'transparent'
showCancel?: boolean
dismissible?: boolean
confirmText?: string
cancelText?: string
content: React.ReactNode;
title?: React.ReactNode;
size?: React.ComponentProps<typeof NextUIModal>['size'];
scrollBehavior?: React.ComponentProps<typeof NextUIModal>['scrollBehavior'];
onClose?: () => void;
onConfirm?: () => void;
onCancel?: () => void;
backdrop?: 'opaque' | 'blur' | 'transparent';
showCancel?: boolean;
dismissible?: boolean;
confirmText?: string;
cancelText?: string;
hideFooter?: boolean;
}
const Modal: React.FC<ModalProps> = React.memo((props) => {
@@ -33,6 +34,7 @@ const Modal: React.FC<ModalProps> = React.memo((props) => {
dismissible,
confirmText = '确定',
cancelText = '取消',
hideFooter = false,
onClose,
onConfirm,
onCancel,
@@ -62,29 +64,31 @@ const Modal: React.FC<ModalProps> = React.memo((props) => {
<ModalHeader className='flex flex-col gap-1'>{title}</ModalHeader>
)}
<ModalBody className='break-all'>{content}</ModalBody>
<ModalFooter>
{showCancel && (
{!hideFooter && (
<ModalFooter>
{showCancel && (
<Button
color='primary'
variant='light'
onPress={() => {
onCancel?.();
nativeClose();
}}
>
{cancelText}
</Button>
)}
<Button
color='primary'
variant='light'
onPress={() => {
onCancel?.();
onConfirm?.();
nativeClose();
}}
>
{cancelText}
{confirmText}
</Button>
)}
<Button
color='primary'
onPress={() => {
onConfirm?.();
nativeClose();
}}
>
{confirmText}
</Button>
</ModalFooter>
</ModalFooter>
)}
</>
)}
</ModalContent>