Skip to content

Commit

Permalink
Merge pull request #20 from andyjjrt/dev_2.4.1
Browse files Browse the repository at this point in the history
v2.4.1
  • Loading branch information
andyjjrt authored Mar 25, 2024
2 parents bae5bf1 + c383a56 commit 50d32f0
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 32 deletions.
23 changes: 11 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ojfe",
"private": true,
"version": "2.4.0",
"version": "2.4.1",
"type": "module",
"scripts": {
"dev": "vite --port 3000",
Expand All @@ -14,27 +14,27 @@
"@kangc/v-md-editor": "^2.3.18",
"@monaco-editor/loader": "^1.4.0",
"@popperjs/core": "^2.11.8",
"@vueuse/core": "^10.8.0",
"@vueuse/core": "^10.9.0",
"axios": "^1.6.7",
"chart.js": "^4.4.1",
"chart.js": "^4.4.2",
"katex": "^0.16.9",
"papaparse": "^5.4.1",
"pinia": "^2.1.7",
"prismjs": "^1.29.0",
"ua-parser-js": "^1.0.37",
"v-calendar": "^3.1.2",
"vue": "^3.4.19",
"vue": "^3.4.21",
"vue-chartjs": "^5.3.0",
"vue-cropper": "^1.1.1",
"vue-i18n": "^9.9.1",
"vue-i18n": "^9.10.1",
"vue-m-message": "^4.0.2",
"vue-router": "^4.2.5",
"vuetify": "^3.5.4"
"vue-router": "^4.3.0",
"vuetify": "^3.5.8"
},
"devDependencies": {
"@mdi/font": "^7.4.47",
"@types/katex": "^0.16.7",
"@types/node": "^20.11.19",
"@types/node": "^20.11.24",
"@types/papaparse": "^5.3.14",
"@types/prismjs": "^1.26.3",
"@types/ua-parser-js": "^0.7.39",
Expand All @@ -43,11 +43,10 @@
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.71.1",
"typescript": "^5.3.3",
"vite": "^5.1.3",
"vite": "^5.1.5",
"vite-plugin-environment": "^1.1.3",
"vite-plugin-pwa": "^0.17.5",
"vite-plugin-vuetify": "^2.0.1",
"vue-tsc": "1.8.27",
"workbox-window": "^7.0.0"
"vite-plugin-vuetify": "^2.0.2",
"vue-tsc": "1.8.27"
}
}
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div>
<RouterView />
<ReloadPrompt />
<!-- <ReloadPrompt /> -->
</div>
</template>

Expand Down
31 changes: 19 additions & 12 deletions src/components/Problem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@
>
<v-icon icon="mdi-file-edit" />
</v-btn>
<v-icon
icon="mdi-check-circle"
color="success"
v-if="getProblemStatus === 1"
/>
<v-icon
icon="mdi-close-circle"
color="error"
v-else-if="getProblemStatus === -1"
/>
<div>
<v-icon
icon="mdi-check-circle"
color="success"
v-if="getProblemStatus === 1"
/>
<v-icon
icon="mdi-close-circle"
color="error"
v-else-if="getProblemStatus === -1"
/>
</div>
</div>
</v-card-title>

Expand Down Expand Up @@ -107,7 +109,7 @@
<v-icon icon="mdi-file-document-refresh-outline" />
</v-btn>
</div>

<div class="position-relative">
<v-progress-linear indeterminate absolute :active="loading" />
<MonacoEditor v-model="code" :lang="selectedLanguage" />
Expand Down Expand Up @@ -226,7 +228,12 @@ const input = computed(() => decodeURI(props.problem.input_description));
const output = computed(() => decodeURI(props.problem.output_description));
const samples = computed(() => props.problem.samples);
const hint = computed(() => decodeURI(props.problem.hint));
const languages = computed(() => props.problem.languages);
const languages = computed(
() =>
constants.languages
?.map((lang) => lang.name)
.filter((lang) => props.problem.languages.includes(lang)) || []
);
const templates = computed(() => props.problem.template);
const loading = ref(false);
Expand Down
9 changes: 5 additions & 4 deletions src/css/vuepress.css
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@
.vuepress-markdown-body code {
margin: 0;
padding: 0.25rem 0.5rem;
color: #476582;
font-size: 0.85em;
background-color: rgba(27, 31, 35, 0.05);
border-radius: 3px;
color: rgb(var(--v-theme-primary));
font-size: 0.85 em;
background-color: rgb(var(--v-theme-primary), var(--v-activated-opacity));
opacity:;
border-radius: 5px;
}
.vuepress-markdown-body code .token.deleted {
color: #ec5975;
Expand Down
17 changes: 14 additions & 3 deletions src/page/Problem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,18 @@
</template>

<script setup lang="ts">
import { useRoute } from "vue-router";
import { useRoute, useRouter } from "vue-router";
import { ref, onMounted, watch } from "vue";
import { useDisplay } from "vuetify";
import { fetchApi } from "../utils/api";
import Problem from "../components/Problem.vue";
import { useUserStore } from "../store/user";
import Loader from "../components/Loader.vue";
import Message from "vue-m-message";
const { mdAndUp } = useDisplay();
const routes = useRoute();
const router = useRouter();
const user = useUserStore();
const problem = ref<Problem | null>(null);
const loading = ref(false);
Expand All @@ -35,7 +36,17 @@ const init = async () => {
},
});
loading.value = false;
problem.value = response.data.data;
if (response.data.error) {
Message.error(response.data.data);
router.push({
name: "NotFound",
params: { pathMatch: routes.path.substring(1).split("/") },
query: routes.query,
hash: routes.hash,
});
} else {
problem.value = response.data.data;
}
};
onMounted(() => init());
Expand Down

0 comments on commit 50d32f0

Please sign in to comment.