升级至 v1.0

This commit is contained in:
naiba 2023-06-19 23:56:07 +08:00
parent 0156662acb
commit a561ca413d
13 changed files with 1475 additions and 1411 deletions

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ TODOs.md
.vscode
.idea
pnpm-global
docs/.vitepress/cache

View File

@ -2,78 +2,79 @@ import { defineConfig } from 'vitepress'
export default defineConfig({
lastUpdated: true,
lang: 'zh-CN',
locales: {
'/': {
lang: 'zh-CN',
title: '哪吒监控',
description: '哪吒监控是一个轻量化的运维工具',
},
'/en_US/': {
lang: 'en-US',
title: 'Nezha Monitoring',
description: 'Nezha Monitoring is a lightweight O&M tool',
}
},
themeConfig: {
locales: {
'/': {
label: '简体中文',
root: {
lang: 'zh-CN',
label: '简体中文',
title: '哪吒监控',
description: '哪吒监控是一个轻量化的运维工具',
link: '/',
themeConfig: {
lastUpdatedText: '上次更新',
editLink: {
pattern: 'https://github.com/nezhahq/nezhahq.github.io/edit/main/docs/:path',
text: '在GitHub中编辑',
},
nav: [
{ text: '使用指南',
link: '/',
activeMatch: '^/$|^/guide/'
{
text: '使用指南',
link: '/',
activeMatch: '^/$|^/guide/'
},
{ text: '社区项目',
link: '/case/index',
activeMatch: '^/case/'
{
text: '社区项目',
link: '/case/index.html',
activeMatch: '^/case/'
},
{
text: '开发手册',
link: '/developer/index',
link: '/developer/index.html',
activeMatch: '^/developer/'
}
],
sidebar: {
'/': getGuideSidebarZhCN(),
'/guide/': getGuideSidebarZhCN(),
'/case/': getCaseSidebarZhCN(),
'/developer/': getDeveloperSidebarZhCN(),
'/': getGuideSidebarZhCN()
}
}
},
en_US: {
lang: 'en-US',
label: 'English',
title: 'Nezha Monitoring',
description: 'Nezha Monitoring is a lightweight O&M tool',
link: '/en_US/',
themeConfig: {
lastUpdatedText: 'Last Updated',
editLink: {
text: 'Edit this page on GitHub',
pattern: 'https://github.com/nezhahq/nezhahq.github.io/edit/main/docs/:path',
},
repo: 'nezhahq/nezhahq.github.io',
docsDir: 'docs',
docsBranch: 'main',
editLinks: true,
editLinkText: '在GitHub中编辑',
lastUpdated: '上次更新'
},
'/en_US/': {
label: 'English',
nav: [
{ text: 'User Guide', link: '/en_US/', activeMatch: '^/en_US/guide/' },
{ text: 'Community Projects', link: '/en_US/case/index', activeMatch: '^/en_US/case/' },
{ text: 'Development Manual', link: '/en_US/developer/index', activeMatch: '^/en_US/developer/' }
{ text: 'Community Projects', link: '/en_US/case/index.html', activeMatch: '^/en_US/case/' },
{ text: 'Development Manual', link: '/en_US/developer/index.html', activeMatch: '^/en_US/developer/' }
],
sidebar: {
'/en_US/': getGuideSidebarEnUS(),
'/en_US/guide/': getGuideSidebarEnUS(),
'/en_US/case/': getCaseSidebarEnUS(),
'/en_US/developer/': getDeveloperSidebarEnUS(),
'/en_US/': getGuideSidebarEnUS()
},
repo: 'nezhahq/nezhahq.github.io',
docsDir: 'docs',
docsBranch: 'main',
editLinks: true,
editLinkText: 'Edit this page on GitHub',
lastUpdated: 'Last Updated'
}
},
},
},
themeConfig: {
algolia: {
appId: 'HP6QF6KMZD',
apiKey: 'fb8bae9ed373d1057e0c07fcf32b3f1a',
indexName: 'nezhahq'
},
footer: {
copyright: 'Copyright © 2022-present Nezhahq'
}
}
})
@ -82,40 +83,40 @@ function getGuideSidebarZhCN() {
return [
{
text: '安装手册',
children: [
{ text: '安装 Dashboard', link: '/guide/dashboard' },
{ text: '安装 Agent', link: '/guide/agent' }
items: [
{ text: '安装 Dashboard', link: '/guide/dashboard.html' },
{ text: '安装 Agent', link: '/guide/agent.html' }
]
},
{
text: '管理面板配置',
children: [
{ text: '主机', link: '/guide/servers' },
{ text: '服务', link: '/guide/services' },
{ text: '定时任务', link: '/guide/tasks' },
{ text: '报警通知', link: '/guide/notifications' },
{ text: '设置', link: '/guide/settings' },
{ text: 'API', link: '/guide/api' }
]
items: [
{ text: '主机', link: '/guide/servers.html' },
{ text: '服务', link: '/guide/services.html' },
{ text: '定时任务', link: '/guide/tasks.html' },
{ text: '报警通知', link: '/guide/notifications.html' },
{ text: '设置', link: '/guide/settings.html' },
{ text: 'API', link: '/guide/api.html' }
],
},
{
text: '常见问题',
children: [
{ text: 'TG api 被墙', link: '/guide/q1' },
{ text: 'Agent 无法启动/上线 查看日志并进行排错的步骤', link: '/guide/q2' },
{ text: '反向代理 gRPC 端口的步骤', link: '/guide/q3' },
{ text: '实时通道断开/在线终端连接失败', link: '/guide/q4' },
{ text: '进行数据迁移、备份和恢复的步骤', link: '/guide/q5' },
{ text: '设置每月重置流量统计的步骤', link: '/guide/q6' },
{ text: '自定义 Agent 监控项目的步骤', link: '/guide/q7' }
items: [
{ text: 'TG api 被墙', link: '/guide/q1.html' },
{ text: 'Agent 无法启动/上线 查看日志并进行排错的步骤', link: '/guide/q2.html' },
{ text: '反向代理 gRPC 端口的步骤', link: '/guide/q3.html' },
{ text: '实时通道断开/在线终端连接失败', link: '/guide/q4.html' },
{ text: '进行数据迁移、备份和恢复的步骤', link: '/guide/q5.html' },
{ text: '设置每月重置流量统计的步骤', link: '/guide/q6.html' },
{ text: '自定义 Agent 监控项目的步骤', link: '/guide/q7.html' }
]
},
{
text: '排障指南',
children: [
{ text: 'Dashboard 相关', link: '/guide/dashboardq' },
{ text: 'Agent 相关', link: '/guide/agentq' },
{ text: '登录相关', link: '/guide/loginq' }
items: [
{ text: 'Dashboard 相关', link: '/guide/dashboardq.html' },
{ text: 'Agent 相关', link: '/guide/agentq.html' },
{ text: '登录相关', link: '/guide/loginq.html' }
]
}
]
@ -125,12 +126,12 @@ function getCaseSidebarZhCN() {
return [
{
text: '社区项目',
children: [
{ text: '1. 搭建哪吒 Telegram 机器人', link: '/case/case1' },
{ text: '2. 使用Siri语音运行快捷指令查询服务器状态', link: '/case/case2' },
{ text: '3. 自建多用户多语言 Telegram 服务器状态查询机器人', link: '/case/case3' },
{ text: '4. Fake-agent监控数据作弊器', link: '/case/case4' },
{ text: '5. Nezha server over Argo tunnel 白嫖利器', link: '/case/case5' }
items: [
{ text: '1. 搭建哪吒 Telegram 机器人', link: '/case/case1.html' },
{ text: '2. 使用Siri语音运行快捷指令查询服务器状态', link: '/case/case2.html' },
{ text: '3. 自建多用户多语言 Telegram 服务器状态查询机器人', link: '/case/case3.html' },
{ text: '4. Fake-agent监控数据作弊器', link: '/case/case4.html' },
{ text: '5. Nezha server over Argo tunnel 白嫖利器', link: '/case/case5.html' }
]
}
]
@ -140,9 +141,9 @@ function getDeveloperSidebarZhCN() {
return [
{
text: '开发手册',
children: [
{ text: '创建新主题', link: '/developer/theme' },
{ text: 'l10n', link: '/developer/l10n' }
items: [
{ text: '创建新主题', link: '/developer/theme.html' },
{ text: 'l10n', link: '/developer/l10n.html' }
]
}
]
@ -152,39 +153,39 @@ function getGuideSidebarEnUS() {
return [
{
text: 'Installation Manual',
children: [
{ text: 'Install Dashboard', link: '/en_US/guide/dashboard' },
{ text: 'Install Agent', link: '/en_US/guide/agent' }
items: [
{ text: 'Install Dashboard', link: '/en_US/guide/dashboard.html' },
{ text: 'Install Agent', link: '/en_US/guide/agent.html' }
]
},
{
text: 'Admin Panel',
children: [
{ text: 'Servers', link: '/en_US/guide/servers' },
{ text: 'Services', link: '/en_US/guide/services' },
{ text: 'Tasks', link: '/en_US/guide/tasks' },
{ text: 'Notifications', link: '/en_US/guide/notifications' },
{ text: 'Settings', link: '/en_US/guide/settings' },
{ text: 'API', link: '/en_US/guide/api' }
items: [
{ text: 'Servers', link: '/en_US/guide/servers.html' },
{ text: 'Services', link: '/en_US/guide/services.html' },
{ text: 'Tasks', link: '/en_US/guide/tasks.html' },
{ text: 'Notifications', link: '/en_US/guide/notifications.html' },
{ text: 'Settings', link: '/en_US/guide/settings.html' },
{ text: 'API', link: '/en_US/guide/api.html' }
]
},
{
text: 'FAQ',
children: [
{ text: 'Agent cannot start/on-line. Steps to review logs and troubleshoot', link: '/en_US/guide/q2' },
{ text: 'Steps for Reverse Proxy gRPC Ports (support Cloudflare CDN)', link: '/en_US/guide/q3' },
{ text: 'Real-time channel disconnection/online terminal connection failure', link: '/en_US/guide/q4' },
{ text: 'Steps to perform data migration, backup and recovery', link: '/en_US/guide/q5' },
{ text: 'Steps to set up monthly reset data statistics', link: '/en_US/guide/q6' },
{ text: 'Steps to customize Agent monitoring items', link: '/en_US/guide/q7' }
items: [
{ text: 'Agent cannot start/on-line. Steps to review logs and troubleshoot', link: '/en_US/guide/q2.html' },
{ text: 'Steps for Reverse Proxy gRPC Ports (support Cloudflare CDN)', link: '/en_US/guide/q3.html' },
{ text: 'Real-time channel disconnection/online terminal connection failure', link: '/en_US/guide/q4.html' },
{ text: 'Steps to perform data migration, backup and recovery', link: '/en_US/guide/q5.html' },
{ text: 'Steps to set up monthly reset data statistics', link: '/en_US/guide/q6.html' },
{ text: 'Steps to customize Agent monitoring items', link: '/en_US/guide/q7.html' }
]
},
{
text: 'Troubleshooting Guide',
children: [
{ text: 'Dashboard', link: '/en_US/guide/dashboardq' },
{ text: 'Agent', link: '/en_US/guide/agentq' },
{ text: 'Login', link: '/en_US/guide/loginq' }
items: [
{ text: 'Dashboard', link: '/en_US/guide/dashboardq.html' },
{ text: 'Agent', link: '/en_US/guide/agentq.html' },
{ text: 'Login', link: '/en_US/guide/loginq.html' }
]
}
]
@ -194,12 +195,12 @@ function getCaseSidebarEnUS() {
return [
{
text: 'Community Projects',
children: [
{ text: '1. Build your own Telegram bot to query server information', link: '/en_US/case/case1' },
{ text: '2. Use Siri to run shortcut to check server status', link: '/en_US/case/case2' },
{ text: '3. Self-hosted, multi-user, multi-lingual server status query Telegram bot', link: '/en_US/case/case3' },
{ text: '4. Fake-agent, monitoring data cheater', link: '/en_US/case/case4' },
{ text: '5. Nezha server over Argo tunnel', link: '/en_US/case/case5' }
items: [
{ text: '1. Build your own Telegram bot to query server information', link: '/en_US/case/case1.html' },
{ text: '2. Use Siri to run shortcut to check server status', link: '/en_US/case/case2.html' },
{ text: '3. Self-hosted, multi-user, multi-lingual server status query Telegram bot', link: '/en_US/case/case3.html' },
{ text: '4. Fake-agent, monitoring data cheater', link: '/en_US/case/case4.html' },
{ text: '5. Nezha server over Argo tunnel', link: '/en_US/case/case5.html' }
]
}
]
@ -209,9 +210,9 @@ function getDeveloperSidebarEnUS() {
return [
{
text: 'Development Manual',
children: [
{ text: 'Create a new theme', link: '/en_US/developer/theme' },
{ text: 'l10n', link: '/en_US/developer/l10n' }
items: [
{ text: 'Create a new theme', link: '/en_US/developer/theme.html' },
{ text: 'l10n', link: '/en_US/developer/l10n.html' }
]
}
]

View File

@ -1,38 +0,0 @@
<script setup>
import DefaultTheme from "vitepress/theme";
import { h, compile, onMounted } from "vue";
const { Layout } = DefaultTheme;
onMounted(() => {
if (
window.matchMedia &&
window.matchMedia("(prefers-color-scheme: dark)").matches
) {
console.log("setting as dark");
document.body.classList.add("dark");
}
setTimeout(() => {
let initial = document.body.classList.contains("dark") ? "🔆" : "🌙";
let navBars = document.getElementsByClassName("nav-links");
if (navBars) {
let navBar = navBars[0];
if (navBar) {
navBar.insertAdjacentHTML(
"beforeend",
`<div class="item" style="padding: 0 1.5rem;;cursor: pointer;" onclick="document.body.classList.toggle('dark'); this.innerHTML= document.body.classList.contains('dark') ? '🔆' : '🌙';"> ${initial} </div>`
);
}
navBar = navBars[1];
if (navBar) {
navBar.insertAdjacentHTML(
"beforeend",
`<div class="item" style="padding: 0 1.5rem;;cursor: pointer;" onclick="document.body.classList.toggle('dark'); this.innerHTML= document.body.classList.contains('dark') ? '🔆' : '🌙';"> ${initial} </div>`
);
}
}
}, 100);
});
</script>
<template>
<Layout></Layout>
</template>

View File

@ -1,89 +0,0 @@
body.dark {
--c-divider: var(--c-divider-dark);
--c-text: var(--c-text-dark-1);
--c-text-light: var(--c-text-dark-2);
--c-text-lighter: var(--c-text-dark-3);
--c-bg: var(--c-white);
--c-bg-accent: var(--c-white-light);
--code-font-family: var(--font-family-mono);
--code-inline-bg-color: rgba(27, 31, 35, 0.05);
--code-bg-color: #282c34;
--c-white: var(--c-black);
--c-white-dark: #f8f8f8;
--c-black: #1a1a1a;
--c-divider-light: rgba(60, 60, 67, 0.12);
--c-divider-dark: rgba(84, 84, 88, 0.48);
--c-text-light-1: #2c3e50;
--c-text-light-2: #476582;
--c-text-light-3: #90a4b7;
--c-text-dark-1: #fff;
--c-text-dark-2: #607385;
--c-text-dark-3: #445666;
--c-brand: #3eaf7c;
--c-brand-light: #4abf8a;
--shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
--shadow-2: 0 3px 12px rgba(0, 0, 0, 0.07), 0 1px 4px rgba(0, 0, 0, 0.07);
--shadow-3: 0 12px 32px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.08);
--shadow-4: 0 14px 44px rgba(0, 0, 0, 0.12), 0 3px 9px rgba(0, 0, 0, 0.12);
--shadow-5: 0 18px 56px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.16);
--header-height: 3.6rem;
--docsearch-searchbox-focus-background: #242424;
--docsearch-container-background: rgba(101, 108, 133, 0.8);
--docsearch-modal-background: #242424;
--docsearch-modal-shadow: inset 1px 1px 0 0 hsla(0, 0%, 100%, 0.5),
0 3px 8px 0 #555a64;
--docsearch-searchbox-background: #ebedf0;
--docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);
--docsearch-hit-color: #444950;
--docsearch-hit-active-color: #333;
--docsearch-hit-background: #333;
--docsearch-hit-shadow: 0 1px 3px 0 #d4d9e1;
--docsearch-key-gradient: linear-gradient(-225deg, #d5dbe4, #f8f8f8);
--docsearch-key-shadow: inset 0 -2px 0 0 #cdcde6, inset 0 0 1px 1px #333,
0 1px 2px 1px rgba(30, 35, 90, 0.4);
--docsearch-footer-background: #333;
--docsearch-footer-shadow: 0 -1px 0 0 #e0e3e8,
0 -3px 6px 0 rgba(69, 98, 155, 0.12);
}
body.dark tr:nth-child(2n) {
background-color: #2a2a2a;
}
body.dark .DocSearch {
--docsearch-primary-color: var(--c-brand);
--docsearch-highlight-color: var(--docsearch-primary-color);
--docsearch-searchbox-shadow: inset 0 0 0 2px var(--docsearch-primary-color);
--docsearch-text-color: var(--c-text-light);
--docsearch-muted-color: var(--c-text-lighter);
--docsearch-searchbox-background: #333;
}
body.dark .DocSearch-Button:hover {
box-shadow: var(--docsearch-searchbox-shadow);
color: var(--docsearch-text-color);
outline: none;
}
body.dark .custom-block.details,
body.dark .custom-block.info,
body.dark .custom-block.tip {
background-color: #2f2f2f;
}
body.dark .custom-block.warning {
background-color: #ffe56436;
color: #ccc18c;
}
body.dark .custom-block.danger {
background-color: #6e4f4fd2;
color: #f5d3d3;
}
body.dark .custom-block.danger .custom-block-title {
color: #f6b9b9;
}

View File

@ -1,11 +0,0 @@
import DefaultTheme from 'vitepress/theme'
import DarkLayout from './DarkLayout.vue'
import DarkStyles from './dark-theme.css'
export { DarkStyles }
export default {
...DefaultTheme,
// override the Layout with a wrapper component that injects the slots
Layout: DarkLayout
}

View File

@ -1,5 +1,4 @@
---
home: true
heroImage: https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg
heroText: 哪吒监控社区项目
tagline: 哪吒监控社区贡献的相关项目,为哪吒监控提供了更多扩展

View File

@ -1,10 +1,8 @@
---
home: true
heroImage: https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg
heroText: 开发手册
tagline: 欢迎使用哪吒监控开发手册我们欢迎你提出高质量的Pull Request帮助哪吒监控变得更好
actionText: 开始使用 →
actionLink: /developer/theme
footer: Copyright © 2022-present Nezhahq
---
<br />本作品采用 <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议</a> 进行许可。
<br />本作品采用 <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议</a> 进行许可。

View File

@ -1,5 +1,4 @@
---
home: true
heroImage: https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg
heroText: Nezha Monitoring Community Project
tagline: Related projects contributed by Nezha Monitoring community, provide more extensions for Nezha Monitoring

View File

@ -1,10 +1,8 @@
---
home: true
heroImage: https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg
heroText: Development Manual
tagline: Welcome to the Nezha Monitoring Development Manual.
actionText: Start Now →
actionLink: /en_US/developer/theme
footer: Copyright © 2022-present Nezhahq
---
<br/>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.

View File

@ -1,5 +1,4 @@
---
home: true
heroImage: https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg
heroText: Nezha Monitoring
tagline: A open source, lightweight server and website monitoring and O&M tool
@ -12,6 +11,5 @@ features:
details: Support monitoring the system status of multiple servers at the same time, support monitoring the status of web pages, ports, SSL certificates; support notifications in case of failure, out of data and other status. Support multiple notification methods (Telegram, email, WeChat, etc.)
- title: Lightweight O&M tool
details: Support WebSSH, support cyclic monitoring data, support setting scheduled tasks and running command on multiple servers
footer: Copyright © 2022-present Nezhahq
---
<br/>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.
<br/>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License</a>.

View File

@ -1,5 +1,4 @@
---
home: true
heroImage: https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg
heroText: 哪吒监控
tagline: 一个开源、轻量的服务器和网站监控、运维工具
@ -12,6 +11,5 @@ features:
details: 支持同时监控多个服务器的系统状态支持监控网页、端口、SSL证书状态支持故障、流量等状态报警支持多种通知方式Telegram、邮件、微信等
- title: 轻量运维
details: 支持在线SSH支持流量循环监控支持设置定时任务、服务器批量执行任务
footer: Copyright © 2022-present Nezhahq
---
<br />本作品采用 <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/">知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议</a> 进行许可。

2516
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,6 @@
},
"homepage": "https://github.com/nezhahq/nezhahq.github.io#readme",
"devDependencies": {
"vitepress": "^0.22.4"
"vitepress": "^1.0.0-beta.2"
}
}