mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-25 02:46:05 +03:00
Fix codespace url (#3436)
* Fix codespace url (https://github.com/louislam/uptime-kuma/pull/3432#discussion_r1265120809)
This commit is contained in:
parent
278b88a9d9
commit
8e72d6f534
3 changed files with 15 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"image": "mcr.microsoft.com/devcontainers/javascript-node:dev-20-bookworm",
|
"image": "mcr.microsoft.com/devcontainers/javascript-node:dev-18-bookworm",
|
||||||
"features": {
|
"features": {
|
||||||
"ghcr.io/devcontainers/features/github-cli:1": {}
|
"ghcr.io/devcontainers/features/github-cli:1": {}
|
||||||
},
|
},
|
||||||
|
@ -14,8 +14,7 @@
|
||||||
"vscode": {
|
"vscode": {
|
||||||
"extensions": [
|
"extensions": [
|
||||||
"streetsidesoftware.code-spell-checker",
|
"streetsidesoftware.code-spell-checker",
|
||||||
"dbaeumer.vscode-eslint",
|
"dbaeumer.vscode-eslint"
|
||||||
"GitHub.copilot"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -17,7 +17,9 @@ export default defineConfig({
|
||||||
},
|
},
|
||||||
define: {
|
define: {
|
||||||
"FRONTEND_VERSION": JSON.stringify(process.env.npm_package_version),
|
"FRONTEND_VERSION": JSON.stringify(process.env.npm_package_version),
|
||||||
"DEVCONTAINER": process.env.DEVCONTAINER,
|
"DEVCONTAINER": JSON.stringify(process.env.DEVCONTAINER),
|
||||||
|
"GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN": JSON.stringify(process.env.GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN),
|
||||||
|
"CODESPACE_NAME": JSON.stringify(process.env.CODESPACE_NAME),
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
commonjs(),
|
commonjs(),
|
||||||
|
|
|
@ -83,12 +83,19 @@ export function getResBaseURL() {
|
||||||
|
|
||||||
export function isDevContainer() {
|
export function isDevContainer() {
|
||||||
// eslint-disable-next-line no-undef
|
// eslint-disable-next-line no-undef
|
||||||
return (typeof DEVCONTAINER === "number" && DEVCONTAINER === 1);
|
return (typeof DEVCONTAINER === "string" && DEVCONTAINER === "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Supports GitHub Codespaces only currently
|
||||||
|
*/
|
||||||
export function getDevContainerServerHostname() {
|
export function getDevContainerServerHostname() {
|
||||||
// replace -3000 with -3001
|
if (!isDevContainer()) {
|
||||||
return location.hostname.replace(/-3000\.preview\.app\.github\.dev/, "-3001.preview.app.github.dev");
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
|
return CODESPACE_NAME + "-3001." + GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue