fix: 顶栏文案去重与文档/连库体验更新
顶栏定为:连接 · 新建连接 · 新建查询 · 查询历史 · 快捷键; 同步 docs/落地页、对象树与 connection-types 注册表整理。
This commit is contained in:
1 parent
f8740d27f7
commit
26f459d1b8
49 files changed
+2682
-492
No files matched your search
@@ -1,39 +1,246 @@
|
||||
/* OpsxDB 文档站 —— 清爽专业风格(浅色) */
|
||||
:root {
|
||||
--bg: #0e1116; --panel: #151a21; --border: #243044;
|
||||
--text: #e6edf7; --muted: #8b9bb4; --accent: #3b82f6;
|
||||
--blue: #059669;
|
||||
--blue-dark: #047857;
|
||||
--blue-soft: rgba(5, 150, 105, 0.08);
|
||||
--bg: #f6f8fb;
|
||||
--panel: #ffffff;
|
||||
--border: #e4e9f1;
|
||||
--text: #1c2434;
|
||||
--text-2: #5b6880;
|
||||
--text-3: #98a2b3;
|
||||
--code-bg: #f3f6fb;
|
||||
--code-border: #e1e8f3;
|
||||
--green: #059669;
|
||||
--amber: #b45309;
|
||||
--red: #dc2626;
|
||||
--sidebar-w: 262px;
|
||||
--toc-w: 220px;
|
||||
--topbar-h: 56px;
|
||||
--radius: 10px;
|
||||
--shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.05);
|
||||
--mono: "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
body { margin: 0; font: 13px/1.55 ui-sans-serif, system-ui, sans-serif; background: var(--bg); color: var(--text); }
|
||||
.top {
|
||||
height: 44px; border-bottom: 1px solid var(--border); background: var(--panel);
|
||||
display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
|
||||
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font-size: 14.5px;
|
||||
line-height: 1.75;
|
||||
}
|
||||
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 600; }
|
||||
.brand em { color: var(--muted); font-style: normal; font-weight: 500; }
|
||||
.logo {
|
||||
width: 24px; height: 24px; border-radius: 6px; background: var(--accent);
|
||||
display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff;
|
||||
a { color: var(--blue); text-decoration: none; }
|
||||
.i { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
|
||||
a:hover { color: var(--blue-dark); text-decoration: underline; }
|
||||
|
||||
/* ---------- 顶栏 ---------- */
|
||||
.topbar {
|
||||
position: sticky; top: 0; z-index: 50;
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
backdrop-filter: saturate(1.4) blur(8px);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.top a { color: var(--muted); text-decoration: none; font-size: 12.5px; }
|
||||
.layout { display: flex; min-height: calc(100vh - 44px); }
|
||||
.side {
|
||||
width: 200px; border-right: 1px solid var(--border); padding: 12px 10px;
|
||||
background: var(--panel); display: flex; flex-direction: column; gap: 2px;
|
||||
.topbar-inner {
|
||||
max-width: 1440px; margin: 0 auto; height: var(--topbar-h);
|
||||
display: flex; align-items: center; gap: 14px; padding: 0 20px;
|
||||
}
|
||||
.menu-btn {
|
||||
display: none; border: 1px solid var(--border); background: #fff;
|
||||
border-radius: 8px; width: 34px; height: 34px; cursor: pointer; color: var(--text-2);
|
||||
place-items: center;
|
||||
}
|
||||
.menu-btn .i { width: 17px; height: 17px; }
|
||||
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none !important; }
|
||||
.brand-logo { display: inline-flex; }
|
||||
.brand-logo svg { display: block; border-radius: 7px; }
|
||||
.brand-name { font-size: 16px; font-weight: 700; color: var(--text); }
|
||||
.brand-name em { font-style: normal; font-weight: 500; color: var(--text-2); margin-left: 2px; }
|
||||
.ver-badge {
|
||||
font-size: 11px; font-weight: 600; color: var(--blue);
|
||||
background: var(--blue-soft); border: 1px solid rgba(5, 150, 105, 0.22);
|
||||
padding: 1px 9px; border-radius: 999px; white-space: nowrap;
|
||||
}
|
||||
.search { position: relative; flex: 1; max-width: 420px; margin-left: 8px; }
|
||||
.search input {
|
||||
width: 100%; height: 36px; border: 1px solid var(--border); border-radius: 9px;
|
||||
background: var(--bg); padding: 0 14px 0 34px; font-size: 13.5px; color: var(--text); outline: none;
|
||||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2398a2b3' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
|
||||
background-repeat: no-repeat; background-position: 12px center;
|
||||
}
|
||||
.search input:focus { border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px var(--blue-soft); }
|
||||
.search-panel {
|
||||
position: absolute; top: 44px; left: 0; right: 0; background: #fff;
|
||||
border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
|
||||
max-height: 420px; overflow: auto; padding: 6px;
|
||||
}
|
||||
.search-item { display: block; padding: 8px 12px; border-radius: 8px; text-decoration: none !important; }
|
||||
.search-item:hover, .search-item.sel { background: var(--blue-soft); }
|
||||
.search-item .si-title { font-weight: 600; color: var(--text); font-size: 13.5px; }
|
||||
.search-item .si-group { color: var(--text-3); font-size: 11px; margin-left: 6px; }
|
||||
.search-item .si-snippet { color: var(--text-2); font-size: 12px; margin-top: 2px; display: block; }
|
||||
.search-empty { padding: 14px; text-align: center; color: var(--text-3); font-size: 13px; }
|
||||
.top-links { margin-left: auto; display: flex; gap: 16px; align-items: center; }
|
||||
.top-links a { font-size: 13.5px; font-weight: 500; }
|
||||
|
||||
/* ---------- 三栏布局 ---------- */
|
||||
.layout {
|
||||
max-width: 1440px; margin: 0 auto; display: grid;
|
||||
grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
|
||||
gap: 0 28px; padding: 24px 20px 60px;
|
||||
}
|
||||
|
||||
/* 侧栏 */
|
||||
.sidebar { position: sticky; top: calc(var(--topbar-h) + 24px); align-self: start; max-height: calc(100vh - var(--topbar-h) - 48px); overflow-y: auto; padding-right: 8px; }
|
||||
.sidebar::-webkit-scrollbar { width: 4px; }
|
||||
.sidebar::-webkit-scrollbar-thumb { background: #d6dde8; border-radius: 4px; }
|
||||
.nav-group { margin-bottom: 18px; }
|
||||
.nav-group-title {
|
||||
font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
|
||||
color: var(--text-3); padding: 0 10px 6px;
|
||||
}
|
||||
.nav-link {
|
||||
display: block; padding: 6px 8px; border-radius: 6px; color: var(--muted);
|
||||
text-decoration: none; font-size: 12.5px;
|
||||
display: block; padding: 6px 10px; border-radius: 8px; font-size: 13.5px;
|
||||
color: var(--text-2); text-decoration: none !important; border-left: 2px solid transparent;
|
||||
}
|
||||
.nav-link:hover { color: var(--text); background: #1a2230; }
|
||||
.nav-link.active { color: var(--text); background: color-mix(in srgb, var(--accent) 18%, transparent); }
|
||||
.content { flex: 1; padding: 24px 28px; max-width: 720px; }
|
||||
.content h1 { font-size: 20px; margin: 0 0 14px; }
|
||||
.content h2 { font-size: 15px; margin: 22px 0 8px; }
|
||||
.content p, .content li { color: #c5d0e0; }
|
||||
.content code, .content pre {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
|
||||
.nav-link:hover { background: rgba(5, 150, 105, 0.06); color: var(--text); }
|
||||
.nav-link.active {
|
||||
background: var(--blue-soft); color: var(--blue-dark); font-weight: 600;
|
||||
border-left-color: var(--blue);
|
||||
}
|
||||
.content pre {
|
||||
background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
|
||||
.sidebar-foot { margin-top: 24px; padding: 12px 10px 0; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-3); }
|
||||
|
||||
/* 内容 */
|
||||
.content { min-width: 0; max-width: 860px; }
|
||||
.breadcrumb { font-size: 12.5px; color: var(--text-3); margin-bottom: 10px; }
|
||||
.breadcrumb span { margin: 0 6px; }
|
||||
.page-title { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; line-height: 1.3; }
|
||||
.page-meta { font-size: 12.5px; color: var(--text-3); margin-bottom: 22px; }
|
||||
|
||||
/* Markdown 排版 */
|
||||
.md h2 { font-size: 21px; font-weight: 700; margin: 38px 0 12px; padding-top: 8px; letter-spacing: -0.01em; }
|
||||
.md h3 { font-size: 16.5px; font-weight: 700; margin: 26px 0 8px; }
|
||||
.md h2 + h3, .md h1 + h2 { margin-top: 18px; }
|
||||
.md p { margin: 10px 0; color: #2a3348; }
|
||||
.md ul, .md ol { padding-left: 22px; margin: 10px 0; }
|
||||
.md li { margin: 5px 0; color: #2a3348; }
|
||||
.md li::marker { color: var(--blue); }
|
||||
.md strong { color: var(--text); }
|
||||
.md hr { border: none; border-top: 1px solid var(--border); margin: 30px 0; }
|
||||
.md img { max-width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
|
||||
.md blockquote {
|
||||
margin: 14px 0; padding: 10px 16px; border-left: 3px solid var(--blue);
|
||||
background: var(--blue-soft); border-radius: 0 8px 8px 0; color: #33415e;
|
||||
}
|
||||
|
||||
/* 表格 */
|
||||
.md table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 13.5px; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
|
||||
.md th, .md td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
|
||||
.md th { background: #f7fbf9; font-weight: 600; color: var(--text); white-space: nowrap; }
|
||||
.md tr:last-child td { border-bottom: none; }
|
||||
|
||||
/* 代码块 */
|
||||
.md code { font-family: var(--mono); font-size: 12.8px; background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 5px; padding: 1px 6px; color: #334155; }
|
||||
.md pre {
|
||||
position: relative; background: #0f172a; color: #dbe4f3; border-radius: var(--radius);
|
||||
padding: 16px 16px 14px; overflow-x: auto; margin: 16px 0; font-size: 13px; line-height: 1.65;
|
||||
}
|
||||
.md pre code { background: none; border: none; color: inherit; padding: 0; font-size: inherit; }
|
||||
.md pre .lang-tag {
|
||||
position: absolute; top: 8px; right: 12px; font-size: 10.5px; color: #7c8db0;
|
||||
font-family: var(--mono); text-transform: lowercase; letter-spacing: 0.04em;
|
||||
}
|
||||
.md pre .copy-btn {
|
||||
position: absolute; top: 6px; right: 60px; font-size: 11px; color: #9fb0d0;
|
||||
background: rgba(255, 255, 255, 0.07); border: none; border-radius: 6px; padding: 2px 9px; cursor: pointer;
|
||||
opacity: 0; transition: opacity 0.15s;
|
||||
}
|
||||
.md pre:hover .copy-btn { opacity: 1; }
|
||||
.md pre .copy-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }
|
||||
/* 行内高亮 token */
|
||||
.md pre .tok-key { color: #7dd3fc; }
|
||||
.md pre .tok-str { color: #86efac; }
|
||||
.md pre .tok-num { color: #fcd34d; }
|
||||
.md pre .tok-com { color: #64748b; font-style: italic; }
|
||||
|
||||
/* 提示块(通过 blockquote 首字符约定) */
|
||||
.md blockquote.tip { border-left-color: var(--green); background: rgba(5, 150, 105, 0.07); }
|
||||
.md blockquote.warn { border-left-color: var(--amber); background: rgba(180, 83, 9, 0.07); }
|
||||
|
||||
/* 上下页 */
|
||||
.pn-nav { display: flex; gap: 14px; margin-top: 48px; }
|
||||
.pn {
|
||||
flex: 1; border: 1px solid var(--border); background: #fff; border-radius: var(--radius);
|
||||
padding: 13px 16px; text-decoration: none !important; transition: border-color 0.15s, box-shadow 0.15s;
|
||||
}
|
||||
.pn:hover { border-color: var(--blue); box-shadow: var(--shadow); }
|
||||
.pn.next { text-align: right; }
|
||||
.pn-label { display: block; font-size: 11.5px; color: var(--text-3); }
|
||||
.pn-title { display: block; font-weight: 600; color: var(--text); font-size: 14px; margin-top: 2px; }
|
||||
|
||||
/* 反馈 */
|
||||
.feedback {
|
||||
margin-top: 28px; padding: 16px 18px; border-top: 1px solid var(--border);
|
||||
display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; flex-wrap: wrap;
|
||||
}
|
||||
.fb-btn {
|
||||
border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: 5px 12px;
|
||||
font-size: 12.5px; cursor: pointer; color: var(--text-2); transition: all 0.15s;
|
||||
}
|
||||
.fb-btn:hover { border-color: var(--blue); color: var(--blue); }
|
||||
.fb-btn.done { border-color: var(--green); color: var(--green); background: rgba(5, 150, 105, 0.06); }
|
||||
.fb-thanks { color: var(--green); font-size: 12.5px; }
|
||||
|
||||
/* 右侧目录 */
|
||||
.toc { position: sticky; top: calc(var(--topbar-h) + 24px); align-self: start; max-height: calc(100vh - var(--topbar-h) - 48px); overflow-y: auto; padding-top: 34px; }
|
||||
.toc-title { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-3); margin-bottom: 8px; }
|
||||
.toc-nav { display: flex; flex-direction: column; gap: 1px; border-left: 2px solid var(--border); padding-left: 0; }
|
||||
.toc-nav a {
|
||||
font-size: 12.5px; color: var(--text-2); padding: 4px 0 4px 12px; text-decoration: none !important;
|
||||
border-left: 2px solid transparent; margin-left: -2px; line-height: 1.5;
|
||||
}
|
||||
.toc-nav a:hover { color: var(--blue); }
|
||||
.toc-nav a.toc-l3 { padding-left: 26px; font-size: 12px; color: var(--text-3); }
|
||||
.toc-nav a.active { color: var(--blue); border-left-color: var(--blue); font-weight: 600; }
|
||||
.print-btn {
|
||||
margin-top: 18px; width: 100%; border: 1px solid var(--border); background: #fff;
|
||||
border-radius: 8px; padding: 7px; font-size: 12.5px; color: var(--text-2); cursor: pointer;
|
||||
}
|
||||
.print-btn:hover { border-color: var(--blue); color: var(--blue); }
|
||||
|
||||
/* 404 */
|
||||
.doc-404 { display: grid; place-items: center; min-height: 100vh; text-align: center; }
|
||||
.doc-404 h1 { font-size: 56px; margin: 0; color: var(--blue); }
|
||||
.doc-404 .btn {
|
||||
display: inline-block; margin-top: 12px; background: var(--blue); color: #fff;
|
||||
padding: 8px 18px; border-radius: 8px; text-decoration: none !important; font-weight: 600;
|
||||
}
|
||||
|
||||
/* ---------- 响应式 ---------- */
|
||||
@media (max-width: 1200px) {
|
||||
.layout { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
|
||||
.toc { display: none; }
|
||||
}
|
||||
@media (max-width: 880px) {
|
||||
.menu-btn { display: inline-grid; place-items: center; }
|
||||
.layout { grid-template-columns: minmax(0, 1fr); padding-top: 12px; }
|
||||
.sidebar {
|
||||
position: fixed; z-index: 60; left: 0; top: var(--topbar-h); bottom: 0;
|
||||
width: 280px; background: #fff; border-right: 1px solid var(--border);
|
||||
padding: 16px; transform: translateX(-100%); transition: transform 0.2s; max-height: none;
|
||||
}
|
||||
.sidebar.open { transform: none; box-shadow: var(--shadow); }
|
||||
.ver-badge { display: none; }
|
||||
.top-links a { font-size: 12.5px; }
|
||||
.page-title { font-size: 24px; }
|
||||
}
|
||||
|
||||
/* ---------- 打印 ---------- */
|
||||
@media print {
|
||||
.topbar, .sidebar, .toc, .pn-nav, .feedback, .menu-btn { display: none !important; }
|
||||
.layout { display: block; max-width: none; padding: 0; }
|
||||
body { background: #fff; }
|
||||
.md pre { background: #f1f5f9 !important; color: #1e293b !important; }
|
||||
.md pre .copy-btn, .md pre .lang-tag { display: none; }
|
||||
}
|
||||
.content code { background: #1a2230; padding: 1px 5px; border-radius: 4px; }
|
||||
@@ -0,0 +1,219 @@
|
||||
/* OpsxDB 文档站交互:搜索 / 代码复制 / 目录高亮 / 反馈 / 移动端导航 */
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
/* ---------- 代码块:语言标签 + 复制按钮 + 轻量高亮 ---------- */
|
||||
document.querySelectorAll("article.md pre").forEach(function (pre) {
|
||||
var code = pre.querySelector("code");
|
||||
if (!code) return;
|
||||
var lang = (code.className.match(/language-([\w-]+)/) || [, ""])[1];
|
||||
if (lang) {
|
||||
var tag = document.createElement("span");
|
||||
tag.className = "lang-tag";
|
||||
tag.textContent = lang;
|
||||
pre.appendChild(tag);
|
||||
}
|
||||
// 复制按钮
|
||||
var btn = document.createElement("button");
|
||||
btn.className = "copy-btn";
|
||||
btn.type = "button";
|
||||
btn.textContent = "复制";
|
||||
btn.addEventListener("click", function () {
|
||||
navigator.clipboard.writeText(code.textContent).then(
|
||||
function () {
|
||||
btn.textContent = "已复制 ✓";
|
||||
setTimeout(function () { btn.textContent = "复制"; }, 1400);
|
||||
},
|
||||
function () { btn.textContent = "复制失败"; }
|
||||
);
|
||||
});
|
||||
pre.appendChild(btn);
|
||||
// JSON / bash 轻量高亮
|
||||
if (lang === "json") highlightJSON(code);
|
||||
else if (lang === "bash" || lang === "sh" || lang === "shell") highlightBash(code);
|
||||
});
|
||||
|
||||
function esc(s) {
|
||||
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
||||
}
|
||||
function highlightJSON(code) {
|
||||
var src = code.textContent;
|
||||
code.innerHTML = esc(src).replace(
|
||||
/("(?:\\.|[^"\\])*")(\s*:)?|\b(true|false|null)\b|(-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)/g,
|
||||
function (m, str, colon, kw, num) {
|
||||
if (str && colon) return '<span class="tok-key">' + str + "</span>" + colon;
|
||||
if (str) return '<span class="tok-str">' + str + "</span>";
|
||||
if (kw) return '<span class="tok-num">' + kw + "</span>";
|
||||
if (num) return '<span class="tok-num">' + num + "</span>";
|
||||
return m;
|
||||
}
|
||||
);
|
||||
}
|
||||
function highlightBash(code) {
|
||||
var lines = code.textContent.split("\n");
|
||||
code.innerHTML = lines
|
||||
.map(function (line) {
|
||||
if (/^\s*#/.test(line)) return '<span class="tok-com">' + esc(line) + "</span>";
|
||||
return esc(line).replace(/(^|\s)(-{1,2}[\w-]+)/g, '$1<span class="tok-key">$2</span>');
|
||||
})
|
||||
.join("\n");
|
||||
}
|
||||
|
||||
/* ---------- blockquote 提示样式约定:> **提示** / > **注意** ---------- */
|
||||
document.querySelectorAll("article.md blockquote").forEach(function (bq) {
|
||||
var t = (bq.textContent || "").trim();
|
||||
if (/^(注意|警告|⚠)/.test(t)) bq.classList.add("warn");
|
||||
else if (/^(提示|说明|💡|Tip)/i.test(t)) bq.classList.add("tip");
|
||||
});
|
||||
|
||||
/* ---------- 搜索 ---------- */
|
||||
var input = document.getElementById("search-input");
|
||||
var panel = document.getElementById("search-panel");
|
||||
var entries = null;
|
||||
var selIndex = -1;
|
||||
|
||||
function ensureIndex(cb) {
|
||||
if (entries) return cb();
|
||||
fetch("/docs/search-data.json")
|
||||
.then(function (r) { return r.json(); })
|
||||
.then(function (data) { entries = data; cb(); })
|
||||
.catch(function () { entries = []; cb(); });
|
||||
}
|
||||
|
||||
function snippet(text, q) {
|
||||
var i = text.toLowerCase().indexOf(q);
|
||||
if (i < 0) return text.slice(0, 60) + "…";
|
||||
var start = Math.max(0, i - 24);
|
||||
return (start > 0 ? "…" : "") + text.slice(start, i + q.length + 40) + "…";
|
||||
}
|
||||
|
||||
function doSearch() {
|
||||
var q = input.value.trim().toLowerCase();
|
||||
selIndex = -1;
|
||||
if (!q) { panel.hidden = true; return; }
|
||||
ensureIndex(function () {
|
||||
var hits = [];
|
||||
entries.forEach(function (e) {
|
||||
var titleHit = e.title.toLowerCase().indexOf(q) >= 0;
|
||||
var idx = e.text.toLowerCase().indexOf(q);
|
||||
if (titleHit || idx >= 0) {
|
||||
hits.push({
|
||||
slug: e.slug,
|
||||
title: e.title,
|
||||
group: e.group,
|
||||
score: (titleHit ? 10 : 0) + (idx === 0 ? 3 : 0),
|
||||
snippet: titleHit ? snippet(e.text, q) : snippet(e.text, q),
|
||||
});
|
||||
}
|
||||
});
|
||||
hits.sort(function (a, b) { return b.score - a.score; });
|
||||
hits = hits.slice(0, 8);
|
||||
if (!hits.length) {
|
||||
panel.innerHTML = '<div class="search-empty">没有找到相关内容,换个关键词试试</div>';
|
||||
} else {
|
||||
panel.innerHTML = hits
|
||||
.map(function (h) {
|
||||
return (
|
||||
'<a class="search-item" href="/docs/' + h.slug + '">' +
|
||||
'<span class="si-title">' + h.title + '</span><span class="si-group">' + h.group + "</span>" +
|
||||
'<span class="si-snippet">' + h.snippet + "</span></a>"
|
||||
);
|
||||
})
|
||||
.join("");
|
||||
}
|
||||
panel.hidden = false;
|
||||
});
|
||||
}
|
||||
|
||||
var debounce;
|
||||
if (input) {
|
||||
input.addEventListener("input", function () {
|
||||
clearTimeout(debounce);
|
||||
debounce = setTimeout(doSearch, 160);
|
||||
});
|
||||
input.addEventListener("focus", function () {
|
||||
if (input.value.trim()) doSearch();
|
||||
});
|
||||
input.addEventListener("keydown", function (e) {
|
||||
var items = panel.querySelectorAll(".search-item");
|
||||
if (e.key === "ArrowDown" && items.length) {
|
||||
e.preventDefault();
|
||||
selIndex = Math.min(selIndex + 1, items.length - 1);
|
||||
} else if (e.key === "ArrowUp" && items.length) {
|
||||
e.preventDefault();
|
||||
selIndex = Math.max(selIndex - 1, 0);
|
||||
} else if (e.key === "Enter") {
|
||||
if (selIndex >= 0 && items[selIndex]) { location.href = items[selIndex].href; return; }
|
||||
var first = items[0];
|
||||
if (first) location.href = first.href;
|
||||
return;
|
||||
} else if (e.key === "Escape") {
|
||||
panel.hidden = true;
|
||||
return;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
items.forEach(function (el, i) { el.classList.toggle("sel", i === selIndex); });
|
||||
});
|
||||
document.addEventListener("click", function (e) {
|
||||
if (!e.target.closest(".search")) panel.hidden = true;
|
||||
});
|
||||
}
|
||||
|
||||
/* ---------- 目录滚动高亮 ---------- */
|
||||
var tocLinks = Array.prototype.slice.call(document.querySelectorAll(".toc-nav a"));
|
||||
if (tocLinks.length && "IntersectionObserver" in window) {
|
||||
var byId = {};
|
||||
tocLinks.forEach(function (a) { byId[a.getAttribute("href").slice(1)] = a; });
|
||||
var io = new IntersectionObserver(
|
||||
function (entries) {
|
||||
entries.forEach(function (en) {
|
||||
if (en.isIntersecting) {
|
||||
tocLinks.forEach(function (a) { a.classList.remove("active"); });
|
||||
var a = byId[en.target.id];
|
||||
if (a) a.classList.add("active");
|
||||
}
|
||||
});
|
||||
},
|
||||
{ rootMargin: "-72px 0px -70% 0px", threshold: 0 }
|
||||
);
|
||||
document.querySelectorAll("article.md h2[id], article.md h3[id]").forEach(function (h) { io.observe(h); });
|
||||
}
|
||||
|
||||
/* ---------- 反馈组件 ---------- */
|
||||
var fb = document.getElementById("feedback");
|
||||
if (fb) {
|
||||
var pageKey = "opsxdb-docs-fb:" + location.pathname;
|
||||
var voted = null;
|
||||
try { voted = localStorage.getItem(pageKey); } catch (e) {}
|
||||
var btns = fb.querySelectorAll(".fb-btn");
|
||||
var thanks = document.getElementById("fb-thanks");
|
||||
function mark(v) {
|
||||
btns.forEach(function (b) {
|
||||
if (b.dataset.v === v) b.classList.add("done");
|
||||
});
|
||||
thanks.hidden = false;
|
||||
try { localStorage.setItem(pageKey, v); } catch (e) {}
|
||||
}
|
||||
if (voted) mark(voted);
|
||||
btns.forEach(function (b) {
|
||||
b.addEventListener("click", function () { mark(b.dataset.v); });
|
||||
});
|
||||
}
|
||||
|
||||
/* ---------- 打印 ---------- */
|
||||
var printBtn = document.getElementById("print-btn");
|
||||
if (printBtn) printBtn.addEventListener("click", function () { window.print(); });
|
||||
|
||||
/* ---------- 移动端侧栏 ---------- */
|
||||
var menuBtn = document.getElementById("menu-btn");
|
||||
var sidebar = document.getElementById("sidebar");
|
||||
if (menuBtn && sidebar) {
|
||||
menuBtn.addEventListener("click", function () { sidebar.classList.toggle("open"); });
|
||||
document.addEventListener("click", function (e) {
|
||||
if (sidebar.classList.contains("open") && !e.target.closest(".sidebar") && !e.target.closest(".menu-btn")) {
|
||||
sidebar.classList.remove("open");
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,40 @@
|
||||
OpsxDB 是一款**本地优先**的桌面数据库工作台,面向运维与开发:连库、写 SQL、看结果,全在本机完成。
|
||||
|
||||
主交付形态是可安装的桌面应用(Tauri 2),本地 Go 后端随应用自动启动;同一套界面也可用单个二进制在 Web / 内网部署。数据全部保存在本机,不经过任何第三方服务器。
|
||||
|
||||
## 功能总览
|
||||
|
||||
| 能力 | 说明 |
|
||||
| --- | --- |
|
||||
| 多驱动连库 | MySQL 族 / PostgreSQL 族 / SQL Server / Oracle / SQLite / Redis,native Go 驱动编译内置 |
|
||||
| 连接选择器 | 搜索 / 分类 / 最近 / 图标网格;粘贴连接 URL 一键填入表单 |
|
||||
| SQL 工作台 | CodeMirror 编辑器、⌘/Ctrl+Enter 执行语句或选区、多 Tab、可拖分栏 |
|
||||
| 对象树 | 懒加载库 / 表 / 列;点表名直接看前 100 行 |
|
||||
| 结果处理 | 一键复制 / CSV / 生成 INSERT;双击单元格复制;截断有提示 |
|
||||
| Redis 工作台 | 编辑器执行 PING / GET / SET / DEL / KEYS,键空间浏览 |
|
||||
| 安全通道 | 每连接独立配置 SSL/TLS 与 SSH 隧道;密码本机混淆存储 |
|
||||
| AI 面板 | 生成 / 解释 / 优化 / 修复 / 方言转换 / 样例 SQL |
|
||||
| 危险操作防护 | DROP / TRUNCATE / 无 WHERE 的 UPDATE·DELETE 执行前确认 |
|
||||
| 双形态 | 桌面 GUI(Tauri 2)与 Web(单二进制 + 静态页)共用一套界面 |
|
||||
|
||||
## 支持的数据库
|
||||
|
||||
| 家族 | 覆盖 | 默认端口 |
|
||||
| --- | --- | --- |
|
||||
| MySQL 族 | MySQL · MariaDB · TiDB · OceanBase · PolarDB · TDSQL | 3306 |
|
||||
| PostgreSQL 族 | PostgreSQL · GaussDB / openGauss · 人大金仓 | 5432 |
|
||||
| SQL Server | 原生协议直连 | 1433 |
|
||||
| Oracle | 纯 Go 驱动 go-ora(不引入 JVM) | 1521 |
|
||||
| SQLite | 本地文件库 | — |
|
||||
| Redis | 命令执行 + 键管理 | 6379 |
|
||||
|
||||
> **提示**:达梦 DM8、MongoDB、ZooKeeper、Elasticsearch、InfluxDB 已列入路线,规划 agent 按需接入。
|
||||
|
||||
## 为什么选 OpsxDB
|
||||
|
||||
- **数据主权**:连接配置与查询历史只存在本机;后端默认仅监听 127.0.0.1。
|
||||
- **开箱即用**:`./run.sh web` 一条命令起 Web 形态;桌面版双击即用,后端随应用拉起。
|
||||
- **为快设计**:点表即看数据、⌘Enter 即执行、结果三键取走(复制 / CSV / INSERT)。
|
||||
- **轻量克制**:一个 Go 二进制 + 一份前端,内网可部署,无遥测无账号。
|
||||
|
||||
> **提示**:想马上动手?直接看下一章《快速开始》,30 秒连上第一个库。
|
||||
@@ -0,0 +1,61 @@
|
||||
本章从零到出结果:起服务 → 建连接 → 执行第一条 SQL。
|
||||
|
||||
## 1. 启动
|
||||
|
||||
桌面版(主交付形态)双击 OpsxDB 应用即可,本地后端随应用自动拉起。
|
||||
|
||||
从源码跑 Web / 桌面形态:
|
||||
|
||||
```bash
|
||||
git clone <repo> opsxdb && cd opsxdb
|
||||
npm install
|
||||
|
||||
./run.sh web # Web 形态:Gin :8788 + Vite 开发壳 :5174
|
||||
./run.sh gui # 桌面形态:Tauri 2 窗口(复用同一套界面)
|
||||
```
|
||||
|
||||
> **注意**:浏览器里的 `:5174` 是 Vite 热更新开发壳,仅调试用;产品页面(官网 `/`、文档 `/docs`)由后端 `:8788` 直接提供。
|
||||
|
||||
## 2. 新建连接
|
||||
|
||||
1. 打开应用,进入**连接选择器**,选择数据库类型(如 MySQL);
|
||||
2. 或者直接粘贴连接 URL,点「填入」自动拆解字段:
|
||||
|
||||
```
|
||||
mysql://root:pass@127.0.0.1:3306/shop
|
||||
```
|
||||
|
||||
3. 点 **测试** 验证连通性,再点 **保存并连接**。
|
||||
|
||||
连接配置保存在本机,密码混淆存储;后续查询只携带会话 ID,不再上送账密。
|
||||
|
||||
## 3. 第一次查询
|
||||
|
||||
1. 左侧对象树展开库,**点表名**直接查看前 100 行(展开表可看列结构);
|
||||
2. 打开 SQL 编辑器,输入:
|
||||
|
||||
```sql
|
||||
SELECT * FROM orders ORDER BY id DESC LIMIT 100;
|
||||
```
|
||||
|
||||
3. 按 **⌘/Ctrl + Enter** 执行当前语句(或选中的片段);
|
||||
4. 结果面板支持**复制 / 导出 CSV / 生成 INSERT**,双击单元格即复制。
|
||||
|
||||
## 4. 验证服务
|
||||
|
||||
```bash
|
||||
curl -s http://127.0.0.1:8788/health
|
||||
# {"ok":true,"service":"opsxdb"}
|
||||
```
|
||||
|
||||
## 5. 手边没有数据库?
|
||||
|
||||
本地还没有可连的库?用仓库自带的辅助脚本一键起一个(需要 Docker,一次只起一个):
|
||||
|
||||
```bash
|
||||
./tests/dbctl.sh up a # MySQL
|
||||
./tests/dbctl.sh up c # PostgreSQL(用户 opsx)
|
||||
./tests/dbctl.sh up f # Redis
|
||||
```
|
||||
|
||||
各驱动的验收状态见《驱动支持》。
|
||||
@@ -0,0 +1,40 @@
|
||||
OpsxDB 的界面为「高频操作」设计:从打开应用到看到数据,路径越短越好。
|
||||
|
||||
## 连接选择器
|
||||
|
||||
启动后的第一个界面:
|
||||
|
||||
- **搜索**:按名称快速过滤已保存的连接;
|
||||
- **分类**:关系型 / NoSQL / 国产库 / 时序·搜索 分组浏览;
|
||||
- **最近**:最近使用的连接排在最前;
|
||||
- **图标网格**:按数据库类型直选,未就绪的类型会标注「未就绪」(仅可保存配置);
|
||||
- **URL 填入**:粘贴 `mysql://user:pass@host:3306/db` 点「填入」,字段自动拆解。
|
||||
|
||||
## 工作台布局
|
||||
|
||||
连接成功后进入工作台,三栏结构:
|
||||
|
||||
| 区域 | 内容 |
|
||||
| --- | --- |
|
||||
| 左侧 | 连接列表 + 对象树(库 → 表 → 列,懒加载) |
|
||||
| 中部 | SQL 编辑器(多 Tab)+ 结果面板,可拖动分栏 |
|
||||
| 右侧 | AI 面板(生成 / 解释 / 优化 / 修复 / 方言 / 样例) |
|
||||
|
||||
## 对象树
|
||||
|
||||
- 点**表名**:直接打开前 100 行数据;
|
||||
- 展开**表**:查看列结构;
|
||||
- 库列表懒加载,大实例也不卡。
|
||||
|
||||
## 编辑器与结果
|
||||
|
||||
- CodeMirror 语法高亮,⌘/Ctrl+Enter 执行**当前语句或选区**(不是整页脚本);
|
||||
- 多 Tab 并行查询,互不阻塞;
|
||||
- 结果面板:复制 / CSV / INSERT 三种取数方式,双击单元格复制;
|
||||
- 超过截断阈值时结果有明确提示。
|
||||
|
||||
## 个性化
|
||||
|
||||
- 深色 / 浅色主题切换;
|
||||
- Tab 布局与主题选择持久化,下次打开保持原样;
|
||||
- 查询历史本地留存,可回跳重跑。
|
||||
@@ -0,0 +1,42 @@
|
||||
本章说明各数据库类型的连接表单、URL 格式与高级选项(SSL / SSH 隧道)。
|
||||
|
||||
## 通用流程
|
||||
|
||||
1. 连接选择器点「新建」或选某个数据库类型;
|
||||
2. 填写表单(不同驱动表单不同,见下表);
|
||||
3. **测试** → 通过后 **保存并连接**。
|
||||
|
||||
支持直接粘贴 URL 自动填表:
|
||||
|
||||
```
|
||||
mysql://root:pass@127.0.0.1:3306/shop
|
||||
postgres://opsx:pass@127.0.0.1:5432/app
|
||||
```
|
||||
|
||||
## 各驱动表单
|
||||
|
||||
| 驱动 | 表单 | 特有字段 |
|
||||
| --- | --- | --- |
|
||||
| MySQL / PostgreSQL / SQL Server | standard | host · port · user · password · database · ssl · ssh |
|
||||
| Oracle | oracle | host · port · user · password · **service**(如 ORCL) |
|
||||
| SQLite | file | database 填本地文件路径(如 `~/data/demo.sqlite`) |
|
||||
| Redis | redis | host · port · password · database 序号 |
|
||||
|
||||
表单只收集服务端实际消费的字段;历史遗留的死参数不会出现在表单里。
|
||||
|
||||
## MySQL 族与 PostgreSQL 族
|
||||
|
||||
协议兼容的国产库无需单独驱动,直接复用家族驱动:
|
||||
|
||||
- **MySQL 族**:MariaDB(3307)、TiDB(4000)、OceanBase(2881)、PolarDB / TDSQL(3306)—— 表单里选对应类型即可;
|
||||
- **PostgreSQL 族**:GaussDB / openGauss、人大金仓 Kingbase(54321)—— 走 postgres 表单,注意默认库与用户名差异。
|
||||
|
||||
## SSL / TLS
|
||||
|
||||
连接表单中开启 **ssl** 即可;按连接独立配置,互不影响。内网自签证书场景按需放宽校验策略。
|
||||
|
||||
## SSH 隧道
|
||||
|
||||
数据库在跳板机后面时,开启 **ssh** 字段组,填写跳板机地址与凭据:OpsxDB 会先建 SSH 隧道,再把数据库连接走隧道转发,无需把库端口暴露到公网。
|
||||
|
||||
> **提示**:连接保存后,后续查询仅携带 `sessionId`,账密不会随每次请求上送;密码在本机混淆存储。
|
||||
@@ -0,0 +1,41 @@
|
||||
OpsxDB 的常用数据库驱动以 native Go 驱动编译内置,开箱即用;更多数据库在路线中。
|
||||
|
||||
## 内置驱动
|
||||
|
||||
| 驱动 | 连接库 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| mysql | MySQL · MariaDB · TiDB · OceanBase · PolarDB · TDSQL | 协议族复用,默认端口 3306 |
|
||||
| postgres | PostgreSQL · GaussDB / openGauss · Kingbase | 协议族复用,默认端口 5432 |
|
||||
| sqlserver | SQL Server | 原生协议,默认端口 1433 |
|
||||
| oracle | Oracle | go-ora 纯 Go 驱动,不引入 JVM,端口 1521 |
|
||||
| sqlite | SQLite | 本地文件库,无端口 |
|
||||
| redis | Redis | 默认端口 6379 |
|
||||
|
||||
## 支持状态
|
||||
|
||||
以下为逐项实测的结果 —— 你可以按这个表判断「现在就能连什么」:
|
||||
|
||||
| 数据库 | 连接 | 库表浏览 | 数据操作 | 备注 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| MySQL / MariaDB | ✅ | ✅ | ✅ | MariaDB 默认端口 3307 |
|
||||
| PostgreSQL | ✅ | ✅ | ✅ | GaussDB / 金仓同样适用 |
|
||||
| SQL Server | ✅ | ✅ | ✅ | Apple Silicon 上连接稍慢属正常 |
|
||||
| SQLite | ✅ | ✅ | ✅ | 填本地文件路径即连 |
|
||||
| Redis | ✅ | ✅ | ✅ | 支持命令执行与键管理 |
|
||||
| Oracle | 代码就绪 | ✅ | 待实测 | 见下方说明 |
|
||||
|
||||
> **说明(Oracle)**:驱动已内置(纯 Go 实现,无需安装 Java),库表浏览可用;完整数据操作正在验收中 —— 在 Apple Silicon 的容器环境会遇到 Oracle 限制(ORA-00442),x86 环境或真实数据库不受影响。
|
||||
|
||||
## 暂不支持(规划中)
|
||||
|
||||
| 数据库 | 状态 |
|
||||
| --- | --- |
|
||||
| 达梦 DM8 | 规划中,暂不可用 |
|
||||
| MongoDB | 规划中,暂不可用 |
|
||||
| ZooKeeper / Elasticsearch / InfluxDB | 规划中,暂不可用 |
|
||||
|
||||
> **注意**:选择器中标注「未就绪」的类型仍可保存连接配置,但不能测试 / 连接;开放支持后会随版本更新自动可用。
|
||||
|
||||
## 后续驱动的接入方式
|
||||
|
||||
常用库继续以原生驱动内置;小众数据库(达梦、MongoDB 等)将通过**按需下载**方式接入 —— 首次使用时下载对应驱动组件,版本固定并校验完整性(sha256),不随包体膨胀。
|
||||
@@ -0,0 +1,46 @@
|
||||
SQL 工作台是日常使用率最高的界面,所有交互围绕「快」设计。
|
||||
|
||||
## 执行模型
|
||||
|
||||
- **⌘/Ctrl + Enter**:执行光标所在的**当前语句**;有选区时执行**选区**;
|
||||
- 不是「整页脚本」模式 —— 多条语句互不干扰,想跑哪句把光标放哪;
|
||||
- 执行在会话上运行,连接断开后自动提示。
|
||||
|
||||
## 多 Tab 与分栏
|
||||
|
||||
- 每个查询一个 Tab,并行执行互不阻塞;
|
||||
- 编辑器 / 结果区可拖动分栏,长查询时编辑器不被结果挤占;
|
||||
- Tab 与布局持久化,重开应用保持原样。
|
||||
|
||||
## 对象树联动
|
||||
|
||||
- 左侧对象树懒加载库 / 表 / 列;
|
||||
- **点表名 = 查询前 100 行**,自动生成对应 SQL;
|
||||
- 展开表看列名与类型,写 SQL 时可对照。
|
||||
|
||||
## 查询历史
|
||||
|
||||
- 本地留存最近 200 条(不上传、不同步);
|
||||
- **相同语句自动去重置顶** —— 历史即「最近用过的不同语句」,高频查询永远在第一条;
|
||||
- 点击条目回填编辑器;悬停出现 **▶** 按钮,回填并直接重跑;
|
||||
- 顶部过滤框支持按语句内容或连接名搜索;
|
||||
- 条目显示时间、连接名、行数与耗时;失败的语句红色标出。
|
||||
|
||||
## 危险 SQL 防护
|
||||
|
||||
执行以下语句前会弹确认框:
|
||||
|
||||
| 类型 | 规则 |
|
||||
| --- | --- |
|
||||
| 删除对象 | DROP / TRUNCATE |
|
||||
| 全表更新 | 无 WHERE 的 UPDATE / DELETE |
|
||||
|
||||
> **注意**:确认框只拦「明确危险」的模式,不替代事务与备份习惯;生产库操作请配合审批流程。
|
||||
|
||||
## 快捷键
|
||||
|
||||
| 快捷键 | 动作 |
|
||||
| --- | --- |
|
||||
| ⌘/Ctrl + Enter | 执行当前语句 / 选区 |
|
||||
| 双击结果单元格 | 复制单元格内容 |
|
||||
| Esc | 关闭弹层 / 取消确认 |
|
||||
@@ -0,0 +1,27 @@
|
||||
查询跑完只是开始,把结果带走才算完成 —— OpsxDB 给了三条最快路径。
|
||||
|
||||
## 三种取数方式
|
||||
|
||||
| 方式 | 用途 |
|
||||
| --- | --- |
|
||||
| **复制** | 直接进剪贴板,贴到群聊 / 文档 / 表格 |
|
||||
| **CSV** | 导出标准 CSV 文件,Excel / Numbers 直接打开 |
|
||||
| **INSERT** | 把结果行生成为 INSERT 语句,直接可在别的库回放 |
|
||||
|
||||
## 单元格操作
|
||||
|
||||
- **双击单元格**:复制该单元格内容;
|
||||
- 列头即字段名,长文本自动截断显示,完整内容在复制时保留。
|
||||
|
||||
## 截断提示
|
||||
|
||||
为保护界面与内存,超大结果集会按阈值截断展示:
|
||||
|
||||
- 结果面板顶部显示「已截断」提示与实际行数;
|
||||
- 需要完整数据时,缩小查询范围(加 LIMIT / WHERE)或使用导出。
|
||||
|
||||
> **提示**:默认「点表名看前 100 行」就是截断策略的一部分 —— 快速浏览用 100 行,精确取数写 WHERE。
|
||||
|
||||
## 与 AI 面板联动
|
||||
|
||||
写不出来的查询可以直接在 AI 面板用自然语言描述(「查最近 7 天下单但未支付的用户」),生成 SQL 后放回编辑器执行,见《AI 助手》。
|
||||
@@ -0,0 +1,34 @@
|
||||
Redis 连接使用专用表单(redis),连上后既是命令行又是键空间浏览器。
|
||||
|
||||
## 命令执行
|
||||
|
||||
SQL 编辑器同样适用于 Redis —— 直接输入命令,⌘/Ctrl + Enter 执行:
|
||||
|
||||
```bash
|
||||
PING
|
||||
SET demo:key "hello" EX 60
|
||||
GET demo:key
|
||||
KEYS demo:*
|
||||
DEL demo:key
|
||||
```
|
||||
|
||||
- 返回值直接显示在结果面板;
|
||||
- 集群 / 哨兵模式按各自连接方式配置(哨兵填写主节点名)。
|
||||
|
||||
## 键空间浏览
|
||||
|
||||
- **KEYS 扫描**:按模式浏览键(生产大库建议用前缀收窄范围);
|
||||
- 键类型视图:string / hash / list / set / zset 分类型展示;
|
||||
- **TTL 管理**:查看与设置过期时间,常用于缓存排障;
|
||||
- 批量操作:选中多个键批量删除。
|
||||
|
||||
> **注意**:`KEYS *` 在大库上会阻塞 Redis,OpsxDB 不做强制拦截 —— 生产环境请自觉使用带前缀的模式。
|
||||
|
||||
## 连接参数
|
||||
|
||||
| 字段 | 说明 |
|
||||
| --- | --- |
|
||||
| host / port | 默认 127.0.0.1:6379 |
|
||||
| password | ACL / requirepass |
|
||||
| database | 逻辑库序号(0-15 常见) |
|
||||
| ssl | 红色连接(TLS)开关 |
|
||||
@@ -0,0 +1,35 @@
|
||||
连生产库的工具,安全必须是默认项。OpsxDB 的安全设计围绕一句话:**数据不出你的机器。**
|
||||
|
||||
## 本地优先
|
||||
|
||||
- 连接配置、查询历史、主题偏好全部保存在本机;
|
||||
- 无账号体系、无遥测、无云端同步;
|
||||
- 后端默认只监听 `127.0.0.1`,对外服务需要显式配置(`OPSXDB_BIND_PUBLIC=1` 或 `OPSXDB_ADDR`)。
|
||||
|
||||
## 凭据保护
|
||||
|
||||
| 层面 | 机制 |
|
||||
| --- | --- |
|
||||
| 存储 | 连接密码在本机混淆存储,不落明文 |
|
||||
| 传输 | 连接建立后,后续查询只携带 `sessionId`,账密不再每次上送 |
|
||||
| 会话 | 会话在服务端维护,可主动关闭(连接断开即失效) |
|
||||
|
||||
## 加密通道
|
||||
|
||||
**SSL / TLS**:每个连接可独立开启;数据库支持 TLS 即可启用(MySQL、PostgreSQL、SQL Server、Redis、MongoDB 均支持)。
|
||||
|
||||
**SSH 隧道**:数据库在跳板机后时,配置 SSH 字段组,OpsxDB 先建隧道再转发数据库连接 —— 库端口不必暴露公网。
|
||||
|
||||
## 危险操作防护
|
||||
|
||||
- DROP / TRUNCATE 执行前确认;
|
||||
- 无 WHERE 的 UPDATE / DELETE 执行前确认;
|
||||
- 结果集按阈值截断,避免误操作拖垮界面。
|
||||
|
||||
## 内网部署形态
|
||||
|
||||
单二进制 + 内置静态页(官网 / 文档 / 工作台),无外部依赖:
|
||||
|
||||
- 任意内网主机可部署;
|
||||
- 无外联请求,可在纯内网环境运行;
|
||||
- 升级即替换一个二进制。
|
||||
@@ -0,0 +1,32 @@
|
||||
AI 面板的目标:让「写不出的 SQL」和「看不懂的 SQL」不再阻塞你。
|
||||
|
||||
## 六种动作
|
||||
|
||||
| 动作 | 用途 |
|
||||
| --- | --- |
|
||||
| 生成 | 自然语言 → SQL(「查最近 7 天下单但未支付的用户」) |
|
||||
| 解释 | 把一段复杂 SQL 翻译成中文说明 |
|
||||
| 优化 | 分析慢查询,给出索引 / 改写建议 |
|
||||
| 修复 | 报错信息 + SQL → 修正版本 |
|
||||
| 方言 | MySQL ↔ PostgreSQL 等跨方言转换 |
|
||||
| 样例 | 按表结构生成示例查询 |
|
||||
|
||||
## 使用方式
|
||||
|
||||
1. 连接库后打开右侧 AI 面板;
|
||||
2. 选择动作,输入需求或粘贴 SQL(可附上对象树上下文);
|
||||
3. 生成结果一键放回编辑器,⌘/Ctrl + Enter 执行。
|
||||
|
||||
> **提示**:生成的 SQL 依旧走危险语句确认流程 —— AI 产出与手写 SQL 同等对待,不放宽防护。
|
||||
|
||||
## 当前状态(v0.1)
|
||||
|
||||
AI 面板当前为**本地 stub**:六种动作的交互框架与 API 已就位(`POST /api/ai/chat`),模型服务接入版本会明确标注数据流向与开关位置。
|
||||
|
||||
## 数据流向承诺
|
||||
|
||||
接入模型服务时遵循三条原则:
|
||||
|
||||
- 默认只发送你明确提交的内容(不含连接凭据);
|
||||
- 可完全关闭 AI 功能;
|
||||
- 使用云端模型时在界面上明确标识。
|
||||
@@ -0,0 +1,40 @@
|
||||
## 产品形态
|
||||
|
||||
**Q:浏览器里的 5174 端口是什么?**
|
||||
Vite 热更新开发壳,仅开发调试用。产品形态是桌面应用(Tauri 2)或自托管 Web 服务,页面与 API 由后端 `:8788` 提供。
|
||||
|
||||
**Q:桌面版和 Web 版功能有差别吗?**
|
||||
没有。同一套 UI、同一份后端,桌面版只是多了应用壳(自动拉起本地后端、原生窗口、安装包形态)。
|
||||
|
||||
**Q:怎么打安装包?**
|
||||
`./run.sh package` 产出 Tauri 安装包(DMG)并内嵌 sidecar 后端二进制。
|
||||
|
||||
## 数据与安全
|
||||
|
||||
**Q:我的连接密码存在哪?**
|
||||
本机,混淆存储;查询只带会话 ID,密码不会随请求重复上送,也不会同步到云端。
|
||||
|
||||
**Q:会上传我的 SQL 或查询结果吗?**
|
||||
不会。没有遥测、没有账号、没有云依赖;AI 功能当前为本地 stub,接入模型服务时会明确标注数据流向。
|
||||
|
||||
**Q:能在公司内网用吗?**
|
||||
能。单二进制 + 内置静态页,无外部依赖;默认只监听回环地址,对外需显式配置。
|
||||
|
||||
## 驱动相关
|
||||
|
||||
**Q:Oracle 能用吗?**
|
||||
驱动代码就绪(go-ora 纯 Go 实现,无需 JVM),但本机 docker 验收在 Apple Silicon 上受镜像限制未通过(ORA-00442),需 x86 环境或真库完成验收,详见《驱动支持》。
|
||||
|
||||
**Q:达梦 / MongoDB 什么时候支持?**
|
||||
已列入路线:长尾库(达梦、MongoDB、ZooKeeper、ES、InfluxDB)规划 agent 按需接入,驱动分发走独立仓库并校验 sha256。
|
||||
|
||||
**Q:MySQL 族 / PG 族的国产库怎么连?**
|
||||
协议兼容直接复用家族驱动:TiDB / OceanBase / PolarDB / TDSQL 选对应类型(MySQL 协议);GaussDB / Kingbase 走 PostgreSQL 表单。注意各自默认端口与用户名差异。
|
||||
|
||||
## 其他
|
||||
|
||||
**Q:和 OpsxAPI 是什么关系?**
|
||||
同一团队的姊妹项目:OpsxAPI 是接口工作台,OpsxDB 是数据库工作台,共用一套 monorepo 脚手架(web + Gin + 可选 Tauri),产品面各自独立。
|
||||
|
||||
**Q:快捷键有哪些?**
|
||||
核心就一个:⌘/Ctrl + Enter 执行当前语句或选区;双击结果单元格复制。完整列表见《SQL 工作台》。
|
||||
@@ -1,7 +0,0 @@
|
||||
<h1>连库入门</h1>
|
||||
<p>在连库页选择驱动,填写主机 / 端口 / 账号,测试通过后保存并打开。</p>
|
||||
<ul>
|
||||
<li>密码仅存本机(本地加密存储)。</li>
|
||||
<li>会话由本地后端维护;后端未启动时顶部会提示,不会白屏。</li>
|
||||
<li>断线后可在底栏重连,恢复当前库上下文。</li>
|
||||
</ul>
|
||||
@@ -1,7 +0,0 @@
|
||||
<h1>常见问题</h1>
|
||||
<h2>打开后提示本地后端未就绪?</h2>
|
||||
<p>确认应用已拉起 sidecar;或手动 <code>./run.sh server</code> 后重试。默认只监听 <code>127.0.0.1:8788</code>。</p>
|
||||
<h2>浏览器也能用吗?</h2>
|
||||
<p>可以调试,但<strong>产品说明与对外沟通应以桌面版为准</strong>,不要暗示 Web 即产品。</p>
|
||||
<h2>官网 / 文档在哪?</h2>
|
||||
<p>本地后端提供:<code>http://127.0.0.1:8788/</code>(官网)、<code>/docs</code>(文档)。</p>
|
||||
@@ -1,13 +0,0 @@
|
||||
<h1>安装与启动</h1>
|
||||
<p>OpsxDB <strong>正式形态是桌面 GUI</strong>(Tauri)。开发态浏览器 <code>:5174</code> 只用于调试,不是产品交付。</p>
|
||||
<h2>桌面版</h2>
|
||||
<ol>
|
||||
<li>安装本机构建产物(macOS <code>.dmg</code> / <code>.app</code>,或 <code>npm run build:desktop</code> 产出)。</li>
|
||||
<li>双击启动:应用会拉起本地后端(默认 <code>127.0.0.1:8788</code>),进入工作台。</li>
|
||||
<li>无需手动执行 <code>./run.sh web</code>。</li>
|
||||
</ol>
|
||||
<h2>开发调试</h2>
|
||||
<pre><code>./run.sh gui # 或 ./run.sh web
|
||||
</code></pre>
|
||||
<p>开发壳地址:<code>http://127.0.0.1:5174</code>。</p>
|
||||
<p>改后端(<code>apps/server</code>)后请执行 <code>./run.sh restart</code>(或等价重启 Gin),避免 <code>:8788</code> 仍跑旧二进制。</p>
|
||||
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"productVersion": "0.1",
|
||||
"groups": [
|
||||
{
|
||||
"name": "开始使用",
|
||||
"pages": [
|
||||
{ "file": "01-intro.md", "slug": "intro", "title": "产品介绍", "updated": "2026-09-20" },
|
||||
{ "file": "02-quickstart.md", "slug": "quickstart", "title": "快速开始", "updated": "2026-09-20" },
|
||||
{ "file": "03-interface.md", "slug": "interface", "title": "界面导览", "updated": "2026-09-20" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "连接与驱动",
|
||||
"pages": [
|
||||
{ "file": "04-connect.md", "slug": "connect", "title": "新建连接", "updated": "2026-09-20" },
|
||||
{ "file": "05-drivers.md", "slug": "drivers", "title": "驱动支持", "updated": "2026-09-20" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "SQL 工作台",
|
||||
"pages": [
|
||||
{ "file": "06-workbench.md", "slug": "workbench", "title": "SQL 工作台", "updated": "2026-09-20" },
|
||||
{ "file": "07-results.md", "slug": "results", "title": "结果与导出", "updated": "2026-09-20" },
|
||||
{ "file": "08-redis.md", "slug": "redis", "title": "Redis 工作台", "updated": "2026-09-20" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "安全与 AI",
|
||||
"pages": [
|
||||
{ "file": "09-security.md", "slug": "security", "title": "安全设计", "updated": "2026-09-20" },
|
||||
{ "file": "10-ai.md", "slug": "ai", "title": "AI 助手", "updated": "2026-09-20" }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "参考",
|
||||
"pages": [
|
||||
{ "file": "11-faq.md", "slug": "faq", "title": "常见问题", "updated": "2026-09-20" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<h1>工作台简介</h1>
|
||||
<p>深色密度布局:左侧连接与对象树,中间编辑器与多结果 Tab,可选 AI 侧栏。</p>
|
||||
<ul>
|
||||
<li>多结果集:成功结果保留;失败不盖掉已有成功集。</li>
|
||||
<li>执行计划:有则展示,无则禁用。</li>
|
||||
<li>书签:紧凑列表,回填 SQL,本地持久化。</li>
|
||||
</ul>
|
||||
@@ -1,89 +1,264 @@
|
||||
// Package docs:用户文档骨架(嵌入 HTML,侧栏+正文密度对齐工作台)。
|
||||
// Package docs 在 /docs 路径提供产品用户文档(Markdown 嵌入二进制,SSR 渲染)。
|
||||
package docs
|
||||
|
||||
import (
|
||||
"embed"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"path"
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/yuin/goldmark"
|
||||
"github.com/yuin/goldmark/extension"
|
||||
gmhtml "github.com/yuin/goldmark/renderer/html"
|
||||
)
|
||||
|
||||
//go:embed content assets template.html
|
||||
var files embed.FS
|
||||
|
||||
type page struct {
|
||||
type PageDef struct {
|
||||
File string `json:"file"`
|
||||
Slug string `json:"slug"`
|
||||
Title string `json:"title"`
|
||||
Updated string `json:"updated,omitempty"`
|
||||
}
|
||||
|
||||
type GroupDef struct {
|
||||
Name string `json:"name"`
|
||||
Pages []PageDef `json:"pages"`
|
||||
}
|
||||
|
||||
type Manifest struct {
|
||||
ProductVersion string `json:"productVersion"`
|
||||
Groups []GroupDef `json:"groups"`
|
||||
}
|
||||
|
||||
// TocItem 本页目录项
|
||||
type TocItem struct {
|
||||
ID string `json:"id"`
|
||||
Level int `json:"level"`
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
type SearchEntry struct {
|
||||
Slug string `json:"slug"`
|
||||
Title string `json:"title"`
|
||||
Group string `json:"group"`
|
||||
Text string `json:"text"`
|
||||
}
|
||||
|
||||
type NavLink struct {
|
||||
Slug string
|
||||
Title string
|
||||
Body string
|
||||
}
|
||||
|
||||
var order = []page{
|
||||
{Slug: "install", Title: "安装与启动"},
|
||||
{Slug: "connect", Title: "连库入门"},
|
||||
{Slug: "workbench", Title: "工作台简介"},
|
||||
{Slug: "faq", Title: "常见问题"},
|
||||
type Page struct {
|
||||
Slug string
|
||||
Title string
|
||||
Group string
|
||||
Updated string
|
||||
HTML string
|
||||
TOC []TocItem
|
||||
Prev *NavLink
|
||||
Next *NavLink
|
||||
}
|
||||
|
||||
// Handler 文档服务
|
||||
type Handler struct {
|
||||
tpl string
|
||||
manifest Manifest
|
||||
pages map[string]*Page
|
||||
order []string
|
||||
searchData []byte
|
||||
tpl string
|
||||
}
|
||||
|
||||
func New() *Handler {
|
||||
raw, err := files.ReadFile("template.html")
|
||||
h := &Handler{pages: map[string]*Page{}}
|
||||
raw, err := files.ReadFile("content/manifest.json")
|
||||
if err != nil {
|
||||
panic("docs: manifest.json 缺失: " + err.Error())
|
||||
}
|
||||
if err := json.Unmarshal(raw, &h.manifest); err != nil {
|
||||
panic("docs: manifest.json 解析失败: " + err.Error())
|
||||
}
|
||||
tplRaw, err := files.ReadFile("template.html")
|
||||
if err != nil {
|
||||
panic("docs: template.html 缺失: " + err.Error())
|
||||
}
|
||||
return &Handler{tpl: string(raw)}
|
||||
h.tpl = string(tplRaw)
|
||||
|
||||
md := goldmark.New(
|
||||
goldmark.WithExtensions(extension.Table, extension.Strikethrough, extension.TaskList),
|
||||
goldmark.WithRendererOptions(gmhtml.WithHardWraps()),
|
||||
)
|
||||
|
||||
search := []SearchEntry{}
|
||||
var prev *NavLink
|
||||
for _, group := range h.manifest.Groups {
|
||||
for _, def := range group.Pages {
|
||||
src, err := files.ReadFile("content/" + def.File)
|
||||
if err != nil {
|
||||
panic("docs: 缺少内容文件 " + def.File)
|
||||
}
|
||||
var buf strings.Builder
|
||||
if err := md.Convert(src, &buf); err != nil {
|
||||
panic("docs: 渲染失败 " + def.File + ": " + err.Error())
|
||||
}
|
||||
body, toc := injectHeadingIDs(buf.String())
|
||||
page := &Page{
|
||||
Slug: def.Slug,
|
||||
Title: def.Title,
|
||||
Group: group.Name,
|
||||
Updated: def.Updated,
|
||||
HTML: body,
|
||||
TOC: toc,
|
||||
Prev: prev,
|
||||
}
|
||||
h.pages[def.Slug] = page
|
||||
h.order = append(h.order, def.Slug)
|
||||
prev = &NavLink{Slug: def.Slug, Title: def.Title}
|
||||
search = append(search, SearchEntry{
|
||||
Slug: def.Slug,
|
||||
Title: def.Title,
|
||||
Group: group.Name,
|
||||
Text: plainText(string(src)),
|
||||
})
|
||||
}
|
||||
}
|
||||
// 下一页链接
|
||||
for i, slug := range h.order {
|
||||
if i+1 < len(h.order) {
|
||||
next := h.pages[h.order[i+1]]
|
||||
h.pages[slug].Next = &NavLink{Slug: next.Slug, Title: next.Title}
|
||||
}
|
||||
}
|
||||
searchJSON, _ := json.Marshal(search)
|
||||
h.searchData = searchJSON
|
||||
return h
|
||||
}
|
||||
|
||||
// Register 注册路由(单一 catch-all,避免静态/参数段冲突)
|
||||
func (h *Handler) Register(r *gin.Engine) {
|
||||
r.GET("/docs", func(c *gin.Context) { c.Redirect(http.StatusFound, "/docs/install") })
|
||||
r.GET("/docs/:slug", h.Page)
|
||||
r.GET("/docs/assets/*file", h.Asset)
|
||||
r.GET("/docs", func(c *gin.Context) {
|
||||
c.Redirect(http.StatusFound, "/docs/"+h.order[0])
|
||||
})
|
||||
r.GET("/docs/*path", h.dispatch)
|
||||
}
|
||||
|
||||
func (h *Handler) dispatch(c *gin.Context) {
|
||||
p := strings.Trim(c.Param("path"), "/")
|
||||
switch {
|
||||
case p == "":
|
||||
c.Redirect(http.StatusFound, "/docs/"+h.order[0])
|
||||
case p == "search-data.json":
|
||||
h.SearchData(c)
|
||||
case strings.HasPrefix(p, "assets/"):
|
||||
c.Params = []gin.Param{{Key: "file", Value: "/" + strings.TrimPrefix(p, "assets")}}
|
||||
h.Asset(c)
|
||||
default:
|
||||
// 取第一段作为 slug(忽略子路径)
|
||||
slug := p
|
||||
if i := strings.IndexByte(p, '/'); i >= 0 {
|
||||
slug = p[:i]
|
||||
}
|
||||
c.Params = []gin.Param{{Key: "slug", Value: slug}}
|
||||
h.Page(c)
|
||||
}
|
||||
}
|
||||
|
||||
// Page 渲染文档页
|
||||
func (h *Handler) Page(c *gin.Context) {
|
||||
slug := c.Param("slug")
|
||||
bodyBytes, err := files.ReadFile("content/" + slug + ".html")
|
||||
if err != nil {
|
||||
page, ok := h.pages[slug]
|
||||
if !ok {
|
||||
c.Status(http.StatusNotFound)
|
||||
_, _ = c.Writer.WriteString(notFoundHTML(h.order[0])) //nolint:errcheck
|
||||
return
|
||||
}
|
||||
title := slug
|
||||
nav := strings.Builder{}
|
||||
for _, p := range order {
|
||||
cls := "nav-link"
|
||||
if p.Slug == slug {
|
||||
cls += " active"
|
||||
title = p.Title
|
||||
}
|
||||
nav.WriteString(`<a class="` + cls + `" href="/docs/` + p.Slug + `">` + p.Title + `</a>`)
|
||||
}
|
||||
html := h.tpl
|
||||
html = strings.ReplaceAll(html, "{{TITLE}}", title)
|
||||
html = strings.ReplaceAll(html, "{{NAV}}", nav.String())
|
||||
html = strings.ReplaceAll(html, "{{BODY}}", string(bodyBytes))
|
||||
c.Header("Content-Type", "text/html; charset=utf-8")
|
||||
c.Header("Cache-Control", "no-cache")
|
||||
_, _ = c.Writer.WriteString(html)
|
||||
_, _ = c.Writer.WriteString(renderPage(h, page))
|
||||
}
|
||||
|
||||
// SearchData 搜索索引
|
||||
func (h *Handler) SearchData(c *gin.Context) {
|
||||
c.Data(http.StatusOK, "application/json; charset=utf-8", h.searchData)
|
||||
}
|
||||
|
||||
// Asset 静态资源
|
||||
func (h *Handler) Asset(c *gin.Context) {
|
||||
name := strings.TrimPrefix(c.Param("file"), "/")
|
||||
name := path.Clean(c.Param("file"))
|
||||
if strings.Contains(name, "..") {
|
||||
c.Status(http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
data, err := files.ReadFile("assets/" + name)
|
||||
data, err := files.ReadFile("assets" + name)
|
||||
if err != nil {
|
||||
c.Status(http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
ct := "application/octet-stream"
|
||||
if strings.HasSuffix(name, ".css") {
|
||||
ct = "text/css; charset=utf-8"
|
||||
switch {
|
||||
case strings.HasSuffix(name, ".css"):
|
||||
c.Header("Content-Type", "text/css; charset=utf-8")
|
||||
case strings.HasSuffix(name, ".js"):
|
||||
c.Header("Content-Type", "application/javascript; charset=utf-8")
|
||||
case strings.HasSuffix(name, ".svg"):
|
||||
c.Header("Content-Type", "image/svg+xml")
|
||||
default:
|
||||
c.Header("Content-Type", "application/octet-stream")
|
||||
}
|
||||
c.Header("Content-Type", ct)
|
||||
c.Data(http.StatusOK, ct, data)
|
||||
c.Header("Cache-Control", "public, max-age=3600")
|
||||
c.Data(http.StatusOK, "", data)
|
||||
}
|
||||
|
||||
// ManifestExport 供测试使用
|
||||
func (h *Handler) ManifestExport() Manifest { return h.manifest }
|
||||
|
||||
func (h *Handler) FirstSlug() string { return h.order[0] }
|
||||
|
||||
var (
|
||||
hRe = regexp.MustCompile(`(?s)<(h[23])>(.*?)</h[23]>`)
|
||||
tagRe = regexp.MustCompile(`<[^>]+>`)
|
||||
)
|
||||
|
||||
// injectHeadingIDs 给 h2/h3 加锚点 id,并产出目录
|
||||
func injectHeadingIDs(html string) (string, []TocItem) {
|
||||
var toc []TocItem
|
||||
counter := 0
|
||||
out := hRe.ReplaceAllStringFunc(html, func(m string) string {
|
||||
sub := hRe.FindStringSubmatch(m)
|
||||
tag, inner := sub[1], sub[2]
|
||||
counter++
|
||||
id := fmt.Sprintf("sec-%d", counter)
|
||||
text := strings.TrimSpace(tagRe.ReplaceAllString(inner, ""))
|
||||
level := 2
|
||||
if tag == "h3" {
|
||||
level = 3
|
||||
}
|
||||
toc = append(toc, TocItem{ID: id, Level: level, Text: text})
|
||||
return fmt.Sprintf(`<%s id="%s">%s</%s>`, tag, id, inner, tag)
|
||||
})
|
||||
return out, toc
|
||||
}
|
||||
|
||||
var mdNoise = regexp.MustCompile("(?s)```.*?```|`[^`]*`|!\\[[^\\]]*\\]\\([^)]*\\)|\\[[^\\]]*\\]\\([^)]*\\)|[#>*_\\-|]+")
|
||||
|
||||
// plainText 供搜索索引的纯文本
|
||||
func plainText(src string) string {
|
||||
s := mdNoise.ReplaceAllString(src, " ")
|
||||
s = strings.Join(strings.Fields(s), " ")
|
||||
if len(s) > 6000 {
|
||||
s = s[:6000]
|
||||
}
|
||||
return s
|
||||
}
|
||||
|
||||
func notFoundHTML(home string) string {
|
||||
return fmt.Sprintf(`<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><title>404 · OpsxDB 文档</title>
|
||||
<link rel="stylesheet" href="/docs/assets/docs.css"></head><body class="doc-404">
|
||||
<div class="wrap"><h1>404</h1><p>文档页面不存在或已被移动。</p><a class="btn" href="%s">返回文档首页</a></div>
|
||||
</body></html>`, home)
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package docs
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func renderPage(h *Handler, p *Page) string {
|
||||
tpl, err := template.New("doc").Parse(h.tpl)
|
||||
if err != nil {
|
||||
return "<!doctype html><meta charset=utf-8><title>error</title>template error: " + template.HTMLEscapeString(err.Error())
|
||||
}
|
||||
|
||||
var sb strings.Builder
|
||||
data := map[string]any{
|
||||
"Manifest": h.manifest,
|
||||
"Page": p,
|
||||
"TOC": p.TOC,
|
||||
"Content": template.HTML(p.HTML), //nolint:gosec —— 内容为内置受信 Markdown
|
||||
}
|
||||
if err := tpl.Execute(&sb, data); err != nil {
|
||||
return "<!doctype html><meta charset=utf-8><title>error</title>render error: " + template.HTMLEscapeString(err.Error())
|
||||
}
|
||||
return sb.String()
|
||||
}
|
||||
@@ -3,17 +3,85 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{{TITLE}} · OpsxDB 文档</title>
|
||||
<title>{{.Page.Title}} · OpsxDB 文档</title>
|
||||
<meta name="description" content="OpsxDB 桌面数据库工作台用户文档 — 连库、写 SQL、看结果;MySQL / PostgreSQL / SQL Server / Oracle / SQLite / Redis 内置驱动,SSH 隧道与 SSL 加密。">
|
||||
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22g%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2264%22%20y2%3D%2264%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%23059669%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%2206B6D4%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2214%22%20fill%3D%22url(%23g)%22%2F%3E%3Cg%20stroke%3D%22%23fff%22%20stroke-width%3D%224.5%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%3E%3Cellipse%20cx%3D%2232%22%20cy%3D%2220%22%20rx%3D%2215%22%20ry%3D%226.5%22%2F%3E%3Cpath%20d%3D%22M17%2020v24c0%203.6%206.7%206.5%2015%206.5s15-2.9%2015-6.5V20%22%2F%3E%3Cpath%20d%3D%22M17%2032c0%203.6%206.7%206.5%2015%206.5s15-2.9%2015-6.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E">
|
||||
<link rel="stylesheet" href="/docs/assets/docs.css">
|
||||
</head>
|
||||
<body>
|
||||
<header class="top">
|
||||
<a class="brand" href="/docs"><span class="logo">DB</span> OpsxDB <em>文档</em></a>
|
||||
<nav><a href="/home">官网</a></nav>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" style="display:none" aria-hidden="true">
|
||||
<symbol id="i-menu" viewBox="0 0 24 24"><path d="M4 5h16"/><path d="M4 12h16"/><path d="M4 19h16"/></symbol>
|
||||
<symbol id="i-printer" viewBox="0 0 24 24"><path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/><path d="M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6"/><rect x="6" y="14" width="12" height="8" rx="1"/></symbol>
|
||||
<symbol id="i-thumbs-up" viewBox="0 0 24 24"><path d="M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"/><path d="M7 10v12"/></symbol>
|
||||
<symbol id="i-thumbs-down" viewBox="0 0 24 24"><path d="M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z"/><path d="M17 14V2"/></symbol>
|
||||
</svg>
|
||||
<header class="topbar">
|
||||
<div class="topbar-inner">
|
||||
<button class="menu-btn" id="menu-btn" aria-label="打开导航"><svg class="i"><use href="#i-menu"/></svg></button>
|
||||
<a class="brand" href="/docs">
|
||||
<span class="brand-logo"><svg width="28" height="28" viewBox="0 0 64 64" aria-label="OpsxDB"><defs><linearGradient id="lg-docs" x1="0" y1="0" x2="64" y2="64" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#059669"/><stop offset="1" stop-color="#06B6D4"/></linearGradient></defs><rect width="64" height="64" rx="14" fill="url(#lg-docs)"/><g stroke="#fff" stroke-width="4.5" fill="none" stroke-linecap="round"><ellipse cx="32" cy="20" rx="15" ry="6.5"/><path d="M17 20v24c0 3.6 6.7 6.5 15 6.5s15-2.9 15-6.5V20"/><path d="M17 32c0 3.6 6.7 6.5 15 6.5s15-2.9 15-6.5"/></g></svg></span>
|
||||
<span class="brand-name">OpsxDB <em>文档</em></span>
|
||||
</a>
|
||||
<span class="ver-badge">v{{.Manifest.ProductVersion}}</span>
|
||||
<div class="search">
|
||||
<input id="search-input" type="search" placeholder="搜索文档…" autocomplete="off" spellcheck="false">
|
||||
<div class="search-panel" id="search-panel" hidden></div>
|
||||
</div>
|
||||
<nav class="top-links">
|
||||
<a href="/home">官网</a>
|
||||
<a href="/docs/quickstart">快速开始</a>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
<div class="layout">
|
||||
<aside class="side">{{NAV}}</aside>
|
||||
<main class="content">{{BODY}}</main>
|
||||
|
||||
<div class="layout" id="layout">
|
||||
<aside class="sidebar" id="sidebar">
|
||||
{{range .Manifest.Groups}}
|
||||
<div class="nav-group">
|
||||
<div class="nav-group-title">{{.Name}}</div>
|
||||
{{range .Pages}}
|
||||
<a class="nav-link{{if eq .Slug $.Page.Slug}} active{{end}}" href="/docs/{{.Slug}}">{{.Title}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="sidebar-foot">© 2026 OpsxDB · 本地优先的数据库工作台</div>
|
||||
</aside>
|
||||
|
||||
<main class="content">
|
||||
<div class="breadcrumb">文档 <span>/</span> {{.Page.Group}} <span>/</span> {{.Page.Title}}</div>
|
||||
<h1 class="page-title">{{.Page.Title}}</h1>
|
||||
{{if .Page.Updated}}<div class="page-meta">更新于 {{.Page.Updated}}</div>{{end}}
|
||||
<article class="md">
|
||||
{{.Content}}
|
||||
</article>
|
||||
|
||||
<div class="pn-nav">
|
||||
{{with .Page.Prev}}
|
||||
<a class="pn prev" href="/docs/{{.Slug}}"><span class="pn-label">← 上一页</span><span class="pn-title">{{.Title}}</span></a>
|
||||
{{else}}<span class="pn"></span>{{end}}
|
||||
{{with .Page.Next}}
|
||||
<a class="pn next" href="/docs/{{.Slug}}"><span class="pn-label">下一页 →</span><span class="pn-title">{{.Title}}</span></a>
|
||||
{{else}}<span class="pn"></span>{{end}}
|
||||
</div>
|
||||
|
||||
<div class="feedback" id="feedback">
|
||||
<span class="feedback-q">本页内容是否对您有帮助?</span>
|
||||
<button class="fb-btn" data-v="yes"><svg class="i"><use href="#i-thumbs-up"/></svg> 有帮助</button>
|
||||
<button class="fb-btn" data-v="no"><svg class="i"><use href="#i-thumbs-down"/></svg> 没有帮助</button>
|
||||
<span class="fb-thanks" id="fb-thanks" hidden>感谢您的反馈!</span>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<aside class="toc">
|
||||
<div class="toc-title">本页目录</div>
|
||||
<nav class="toc-nav">
|
||||
{{range .TOC}}<a class="toc-l{{.Level}}" href="#{{.ID}}">{{.Text}}</a>
|
||||
{{end}}
|
||||
</nav>
|
||||
<button class="print-btn" id="print-btn"><svg class="i"><use href="#i-printer"/></svg> 打印 / 导出 PDF</button>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
<script src="/docs/assets/docs.js" defer></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,50 +1,268 @@
|
||||
/* OpsxDB 官网 —— 营销单页样式(祖母绿 → 青家族色) */
|
||||
:root {
|
||||
--bg: #0e1116;
|
||||
--panel: #151a21;
|
||||
--border: #243044;
|
||||
--text: #e6edf7;
|
||||
--muted: #8b9bb4;
|
||||
--accent: #3b82f6;
|
||||
--green: #059669;
|
||||
--green-dark: #047857;
|
||||
--green-soft: rgba(5, 150, 105, 0.08);
|
||||
--cyan: #06b6d4;
|
||||
--bg: #ffffff;
|
||||
--bg-alt: #f5faf8;
|
||||
--border: #e2ebe7;
|
||||
--text: #101828;
|
||||
--text-2: #52606d;
|
||||
--text-3: #98a2b3;
|
||||
--red: #dc2626;
|
||||
--amber: #d97706;
|
||||
--radius: 14px;
|
||||
--shadow: 0 1px 3px rgba(6, 23, 18, .06), 0 12px 32px rgba(6, 23, 18, .08);
|
||||
--mono: "JetBrains Mono", SFMono-Regular, Menlo, monospace;
|
||||
}
|
||||
* { box-sizing: border-box; }
|
||||
* { box-sizing: border-box; scroll-behavior: smooth; }
|
||||
body {
|
||||
margin: 0;
|
||||
font: 14px/1.55 ui-sans-serif, system-ui, -apple-system, sans-serif;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
margin: 0; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
|
||||
color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.75;
|
||||
}
|
||||
.nav { border-bottom: 1px solid var(--border); background: var(--panel); }
|
||||
.nav .inner {
|
||||
max-width: 880px; margin: 0 auto; padding: 0 20px; height: 48px;
|
||||
display: flex; align-items: center; justify-content: space-between;
|
||||
}
|
||||
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
|
||||
.logo {
|
||||
width: 28px; height: 28px; border-radius: 7px; background: var(--accent);
|
||||
display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
|
||||
}
|
||||
.nav a { color: var(--muted); text-decoration: none; margin-left: 16px; font-size: 13px; }
|
||||
.nav a:hover { color: var(--text); }
|
||||
.hero { max-width: 880px; margin: 0 auto; padding: 56px 20px 72px; }
|
||||
.eyebrow { color: var(--accent); font-size: 12px; letter-spacing: .04em; margin: 0 0 12px; }
|
||||
h1 { font-size: 28px; line-height: 1.25; margin: 0 0 14px; font-weight: 650; }
|
||||
.lead { color: var(--muted); max-width: 52ch; margin: 0 0 24px; }
|
||||
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
|
||||
a { color: var(--green-dark); text-decoration: none; }
|
||||
h1,h2,h3 { letter-spacing: -0.015em; }
|
||||
section[id] { scroll-margin-top: 76px; }
|
||||
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
|
||||
.wrap.narrow { max-width: 820px; }
|
||||
/* ---------- SVG 图标 ---------- */
|
||||
.i { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
|
||||
.i-lg { width: 28px; height: 28px; vertical-align: middle; }
|
||||
code { font-family: var(--mono); font-size: 13px; background: var(--green-soft); color: var(--green-dark); border-radius: 5px; padding: 1px 6px; }
|
||||
|
||||
/* ---------- 按钮 ---------- */
|
||||
.btn {
|
||||
display: inline-flex; align-items: center; height: 36px; padding: 0 14px;
|
||||
border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 550;
|
||||
border: 1px solid var(--border);
|
||||
display: inline-flex; align-items: center; justify-content: center; gap: 6px;
|
||||
border-radius: 10px; padding: 9px 20px; font-size: 14.5px; font-weight: 600; cursor: pointer;
|
||||
transition: all .18s; border: 1px solid transparent; white-space: nowrap;
|
||||
}
|
||||
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
|
||||
.btn.ghost { color: var(--text); background: transparent; }
|
||||
.caps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
|
||||
.caps li {
|
||||
background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
|
||||
padding: 12px 14px; display: grid; gap: 4px;
|
||||
.btn-lg { padding: 12px 26px; font-size: 15.5px; }
|
||||
.btn-primary { background: var(--green); color: #fff !important; box-shadow: 0 6px 18px rgba(5,150,105,.30); }
|
||||
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); }
|
||||
.btn-ghost { border-color: var(--border); color: var(--text) !important; background: #fff; }
|
||||
.btn-ghost:hover { border-color: var(--green); color: var(--green-dark) !important; }
|
||||
.btn-inverse { background: #fff; color: var(--green-dark) !important; }
|
||||
.btn-inverse:hover { transform: translateY(-1px); }
|
||||
.btn-outline { border-color: rgba(255,255,255,.5); color: #fff !important; }
|
||||
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,.1); }
|
||||
|
||||
/* ---------- 导航 ---------- */
|
||||
.nav {
|
||||
position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.9);
|
||||
backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.caps strong { font-size: 13px; }
|
||||
.caps span { color: var(--muted); font-size: 12.5px; }
|
||||
.foot {
|
||||
border-top: 1px solid var(--border); color: var(--muted);
|
||||
text-align: center; padding: 18px; font-size: 12px;
|
||||
.nav-inner { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 28px; }
|
||||
.brand { display: flex; align-items: center; gap: 9px; }
|
||||
.brand-logo { display: inline-flex; }
|
||||
.brand-logo svg { display: block; border-radius: 8px; }
|
||||
.brand-name { font-size: 17px; font-weight: 800; color: var(--text) !important; }
|
||||
.nav-links { display: flex; gap: 22px; }
|
||||
.nav-links a { font-size: 14px; font-weight: 500; color: var(--text-2) !important; }
|
||||
.nav-links a:hover { color: var(--green-dark) !important; }
|
||||
.nav-cta { margin-left: auto; }
|
||||
|
||||
/* ---------- Hero ---------- */
|
||||
.hero {
|
||||
position: relative; overflow: hidden;
|
||||
background:
|
||||
radial-gradient(1200px 500px at 85% -10%, rgba(5,150,105,.13), transparent 60%),
|
||||
radial-gradient(800px 400px at -10% 10%, rgba(6,182,212,.09), transparent 55%),
|
||||
linear-gradient(180deg, #f5fbf8 0%, #fff 100%);
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
.hero-inner {
|
||||
max-width: 1120px; margin: 0 auto; padding: 72px 24px 56px;
|
||||
display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: center;
|
||||
}
|
||||
.hero-badge {
|
||||
display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--green-dark);
|
||||
background: #fff; border: 1px solid rgba(5,150,105,.25); border-radius: 999px; padding: 4px 14px;
|
||||
box-shadow: 0 2px 8px rgba(5,150,105,.1); margin-bottom: 18px;
|
||||
}
|
||||
.hero h1 { font-size: 44px; line-height: 1.22; font-weight: 800; margin: 0 0 16px; }
|
||||
.hero h1 em { font-style: normal; color: var(--green); }
|
||||
.hero-sub { color: var(--text-2); font-size: 16px; margin: 0 0 26px; }
|
||||
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
|
||||
.hero-actions.center { justify-content: center; }
|
||||
.hero-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
|
||||
.hero-pills span {
|
||||
font-size: 12px; color: var(--text-2); background: #fff; border: 1px solid var(--border);
|
||||
padding: 3px 12px; border-radius: 999px;
|
||||
}
|
||||
|
||||
/* ---------- 工作台 Mock(纯 CSS) ---------- */
|
||||
.mock {
|
||||
border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid #1b2b26;
|
||||
background: #0c1512; transform: perspective(1400px) rotateY(-4deg) rotateX(1.5deg);
|
||||
}
|
||||
.mock-titlebar {
|
||||
display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
|
||||
background: #0f1a16; border-bottom: 1px solid #1b2b26;
|
||||
}
|
||||
.mock-titlebar i { width: 11px; height: 11px; border-radius: 50%; background: #37504a; }
|
||||
.mock-titlebar i:nth-child(1) { background: #f87171; } .mock-titlebar i:nth-child(2) { background: #fbbf24; } .mock-titlebar i:nth-child(3) { background: #34d399; }
|
||||
.mock-titlebar span { margin-left: 8px; color: #8aa39b; font-size: 11px; }
|
||||
.mock-body { display: grid; grid-template-columns: 158px minmax(0,1fr); min-height: 330px; }
|
||||
.mock-side { border-right: 1px solid #1b2b26; padding: 10px 8px; background: #0b1310; }
|
||||
.mock-search { height: 22px; border-radius: 6px; background: #142019; margin-bottom: 10px; }
|
||||
.mock-group { color: #8aa39b; font-size: 11px; padding: 8px 6px 3px; }
|
||||
.mock-item { display: flex; align-items: center; gap: 6px; color: #a9c0b8; font-size: 11.5px; padding: 4px 6px; border-radius: 6px; }
|
||||
.mock-item.active { background: rgba(5,150,105,.18); color: #6ee7b7; }
|
||||
.mock-item.conn .dot { width: 7px; height: 7px; border-radius: 50%; background: #47564f; flex-shrink: 0; }
|
||||
.mock-item.conn .dot.on { background: #34d399; }
|
||||
.mi { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; opacity: .8; }
|
||||
.mock-main { padding: 10px 12px; display: flex; flex-direction: column; gap: 9px; }
|
||||
.mock-tabs { display: flex; gap: 4px; }
|
||||
.mock-tabs .tab { color: #5f7a70; font-size: 10.5px; padding: 4px 10px; border-radius: 6px 6px 0 0; }
|
||||
.mock-tabs .tab.on { color: #6ee7b7; background: rgba(5,150,105,.12); border-bottom: 2px solid var(--green); }
|
||||
.mock-sql { border: 1px solid #1b2b26; border-radius: 9px; padding: 10px 12px; background: #0b1310; }
|
||||
.mock-sql pre {
|
||||
margin: 0; font-family: var(--mono); font-size: 11px; line-height: 1.7; color: #c3d4cd; white-space: pre-wrap;
|
||||
}
|
||||
.mock-sql .kw { color: #6ee7b7; }
|
||||
.mock-sql .str { color: #fcd34d; }
|
||||
.mock-sql .num { color: #7dd3fc; }
|
||||
.mock-grid {
|
||||
display: grid; grid-template-columns: 52px 62px 1fr 68px; gap: 0 10px;
|
||||
border: 1px solid #1b2b26; border-radius: 9px; padding: 8px 10px; background: #0b1310;
|
||||
font-family: var(--mono); font-size: 10.5px; line-height: 1.9; color: #b7c8c1;
|
||||
}
|
||||
.mock-grid .gh { color: #7fe3c3; border-bottom: 1px solid #1b2b26; margin-bottom: 3px; font-weight: 600; }
|
||||
.mock-grid .ok { color: #34d399; }
|
||||
.mock-grid .warn { color: #fbbf24; }
|
||||
.mock-status { display: flex; justify-content: space-between; color: #5f7a70; font-size: 10px; font-family: var(--mono); padding: 0 2px; }
|
||||
.mock-status .ok { color: #34d399; }
|
||||
|
||||
/* ---------- 数据统计条 ---------- */
|
||||
.stats { border-top: 1px solid var(--border); background: rgba(255,255,255,.7); }
|
||||
.stats-inner {
|
||||
max-width: 1120px; margin: 0 auto; padding: 18px 24px;
|
||||
display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; text-align: center;
|
||||
}
|
||||
.stat b { display: block; font-size: 26px; font-weight: 800; color: var(--green-dark); line-height: 1.2; }
|
||||
.stat span { font-size: 12.5px; color: var(--text-2); }
|
||||
|
||||
/* ---------- 通用 Section ---------- */
|
||||
.section { padding: 72px 0; }
|
||||
.section.alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
|
||||
.sec-title { font-size: 30px; font-weight: 800; text-align: center; margin: 0 0 8px; }
|
||||
.sec-sub { text-align: center; color: var(--text-2); margin: 0 0 40px; }
|
||||
.grid { display: grid; gap: 18px; }
|
||||
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
|
||||
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
|
||||
|
||||
/* ---------- 卡片 ---------- */
|
||||
.card {
|
||||
background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
|
||||
padding: 22px; box-shadow: 0 1px 2px rgba(6,23,18,.04); transition: all .18s;
|
||||
}
|
||||
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: rgba(5,150,105,.35); }
|
||||
.card h3 { font-size: 16px; margin: 0 0 6px; }
|
||||
.card p { color: var(--text-2); font-size: 13.5px; margin: 0; }
|
||||
.card-icon { color: var(--green); margin-bottom: 10px; }
|
||||
.card-icon .i-lg { width: 30px; height: 30px; }
|
||||
.card.row { display: flex; gap: 14px; align-items: flex-start; }
|
||||
.card.row .card-icon { margin: 2px 0 0; }
|
||||
|
||||
/* ---------- 驱动矩阵 ---------- */
|
||||
.proto {
|
||||
background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--green);
|
||||
border-radius: 12px; padding: 18px 20px;
|
||||
}
|
||||
.proto h3 { margin: 0 0 6px; font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
|
||||
.proto h3 .i { color: var(--green); width: 17px; height: 17px; }
|
||||
.proto p { margin: 0; color: var(--text-2); font-size: 13.5px; }
|
||||
.proto .port { margin-left: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--green-dark); background: var(--green-soft); border-radius: 5px; padding: 1px 8px; white-space: nowrap; }
|
||||
|
||||
/* ---------- 徽章 / 脚注 ---------- */
|
||||
.badges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 18px; }
|
||||
.badges span {
|
||||
background: #fff; border: 1px solid var(--border); border-radius: 999px;
|
||||
padding: 6px 16px; font-size: 13px; font-weight: 500; color: var(--text);
|
||||
}
|
||||
.badges span.more { border-style: dashed; color: var(--text-2); }
|
||||
.footnote { text-align: center; color: var(--text-3); font-size: 12.5px; margin: 10px 0 0; }
|
||||
|
||||
/* ---------- 形态卡(下载) ---------- */
|
||||
.pricing.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; max-width: 1080px; margin: 0 auto; }
|
||||
.price-card {
|
||||
position: relative; background: #fff; border: 1px solid var(--border); border-radius: 16px;
|
||||
padding: 30px 28px 26px; box-shadow: 0 1px 2px rgba(6,23,18,.04); display: flex; flex-direction: column;
|
||||
}
|
||||
.price-card.featured { border: 2px solid var(--green); box-shadow: 0 12px 36px rgba(5,150,105,.16); }
|
||||
.price-card.enterprise {
|
||||
background: linear-gradient(160deg, #0f1f1a 0%, #0c1512 70%);
|
||||
border: 1px solid #22453a; box-shadow: 0 14px 40px rgba(12,21,18,.4);
|
||||
}
|
||||
.price-card.enterprise .plan { color: #8aa39b; }
|
||||
.price-card.enterprise .price b { color: #fff; font-size: 34px; }
|
||||
.price-card.enterprise .price span { color: #8aa39b; }
|
||||
.price-card.enterprise .plan-sub { color: #8aa39b; }
|
||||
.price-card.enterprise li { color: #a9c0b8; border-bottom-color: #1b2b26; }
|
||||
.btn-dark { background: #fff; color: #0c1512 !important; }
|
||||
.btn-dark:hover { transform: translateY(-1px); background: #e6f7f0; }
|
||||
.plan-tag {
|
||||
position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
|
||||
background: var(--green); color: #fff; font-size: 12px; font-weight: 700;
|
||||
padding: 3px 14px; border-radius: 999px; white-space: nowrap;
|
||||
}
|
||||
.plan-tag.dark { background: #0c1512; border: 1px solid #22453a; }
|
||||
.plan { font-size: 16px; font-weight: 700; color: var(--text-2); }
|
||||
.price { margin: 8px 0 2px; }
|
||||
.price b { font-size: 40px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
|
||||
.price span { color: var(--text-3); font-size: 14px; margin-left: 4px; }
|
||||
.plan-sub { color: var(--text-3); font-size: 13px; margin-bottom: 18px; }
|
||||
.price-card ul { list-style: none; padding: 0; margin: 0 0 22px; flex: 1; }
|
||||
.price-card li { font-size: 13.5px; color: var(--text-2); padding: 6px 0; border-bottom: 1px dashed var(--border); }
|
||||
.price-card li:last-child { border-bottom: none; }
|
||||
.price-card li code { font-size: 12px; }
|
||||
.price-card .btn { width: 100%; }
|
||||
|
||||
/* ---------- FAQ ---------- */
|
||||
.faq details {
|
||||
background: #fff; border: 1px solid var(--border); border-radius: 12px;
|
||||
padding: 16px 20px; margin-bottom: 12px;
|
||||
}
|
||||
.faq summary { font-weight: 600; cursor: pointer; font-size: 15px; list-style: none; display: flex; justify-content: space-between; }
|
||||
.faq summary::after { content: "+"; color: var(--text-3); font-weight: 400; }
|
||||
.faq details[open] summary::after { content: "-"; }
|
||||
.faq details p { margin: 10px 0 0; color: var(--text-2); font-size: 14px; }
|
||||
|
||||
/* ---------- CTA ---------- */
|
||||
.cta {
|
||||
background: linear-gradient(135deg, #047857 0%, #059669 55%, #0d9488 100%);
|
||||
color: #fff; text-align: center; padding: 72px 24px;
|
||||
}
|
||||
.cta h2 { font-size: 32px; font-weight: 800; margin: 0 0 10px; }
|
||||
.cta p { color: rgba(255,255,255,.85); margin: 0 0 28px; }
|
||||
|
||||
/* ---------- Footer ---------- */
|
||||
.footer { background: #0c1512; color: #8aa39b; padding: 52px 0 0; font-size: 13.5px; }
|
||||
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 36px; }
|
||||
.footer .brand-name { color: #fff !important; }
|
||||
.footer .brand { display: flex; align-items: center; gap: 9px; }
|
||||
.footer-desc { margin: 12px 0 0; font-size: 13px; line-height: 1.8; }
|
||||
.footer h4 { color: #fff; font-size: 13.5px; margin: 4px 0 12px; }
|
||||
.footer a { display: block; color: #8aa39b !important; padding: 4px 0; font-size: 13px; }
|
||||
.footer a:hover { color: #fff !important; }
|
||||
.footer-bar { border-top: 1px solid #1b2b26; text-align: center; padding: 18px; font-size: 12px; color: #5f7a70; }
|
||||
|
||||
/* ---------- 响应式 ---------- */
|
||||
@media (max-width: 1020px) {
|
||||
.hero-inner { grid-template-columns: 1fr; padding-top: 52px; }
|
||||
.mock { transform: none; }
|
||||
.g4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
|
||||
.g3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
|
||||
.pricing.three { grid-template-columns: minmax(0, 420px); }
|
||||
.footer-grid { grid-template-columns: repeat(2, 1fr); }
|
||||
.stats-inner { grid-template-columns: repeat(2, 1fr); }
|
||||
}
|
||||
@media (max-width: 680px) {
|
||||
.nav-links { display: none; }
|
||||
.hero h1 { font-size: 32px; }
|
||||
.sec-title { font-size: 24px; }
|
||||
.g3, .g4 { grid-template-columns: 1fr; }
|
||||
.footer-grid { grid-template-columns: 1fr; }
|
||||
.stats-inner { grid-template-columns: repeat(2, 1fr); }
|
||||
}
|
||||
@@ -4,33 +4,297 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>OpsxDB — 本地优先的桌面数据库工作台</title>
|
||||
<meta name="description" content="OpsxDB 主交付是桌面 GUI:连库、写 SQL、看结果。开发态 Vite 仅调试用。">
|
||||
<meta name="description" content="OpsxDB:连库、写 SQL、看结果,全在本机完成。MySQL / PostgreSQL / SQL Server / Oracle / SQLite / Redis 一个窗口管完,SSH 隧道与 SSL 加密,AI 辅助写 SQL。">
|
||||
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2064%2064%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22g%22%20x1%3D%220%22%20y1%3D%220%22%20x2%3D%2264%22%20y2%3D%2264%22%20gradientUnits%3D%22userSpaceOnUse%22%3E%3Cstop%20offset%3D%220%22%20stop-color%3D%22%23059669%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%2206B6D4%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Crect%20width%3D%2264%22%20height%3D%2264%22%20rx%3D%2214%22%20fill%3D%22url(%23g)%22%2F%3E%3Cg%20stroke%3D%22%23fff%22%20stroke-width%3D%224.5%22%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%3E%3Cellipse%20cx%3D%2232%22%20cy%3D%2220%22%20rx%3D%2215%22%20ry%3D%226.5%22%2F%3E%3Cpath%20d%3D%22M17%2020v24c0%203.6%206.7%206.5%2015%206.5s15-2.9%2015-6.5V20%22%2F%3E%3Cpath%20d%3D%22M17%2032c0%203.6%206.7%206.5%2015%206.5s15-2.9%2015-6.5%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E">
|
||||
<link rel="stylesheet" href="/site/assets/site.css">
|
||||
</head>
|
||||
<body>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" style="display:none" aria-hidden="true">
|
||||
<symbol id="i-database" viewBox="0 0 24 24"><ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5v14a9 3 0 0 0 18 0V5"/><path d="M3 12a9 3 0 0 0 18 0"/></symbol>
|
||||
<symbol id="i-shield-check" viewBox="0 0 24 24"><path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"/><path d="m9 12 2 2 4-4"/></symbol>
|
||||
<symbol id="i-terminal" viewBox="0 0 24 24"><polyline points="4 17 10 11 4 5"/><line x1="12" x2="20" y1="19" y2="19"/></symbol>
|
||||
<symbol id="i-table" viewBox="0 0 24 24"><rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/><path d="M9 3v18"/><path d="M15 3v18"/></symbol>
|
||||
<symbol id="i-tree" viewBox="0 0 24 24"><path d="M13 10h7a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"/><path d="M13 21h7a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z"/><path d="M3 5a2 2 0 0 0 2 2h3"/><path d="M3 3v13a2 2 0 0 0 2 2h3"/></symbol>
|
||||
<symbol id="i-zap" viewBox="0 0 24 24"><path d="M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z"/></symbol>
|
||||
<symbol id="i-sparkles" viewBox="0 0 24 24"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/><path d="M20 3v4"/><path d="M22 5h-4"/></symbol>
|
||||
<symbol id="i-key" viewBox="0 0 24 24"><circle cx="7.5" cy="15.5" r="5.5"/><path d="m21 2-9.6 9.6"/><path d="m15.5 7.5 3 3L22 7l-3-3"/></symbol>
|
||||
<symbol id="i-monitor" viewBox="0 0 24 24"><rect width="20" height="14" x="2" y="3" rx="2"/><line x1="8" x2="16" y1="21" y2="21"/><line x1="12" x2="12" y1="17" y2="21"/></symbol>
|
||||
<symbol id="i-server" viewBox="0 0 24 24"><rect width="20" height="8" x="2" y="2" rx="2" ry="2"/><rect width="20" height="8" x="2" y="14" rx="2" ry="2"/><line x1="6" x2="6.01" y1="6" y2="6"/><line x1="6" x2="6.01" y1="18" y2="18"/></symbol>
|
||||
<symbol id="i-clock" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></symbol>
|
||||
<symbol id="i-clipboard" viewBox="0 0 24 24"><rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/></symbol>
|
||||
</svg>
|
||||
|
||||
<!-- ===================== 导航 ===================== -->
|
||||
<header class="nav">
|
||||
<div class="inner">
|
||||
<a class="brand" href="/home"><span class="logo">DB</span> OpsxDB</a>
|
||||
<nav>
|
||||
<a href="/docs">文档</a>
|
||||
<div class="nav-inner">
|
||||
<a class="brand" href="/home">
|
||||
<span class="brand-logo"><svg width="30" height="30" viewBox="0 0 64 64" aria-label="OpsxDB"><defs><linearGradient id="lg-site" x1="0" y1="0" x2="64" y2="64" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#059669"/><stop offset="1" stop-color="#06B6D4"/></linearGradient></defs><rect width="64" height="64" rx="14" fill="url(#lg-site)"/><g stroke="#fff" stroke-width="4.5" fill="none" stroke-linecap="round"><ellipse cx="32" cy="20" rx="15" ry="6.5"/><path d="M17 20v24c0 3.6 6.7 6.5 15 6.5s15-2.9 15-6.5V20"/><path d="M17 32c0 3.6 6.7 6.5 15 6.5s15-2.9 15-6.5"/></g></svg></span>
|
||||
<span class="brand-name">OpsxDB</span>
|
||||
</a>
|
||||
<nav class="nav-links">
|
||||
<a href="#features">功能</a>
|
||||
<a href="#drivers">驱动</a>
|
||||
<a href="#security">安全</a>
|
||||
<a href="#download">下载</a>
|
||||
<a href="/docs" target="_blank" rel="noopener">文档</a>
|
||||
</nav>
|
||||
<div class="nav-cta">
|
||||
<a class="btn btn-primary" href="/docs/quickstart" target="_blank" rel="noopener">快速开始 →</a>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<main class="hero">
|
||||
<p class="eyebrow">桌面 GUI · 本地优先</p>
|
||||
<h1>连库、写 SQL、看结果——都在本机完成</h1>
|
||||
<p class="lead">正式形态是可安装的桌面应用,本地后端随应用启动。浏览器里的 :5174 只是开发壳,不是产品。</p>
|
||||
<div class="actions">
|
||||
<a class="btn primary" id="download" href="#download">下载桌面版(占位)</a>
|
||||
<a class="btn ghost" href="/docs">阅读文档</a>
|
||||
|
||||
<!-- ===================== Hero ===================== -->
|
||||
<section class="hero">
|
||||
<div class="hero-inner">
|
||||
<div class="hero-copy">
|
||||
<div class="hero-badge"><svg class="i"><use href="#i-sparkles"/></svg> v0.1 · 桌面 GUI · 数据 100% 本机</div>
|
||||
<h1>一个窗口,<br>管好<em>全公司的数据库</em></h1>
|
||||
<p class="hero-sub">
|
||||
连库、写 SQL、看结果,全在本机完成。<br>
|
||||
MySQL / PostgreSQL / SQL Server / Oracle / SQLite / Redis 内置驱动,
|
||||
SSH 隧道与 SSL 加密直达内网库,AI 帮你把 SQL 写得又快又稳。
|
||||
</p>
|
||||
<div class="hero-actions">
|
||||
<a class="btn btn-primary btn-lg" href="#download">下载桌面版</a>
|
||||
<a class="btn btn-ghost btn-lg" href="/docs/quickstart" target="_blank" rel="noopener">30 秒连上第一个库 →</a>
|
||||
</div>
|
||||
<div class="hero-pills">
|
||||
<span>本地优先</span><span>SSH 隧道</span><span>SSL 加密</span><span>国产库兼容</span><span>AI 写 SQL</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 工作台示意(纯 CSS 绘制) -->
|
||||
<div class="mock" aria-hidden="true">
|
||||
<div class="mock-titlebar"><i></i><i></i><i></i><span>OpsxDB · prod-mysql</span></div>
|
||||
<div class="mock-body">
|
||||
<div class="mock-side">
|
||||
<div class="mock-search"></div>
|
||||
<div class="mock-item conn"><i class="dot on"></i>prod-mysql</div>
|
||||
<div class="mock-item conn"><i class="dot on"></i>pg-analytics</div>
|
||||
<div class="mock-item conn"><i class="dot"></i>sqlite-demo</div>
|
||||
<div class="mock-group">shop(库)</div>
|
||||
<div class="mock-item active"><svg class="mi"><use href="#i-table"/></svg> orders</div>
|
||||
<div class="mock-item"><svg class="mi"><use href="#i-table"/></svg> users</div>
|
||||
<div class="mock-item"><svg class="mi"><use href="#i-table"/></svg> products</div>
|
||||
</div>
|
||||
<div class="mock-main">
|
||||
<div class="mock-tabs"><span class="tab on">orders · 前 100 行</span><span class="tab">query-2</span></div>
|
||||
<div class="mock-sql">
|
||||
<pre><span class="kw">SELECT</span> id, user_id, amount, status
|
||||
<span class="kw">FROM</span> orders
|
||||
<span class="kw">WHERE</span> created_at > <span class="str">'2026-09-01'</span>
|
||||
<span class="kw">ORDER BY</span> id <span class="kw">DESC</span> <span class="kw">LIMIT</span> <span class="num">100</span>;</pre>
|
||||
</div>
|
||||
<div class="mock-grid">
|
||||
<span class="gh">id</span><span class="gh">user_id</span><span class="gh">amount</span><span class="gh">status</span>
|
||||
<span>9f2a</span><span>u_1024</span><span>¥ 1,299.00</span><span class="ok">PAID</span>
|
||||
<span>9f29</span><span>u_0987</span><span>¥ 89.00</span><span class="ok">PAID</span>
|
||||
<span>9f28</span><span>u_2333</span><span>¥ 459.00</span><span class="warn">PENDING</span>
|
||||
<span>9f27</span><span>u_1024</span><span>¥ 3,280.00</span><span class="ok">PAID</span>
|
||||
</div>
|
||||
<div class="mock-status"><span class="ok">✓ 100 行 · 38ms</span><span>MySQL 8 · 127.0.0.1:3306</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="caps">
|
||||
<li><strong>多驱动连库</strong><span>MySQL / Postgres / SQLite 等,会话保活</span></li>
|
||||
<li><strong>工作台密度</strong><span>结果集、对象树、书签,深色紧凑布局</span></li>
|
||||
<li><strong>本机后端</strong><span>双击启动即带本地服务,不依赖手动起 Vite</span></li>
|
||||
</ul>
|
||||
</main>
|
||||
<footer class="foot">© 2026 OpsxDB · 产品形态为桌面 GUI</footer>
|
||||
|
||||
<!-- 数据统计条 -->
|
||||
<div class="stats">
|
||||
<div class="stats-inner">
|
||||
<div class="stat"><b>7</b><span>内置驱动</span></div>
|
||||
<div class="stat"><b>18</b><span>可连数据库</span></div>
|
||||
<div class="stat"><b>0</b><span>数据外发</span></div>
|
||||
<div class="stat"><b>1</b><span>个二进制即可自托管</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ===================== 为什么选 ===================== -->
|
||||
<section class="section">
|
||||
<div class="wrap">
|
||||
<h2 class="sec-title">为什么运维和开发选 OpsxDB</h2>
|
||||
<p class="sec-sub">不把生产库连到别人的云上 —— 这是我们做这款工具的出发点。</p>
|
||||
<div class="grid g4">
|
||||
<div class="card">
|
||||
<div class="card-icon"><svg class="i-lg"><use href="#i-shield-check"/></svg></div>
|
||||
<h3>本地优先,数据主权</h3>
|
||||
<p>连接配置、查询历史全部保存在本机,服务只监听 127.0.0.1,不经过任何第三方服务器。</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-icon"><svg class="i-lg"><use href="#i-database"/></svg></div>
|
||||
<h3>六类库一个窗口</h3>
|
||||
<p>MySQL 族 / PostgreSQL 族 / SQL Server / Oracle / SQLite / Redis 统一工作台,切换零负担。</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-icon"><svg class="i-lg"><use href="#i-key"/></svg></div>
|
||||
<h3>安全通道直达内网</h3>
|
||||
<p>每个连接可独立配置 SSL/TLS 与 SSH 隧道,跳板机后面的库也能安全直连。</p>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-icon"><svg class="i-lg"><use href="#i-sparkles"/></svg></div>
|
||||
<h3>AI 把 SQL 写快</h3>
|
||||
<p>自然语言生成、解释、优化、修复、方言转换,写不出的那句 SQL 交给 AI 起草。</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ===================== 功能 ===================== -->
|
||||
<section class="section alt" id="features">
|
||||
<div class="wrap">
|
||||
<h2 class="sec-title">开箱即用的专业能力</h2>
|
||||
<p class="sec-sub">为「每天都要碰库的人」设计的工作台密度。</p>
|
||||
<div class="grid g3">
|
||||
<div class="card row"><div class="card-icon"><svg class="i-lg"><use href="#i-terminal"/></svg></div><div><h3>连接选择器</h3><p>搜索 / 分类 / 最近 / 图标网格;粘贴 <code>mysql://user:pass@host:3306/db</code> 一键填入表单。</p></div></div>
|
||||
<div class="card row"><div class="card-icon"><svg class="i-lg"><use href="#i-zap"/></svg></div><div><h3>SQL 工作台</h3><p>CodeMirror 编辑器,⌘/Ctrl+Enter 执行当前语句或选区,多 Tab 并行,可拖分栏。</p></div></div>
|
||||
<div class="card row"><div class="card-icon"><svg class="i-lg"><use href="#i-table"/></svg></div><div><h3>结果随手取</h3><p>结果集一键复制 / 导出 CSV / 生成 INSERT;双击单元格即复制,截断行数有提示。</p></div></div>
|
||||
<div class="card row"><div class="card-icon"><svg class="i-lg"><use href="#i-tree"/></svg></div><div><h3>对象树与表数据</h3><p>懒加载库 / 表 / 列;点表名直接看前 100 行,展开表即看列结构。</p></div></div>
|
||||
<div class="card row"><div class="card-icon"><svg class="i-lg"><use href="#i-database"/></svg></div><div><h3>Redis 工作台</h3><p>编辑器直接执行 <code>PING</code> / <code>GET</code> / <code>SET</code> / <code>KEYS</code>,键空间浏览、TTL 管理。</p></div></div>
|
||||
<div class="card row"><div class="card-icon"><svg class="i-lg"><use href="#i-sparkles"/></svg></div><div><h3>AI 面板</h3><p>生成 / 解释 / 优化 / 修复 / 方言转换 / 样例 SQL,六种动作贴着查询上下文。</p></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ===================== 驱动矩阵 ===================== -->
|
||||
<section class="section" id="drivers">
|
||||
<div class="wrap">
|
||||
<h2 class="sec-title">数据库支持</h2>
|
||||
<p class="sec-sub">常用库 native Go 驱动编译内置;长尾库规划 agent 按需接入。</p>
|
||||
<div class="grid g3">
|
||||
<div class="proto"><h3><svg class="i"><use href="#i-database"/></svg> MySQL 族</h3><p>MySQL · MariaDB · TiDB · OceanBase · PolarDB · TDSQL<span class="port">:3306</span></p></div>
|
||||
<div class="proto"><h3><svg class="i"><use href="#i-database"/></svg> PostgreSQL 族</h3><p>PostgreSQL · GaussDB / openGauss · 人大金仓<span class="port">:5432</span></p></div>
|
||||
<div class="proto"><h3><svg class="i"><use href="#i-database"/></svg> SQL Server</h3><p>原生协议直连,SSL 可选<span class="port">:1433</span></p></div>
|
||||
<div class="proto"><h3><svg class="i"><use href="#i-database"/></svg> Oracle</h3><p>纯 Go 驱动 go-ora,不引入 JVM<span class="port">:1521</span></p></div>
|
||||
<div class="proto"><h3><svg class="i"><use href="#i-database"/></svg> SQLite</h3><p>本地文件库,填路径即连<span class="port">file</span></p></div>
|
||||
<div class="proto"><h3><svg class="i"><use href="#i-zap"/></svg> Redis</h3><p>连接即可执行命令与键管理<span class="port">:6379</span></p></div>
|
||||
</div>
|
||||
<div class="badges">
|
||||
<span class="more">规划中 · agent 按需接入:达梦 DM8 · MongoDB · ZooKeeper · Elasticsearch · InfluxDB</span>
|
||||
</div>
|
||||
<p class="footnote">驱动验收状态(本机 docker 实测)见 <a href="/docs/drivers" target="_blank" rel="noopener">文档 · 驱动支持</a>。</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ===================== 安全 ===================== -->
|
||||
<section class="section alt" id="security">
|
||||
<div class="wrap">
|
||||
<h2 class="sec-title">安全是默认项,不是选项</h2>
|
||||
<p class="sec-sub">连生产库的工具,必须先过安全这一关。</p>
|
||||
<div class="grid g3">
|
||||
<div class="card row"><div class="card-icon"><svg class="i-lg"><use href="#i-key"/></svg></div><div><h3>密码不出本机</h3><p>连接密码本机混淆存储;查询只带 <code>sessionId</code>,账密不再每次上送。</p></div></div>
|
||||
<div class="card row"><div class="card-icon"><svg class="i-lg"><use href="#i-shield-check"/></svg></div><div><h3>SSL / TLS 每库可配</h3><p>按连接独立开启 TLS,证书校验策略随库配置。</p></div></div>
|
||||
<div class="card row"><div class="card-icon"><svg class="i-lg"><use href="#i-server"/></svg></div><div><h3>SSH 隧道</h3><p>跳板机场景一条隧道直达内网库,无需暴露公网端口。</p></div></div>
|
||||
<div class="card row"><div class="card-icon"><svg class="i-lg"><use href="#i-monitor"/></svg></div><div><h3>仅监听回环</h3><p>后端默认绑定 127.0.0.1,对外服务需显式开启。</p></div></div>
|
||||
<div class="card row"><div class="card-icon"><svg class="i-lg"><use href="#i-clipboard"/></svg></div><div><h3>危险 SQL 确认</h3><p>DROP / TRUNCATE / 无 WHERE 的 UPDATE·DELETE 执行前二次确认。</p></div></div>
|
||||
<div class="card row"><div class="card-icon"><svg class="i-lg"><use href="#i-clock"/></svg></div><div><h3>查询历史本地留存</h3><p>历史只存在本机,随时回跳重跑,不上传不同步。</p></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ===================== 下载 / 形态 ===================== -->
|
||||
<section class="section" id="download">
|
||||
<div class="wrap">
|
||||
<h2 class="sec-title">三种形态,同一套体验</h2>
|
||||
<p class="sec-sub">主交付是桌面 GUI;Web 与内网部署复用同一个 Go 二进制。</p>
|
||||
<div class="pricing three">
|
||||
<div class="price-card featured">
|
||||
<div class="plan-tag">推荐 · 主交付</div>
|
||||
<div class="plan">桌面版</div>
|
||||
<div class="price"><b>Tauri 2</b></div>
|
||||
<div class="plan-sub">macOS(Apple Silicon / Intel)· Windows 规划中</div>
|
||||
<ul>
|
||||
<li>✓ 双击启动,本地后端随应用自动拉起</li>
|
||||
<li>✓ DMG 安装包内置 sidecar,无需手动起服务</li>
|
||||
<li>✓ 连接 / 查询 / 结果全功能</li>
|
||||
<li>✓ 数据 100% 留在本机</li>
|
||||
</ul>
|
||||
<a class="btn btn-primary" href="/docs/quickstart" target="_blank" rel="noopener">从源码构建</a>
|
||||
</div>
|
||||
<div class="price-card">
|
||||
<div class="plan">Web 自托管</div>
|
||||
<div class="price"><b>1 个二进制</b></div>
|
||||
<div class="plan-sub">Gin + 内置静态页</div>
|
||||
<ul>
|
||||
<li>✓ <code>./run.sh web</code> 一条命令启动</li>
|
||||
<li>✓ 官网与文档随二进制内置</li>
|
||||
<li>✓ 浏览器直接用,无需安装</li>
|
||||
<li>✓ 适合快速体验与调试</li>
|
||||
</ul>
|
||||
<a class="btn btn-primary" href="/docs/quickstart" target="_blank" rel="noopener">查看快速开始</a>
|
||||
</div>
|
||||
<div class="price-card enterprise">
|
||||
<div class="plan-tag dark">内网部署</div>
|
||||
<div class="plan">企业内网版</div>
|
||||
<div class="price"><b>无外联</b></div>
|
||||
<div class="plan-sub">数据不出企业网</div>
|
||||
<ul>
|
||||
<li>✓ 单二进制 + 静态页,内网任意主机部署</li>
|
||||
<li>✓ 默认仅回环监听,对外需显式配置</li>
|
||||
<li>✓ SSH 隧道 / TLS 直达内网数据库</li>
|
||||
<li>✓ 无遥测、无账号、无云依赖</li>
|
||||
</ul>
|
||||
<a class="btn btn-dark" href="/docs/security" target="_blank" rel="noopener">安全设计</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ===================== FAQ ===================== -->
|
||||
<section class="section alt" id="faq">
|
||||
<div class="wrap narrow">
|
||||
<h2 class="sec-title">常见问题</h2>
|
||||
<div class="faq">
|
||||
<details open><summary>我的连接密码保存在哪?安全吗?</summary><p>全部保存在本机(混淆存储),查询时只携带会话 ID,密码不会随每次请求上送,也不会同步到任何云端。</p></details>
|
||||
<details><summary>浏览器里打开的 5174 端口是什么?</summary><p>那是开发调试用的 Vite 热更新壳,不是产品形态。正式形态是桌面应用(或自托管的 Web 服务),由后端 :8788 提供页面与 API。</p></details>
|
||||
<details><summary>和 DBeaver / Navicat 有什么差别?</summary><p>OpsxDB 面向运维与开发的日常高频操作(连库、点表、写 SQL、取结果),界面密度和快捷键为「快」设计;本地优先、单二进制自托管、内置中文文档。重度管理功能(ER 图、数据比对等)在路线图中。</p></details>
|
||||
<details><summary>Oracle 支持好了吗?</summary><p>驱动代码已就绪(纯 Go 的 go-ora,无需 JVM),但本机 docker 验收在 Apple Silicon 上受镜像限制未通过,需 x86 环境或真库完成验收,详见文档《驱动支持》。</p></details>
|
||||
<details><summary>AI 功能需要联网吗?</summary><p>当前版本 AI 面板为本地 stub(生成 / 解释 / 优化等动作的框架已就位),接入模型服务的版本会明确标注数据流向。</p></details>
|
||||
<details><summary>支持达梦 / MongoDB 吗?</summary><p>已列入路线:常用库 native 内置,长尾库(达梦、MongoDB、ZooKeeper、ES、InfluxDB)规划 agent 按需接入,驱动分发走独立仓库并校验 sha256。</p></details>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ===================== CTA ===================== -->
|
||||
<section class="cta">
|
||||
<div class="wrap">
|
||||
<h2>把数据库客户端收回自己手里</h2>
|
||||
<p>30 秒连上第一个库;官网与文档都由你手里的这个二进制提供。</p>
|
||||
<div class="hero-actions center">
|
||||
<a class="btn btn-inverse btn-lg" href="/docs/quickstart" target="_blank" rel="noopener">快速开始 ↗</a>
|
||||
<a class="btn btn-outline btn-lg" href="/docs" target="_blank" rel="noopener">阅读文档</a>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- ===================== Footer ===================== -->
|
||||
<footer class="footer">
|
||||
<div class="wrap footer-grid">
|
||||
<div>
|
||||
<div class="brand"><span class="brand-logo"><svg width="30" height="30" viewBox="0 0 64 64" aria-label="OpsxDB"><defs><linearGradient id="lg-foot" x1="0" y1="0" x2="64" y2="64" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#059669"/><stop offset="1" stop-color="#06B6D4"/></linearGradient></defs><rect width="64" height="64" rx="14" fill="url(#lg-foot)"/><g stroke="#fff" stroke-width="4.5" fill="none" stroke-linecap="round"><ellipse cx="32" cy="20" rx="15" ry="6.5"/><path d="M17 20v24c0 3.6 6.7 6.5 15 6.5s15-2.9 15-6.5V20"/><path d="M17 32c0 3.6 6.7 6.5 15 6.5s15-2.9 15-6.5"/></g></svg></span><span class="brand-name">OpsxDB</span></div>
|
||||
<p class="footer-desc">本地优先的桌面数据库工作台。<br>数据在自己手里,才是真的效率工具。</p>
|
||||
</div>
|
||||
<div>
|
||||
<h4>产品</h4>
|
||||
<a href="#features">功能特性</a>
|
||||
<a href="#drivers">数据库支持</a>
|
||||
<a href="#download">下载与形态</a>
|
||||
</div>
|
||||
<div>
|
||||
<h4>资源</h4>
|
||||
<a href="/docs" target="_blank" rel="noopener">用户文档</a>
|
||||
<a href="/docs/drivers" target="_blank" rel="noopener">驱动验收状态</a>
|
||||
<a href="/docs/faq" target="_blank" rel="noopener">常见问题</a>
|
||||
</div>
|
||||
<div>
|
||||
<h4>安全</h4>
|
||||
<a href="#security">安全设计</a>
|
||||
<a href="/docs/security" target="_blank" rel="noopener">SSL 与 SSH 隧道</a>
|
||||
<a href="/docs/quickstart" target="_blank" rel="noopener">快速开始</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-bar">© 2026 OpsxDB · 本页由单二进制内置提供(/ · /home)</div>
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user