Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: move `static` to `public` folder (#1759)

boojack0a3b298886c5
diff --git a/frontend/index.html b/frontend/index.html
index 4468f93b9c..dc8d145622 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
- <link rel="icon" type="image/*" href="/static/favicon.ico" />
+ <link rel="icon" type="image/*" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Bytebase</title>
</head>
diff --git a/frontend/static/demo/schema-migration/guide.json b/frontend/public/demo/schema-migration/guide.json
similarity index 100%
rename from frontend/static/demo/schema-migration/guide.json
rename to frontend/public/demo/schema-migration/guide.json
diff --git a/frontend/static/demo/schema-migration/hint.json b/frontend/public/demo/schema-migration/hint.json
similarity index 100%
rename from frontend/static/demo/schema-migration/hint.json
rename to frontend/public/demo/schema-migration/hint.json
diff --git a/frontend/static/demo/schema-migration/recorder.json b/frontend/public/demo/schema-migration/recorder.json
similarity index 100%
rename from frontend/static/demo/schema-migration/recorder.json
rename to frontend/public/demo/schema-migration/recorder.json
diff --git a/frontend/static/favicon.ico b/frontend/public/favicon.ico
similarity index 100%
rename from frontend/static/favicon.ico
rename to frontend/public/favicon.ico
diff --git a/frontend/src/plugins/demo/data.ts b/frontend/src/plugins/demo/data.ts
index 8010117171..67bb765bca 100644
--- a/frontend/src/plugins/demo/data.ts
+++ b/frontend/src/plugins/demo/data.ts
@@ -3,7 +3,7 @@ import { validateStepData } from "./guide";
import { GuideData, HintData } from "./types";
const fetchJSONData = async (path: string) => {
- const res = await fetch("/static/demo" + path);
+ const res = await fetch("/demo" + path);
const data = await res.json();
return data;
};
diff --git a/frontend/src/plugins/demo/index.ts b/frontend/src/plugins/demo/index.ts
index 78029e93e3..908fe69ca3 100644
--- a/frontend/src/plugins/demo/index.ts
+++ b/frontend/src/plugins/demo/index.ts
@@ -1,3 +1,4 @@
+import { isNull } from "lodash-es";
import { initGuideListeners, initHintListeners } from "./listener";
import * as storage from "./storage";
@@ -10,6 +11,14 @@ window.addEventListener(
"hint",
]);
const params = new URLSearchParams(window.location.search);
+
+ // If there is a cleardemo flag in the url, then clear the demo storage and return
+ const clearDemo = params.get("cleardemo");
+ if (!isNull(clearDemo)) {
+ storage.remove(["guide", "hint"]);
+ return;
+ }
+
const paramGuide = params.get("guide");
const paramHint = params.get("hint");
diff --git a/frontend/static/favicon.svg b/frontend/static/favicon.svg
deleted file mode 100644
index 5d25a8b6f5..0000000000
--- a/frontend/static/favicon.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="160" height="160" viewBox="0 0 160 160" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M46.1905 152.505C29.9046 144.91 16.6497 132.054 8.56169 116.008C0.473633 99.9615 -1.97652 81.6593 1.60602 64.0506C5.18857 46.4418 14.5952 30.5519 28.3101 18.9414C42.025 7.33087 59.2495 0.675864 77.208 0.0487342C95.1666 -0.578395 112.813 4.85888 127.305 15.4844C141.796 26.11 152.288 41.3049 157.09 58.6209C161.893 75.9369 160.725 94.3654 153.776 110.937C146.827 127.508 134.501 141.258 118.785 149.97L80 80L46.1905 152.505Z" fill="#111827"/>
-<path d="M118.708 150.012C107.686 156.106 95.3806 159.511 82.7937 159.951C70.2068 160.391 57.694 157.853 46.2734 152.543L80 80L118.708 150.012Z" fill="white"/>
-<path d="M35 47.0375L125.88 47.0375L125.88 85.4375C125.88 95.4215 123.533 102.931 118.84 107.965C114.232 113.086 108.259 115.646 100.92 115.646C96.2267 115.646 92.1307 114.494 88.632 112.19C85.2187 109.971 82.616 106.899 80.824 102.974C79.2027 107.24 76.6427 110.611 73.144 113.086C69.6453 115.646 65.5067 116.926 60.728 116.926C52.7067 116.926 46.392 114.366 41.784 109.246C37.2613 104.126 35 96.7442 35 87.1015L35 47.0375ZM109.112 65.2135L89.4 65.2135V85.3095C89.4 88.9788 90.2107 91.7948 91.832 93.7575C93.5387 95.8055 96.0133 96.8295 99.256 96.8295C102.157 96.8295 104.504 95.8482 106.296 93.8855C108.173 92.0082 109.112 89.1495 109.112 85.3095L109.112 65.2135ZM72.504 65.2135H51.768V86.5895C51.768 90.4295 52.664 93.2882 54.456 95.1655C56.248 97.1282 58.808 98.1095 62.136 98.1095C65.2933 98.1095 67.8107 97.1282 69.688 95.1655C71.5653 93.2882 72.504 90.4295 72.504 86.5895V65.2135Z" fill="white"/>
-</svg>