add cpp
Some checks failed
Deploy / build-and-deploy (push) Has been cancelled

This commit is contained in:
2025-09-10 13:46:12 +08:00
parent 044b33f39c
commit 80d279365c
5 changed files with 5 additions and 3 deletions

1
public/cpp.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><path fill="#659ad2" d="M29 10.232a2.4 2.4 0 0 0-.318-1.244a2.45 2.45 0 0 0-.936-.879q-5.194-2.868-10.393-5.733a2.64 2.64 0 0 0-2.763.024c-1.378.779-8.275 4.565-10.331 5.706A2.29 2.29 0 0 0 3 10.231V21.77a2.4 2.4 0 0 0 .3 1.22a2.43 2.43 0 0 0 .954.9c2.056 1.141 8.954 4.927 10.332 5.706a2.64 2.64 0 0 0 2.763.026q5.19-2.871 10.386-5.733a2.44 2.44 0 0 0 .955-.9a2.4 2.4 0 0 0 .3-1.22V10.232"/><path fill="#00599c" d="M28.549 23.171a2 2 0 0 0 .147-.182a2.4 2.4 0 0 0 .3-1.22V10.232a2.4 2.4 0 0 0-.318-1.244c-.036-.059-.089-.105-.13-.16L16 16Z"/><path fill="#004482" d="M28.549 23.171L16 16L3.451 23.171a2.4 2.4 0 0 0 .809.72c2.056 1.141 8.954 4.927 10.332 5.706a2.64 2.64 0 0 0 2.763.026q5.19-2.871 10.386-5.733a2.4 2.4 0 0 0 .808-.719"/><path fill="#fff" d="M19.6 18.02a4.121 4.121 0 1 1-.027-4.087l3.615-2.073A8.309 8.309 0 0 0 7.7 16a8.2 8.2 0 0 0 1.1 4.117a8.319 8.319 0 0 0 14.411-.017z"/><path fill="#fff" d="M24.076 15.538h-.926v-.921h-.925v.921h-.926v.923h.926v.92h.925v-.92h.926zm3.473 0h-.926v-.921h-.926v.921h-.926v.923h.926v.92h.926v-.92h.926z"/></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -68,6 +68,5 @@ export async function createCode(data: { code: string; query: string }) {
} }
export async function removeCode(id: number) { export async function removeCode(id: number) {
const res = await api.delete(`/${id}`) await api.delete(`/${id}`)
console.log(res.data)
} }

View File

@@ -6,6 +6,7 @@ import { code } from "../composables/code"
const LANGS = [ const LANGS = [
["python", "Python"], ["python", "Python"],
["c", "C 语言"], ["c", "C 语言"],
["cpp", "C++"],
] ]
const languages: SelectOption[] = LANGS.map((it) => ({ const languages: SelectOption[] = LANGS.map((it) => ({

View File

@@ -17,6 +17,7 @@ const cache: Cache = {
code: { code: {
python: useStorage("code_python", sources["python"]), python: useStorage("code_python", sources["python"]),
c: useStorage("code_c", sources["c"]), c: useStorage("code_c", sources["c"]),
cpp: useStorage("code_cpp", sources["cpp"]),
}, },
} }

View File

@@ -1,6 +1,6 @@
import { RemovableRef } from "@vueuse/core" import { RemovableRef } from "@vueuse/core"
export type LANGUAGE = "c" | "python" export type LANGUAGE = "c" | "python" | "cpp"
export interface Code { export interface Code {
value: string value: string