refactor: move editor components to components/editor/
This commit is contained in:
@@ -78,11 +78,12 @@ import { Icon } from "@iconify/vue"
|
||||
import { marked } from "marked"
|
||||
import PromptPanel from "../components/PromptPanel.vue"
|
||||
import ExternalAIPanel from "../components/ExternalAIPanel.vue"
|
||||
import Preview from "../components/Preview.vue"
|
||||
import Preview from "../components/editor/Preview.vue"
|
||||
import TaskStatsModal from "../components/TaskStatsModal.vue"
|
||||
import { Challenge, Submission } from "../api"
|
||||
import { html, css, js } from "../store/editors"
|
||||
import { taskId } from "../store/task"
|
||||
import { taskId, taskTab, challengeDisplay } from "../store/task"
|
||||
import { TASK_TYPE } from "../utils/const"
|
||||
import { authed, roleAdmin, roleSuper } from "../store/user"
|
||||
import {
|
||||
connectPrompt,
|
||||
@@ -106,6 +107,8 @@ watch(streaming, (val) => {
|
||||
|
||||
async function loadChallenge() {
|
||||
const display = Number(route.params.display)
|
||||
taskTab.value = TASK_TYPE.Challenge
|
||||
challengeDisplay.value = display
|
||||
const data = await Challenge.get(display)
|
||||
taskId.value = data.task_ptr
|
||||
challengeContent.value = await marked.parse(data.content, { async: true })
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { useMagicKeys, whenever } from "@vueuse/core"
|
||||
import Editors from "../components/Editors.vue"
|
||||
import Preview from "../components/Preview.vue"
|
||||
import Editors from "../components/editor/Editors.vue"
|
||||
import Preview from "../components/editor/Preview.vue"
|
||||
import Task from "../components/Task.vue"
|
||||
import { show, panelSize } from "../store/panel"
|
||||
import { html, css, js } from "../store/editors"
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
style="height: 100%; padding-right: 10px; overflow: hidden"
|
||||
>
|
||||
<n-flex justify="space-between" style="flex-shrink: 0">
|
||||
<n-button secondary @click="() => goHome($router, taskTab, step)">
|
||||
<n-button secondary @click="() => goHome($router, taskTab, taskTab === TASK_TYPE.Challenge ? challengeDisplay : step)">
|
||||
首页
|
||||
</n-button>
|
||||
<n-flex align="center">
|
||||
@@ -112,7 +112,7 @@ import { TASK_TYPE } from "../utils/const"
|
||||
import { watchDebounced } from "@vueuse/core"
|
||||
import { useRouter, useRoute } from "vue-router"
|
||||
|
||||
import Preview from "../components/Preview.vue"
|
||||
import Preview from "../components/editor/Preview.vue"
|
||||
import TaskTitle from "../components/submissions/TaskTitle.vue"
|
||||
import CodeModal from "../components/submissions/CodeModal.vue"
|
||||
import ChainModal from "../components/submissions/ChainModal.vue"
|
||||
@@ -120,7 +120,7 @@ import FlagCell from "../components/submissions/FlagCell.vue"
|
||||
import ExpandedSubTable from "../components/submissions/ExpandedSubTable.vue"
|
||||
|
||||
import { submission } from "../store/submission"
|
||||
import { taskTab } from "../store/task"
|
||||
import { taskTab, challengeDisplay } from "../store/task"
|
||||
import { step } from "../store/tutorial"
|
||||
import { html as eHtml, css as eCss, js as eJs } from "../store/editors"
|
||||
import { roleAdmin, roleSuper, user } from "../store/user"
|
||||
|
||||
Reference in New Issue
Block a user