diff --git a/.oxlintrc.json b/.oxlintrc.json index ed1ef5b..8676ed9 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -10,7 +10,9 @@ "vitest" ], "categories": {}, - "rules": {}, + "rules": { + "no-unused-vars": "error" + }, "settings": { "jsdoc": { "ignorePrivate": false, diff --git a/.vscode/settings.json b/.vscode/settings.json index f563e1a..762595d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,9 +1,9 @@ { "editor.defaultFormatter": "oxc.oxc-vscode", "editor.formatOnSave": true, - // "editor.codeActionsOnSave": { - // "source.fixAll.oxc": "always" - // }, + "editor.codeActionsOnSave": { + "source.fixAll.oxc": "always" + }, "typescript.tsdk": "node_modules\\typescript\\lib", "[typescript]": { "editor.defaultFormatter": "oxc.oxc-vscode" diff --git a/app/app.config.ts b/app/app.config.ts index 32aa854..323d793 100644 --- a/app/app.config.ts +++ b/app/app.config.ts @@ -1,14 +1,28 @@ export default defineAppConfig({ ui: { - primary: 'indigo', - gray: 'neutral', strategy: 'merge', + colors: { + primary: 'indigo', + neutral: 'neutral', + success: 'emerald', + warning: 'amber', + }, + icons: { + loading: 'svg-spinners-180-ring', + }, button: { - icon: { - loading: 'animate-none', + slots: { + leadingIcon: 'animate-none', }, - default: { - loadingIcon: 'i-svg-spinners-180-ring-with-bg', + }, + input: { + slots: { + root: 'w-full', + }, + }, + textarea: { + slots: { + root: 'w-full', }, }, notifications: { diff --git a/app/app.vue b/app/app.vue index 1186dc7..8f3c52f 100644 --- a/app/app.vue +++ b/app/app.vue @@ -4,7 +4,7 @@ import ModalAuthentication from '~/components/ModalAuthentication.vue' const toast = useToast() const route = useRoute() const router = useRouter() -const modal = useModal() +const overlay = useOverlay() const loginState = useLoginState() useHead({ @@ -24,10 +24,11 @@ onMounted(() => { toast.add({ title: '登录失效', description: '登录已过期,请重新登录', - color: 'red', + color: 'error', icon: 'i-tabler-alert-triangle', }) - modal.open(ModalAuthentication) + const modal = overlay.create(ModalAuthentication) + modal.open() } else if (!loggedIn && !loginState.token) { // Prevents redirect from register page if (route.path === '/user/register') return @@ -41,12 +42,10 @@ onMounted(() => {
- - - - - - - + + + + +
diff --git a/app/assets/css/tailwind.css b/app/assets/css/main.css similarity index 79% rename from app/assets/css/tailwind.css rename to app/assets/css/main.css index caa50b4..d450cb7 100644 --- a/app/assets/css/tailwind.css +++ b/app/assets/css/main.css @@ -1,7 +1,10 @@ @import 'tailwindcss'; +@import '@nuxt/ui'; @config '../../../tailwind.config.ts'; +@source inline("{hover:,}{bg,text,border,from,to}-{primary,neutral,amber}{-{50,{100..900..100},950},}{/{0..100..5},}"); + /* The default border color has changed to `currentcolor` in Tailwind CSS v4, so we've added these compatibility styles to make sure everything still @@ -25,3 +28,6 @@ box-sizing: border-box; } } + +@layer theme { +} diff --git a/app/components/BubbleTitle.vue b/app/components/BubbleTitle.vue index e855c34..d6286ae 100644 --- a/app/components/BubbleTitle.vue +++ b/app/components/BubbleTitle.vue @@ -14,7 +14,7 @@ const props = defineProps({ }, bubbleColor: { type: String, - default: 'primary-500', + default: 'primary', }, }) diff --git a/app/components/DatePicker.vue b/app/components/DatePicker.vue index 6675b50..814816b 100644 --- a/app/components/DatePicker.vue +++ b/app/components/DatePicker.vue @@ -1,11 +1,10 @@ diff --git a/app/components/SlideCreateCourseGreen.vue b/app/components/SlideCreateCourseGreen.vue index d03dced..050a583 100644 --- a/app/components/SlideCreateCourseGreen.vue +++ b/app/components/SlideCreateCourseGreen.vue @@ -4,9 +4,7 @@ import ModalDigitalHumanSelect from '~/components/ModalDigitalHumanSelect.vue' import type { FormSubmitEvent } from '#ui/types' import { useFetchWrapped } from '~/composables/useFetchWrapped' -const emit = defineEmits(['success']) - -const slide = useSlideover() +const emit = defineEmits(['success', 'close']) const toast = useToast() const loginState = useLoginState() @@ -100,16 +98,16 @@ const onCreateCourseGreenSubmit = async ( toast.add({ title: '创建成功', description: '视频已加入生成队列', - color: 'green', + color: 'success', icon: 'i-tabler-check', }) emit('success') - slide.close() + emit('close') } else { toast.add({ title: '创建失败', description: res.msg || '未知错误', - color: 'red', + color: 'error', icon: 'i-tabler-alert-triangle', }) } @@ -120,7 +118,7 @@ const onCreateCourseGreenSubmit = async ( toast.add({ title: '创建失败', description: e.message || '未知错误', - color: 'red', + color: 'error', icon: 'i-tabler-alert-triangle', }) }) @@ -128,174 +126,174 @@ const onCreateCourseGreenSubmit = async ( diff --git a/app/components/aigc/RatioSelector.vue b/app/components/aigc/RatioSelector.vue index 0fd2b5b..ff079a9 100644 --- a/app/components/aigc/RatioSelector.vue +++ b/app/components/aigc/RatioSelector.vue @@ -68,7 +68,7 @@ const getShapeSize = (r: { w: number; h: number }, size: number) => { :class="[ratio.value === selected && 'bg-sky-200/50 dark:bg-sky-700/50']" >
-import type { PropType } from 'vue' -import type { ChatSession } from '~/typings/llm' - -const props = defineProps({ - active: { - type: Boolean, - default: false, - }, - chatSession: { - type: Object as PropType, - required: true, - }, -}) -const emit = defineEmits<{ - (e: 'remove', session: ChatSession): void -}>() - -const dayjs = useDayjs() - - - - - diff --git a/app/components/aigc/chat/Message.vue b/app/components/aigc/chat/Message.vue deleted file mode 100644 index 07f086d..0000000 --- a/app/components/aigc/chat/Message.vue +++ /dev/null @@ -1,129 +0,0 @@ - - - - - diff --git a/app/components/aigc/chat/NewSessionScreen.vue b/app/components/aigc/chat/NewSessionScreen.vue deleted file mode 100644 index 64cffc2..0000000 --- a/app/components/aigc/chat/NewSessionScreen.vue +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - diff --git a/app/components/aigc/drawing/OptionBlock.vue b/app/components/aigc/drawing/OptionBlock.vue deleted file mode 100644 index 20d05a9..0000000 --- a/app/components/aigc/drawing/OptionBlock.vue +++ /dev/null @@ -1,51 +0,0 @@ - - - - - diff --git a/app/components/aigc/drawing/ResultBlock.vue b/app/components/aigc/drawing/ResultBlock.vue deleted file mode 100644 index d54d11e..0000000 --- a/app/components/aigc/drawing/ResultBlock.vue +++ /dev/null @@ -1,303 +0,0 @@ - - - - - diff --git a/app/components/aigc/drawing/index.d.ts b/app/components/aigc/drawing/index.d.ts deleted file mode 100644 index 206eda9..0000000 --- a/app/components/aigc/drawing/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export declare interface ResultBlockMeta { - modal?: string - cost?: string - ratio?: string - id?: string - style?: string - datetime?: number - type?: string -} diff --git a/app/components/aigc/generation/CGTaskCard.client.vue b/app/components/aigc/generation/CGTaskCard.client.vue index a651704..130469c 100644 --- a/app/components/aigc/generation/CGTaskCard.client.vue +++ b/app/components/aigc/generation/CGTaskCard.client.vue @@ -6,7 +6,6 @@ import gsap from 'gsap' const toast = useToast() const loginState = useLoginState() -const { metaSymbol } = useShortcuts() const srtEditor = ref() @@ -59,17 +58,17 @@ const isPreviewModalOpen = ref(false) const stateDisplay = computed(() => { if (props.course.progress === -1) return { - color: 'red', + color: 'error' as const, text: '失败', } if (props.course.progress === 100) return { - color: 'green', + color: 'success' as const, text: '完成', } return { - color: 'blue', - text: !!props.course.progress + color: 'info' as const, + text: props.course.progress ? `${tweenedGenerateProgress.value.toFixed(0)}%` : '队列中', } @@ -108,7 +107,7 @@ const startDownload = async (url: string, filename: string) => { toast.add({ title: '下载完成', description: '资源下载已完成', - color: 'green', + color: 'success', icon: 'i-tabler-check', }) }) @@ -122,7 +121,7 @@ const startDownload = async (url: string, filename: string) => { toast.add({ title: '下载失败', description: err.message || '下载失败,未知错误', - color: 'red', + color: 'error', icon: 'i-tabler-alert-triangle', }) }) @@ -137,7 +136,7 @@ const copyTaskId = (extraMessage?: string) => { toast.add({ title: '复制成功', description: '已复制任务 ID', - color: 'green', + color: 'success', icon: 'i-tabler-check', }) } @@ -155,7 +154,7 @@ const onCombination = async () => { toast.add({ title: '获取字幕失败', description: '无法获取字幕文件,请稍后重试', - color: 'red', + color: 'error', icon: 'i-tabler-alert-triangle', }) return @@ -174,7 +173,7 @@ const onCombination = async () => { toast.add({ title: '嵌入字幕失败', description: err.message || '未知错误', - color: 'red', + color: 'error', icon: 'i-tabler-alert-triangle', }) combinationState.value = 0 @@ -208,7 +207,7 @@ const onRetryClick = (course: resp.gen.CourseGenItem) => { toast.add({ title: '重试已提交', description: '已加入生成队列', - color: 'green', + color: 'success', icon: 'i-tabler-check', }) // delete @@ -217,7 +216,7 @@ const onRetryClick = (course: resp.gen.CourseGenItem) => { toast.add({ title: '提交重试失败', description: res.msg || '未知错误', - color: 'red', + color: 'error', icon: 'i-tabler-alert-triangle', }) } @@ -226,7 +225,7 @@ const onRetryClick = (course: resp.gen.CourseGenItem) => { toast.add({ title: '提交重试失败', description: err.message || '未知错误', - color: 'red', + color: 'error', icon: 'i-tabler-alert-triangle', }) } @@ -236,11 +235,11 @@ const onRetryClick = (course: resp.gen.CourseGenItem) => { diff --git a/app/pages/generation/avatar-models.vue b/app/pages/generation/avatar-models.vue index a7418a7..eb2ce42 100644 --- a/app/pages/generation/avatar-models.vue +++ b/app/pages/generation/avatar-models.vue @@ -1,6 +1,6 @@