change to vite8
Some checks failed
Deploy / deploy (build, debian, 22, /root/OJDeploy/data/clientnext) (push) Has been cancelled
Deploy / deploy (build:staging, school, 8822, /root/OJ/data/dist) (push) Has been cancelled

This commit is contained in:
2026-07-02 18:28:47 -06:00
parent 5d418a2280
commit dd29f04664
62 changed files with 3033 additions and 1028 deletions

View File

@@ -1,6 +1,6 @@
<script lang="ts" setup>
import TextEditor from "shared/components/TextEditor.vue"
import { AnnouncementEdit } from "utils/types"
import type { AnnouncementEdit } from "utils/types"
import { createAnnouncement, editAnnouncement, getAnnouncement } from "../api"
interface Props {

View File

@@ -2,7 +2,7 @@
import { NSwitch } from "naive-ui"
import Pagination from "shared/components/Pagination.vue"
import { parseTime } from "utils/functions"
import { Announcement } from "utils/types"
import type { Announcement } from "utils/types"
import { editAnnouncement, getAnnouncementList } from "../api"
import Actions from "./components/Actions.vue"

View File

@@ -20,7 +20,7 @@
import { NButton } from "naive-ui"
import Pagination from "shared/components/Pagination.vue"
import { parseTime } from "utils/functions"
import { Comment } from "utils/types"
import type { Comment } from "utils/types"
import { getCommentList } from "../api"
import CommentActions from "./components/CommentActions.vue"

View File

@@ -1,5 +1,5 @@
<script lang="ts" setup>
import { Contest } from "utils/types"
import type { Contest } from "utils/types"
import { cloneContest } from "../../api"
interface Props {

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { h } from "vue"
import { ProblemSetBadge } from "utils/types"
import type { ProblemSetBadge } from "utils/types"
import { NButton, NImage } from "naive-ui"
interface Props {

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ProblemSetBadge } from "utils/types"
import type { ProblemSetBadge } from "utils/types"
interface Props {
show: boolean

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ProblemSetProblem } from "utils/types"
import type { ProblemSetProblem } from "utils/types"
interface Props {
show: boolean

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { h } from "vue"
import { NDataTable, NButton, NFlex } from "naive-ui"
import { ProblemSetProblem } from "utils/types"
import type { ProblemSetProblem } from "utils/types"
interface Props {
problems: ProblemSetProblem[]

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { parseTime } from "utils/functions"
import { ProblemSet } from "utils/types"
import type { ProblemSet } from "utils/types"
interface Props {
problemSet: ProblemSet

View File

@@ -2,7 +2,7 @@
import { h } from "vue"
import { NDataTable, NButton, NFlex } from "naive-ui"
import { parseTime } from "utils/functions"
import { ProblemSetProgress } from "utils/types"
import type { ProblemSetProgress } from "utils/types"
interface Props {
progress: ProblemSetProgress[]

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { NTabPane, NTabs, NButton, NFlex } from "naive-ui"
import {
import type {
ProblemSet,
ProblemSetProblem,
ProblemSetBadge,

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { CreateProblemSetData, EditProblemSetData } from "utils/types"
import type { CreateProblemSetData, EditProblemSetData } from "utils/types"
import { getProblemSetDetail, createProblemSet, editProblemSet } from "../api"
const route = useRoute()

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { NButton, NTag } from "naive-ui"
import { parseTime } from "utils/functions"
import { Server } from "utils/types"
import type { Server } from "utils/types"
import { useConfigStore } from "shared/store/config"
import { useConfigWebSocket } from "shared/composables/websocket"
import {

View File

@@ -6,7 +6,7 @@ import { getRank } from "oj/api"
import Pagination from "shared/components/Pagination.vue"
import { useUserStore } from "shared/store/user"
import { getACRate } from "utils/functions"
import { Rank } from "utils/types"
import type { Rank } from "utils/types"
import { getBaseInfo, randomUser10 } from "../api"
const userCount = ref(0)

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import {
import type {
Exercise,
ExerciseType,
ExerciseMcqData,

View File

@@ -1,7 +1,7 @@
<script lang="ts" setup>
import CodeEditor from "shared/components/CodeEditor.vue"
import MarkdownEditor from "shared/components/MarkdownEditor.vue"
import { Tutorial } from "utils/types"
import type { Tutorial } from "utils/types"
import { createTutorial, getTutorial, updateTutorial } from "../api"
import ExerciseManager from "./components/ExerciseManager.vue"

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { NSwitch } from "naive-ui"
import { parseTime } from "utils/functions"
import { Tutorial } from "utils/types"
import type { Tutorial } from "utils/types"
import { getTutorialList, setTutorialVisibility } from "../api"
import Actions from "./components/Actions.vue"

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { PROBLEM_PERMISSION, USER_TYPE } from "utils/constants"
import { getUserRole } from "utils/functions"
import { User } from "utils/types"
import type { User } from "utils/types"
import TextCopy from "shared/components/TextCopy.vue"
interface Props {

View File

@@ -3,7 +3,7 @@ import { DataTableRowKey, SelectOption } from "naive-ui"
import Pagination from "shared/components/Pagination.vue"
import { usePagination } from "shared/composables/pagination"
import { parseTime } from "utils/functions"
import { User } from "utils/types"
import type { User } from "utils/types"
import {
deleteUsers,
editUser,

10
src/env.d.ts vendored
View File

@@ -1,4 +1,4 @@
/// <reference types="@rsbuild/core/types" />
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly PUBLIC_ENV: string
@@ -14,11 +14,3 @@ interface ImportMetaEnv {
interface ImportMeta {
readonly env: ImportMetaEnv
}
interface Document {
startViewTransition?: (callback: () => void | Promise<void>) => {
ready: Promise<void>
finished: Promise<void>
updateCallbackDone: Promise<void>
}
}

View File

@@ -36,7 +36,7 @@
<script lang="ts" setup>
import { NButton, NTooltip } from "naive-ui"
import TagTitle from "./TagTitle.vue"
import { FlowchartSummary, SolvedProblem } from "utils/types"
import type { FlowchartSummary, SolvedProblem } from "utils/types"
import { useAIStore } from "oj/store/ai"
import { useBreakpoints } from "shared/composables/breakpoints"
import { parseTime } from "utils/functions"

View File

@@ -5,7 +5,7 @@ import Pagination from "shared/components/Pagination.vue"
import { useBreakpoints } from "shared/composables/breakpoints"
import { parseTime } from "utils/functions"
import { renderTableTitle } from "utils/renders"
import { Announcement } from "utils/types"
import type { Announcement } from "utils/types"
import TitleWithTag from "./components/TitleWithTag.vue"
const total = ref(0)

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ContestRank } from "utils/types"
import type { ContestRank } from "utils/types"
interface Props {
rank: ContestRank

View File

@@ -15,7 +15,7 @@ import {
Tooltip,
Legend,
} from "chart.js"
import { ContestRank } from "utils/types"
import type { ContestRank } from "utils/types"
ChartJS.register(
CategoryScale,

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ProblemFiltered } from "utils/types"
import type { ProblemFiltered } from "utils/types"
import ProblemStatus from "oj/problem/components/ProblemStatus.vue"
import { useContestStore } from "oj/store/contest"
import { renderTableTitle } from "utils/renders"

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { Exercise, ExerciseDebugData } from "utils/types"
import type { Exercise, ExerciseDebugData } from "utils/types"
import { highlightLines } from "../composables/useCodeHighlight"
import "./exercise-highlight.css"

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { Exercise, ExerciseGroupData } from "utils/types"
import type { Exercise, ExerciseGroupData } from "utils/types"
const props = defineProps<{ exercise: Exercise; lang?: string }>()
const data = computed(() => props.exercise.data as ExerciseGroupData)

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { Exercise, ExerciseMatchData } from "utils/types"
import type { Exercise, ExerciseMatchData } from "utils/types"
const props = defineProps<{ exercise: Exercise; lang?: string }>()
const data = computed(() => props.exercise.data as ExerciseMatchData)

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { Exercise, ExerciseMcqData } from "utils/types"
import type { Exercise, ExerciseMcqData } from "utils/types"
const props = defineProps<{ exercise: Exercise }>()
const data = computed(() => props.exercise.data as ExerciseMcqData)

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { Exercise, ExercisePredictData } from "utils/types"
import type { Exercise, ExercisePredictData } from "utils/types"
import { highlight } from "../composables/useCodeHighlight"
import "./exercise-highlight.css"

View File

@@ -2,7 +2,7 @@
import hljs from "highlight.js/lib/core"
import python from "highlight.js/lib/languages/python"
import c from "highlight.js/lib/languages/c"
import { Exercise, ExerciseSortData } from "utils/types"
import type { Exercise, ExerciseSortData } from "utils/types"
hljs.registerLanguage("python", python)
hljs.registerLanguage("c", c)

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import { Exercise } from "utils/types"
import type { Exercise } from "utils/types"
const ExerciseMcq = defineAsyncComponent(() => import("./ExerciseMcq.vue"))
const ExerciseSort = defineAsyncComponent(() => import("./ExerciseSort.vue"))

View File

@@ -1,4 +1,4 @@
import { Exercise } from "utils/types"
import type { Exercise } from "utils/types"
type Segment =
| { type: "md"; content: string }

View File

@@ -7,7 +7,7 @@ import CodeEditor from "shared/components/CodeEditor.vue"
import { useBreakpoints } from "shared/composables/breakpoints"
import { provideSyncStatus } from "oj/composables/syncStatus"
import storage from "utils/storage"
import { LANGUAGE } from "utils/types"
import type { LANGUAGE } from "utils/types"
import Form from "./Form.vue"
const route = useRoute()

View File

@@ -15,7 +15,7 @@ import {
import { useBreakpoints } from "shared/composables/breakpoints"
import { useUserStore } from "shared/store/user"
import storage from "utils/storage"
import { LANGUAGE } from "utils/types"
import type { LANGUAGE } from "utils/types"
import StatisticsPanel from "shared/components/StatisticsPanel.vue"
import IconButton from "shared/components/IconButton.vue"
import { Icon } from "@iconify/vue"

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { Icon } from "@iconify/vue"
import { ProblemSet, UserBadge as UserBadgeType } from "utils/types"
import type { ProblemSet, UserBadge as UserBadgeType } from "utils/types"
import UserBadge from "shared/components/UserBadge.vue"
import { useUserStore } from "shared/store/user"

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { Icon } from "@iconify/vue"
import { ProblemSetProblem } from "utils/types"
import type { ProblemSetProblem } from "utils/types"
import { DIFFICULTY } from "utils/constants"
import { getTagColor } from "utils/functions"
import { useBreakpoints } from "shared/composables/breakpoints"

View File

@@ -2,7 +2,7 @@
import { h, computed, ref, onMounted, watch } from "vue"
import { watchDebounced } from "@vueuse/core"
import { parseTime } from "utils/functions"
import { ProblemSetProgress } from "utils/types"
import type { ProblemSetProgress } from "utils/types"
import { getProblemSetUserProgress } from "../../api"
import { NFlex, NTag } from "naive-ui"
import { usePagination } from "shared/composables/pagination"

View File

@@ -5,7 +5,7 @@ import {
joinProblemSet,
getUserBadges,
} from "../api"
import {
import type {
ProblemSet,
ProblemSetProblem,
UserBadge as UserBadgeType,

View File

@@ -11,7 +11,7 @@ import {
Colors,
} from "chart.js"
import { ChartType } from "utils/constants"
import { Rank } from "utils/types"
import type { Rank } from "utils/types"
// 仅注册柱状图所需的 Chart.js 组件
ChartJS.register(

View File

@@ -1,4 +1,4 @@
import { DetailsData, DurationData } from "utils/types"
import type { DetailsData, DurationData } from "utils/types"
import { consumeJSONEventStream } from "utils/stream"
import {
getAIDetailData,

View File

@@ -1,7 +1,7 @@
import { defineStore } from "pinia"
import { STORAGE_KEY } from "utils/constants"
import storage from "utils/storage"
import { Code, LANGUAGE } from "utils/types"
import type { Code, LANGUAGE } from "utils/types"
/**
* 代码编辑器状态管理 Store

View File

@@ -2,7 +2,7 @@ import { formatISO, getTime, parseISO } from "date-fns"
import { useUserStore } from "shared/store/user"
import { ContestStatus, ContestType } from "utils/constants"
import { duration } from "utils/functions"
import { Contest, Problem } from "utils/types"
import type { Contest, Problem } from "utils/types"
import {
checkContestPassword,
getContest,

View File

@@ -109,7 +109,7 @@
<script setup lang="ts">
import { Icon } from "@iconify/vue"
import { FlowchartSubmission } from "utils/types"
import type { FlowchartSubmission } from "utils/types"
import { useMermaid } from "shared/composables/useMermaid"
interface Props {

View File

@@ -5,7 +5,7 @@
</n-text>
</template>
<script setup lang="ts">
import { Grade } from "utils/types"
import type { Grade } from "utils/types"
defineProps<{
score: number
grade: Grade

View File

@@ -11,7 +11,7 @@ import {
submissionTimeFormat,
utoa,
} from "utils/functions"
import { Submission } from "utils/types"
import type { Submission } from "utils/types"
import SubmissionResultTag from "shared/components/SubmissionResultTag.vue"
import { useBreakpoints } from "shared/composables/breakpoints"
import { useCodeStore } from "oj/store/code"

View File

@@ -48,7 +48,7 @@ import { JUDGE_STATUS, LANGUAGE_FORMAT_VALUE } from "utils/constants"
import Copy from "shared/components/Copy.vue"
import Pagination from "shared/components/Pagination.vue"
import { parseTime } from "utils/functions"
import { Message } from "utils/types"
import type { Message } from "utils/types"
const router = useRouter()
const messages = ref<Message[]>([])

View File

@@ -1,5 +1,5 @@
import http from "utils/http"
import { Profile, Tag } from "utils/types"
import type { Profile, Tag } from "utils/types"
export function login(data: { username: string; password: string }) {
return http.post("login", data)

View File

@@ -1,7 +1,7 @@
<script setup lang="ts">
import { Icon } from "@iconify/vue"
import { ContestType } from "utils/constants"
import { Contest } from "utils/types"
import type { Contest } from "utils/types"
defineProps<{ contest: Contest }>()
</script>

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { ContestType } from "utils/constants"
import { Contest } from "utils/types"
import type { Contest } from "utils/types"
interface Props {
contest: Contest

View File

@@ -1,6 +1,6 @@
<script setup lang="ts">
import { JUDGE_STATUS } from "utils/constants"
import { SUBMISSION_RESULT } from "utils/types"
import type { SUBMISSION_RESULT } from "utils/types"
interface Props {
result: SUBMISSION_RESULT

View File

@@ -23,7 +23,7 @@
</template>
<script setup lang="ts">
import { UserBadge } from "utils/types"
import type { UserBadge } from "utils/types"
import { parseTime } from "utils/functions"
interface Props {
badge: UserBadge

View File

@@ -1,5 +1,5 @@
import { getWebsiteConfig } from "oj/api"
import { WebsiteConfig } from "utils/types"
import type { WebsiteConfig } from "utils/types"
export const useConfigStore = defineStore("config", () => {
const config = ref<WebsiteConfig>({

View File

@@ -1,6 +1,6 @@
import { PROBLEM_PERMISSION, STORAGE_KEY, USER_TYPE } from "utils/constants"
import storage from "utils/storage"
import { Profile, User } from "utils/types"
import type { Profile, User } from "utils/types"
import { getProfile } from "../api"
import { useConfigStore } from "./config"