This commit is contained in:
lhx-666-cool
2025-04-25 21:03:43 +08:00
parent f6cb277519
commit a92e796078
14 changed files with 197 additions and 35 deletions

2
web/.env Normal file
View File

@@ -0,0 +1,2 @@
VITE_BACKEND="https://fuhncvpxdcuf.ap-northeast-1.clawcloudrun.com"
VITE_LSP_SERVER="wss://lsp.hxzzz.asia/cpp"

2
web/.env.example Normal file
View File

@@ -0,0 +1,2 @@
VITE_BACKEND="https://example.com"
VITE_LSP_SERVER="wss://example.com/cpp"

25
web/.gitignore vendored Normal file
View File

@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.env

1
web/dist/assets/index-BilnBkEm.css vendored Normal file

File diff suppressed because one or more lines are too long

128
web/dist/assets/index-IyJvCkxk.js vendored Normal file

File diff suppressed because one or more lines are too long

10
web/dist/config.js vendored
View File

@@ -1,5 +1,9 @@
window.CONFIG = { window.CONFIG = {
BACKEND: "__BACKEND_URL_PLACEHOLDER__", BACKEND: "https://fuhncvpxdcuf.ap-northeast-1.clawcloudrun.com",
LSP_SERVER: "__LSP_SERVER_URL_PLACEHOLDER__" LSP_SERVER: "wss://lsp.hxzzz.asia/cpp"
}; }
window.CONFIG = {
BACKEND: "https://example.com",
LSP_SERVER: "wss://examplelsp.com/cpp"
}

4
web/dist/index.html vendored
View File

@@ -5,8 +5,8 @@
<link rel="icon" type="image/svg+xml" href="/meow.png" /> <link rel="icon" type="image/svg+xml" href="/meow.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Meow Page</title> <title>Meow Page</title>
<script type="module" crossorigin src="/assets/index-DxgtxK6M.js"></script> <script type="module" crossorigin src="/assets/index-IyJvCkxk.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-v4vzjzRk.css"> <link rel="stylesheet" crossorigin href="/assets/index-BilnBkEm.css">
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>

View File

@@ -7,65 +7,68 @@
"@codemirror/commands": { "@codemirror/commands": {
"src": "../../@codemirror/commands/dist/index.js", "src": "../../@codemirror/commands/dist/index.js",
"file": "@codemirror_commands.js", "file": "@codemirror_commands.js",
"fileHash": "79035fff", "fileHash": "6c978497",
"needsInterop": false "needsInterop": false
}, },
"@codemirror/lang-cpp": { "@codemirror/lang-cpp": {
"src": "../../@codemirror/lang-cpp/dist/index.js", "src": "../../@codemirror/lang-cpp/dist/index.js",
"file": "@codemirror_lang-cpp.js", "file": "@codemirror_lang-cpp.js",
"fileHash": "1c5c6400", "fileHash": "6190eb4b",
"needsInterop": false "needsInterop": false
}, },
"@codemirror/state": { "@codemirror/state": {
"src": "../../@codemirror/state/dist/index.js", "src": "../../@codemirror/state/dist/index.js",
"file": "@codemirror_state.js", "file": "@codemirror_state.js",
"fileHash": "37111c8b", "fileHash": "c4694a59",
"needsInterop": false "needsInterop": false
}, },
"@codemirror/theme-one-dark": { "@codemirror/theme-one-dark": {
"src": "../../@codemirror/theme-one-dark/dist/index.js", "src": "../../@codemirror/theme-one-dark/dist/index.js",
"file": "@codemirror_theme-one-dark.js", "file": "@codemirror_theme-one-dark.js",
"fileHash": "c0515ff8", "fileHash": "65bffb1c",
"needsInterop": false "needsInterop": false
}, },
"@codemirror/view": { "@codemirror/view": {
"src": "../../@codemirror/view/dist/index.js", "src": "../../@codemirror/view/dist/index.js",
"file": "@codemirror_view.js", "file": "@codemirror_view.js",
"fileHash": "0370f8c1", "fileHash": "d1cd0203",
"needsInterop": false "needsInterop": false
}, },
"codemirror": { "codemirror": {
"src": "../../codemirror/dist/index.js", "src": "../../codemirror/dist/index.js",
"file": "codemirror.js", "file": "codemirror.js",
"fileHash": "1422892d", "fileHash": "b30e7433",
"needsInterop": false "needsInterop": false
}, },
"codemirror-languageserver": { "codemirror-languageserver": {
"src": "../../codemirror-languageserver/dist/index.js", "src": "../../codemirror-languageserver/dist/index.js",
"file": "codemirror-languageserver.js", "file": "codemirror-languageserver.js",
"fileHash": "ea145022", "fileHash": "e0f65388",
"needsInterop": false "needsInterop": false
}, },
"vue": { "vue": {
"src": "../../vue/dist/vue.runtime.esm-bundler.js", "src": "../../vue/dist/vue.runtime.esm-bundler.js",
"file": "vue.js", "file": "vue.js",
"fileHash": "ff41c326", "fileHash": "b719eac0",
"needsInterop": false "needsInterop": false
}, },
"vue-router": { "vue-router": {
"src": "../../vue-router/dist/vue-router.mjs", "src": "../../vue-router/dist/vue-router.mjs",
"file": "vue-router.js", "file": "vue-router.js",
"fileHash": "75f10b17", "fileHash": "af5ae4a0",
"needsInterop": false "needsInterop": false
} }
}, },
"chunks": { "chunks": {
"chunk-U3LI7FBV": {
"file": "chunk-U3LI7FBV.js"
},
"chunk-HCLPPKHD": {
"file": "chunk-HCLPPKHD.js"
},
"chunk-DAJFLW74": { "chunk-DAJFLW74": {
"file": "chunk-DAJFLW74.js" "file": "chunk-DAJFLW74.js"
}, },
"chunk-OE45CUQR": {
"file": "chunk-OE45CUQR.js"
},
"chunk-ELUT3ZLT": { "chunk-ELUT3ZLT": {
"file": "chunk-ELUT3ZLT.js" "file": "chunk-ELUT3ZLT.js"
}, },
@@ -75,9 +78,6 @@
"chunk-JEVQZFNC": { "chunk-JEVQZFNC": {
"file": "chunk-JEVQZFNC.js" "file": "chunk-JEVQZFNC.js"
}, },
"chunk-U3LI7FBV": {
"file": "chunk-U3LI7FBV.js"
},
"chunk-EWTE5DHJ": { "chunk-EWTE5DHJ": {
"file": "chunk-EWTE5DHJ.js" "file": "chunk-EWTE5DHJ.js"
} }

View File

@@ -2501,13 +2501,13 @@ var lintGutterConfig = Facet.define({
}); });
export { export {
crelt,
insertCompletionText, insertCompletionText,
closeBrackets, closeBrackets,
closeBracketsKeymap, closeBracketsKeymap,
autocompletion, autocompletion,
completionKeymap, completionKeymap,
crelt,
setDiagnostics, setDiagnostics,
lintKeymap lintKeymap
}; };
//# sourceMappingURL=chunk-OE45CUQR.js.map //# sourceMappingURL=chunk-HCLPPKHD.js.map

View File

@@ -2,7 +2,7 @@ import {
autocompletion, autocompletion,
insertCompletionText, insertCompletionText,
setDiagnostics setDiagnostics
} from "./chunk-OE45CUQR.js"; } from "./chunk-HCLPPKHD.js";
import "./chunk-ELUT3ZLT.js"; import "./chunk-ELUT3ZLT.js";
import { import {
ViewPlugin, ViewPlugin,

View File

@@ -1,8 +1,3 @@
import {
defaultKeymap,
history,
historyKeymap
} from "./chunk-DAJFLW74.js";
import { import {
autocompletion, autocompletion,
closeBrackets, closeBrackets,
@@ -10,7 +5,12 @@ import {
completionKeymap, completionKeymap,
crelt, crelt,
lintKeymap lintKeymap
} from "./chunk-OE45CUQR.js"; } from "./chunk-HCLPPKHD.js";
import {
defaultKeymap,
history,
historyKeymap
} from "./chunk-DAJFLW74.js";
import { import {
bracketMatching, bracketMatching,
defaultHighlightStyle, defaultHighlightStyle,

View File

@@ -82,9 +82,8 @@ const status = ref('completed')
const stderr = ref('') const stderr = ref('')
const time = ref(0) const time = ref(0)
const log = ref('') const log = ref('')
const serverUri = window.CONFIG.LSP_SERVER !== '__LSP_SERVER_URL_PLACEHOLDER__'? window.CONFIG.LSP_SERVER : import.meta.env.VITE_LSP_SERVER;
const serverUri = window.CONFIG.LSP_SERVER; const backend = window.CONFIG.BACKEND !== '__BACKEND_URL_PLACEHOLDER__'? window.CONFIG.BACKEND : import.meta.env.VITE_BACKEND;
const backend = window.CONFIG.BACKEND;
const ls = languageServer({ const ls = languageServer({
serverUri, serverUri,
rootUri: 'file:///main.cpp', rootUri: 'file:///main.cpp',
@@ -135,7 +134,8 @@ onMounted(() => {
state, state,
parent: editorContainer.value as HTMLElement parent: editorContainer.value as HTMLElement
}) })
if (props.id !== null) { console.log(props.id)
if (props.id !== null && props.id !== undefined && props.id !== '') {
fetch(backend + `/api/pastes/${props.id}`) fetch(backend + `/api/pastes/${props.id}`)
.then(res => res.json()) .then(res => res.json())
.then(res => { .then(res => {