deploy: 152f482594
No files matched your search
|
Before Width: | Height: | Size: 93 KiB After Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 338 KiB After Width: | Height: | Size: 338 KiB |
|
Before Width: | Height: | Size: 79 KiB After Width: | Height: | Size: 79 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 329 KiB After Width: | Height: | Size: 329 KiB |
@@ -1 +0,0 @@
|
||||
import{_ as c,o as p,c as u,C as f,a4 as s,M as r,a5 as m,a6 as h,a7 as _,a8 as w,a9 as A,aa as g,ab as v,ac as P,ad as y,ae as C,J as $,d as b,u as x,p as E,k as R,af as D,ag as L,ah as T}from"./chunks/framework.44fd0451.js";import{t as i}from"./chunks/theme.ccb07a11.js";const V={data(){return{show:!1}},mounted(){this.show=navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i)}},k={key:0,class:"wwads-cn wwads-horizontal","data-id":"296"};function O(e,t,a,n,l,J){return l.show?(p(),u("div",k)):f("",!0)}const S=c(V,[["render",O]]),j={},B={class:"wwads-cn wwads-vertical","data-id":"296",style:{"margin-bottom":"20px"}};function F(e,t){return p(),u("div",B)}const z=c(j,[["render",F]]),H={...i,Layout(){return s(i.Layout,null,{"doc-top":()=>s(S),"aside-top":()=>s(z)})}};function d(e){if(e.extends){const t=d(e.extends);return{...t,...e,async enhanceApp(a){t.enhanceApp&&await t.enhanceApp(a),e.enhanceApp&&await e.enhanceApp(a)}}}return e}const o=d(H),I=b({name:"VitePressApp",setup(){const{site:e}=x();return E(()=>{R(()=>{document.documentElement.lang=e.value.lang,document.documentElement.dir=e.value.dir})}),D(),L(),T(),o.setup&&o.setup(),()=>s(o.Layout)}});async function M(){const e=G(),t=N();t.provide(h,e);const a=_(e.route);return t.provide(w,a),t.component("Content",A),t.component("ClientOnly",g),Object.defineProperties(t.config.globalProperties,{$frontmatter:{get(){return a.frontmatter.value}},$params:{get(){return a.page.value.params}}}),o.enhanceApp&&await o.enhanceApp({app:t,router:e,siteData:v}),{app:t,router:e,data:a}}function N(){return P(I)}function G(){let e=r,t;return y(a=>{let n=C(a);return e&&(t=n),(e||t===n)&&(n=n.replace(/\.js$/,".lean.js")),r&&(e=!1),$(()=>import(n),[])},o.NotFound)}r&&M().then(({app:e,router:t,data:a})=>{t.go().then(()=>{m(t.route,a.site),e.mount("#app")})});export{M as createApp};
|
||||
@@ -0,0 +1 @@
|
||||
import{U as o,a5 as p,a6 as u,a7 as l,a8 as c,a9 as f,aa as d,ab as m,ac as h,ad as g,ae as A,d as P,u as v,y,x as w,af as C,ag as R,ah as b,a3 as E}from"./chunks/framework.BmdFiWrL.js";import{R as S}from"./chunks/theme.DAaY-8e0.js";function i(e){if(e.extends){const a=i(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const s=i(S),T=P({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=v();return y(()=>{w(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&C(),R(),b(),s.setup&&s.setup(),()=>E(s.Layout)}});async function _(){globalThis.__VITEPRESS__=!0;const e=D(),a=x();a.provide(u,e);const t=l(e.route);return a.provide(c,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),s.enhanceApp&&await s.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function x(){return h(T)}function D(){let e=o,a;return g(t=>{let n=A(t),r=null;return n&&(e&&(a=n),(e||a===n)&&(n=n.replace(/\.js$/,".lean.js")),r=import(n)),o&&(e=!1),r},s.NotFound)}o&&_().then(({app:e,router:a,data:t})=>{a.go().then(()=>{p(a.route,t.site),e.mount("#app")})});export{_ as createApp};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o as t,c as a,R as r}from"./chunks/framework.44fd0451.js";const b=JSON.parse('{"title":"自建一个TG机器人来查询服务器信息","description":"","frontmatter":{},"headers":[],"relativePath":"case/case1.md","filePath":"case/case1.md","lastUpdated":1718495592000}'),o={name:"case/case1.md"},_=r('<h1 id="自建一个tg机器人来查询服务器信息" tabindex="-1">自建一个TG机器人来查询服务器信息 <a class="header-anchor" href="#自建一个tg机器人来查询服务器信息" aria-label="Permalink to "自建一个TG机器人来查询服务器信息""></a></h1><p>贡献者:</p><ul><li><a href="https://github.com/spiritLHLS" target="_blank" rel="noreferrer">spiritLHLS</a></li><li><a href="https://github.com/Erope/" target="_blank" rel="noreferrer">Erope</a></li></ul><p>项目地址:<a href="https://github.com/spiritLHLS/nezha_api_tgbot" target="_blank" rel="noreferrer">nezha_api_tgbot</a></p><p>镜像备份(非实时更新):<a href="https://github.com/nezhahq/nezha_api_tgbot" target="_blank" rel="noreferrer">nezha_api_tgbot</a><br> 机器人可以通过API向面板请求服务器状态信息,得到信息后发送给用户<br> 你可以搭建此机器人来方便地查看指定服务器的当前状态且不需要打开面板</p>',5),s=[_];function i(n,c,p,h,l,d){return t(),a("div",null,s)}const g=e(o,[["render",i]]);export{b as __pageData,g as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o as t,c as a,R as r}from"./chunks/framework.44fd0451.js";const b=JSON.parse('{"title":"自建一个TG机器人来查询服务器信息","description":"","frontmatter":{},"headers":[],"relativePath":"case/case1.md","filePath":"case/case1.md","lastUpdated":1718495592000}'),o={name:"case/case1.md"},_=r("",5),s=[_];function i(n,c,p,h,l,d){return t(),a("div",null,s)}const g=e(o,[["render",i]]);export{b as __pageData,g as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as a,a4 as r}from"./chunks/framework.BmdFiWrL.js";const b=JSON.parse('{"title":"自建一个TG机器人来查询服务器信息","description":"","frontmatter":{},"headers":[],"relativePath":"case/case1.md","filePath":"case/case1.md","lastUpdated":1719239024000}'),o={name:"case/case1.md"},_=r('<h1 id="自建一个tg机器人来查询服务器信息" tabindex="-1">自建一个TG机器人来查询服务器信息 <a class="header-anchor" href="#自建一个tg机器人来查询服务器信息" aria-label="Permalink to "自建一个TG机器人来查询服务器信息""></a></h1><p>贡献者:</p><ul><li><a href="https://github.com/spiritLHLS" target="_blank" rel="noreferrer">spiritLHLS</a></li><li><a href="https://github.com/Erope/" target="_blank" rel="noreferrer">Erope</a></li></ul><p>项目地址:<a href="https://github.com/spiritLHLS/nezha_api_tgbot" target="_blank" rel="noreferrer">nezha_api_tgbot</a></p><p>镜像备份(非实时更新):<a href="https://github.com/nezhahq/nezha_api_tgbot" target="_blank" rel="noreferrer">nezha_api_tgbot</a><br> 机器人可以通过API向面板请求服务器状态信息,得到信息后发送给用户<br> 你可以搭建此机器人来方便地查看指定服务器的当前状态且不需要打开面板</p>',5),s=[_];function i(n,c,p,h,l,d){return a(),t("div",null,s)}const g=e(o,[["render",i]]);export{b as __pageData,g as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as a,a4 as r}from"./chunks/framework.BmdFiWrL.js";const b=JSON.parse('{"title":"自建一个TG机器人来查询服务器信息","description":"","frontmatter":{},"headers":[],"relativePath":"case/case1.md","filePath":"case/case1.md","lastUpdated":1719239024000}'),o={name:"case/case1.md"},_=r("",5),s=[_];function i(n,c,p,h,l,d){return a(),t("div",null,s)}const g=e(o,[["render",i]]);export{b as __pageData,g as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as a}from"./chunks/qrcode.59c44dde.js";import{_ as e,o as r,c as i,R as t}from"./chunks/framework.44fd0451.js";const b=JSON.parse('{"title":"在iOS/MacOS中使用Siri运行快捷指令查询服务器状态","description":"","frontmatter":{},"headers":[],"relativePath":"case/case2.md","filePath":"case/case2.md","lastUpdated":1718495592000}'),o={name:"case/case2.md"},c=t('<h1 id="在ios-macos中使用siri运行快捷指令查询服务器状态" tabindex="-1">在iOS/MacOS中使用Siri运行快捷指令查询服务器状态 <a class="header-anchor" href="#在ios-macos中使用siri运行快捷指令查询服务器状态" aria-label="Permalink to "在iOS/MacOS中使用Siri运行快捷指令查询服务器状态""></a></h1><p>当前版本:V1.0<br> 贡献者:</p><ul><li>白歌 <a href="https://github.com/hhhkkk520" target="_blank" rel="noreferrer">hhhkkk520</a></li></ul><h2 id="获取快捷指令" tabindex="-1">获取快捷指令 <a class="header-anchor" href="#获取快捷指令" aria-label="Permalink to "获取快捷指令""></a></h2><p>使用iPhone或iPad扫描以下二维码,获取快捷指令<br><br><img src="'+a+'" alt="coode"><br><br> MacOS用户请访问<a href="https://www.icloud.com/shortcuts/312005bf5ffd4387ac92a84056db9f09" target="_blank" rel="noreferrer">这里</a>,获取快捷指令</p><h2 id="使用说明" tabindex="-1">使用说明 <a class="header-anchor" href="#使用说明" aria-label="Permalink to "使用说明""></a></h2><ul><li>获取快捷指令后,打开并编辑快捷指令</li><li>分别在三个文本框中填入 <code>面板URL</code>、<code>API Token</code>、<code>服务器ID</code></li><li>保存编辑并测试运行,能获取结果则表示设置正确</li><li>修改快捷指令的名称,如修改为:“一号服务器状态”,保存后便可使用Siri指令:“嘿Siri,一号服务器状态”来获取服务器状态</li></ul><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>每个快捷指令只能监控一台服务器,如需要监控多个服务器,请多次复制此快捷指令并分别配置,然后分别修改快捷指令名称,如;一号服务器状态、二号服务器状态等</p></div>',8),s=[c];function l(d,n,h,_,p,m){return r(),i("div",null,s)}const S=e(o,[["render",l]]);export{b as __pageData,S as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as a}from"./chunks/qrcode.59c44dde.js";import{_ as e,o as r,c as i,R as t}from"./chunks/framework.44fd0451.js";const b=JSON.parse('{"title":"在iOS/MacOS中使用Siri运行快捷指令查询服务器状态","description":"","frontmatter":{},"headers":[],"relativePath":"case/case2.md","filePath":"case/case2.md","lastUpdated":1718495592000}'),o={name:"case/case2.md"},c=t("",8),s=[c];function l(d,n,h,_,p,m){return r(),i("div",null,s)}const S=e(o,[["render",l]]);export{b as __pageData,S as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as a}from"./chunks/qrcode.CZOxHFH-.js";import{_ as e,c as r,o as i,a4 as t}from"./chunks/framework.BmdFiWrL.js";const b=JSON.parse('{"title":"在iOS/MacOS中使用Siri运行快捷指令查询服务器状态","description":"","frontmatter":{},"headers":[],"relativePath":"case/case2.md","filePath":"case/case2.md","lastUpdated":1719239024000}'),o={name:"case/case2.md"},c=t('<h1 id="在ios-macos中使用siri运行快捷指令查询服务器状态" tabindex="-1">在iOS/MacOS中使用Siri运行快捷指令查询服务器状态 <a class="header-anchor" href="#在ios-macos中使用siri运行快捷指令查询服务器状态" aria-label="Permalink to "在iOS/MacOS中使用Siri运行快捷指令查询服务器状态""></a></h1><p>当前版本:V1.0<br> 贡献者:</p><ul><li>白歌 <a href="https://github.com/hhhkkk520" target="_blank" rel="noreferrer">hhhkkk520</a></li></ul><h2 id="获取快捷指令" tabindex="-1">获取快捷指令 <a class="header-anchor" href="#获取快捷指令" aria-label="Permalink to "获取快捷指令""></a></h2><p>使用iPhone或iPad扫描以下二维码,获取快捷指令<br><br><img src="'+a+'" alt="coode"><br><br> MacOS用户请访问<a href="https://www.icloud.com/shortcuts/312005bf5ffd4387ac92a84056db9f09" target="_blank" rel="noreferrer">这里</a>,获取快捷指令</p><h2 id="使用说明" tabindex="-1">使用说明 <a class="header-anchor" href="#使用说明" aria-label="Permalink to "使用说明""></a></h2><ul><li>获取快捷指令后,打开并编辑快捷指令</li><li>分别在三个文本框中填入 <code>面板URL</code>、<code>API Token</code>、<code>服务器ID</code></li><li>保存编辑并测试运行,能获取结果则表示设置正确</li><li>修改快捷指令的名称,如修改为:“一号服务器状态”,保存后便可使用Siri指令:“嘿Siri,一号服务器状态”来获取服务器状态</li></ul><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>每个快捷指令只能监控一台服务器,如需要监控多个服务器,请多次复制此快捷指令并分别配置,然后分别修改快捷指令名称,如;一号服务器状态、二号服务器状态等</p></div>',8),s=[c];function l(d,n,h,_,p,m){return i(),r("div",null,s)}const S=e(o,[["render",l]]);export{b as __pageData,S as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as a}from"./chunks/qrcode.CZOxHFH-.js";import{_ as e,c as r,o as i,a4 as t}from"./chunks/framework.BmdFiWrL.js";const b=JSON.parse('{"title":"在iOS/MacOS中使用Siri运行快捷指令查询服务器状态","description":"","frontmatter":{},"headers":[],"relativePath":"case/case2.md","filePath":"case/case2.md","lastUpdated":1719239024000}'),o={name:"case/case2.md"},c=t("",8),s=[c];function l(d,n,h,_,p,m){return i(),r("div",null,s)}const S=e(o,[["render",l]]);export{b as __pageData,S as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as t,c as e,o as a,a4 as r}from"./chunks/framework.BmdFiWrL.js";const b=JSON.parse('{"title":"自建使用 API 来进行查询,且支持多语言的 Telegram 查询机器人","description":"","frontmatter":{},"headers":[],"relativePath":"case/case3.md","filePath":"case/case3.md","lastUpdated":1719239024000}'),d={name:"case/case3.md"},l=r('<h1 id="自建使用-api-来进行查询-且支持多语言的-telegram-查询机器人" tabindex="-1">自建使用 API 来进行查询,且支持多语言的 Telegram 查询机器人 <a class="header-anchor" href="#自建使用-api-来进行查询-且支持多语言的-telegram-查询机器人" aria-label="Permalink to "自建使用 API 来进行查询,且支持多语言的 Telegram 查询机器人""></a></h1><p>贡献者:</p><ul><li><a href="https://github.com/tech-fever" target="_blank" rel="noreferrer">tech-fever</a></li></ul><p>项目地址:<a href="https://github.com/tech-fever/nezha_telegram_bot" target="_blank" rel="noreferrer">nezha_telegram_bot</a></p><p>镜像备份(非实时更新):<a href="https://github.com/nezhahq/nezha_telegram_bot" target="_blank" rel="noreferrer">nezha_telegram_bot</a></p><h2 id="项目特色" tabindex="-1">项目特色 <a class="header-anchor" href="#项目特色" aria-label="Permalink to "项目特色""></a></h2><p>开源Telegram机器人项目,可以基于API实时查询哪吒面板的服务器信息。</p><ul><li>[x] 支持中/英多语言切换</li><li>[x] 支持分组统计(CPU、磁盘、内存、上下行速度、流量统计等)</li><li>[x] 支持实时刷新单个服务器数据</li><li>[x] 支持键盘互动查询</li><li>[x] 支持命令直接查询</li><li>[x] 增加群聊判断,限制群聊可发送命令</li><li>[x] 增加群聊内5秒自动删除信息</li><li>[x] 支持docker部署</li></ul><h2 id="命令列表" tabindex="-1">命令列表 <a class="header-anchor" href="#命令列表" aria-label="Permalink to "命令列表""></a></h2><table tabindex="0"><thead><tr><th>命令</th><th>功能</th><th>仅私聊</th></tr></thead><tbody><tr><td>start</td><td>开始使用键盘主菜单</td><td>✔️</td></tr><tr><td>help</td><td>帮助列表</td><td>❌</td></tr><tr><td>add</td><td>添加面板链接和token</td><td>✔️</td></tr><tr><td>url</td><td>添加面板链接</td><td>✔️</td></tr><tr><td>token</td><td>添加面板token</td><td>✔️</td></tr><tr><td>info</td><td>获取保存的面板链接和token</td><td>✔️</td></tr><tr><td>delete</td><td>删除保存的面板链接和token</td><td>✔️</td></tr><tr><td>id</td><td>命令后面添加整数id,来进行单个服务器信息查询(私聊带刷新按钮,群聊不带)</td><td>❌</td></tr><tr><td>all</td><td>查询所有服务器的统计信息</td><td>❌</td></tr><tr><td>search</td><td>在服务器名字中搜索关键字(支持多个,用空格分开)</td><td>❌</td></tr></tbody></table><h2 id="效果展示" tabindex="-1">效果展示 <a class="header-anchor" href="#效果展示" aria-label="Permalink to "效果展示""></a></h2><p><img src="https://user-images.githubusercontent.com/105153585/175813727-bef77a8e-ff46-4fd4-b41b-43902abf6159.png#pic_left" alt="image"><img src="https://user-images.githubusercontent.com/105153585/175813645-4df4f4c7-2591-4133-9645-21c7db2f62ab.png#pic_right" alt="image"></p>',12),i=[l];function o(h,n,c,s,_,m){return a(),e("div",null,i)}const f=t(d,[["render",o]]);export{b as __pageData,f as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as t,c as e,o as a,a4 as r}from"./chunks/framework.BmdFiWrL.js";const b=JSON.parse('{"title":"自建使用 API 来进行查询,且支持多语言的 Telegram 查询机器人","description":"","frontmatter":{},"headers":[],"relativePath":"case/case3.md","filePath":"case/case3.md","lastUpdated":1719239024000}'),d={name:"case/case3.md"},l=r("",12),i=[l];function o(h,n,c,s,_,m){return a(),e("div",null,i)}const f=t(d,[["render",o]]);export{b as __pageData,f as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as t,o as e,c as a,R as r}from"./chunks/framework.44fd0451.js";const f=JSON.parse('{"title":"自建使用 API 来进行查询,且支持多语言的 Telegram 查询机器人","description":"","frontmatter":{},"headers":[],"relativePath":"case/case3.md","filePath":"case/case3.md","lastUpdated":1718495592000}'),d={name:"case/case3.md"},l=r('<h1 id="自建使用-api-来进行查询-且支持多语言的-telegram-查询机器人" tabindex="-1">自建使用 API 来进行查询,且支持多语言的 Telegram 查询机器人 <a class="header-anchor" href="#自建使用-api-来进行查询-且支持多语言的-telegram-查询机器人" aria-label="Permalink to "自建使用 API 来进行查询,且支持多语言的 Telegram 查询机器人""></a></h1><p>贡献者:</p><ul><li><a href="https://github.com/tech-fever" target="_blank" rel="noreferrer">tech-fever</a></li></ul><p>项目地址:<a href="https://github.com/tech-fever/nezha_telegram_bot" target="_blank" rel="noreferrer">nezha_telegram_bot</a></p><p>镜像备份(非实时更新):<a href="https://github.com/nezhahq/nezha_telegram_bot" target="_blank" rel="noreferrer">nezha_telegram_bot</a></p><h2 id="项目特色" tabindex="-1">项目特色 <a class="header-anchor" href="#项目特色" aria-label="Permalink to "项目特色""></a></h2><p>开源Telegram机器人项目,可以基于API实时查询哪吒面板的服务器信息。</p><ul><li>[x] 支持中/英多语言切换</li><li>[x] 支持分组统计(CPU、磁盘、内存、上下行速度、流量统计等)</li><li>[x] 支持实时刷新单个服务器数据</li><li>[x] 支持键盘互动查询</li><li>[x] 支持命令直接查询</li><li>[x] 增加群聊判断,限制群聊可发送命令</li><li>[x] 增加群聊内5秒自动删除信息</li><li>[x] 支持docker部署</li></ul><h2 id="命令列表" tabindex="-1">命令列表 <a class="header-anchor" href="#命令列表" aria-label="Permalink to "命令列表""></a></h2><table><thead><tr><th>命令</th><th>功能</th><th>仅私聊</th></tr></thead><tbody><tr><td>start</td><td>开始使用键盘主菜单</td><td>✔️</td></tr><tr><td>help</td><td>帮助列表</td><td>❌</td></tr><tr><td>add</td><td>添加面板链接和token</td><td>✔️</td></tr><tr><td>url</td><td>添加面板链接</td><td>✔️</td></tr><tr><td>token</td><td>添加面板token</td><td>✔️</td></tr><tr><td>info</td><td>获取保存的面板链接和token</td><td>✔️</td></tr><tr><td>delete</td><td>删除保存的面板链接和token</td><td>✔️</td></tr><tr><td>id</td><td>命令后面添加整数id,来进行单个服务器信息查询(私聊带刷新按钮,群聊不带)</td><td>❌</td></tr><tr><td>all</td><td>查询所有服务器的统计信息</td><td>❌</td></tr><tr><td>search</td><td>在服务器名字中搜索关键字(支持多个,用空格分开)</td><td>❌</td></tr></tbody></table><h2 id="效果展示" tabindex="-1">效果展示 <a class="header-anchor" href="#效果展示" aria-label="Permalink to "效果展示""></a></h2><p><img src="https://user-images.githubusercontent.com/105153585/175813727-bef77a8e-ff46-4fd4-b41b-43902abf6159.png#pic_left" alt="image"><img src="https://user-images.githubusercontent.com/105153585/175813645-4df4f4c7-2591-4133-9645-21c7db2f62ab.png#pic_right" alt="image"></p>',12),i=[l];function o(h,n,c,s,_,m){return e(),a("div",null,i)}const b=t(d,[["render",o]]);export{f as __pageData,b as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as t,o as e,c as a,R as r}from"./chunks/framework.44fd0451.js";const f=JSON.parse('{"title":"自建使用 API 来进行查询,且支持多语言的 Telegram 查询机器人","description":"","frontmatter":{},"headers":[],"relativePath":"case/case3.md","filePath":"case/case3.md","lastUpdated":1718495592000}'),d={name:"case/case3.md"},l=r("",12),i=[l];function o(h,n,c,s,_,m){return e(),a("div",null,i)}const b=t(d,[["render",o]]);export{f as __pageData,b as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as s,o as t,c as e,R as a}from"./chunks/framework.44fd0451.js";const r="/assets/2.38c2ea56.png",n="/assets/5.23139306.png",o="/assets/6.22a61698.png",p="/assets/4.fe6a4e7a.jpg",c="/assets/1.b4b4591f.jpeg",y=JSON.parse('{"title":"重磅推荐!一秒拥有宇宙级算力!让你在人前,不!再!自!卑","description":"","frontmatter":{},"headers":[],"relativePath":"case/case4.md","filePath":"case/case4.md","lastUpdated":1718495592000}'),_={name:"case/case4.md"},i=a('<h1 id="重磅推荐-一秒拥有宇宙级算力-让你在人前-不-再-自-卑" tabindex="-1">重磅推荐!一秒拥有宇宙级算力!让你在人前,不!再!自!卑 <a class="header-anchor" href="#重磅推荐-一秒拥有宇宙级算力-让你在人前-不-再-自-卑" aria-label="Permalink to "重磅推荐!一秒拥有宇宙级算力!让你在人前,不!再!自!卑""></a></h1><br><hr><p><img src="'+r+'" alt="2"><br><br><span style="font-size:5;">还在因为自己的小鸡配置太差被朋友嘲笑吗? </span><br><span style="font-size:5;">还在想参加以针会友活动却因为小鸡不够排面而觉得羞耻吗? </span><br><span style="font-size:5;">还在因为在哪吒TG群里机器人排名太低而觉得自己低人一等吗? </span><br><br><br><span style="font-size:6;"><strong>今天开始!找回自信!</strong></span><br></p><p>来自南京的名老中医 <a href="https://github.com/dysf888" target="_blank" rel="noreferrer">dysf888</a> 独家秘方!让你<strong>找回男人本色,激情畅享!</strong><br> 安装 <a href="https://github.com/dysf888/fake-nezha-agent" target="_blank" rel="noreferrer">Fake Agent</a>,可随意修改服务器监测数据的倍数上传到 Dashboard,让你的小鸡 <strong>脱!胎!换!骨!</strong> 让你在 MJJ 面前<span style="font-size:5;">硬</span>起来!</p><p>镜像备份(非实时更新):<a href="https://github.com/nezhahq/fake-nezha-agent" target="_blank" rel="noreferrer">Fake Agent</a><br><br></p><p><span style="font-size:4;"><strong>哪吒监控创始人奶爸也在用:</strong></span><br><img src="'+n+'" alt="5"></p><br><p><span style="font-size:4;"><strong>男人用了都说好:</strong></span><br><img src="'+o+'" alt="6"><br><img src="'+p+'" alt="4"></p><br><hr><p><img src="'+c+'" alt="1"></p>',12),l=[i];function g(f,b,h,m,d,k){return t(),e("div",null,l)}const z=s(_,[["render",g]]);export{y as __pageData,z as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as s,o as t,c as e,R as a}from"./chunks/framework.44fd0451.js";const r="/assets/2.38c2ea56.png",n="/assets/5.23139306.png",o="/assets/6.22a61698.png",p="/assets/4.fe6a4e7a.jpg",c="/assets/1.b4b4591f.jpeg",y=JSON.parse('{"title":"重磅推荐!一秒拥有宇宙级算力!让你在人前,不!再!自!卑","description":"","frontmatter":{},"headers":[],"relativePath":"case/case4.md","filePath":"case/case4.md","lastUpdated":1718495592000}'),_={name:"case/case4.md"},i=a("",12),l=[i];function g(f,b,h,m,d,k){return t(),e("div",null,l)}const z=s(_,[["render",g]]);export{y as __pageData,z as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as s,c as t,o as e,a4 as a}from"./chunks/framework.BmdFiWrL.js";const r="/assets/2.r5IbCoDU.png",n="/assets/5.DI5HceD6.png",o="/assets/6.B0QVmape.png",p="/assets/4.DAp6JO4C.jpg",c="/assets/1.VA-CzEkF.jpeg",u=JSON.parse('{"title":"重磅推荐!一秒拥有宇宙级算力!让你在人前,不!再!自!卑","description":"","frontmatter":{},"headers":[],"relativePath":"case/case4.md","filePath":"case/case4.md","lastUpdated":1719239024000}'),_={name:"case/case4.md"},i=a('<h1 id="重磅推荐-一秒拥有宇宙级算力-让你在人前-不-再-自-卑" tabindex="-1">重磅推荐!一秒拥有宇宙级算力!让你在人前,不!再!自!卑 <a class="header-anchor" href="#重磅推荐-一秒拥有宇宙级算力-让你在人前-不-再-自-卑" aria-label="Permalink to "重磅推荐!一秒拥有宇宙级算力!让你在人前,不!再!自!卑""></a></h1><br><hr><p><img src="'+r+'" alt="2"><br><br><span style="font-size:5;">还在因为自己的小鸡配置太差被朋友嘲笑吗? </span><br><span style="font-size:5;">还在想参加以针会友活动却因为小鸡不够排面而觉得羞耻吗? </span><br><span style="font-size:5;">还在因为在哪吒TG群里机器人排名太低而觉得自己低人一等吗? </span><br><br><br><span style="font-size:6;"><strong>今天开始!找回自信!</strong></span><br></p><p>来自南京的名老中医 <a href="https://github.com/dysf888" target="_blank" rel="noreferrer">dysf888</a> 独家秘方!让你<strong>找回男人本色,激情畅享!</strong><br> 安装 <a href="https://github.com/dysf888/fake-nezha-agent" target="_blank" rel="noreferrer">Fake Agent</a>,可随意修改服务器监测数据的倍数上传到 Dashboard,让你的小鸡 <strong>脱!胎!换!骨!</strong> 让你在 MJJ 面前<span style="font-size:5;">硬</span>起来!</p><p>镜像备份(非实时更新):<a href="https://github.com/nezhahq/fake-nezha-agent" target="_blank" rel="noreferrer">Fake Agent</a><br><br></p><p><span style="font-size:4;"><strong>哪吒监控创始人奶爸也在用:</strong></span><br><img src="'+n+'" alt="5"></p><br><p><span style="font-size:4;"><strong>男人用了都说好:</strong></span><br><img src="'+o+'" alt="6"><br><img src="'+p+'" alt="4"></p><br><hr><p><img src="'+c+'" alt="1"></p>',12),l=[i];function g(b,f,h,m,d,k){return e(),t("div",null,l)}const y=s(_,[["render",g]]);export{u as __pageData,y as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as s,c as t,o as e,a4 as a}from"./chunks/framework.BmdFiWrL.js";const r="/assets/2.r5IbCoDU.png",n="/assets/5.DI5HceD6.png",o="/assets/6.B0QVmape.png",p="/assets/4.DAp6JO4C.jpg",c="/assets/1.VA-CzEkF.jpeg",u=JSON.parse('{"title":"重磅推荐!一秒拥有宇宙级算力!让你在人前,不!再!自!卑","description":"","frontmatter":{},"headers":[],"relativePath":"case/case4.md","filePath":"case/case4.md","lastUpdated":1719239024000}'),_={name:"case/case4.md"},i=a("",12),l=[i];function g(b,f,h,m,d,k){return e(),t("div",null,l)}const y=s(_,[["render",g]]);export{u as __pageData,y as default};
|
||||
@@ -1,47 +0,0 @@
|
||||
import{_ as a,o as e,c as s,R as t}from"./chunks/framework.44fd0451.js";const m=JSON.parse('{"title":"使用 Argo 隧道的哪吒服务端","description":"","frontmatter":{},"headers":[],"relativePath":"case/case5.md","filePath":"case/case5.md","lastUpdated":1718495592000}'),l={name:"case/case5.md"},n=t(`<h1 id="使用-argo-隧道的哪吒服务端" tabindex="-1">使用 Argo 隧道的哪吒服务端 <a class="header-anchor" href="#使用-argo-隧道的哪吒服务端" aria-label="Permalink to "使用 Argo 隧道的哪吒服务端""></a></h1><p>贡献者:</p><ul><li><a href="https://github.com/fscarmen2" target="_blank" rel="noreferrer">fscarmen</a></li></ul><p>项目地址:<a href="https://github.com/fscarmen2/Argo-Nezha-Service-Container" target="_blank" rel="noreferrer">Argo-Nezha-Service-Container</a></p><p>镜像备份(非实时更新):<a href="https://github.com/nezhahq/Argo-Nezha-Service-Container" target="_blank" rel="noreferrer">Argo-Nezha-Service-Container</a></p><hr><h1 id="目录" tabindex="-1">目录 <a class="header-anchor" href="#目录" aria-label="Permalink to "目录""></a></h1><ul><li><a href="./case5.html#项目特点">项目特点</a></li><li><a href="./case5.html#准备需要用的变量">准备需要用的变量</a></li><li><a href="./case5.html#argo-认证的获取方式-json-或-token">Argo 认证的获取方式: json 或 token</a></li><li><a href="./case5.html#PaaS-部署实例">PaaS 部署实例</a></li><li><a href="./case5.html#vps-部署方式-1-----docker">VPS 部署方式 1 --- docker</a></li><li><a href="./case5.html#vps-部署方式-2-----宿主机">VPS 部署方式 2 --- 宿主机</a></li><li><a href="./case5.html#客户端接入">客户端接入</a></li><li><a href="./case5.html#ssh-接入">SSH 接入</a></li><li><a href="./case5.html#手动备份数据">手动备份数据</a></li><li><a href="./case5.html#自动还原备份">自动还原备份</a></li><li><a href="./case5.html#手动还原备份">手动还原备份</a></li><li><a href="./case5.html#完美搬家">完美搬家</a></li><li><a href="./case5.html#主体目录文件及说明">主体目录文件及说明</a></li><li><a href="./case5.html#鸣谢下列作者的文章和项目">鸣谢下列作者的文章和项目</a></li><li><a href="./case5.html#免责声明">免责声明</a></li></ul><hr><h2 id="项目特点" tabindex="-1">项目特点: <a class="header-anchor" href="#项目特点" aria-label="Permalink to "项目特点:""></a></h2><ul><li>适用范围更广 --- 只要能连通网络,就能安装哪吒服务端,如 LXC, OpenVZ VPS,Nas 虚拟机 , Container PaaS 等</li><li>Argo 隧道突破需要公网入口的限制 --- 传统的哪吒需要有两个公网端口,一个用于面板的访问,另一个用于客户端上报数据,本项目借用 Cloudflare Argo 隧道,使用内网穿透的办法</li><li>IPv4 / v6 具备更高的灵活性 --- 传统哪吒需要处理服务端和客户端的 IPv4/v6 兼容性问题,还需要通过 warp 等工具来解决不对应的情况。然而,本项目可以完全不需要考虑这些问题,可以任意对接,更加方便和简便</li><li>一条 Argo 隧道分流多个域名和协议 --- 建立一条内网穿透的 Argo 隧道,即可分流三个域名(hostname)和协议(protocal),分别用于面板的访问(http),客户端上报数据(tcp)和 ssh(可选)</li><li>GrpcWebProxy 反向代理的 gRPC 数据端口 --- 配上证书做 tls 终结,然后 Argo 的隧道配置用 https 服务指向这个反向代理,启用http2回源,grpc(nezha)->GrpcWebProxy->h2(argo)->cf cdn edge->agent</li><li>每天自动备份 --- 北京时间每天 4 时 0 分自动备份整个哪吒面板文件夹到指定的 github 私库,包括面板主题,面板设置,探针数据和隧道信息,备份保留近 5 天数据;鉴于内容十分重要,必须要放在私库</li><li>每天自动更新面板 -- 北京时间每天 4 时 0 分自动检测最新的官方面板版本,有升级时自动更新</li><li>手/自一体还原备份 --- 每分钟检测一次在线还原文件的内容,遇到有更新立刻还原</li><li>默认内置本机探针 --- 能很方便的监控自身服务器信息</li><li>数据更安全 --- Argo 隧道使用TLS加密通信,可以将应用程序流量安全地传输到 Cloudflare 网络,提高了应用程序的安全性和可靠性。此外,Argo Tunnel也可以防止IP泄露和DDoS攻击等网络威胁</li></ul><img width="1609" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/4893c3cd-5055-468f-8138-6c5460bdd1e4"><h2 id="准备需要用的变量" tabindex="-1">准备需要用的变量 <a class="header-anchor" href="#准备需要用的变量" aria-label="Permalink to "准备需要用的变量""></a></h2><ul><li>到 Cloudflare 官网,选择使用的域名,打开 <code>网络</code> 选项将 <code>gRPC</code> 开
Line truncated
|
||||
<span class="line"><span style="color:#A6ACCD;"> --name nezha_dashboard \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> --pull always \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> --restart always \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e GH_USER=<填 github 用户名> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e GH_EMAIL=<填 github 邮箱> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e GH_PAT=<填获取的> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e GH_REPO=<填自定义的> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e GH_CLIENTID=<填获取的> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e GH_CLIENTSECRET=<填获取的> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e ARGO_AUTH='<填获取的 Argo json 或者 token>' \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e ARGO_DOMAIN=<填自定义的> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e GH_BACKUP_USER=<如与 GH_USER 一致,可以不要该环境变量> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> fscarmen/argo-nezha</span></span></code></pre></div><h3 id="docker-compose-部署" tabindex="-1">docker-compose 部署 <a class="header-anchor" href="#docker-compose-部署" aria-label="Permalink to "docker-compose 部署""></a></h3><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">version: '3.8'</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">services:</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> argo-nezha:</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> image: fscarmen/argo-nezha</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> pull: always</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> container_name: nezha_dashboard</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> restart: always</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> environment:</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - GH_USER=<填 github 用户名></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - GH_EMAIL=<<填 github 邮箱></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - GH_PAT=<填获取的></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - GH_REPO=<填自定义的></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - GH_CLIENTID=<填获取的></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - GH_CLIENTSECRET=<填获取的></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - ARGO_AUTH='<填获取的 Argo json 或者 token>'</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - ARGO_DOMAIN=<填自定义的></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - GH_BACKUP_USER=<如与 GH_USER 一致,可以不要该环境变量></span></span></code></pre></div><h2 id="vps-部署方式-2-宿主机" tabindex="-1">VPS 部署方式 2 --- 宿主机 <a class="header-anchor" href="#vps-部署方式-2-宿主机" aria-label="Permalink to "VPS 部署方式 2 --- 宿主机""></a></h2><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">bash <(wget -qO- https://raw.githubusercontent.com/fscarmen2/Argo-Nezha-Service-Container/main/dashboard.sh)</span></span></code></pre></div><h2 id="客户端接入" tabindex="-1">客户端接入 <a class="header-anchor" href="#客户端接入" aria-label="Permalink to "客户端接入""></a></h2><p>通过gRPC传输,无需额外配置。使用面板给到的安装方式,举例</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh install_agent nezha.seales.nom.za 443 eAxO9IF519fKFODlW0 --tls</span></span></code></pre></div><h2 id="ssh-接入" tabindex="-1">SSH 接入 <a class="header-anchor" href="#ssh-接入" aria-label="Permalink to "SSH 接入""></a></h2><ul><li>以 macOS + WindTerm 为例,其他根据使用的 SSH 工具,结合官方官方说明文档: <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/use_cases/ssh/#2-connect-as-a-user" target="_blank" rel="noreferrer">https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/use_cases/ssh/#2-connect-as-a-user</a></li><li>官方 cloudflared 下载: <a href="https://github.com/cloudflare/cloudflared/releases" target="_blank" rel="noreferrer">https://github.com/cloudflare/cloudflared/releases</a></li><li>以下输入命令举例: SSH 用户名: root, 密码:<GH_CLIENTSECRET></li></ul><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;"><file path>/cloudflared access ssh --hostname nezha.seales.nom.za/<GH_CLIENTID></span></span></code></pre></div><img width="1180" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/507b037a-25c6-457f-b2b5-d54f4b70a2b6"><img width="828" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/80284f0b-e2d7-4adb-982a-969aca0cb5f6"><img width="955" alt="image" src="https://user-images.githubusercontent.com/92626977/233350802-754624e0-8456-4353-8577-1f5385fb8723.png"><h2 id="手动备份数据" tabindex="-1">手动备份数据 <a class="header-anchor" href="#手动备份数据" aria-label="Permalink to "手动备份数据""></a></h2><p>方法一: 把 Github 备份库里的 <code>README.md</code> 文件内容改为 <code>backup</code></p><img width="970" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/c5b6bc4b-e69c-48ce-97d4-3f9be88515f3"><p>方法二: ssh 进去后,容器版本运行 <code>/dashboard/backup.sh</code>; 非容器版本运行 <code>/opt/nezha/dashboard/backup.sh</code></p><h2 id="自动还原备份" tabindex="-1">自动还原备份 <a class="header-anchor" href="#自动还原备份" aria-label="Permalink to "自动还原备份""></a></h2><ul><li>把需要还原的文件名改到 github 备份库里的 <code>README.md</code>,定时服务会每分钟检测更新,并把上次同步的文件名记录在本地 <code>/dbfile</code> 处以与在线的文件内容作比对</li></ul><p>下图为以还原文件名为 <code>dashboard-2023-04-23-13:08:37.tar.gz</code> 作示例</p><p><img src="https://user-images.githubusercontent.com/92626977/233822466-c24e94f6-ba8a-47c9-b77d-aa62a56cc929.png" alt="image"></p><h2 id="手动还原备份" tabindex="-1">手动还原备份 <a class="header-anchor" href="#手动还原备份" aria-label="Permalink to "手动还原备份""></a></h2><ul><li>ssh 进入容器后运行,github 备份库里的 tar.gz 文件名,格式: dashboard-2023-04-22-21:42:10.tar.gz</li></ul><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">bash /dashboard/restore.sh <文件名></span></span></code></pre></div><img width="1209" alt="image" src="https://user-images.githubusercontent.com/92626977/233792709-fb37b79c-c755-4db1-96ec-1039309ff932.png"><h2 id="完美搬家" tabindex="-1">完美搬Line truncated
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- app # 哪吒面板主程序</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- argo.json # Argo 隧道 json 文件,记录着使用隧道的信息</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- argo.yml # Argo 隧道 yml 文件,用于在一同隧道下,根据不同域名来分流 web, gRPC 和 ssh 协议的作用</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- backup.sh # 备份数据脚本</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- restore.sh # 还原备份脚本</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- dbfile # 记录最新的还原或备份文件名</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- resource # 面板主题、语言和旗帜等资料的文件夹</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- data</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">| |-- config.yaml # 哪吒面板的配置,如 Github OAuth2 / gRPC 域名 / 端口 / 是否启用 TLS 等信息</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">| \`-- sqlite.db # SQLite 数据库文件,记录着面板设置的所有 severs 和 cron 等信息</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- entrypoint.sh # 主脚本,容器运行后执行</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- nezha.csr # SSL/TLS 证书签名请求</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- nezha.key # SSL/TLS 证书的私钥信息</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- nezha.pem # SSL/TLS 证书文件</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- cloudflared # Cloudflare Argo 隧道主程序</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- grpcwebproxy # gRPC 反代主程序</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">\`-- nezha-agent # 哪吒客户端,用于监控本地 localhost</span></span></code></pre></div><h2 id="鸣谢下列作者的文章和项目" tabindex="-1">鸣谢下列作者的文章和项目: <a class="header-anchor" href="#鸣谢下列作者的文章和项目" aria-label="Permalink to "鸣谢下列作者的文章和项目:""></a></h2><ul><li>热心的朝阳群众 Robin,讨论哪吒服务端与客户端的关系,从而诞生了此项目</li><li>哪吒官网: <a href="https://nezha.wiki/" target="_blank" rel="noreferrer">https://nezha.wiki/</a> , TG 群: <a href="https://t.me/nezhamonitoring" target="_blank" rel="noreferrer">https://t.me/nezhamonitoring</a></li><li>共穷国际老中医: <a href="http://solitud.es/" target="_blank" rel="noreferrer">http://solitud.es/</a></li><li>Akkia's Blog: <a href="https://blog.akkia.moe/" target="_blank" rel="noreferrer">https://blog.akkia.moe/</a></li><li>胡桃's Blog: <a href="https://blog.xn--pn1aul.org/" target="_blank" rel="noreferrer">https://blog.萝莉.org/</a></li><li>HiFeng's Blog: <a href="https://www.hicairo.com/" target="_blank" rel="noreferrer">https://www.hicairo.com/</a></li><li>用 Cloudflare Tunnel 进行内网穿透: <a href="https://blog.outv.im/2021/cloudflared-tunnel/" target="_blank" rel="noreferrer">https://blog.outv.im/2021/cloudflared-tunnel/</a></li><li>如何给 GitHub Actions 添加自己的 Runner 主机: <a href="https://cloud.tencent.com/developer/article/1756690" target="_blank" rel="noreferrer">https://cloud.tencent.com/developer/article/1756690</a></li><li>github self-hosted runner 添加与启动: <a href="https://blog.csdn.net/sinat_32188225/article/details/125978331" target="_blank" rel="noreferrer">https://blog.csdn.net/sinat_32188225/article/details/125978331</a></li><li>如何从Docker镜像中导出文件: <a href="https://www.pkslow.com/archives/extract-files-from-docker-image" target="_blank" rel="noreferrer">https://www.pkslow.com/archives/extract-files-from-docker-image</a></li><li>grpcwebproxy: <a href="https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy" target="_blank" rel="noreferrer">https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy</a></li><li>Applexad 的哪吒官方改版的面板二进制文件: <a href="https://github.com/applexad/nezha-binary-build" target="_blank" rel="noreferrer">https://github.com/applexad/nezha-binary-build</a></li></ul><h2 id="免责声明" tabindex="-1">免责声明: <a class="header-anchor" href="#免责声明" aria-label="Permalink to "免责声明:""></a></h2><ul><li>本程序仅供学习了解, 非盈利目的,请于下载后 24 小时内删除, 不得用作任何商业用途, 文字、数据及图片均有所属版权, 如转载须注明来源。</li><li>使用本程序必循遵守部署免责声明。使用本程序必循遵守部署服务器所在地、所在国家和用户所在国家的法律法规, 程序作者不对使用者任何不当行为负责。</li></ul>`,89),r=[n];function o(c,i,p,h,d,g){return e(),s("div",null,r)}const u=a(l,[["render",o]]);export{m as __pageData,u as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as a,o as e,c as s,R as t}from"./chunks/framework.44fd0451.js";const m=JSON.parse('{"title":"使用 Argo 隧道的哪吒服务端","description":"","frontmatter":{},"headers":[],"relativePath":"case/case5.md","filePath":"case/case5.md","lastUpdated":1718495592000}'),l={name:"case/case5.md"},n=t("",89),r=[n];function o(c,i,p,h,d,g){return e(),s("div",null,r)}const u=a(l,[["render",o]]);export{m as __pageData,u as default};
|
||||
@@ -0,0 +1,47 @@
|
||||
import{_ as a,c as e,o as s,a4 as t}from"./chunks/framework.BmdFiWrL.js";const u=JSON.parse('{"title":"使用 Argo 隧道的哪吒服务端","description":"","frontmatter":{},"headers":[],"relativePath":"case/case5.md","filePath":"case/case5.md","lastUpdated":1719239024000}'),n={name:"case/case5.md"},r=t(`<h1 id="使用-argo-隧道的哪吒服务端" tabindex="-1">使用 Argo 隧道的哪吒服务端 <a class="header-anchor" href="#使用-argo-隧道的哪吒服务端" aria-label="Permalink to "使用 Argo 隧道的哪吒服务端""></a></h1><p>贡献者:</p><ul><li><a href="https://github.com/fscarmen2" target="_blank" rel="noreferrer">fscarmen</a></li></ul><p>项目地址:<a href="https://github.com/fscarmen2/Argo-Nezha-Service-Container" target="_blank" rel="noreferrer">Argo-Nezha-Service-Container</a></p><p>镜像备份(非实时更新):<a href="https://github.com/nezhahq/Argo-Nezha-Service-Container" target="_blank" rel="noreferrer">Argo-Nezha-Service-Container</a></p><hr><h1 id="目录" tabindex="-1">目录 <a class="header-anchor" href="#目录" aria-label="Permalink to "目录""></a></h1><ul><li><a href="./case5.html#项目特点">项目特点</a></li><li><a href="./case5.html#准备需要用的变量">准备需要用的变量</a></li><li><a href="./case5.html#argo-认证的获取方式-json-或-token">Argo 认证的获取方式: json 或 token</a></li><li><a href="./case5.html#PaaS-部署实例">PaaS 部署实例</a></li><li><a href="./case5.html#vps-部署方式-1-----docker">VPS 部署方式 1 --- docker</a></li><li><a href="./case5.html#vps-部署方式-2-----宿主机">VPS 部署方式 2 --- 宿主机</a></li><li><a href="./case5.html#客户端接入">客户端接入</a></li><li><a href="./case5.html#ssh-接入">SSH 接入</a></li><li><a href="./case5.html#手动备份数据">手动备份数据</a></li><li><a href="./case5.html#自动还原备份">自动还原备份</a></li><li><a href="./case5.html#手动还原备份">手动还原备份</a></li><li><a href="./case5.html#完美搬家">完美搬家</a></li><li><a href="./case5.html#主体目录文件及说明">主体目录文件及说明</a></li><li><a href="./case5.html#鸣谢下列作者的文章和项目">鸣谢下列作者的文章和项目</a></li><li><a href="./case5.html#免责声明">免责声明</a></li></ul><hr><h2 id="项目特点" tabindex="-1">项目特点: <a class="header-anchor" href="#项目特点" aria-label="Permalink to "项目特点:""></a></h2><ul><li>适用范围更广 --- 只要能连通网络,就能安装哪吒服务端,如 LXC, OpenVZ VPS,Nas 虚拟机 , Container PaaS 等</li><li>Argo 隧道突破需要公网入口的限制 --- 传统的哪吒需要有两个公网端口,一个用于面板的访问,另一个用于客户端上报数据,本项目借用 Cloudflare Argo 隧道,使用内网穿透的办法</li><li>IPv4 / v6 具备更高的灵活性 --- 传统哪吒需要处理服务端和客户端的 IPv4/v6 兼容性问题,还需要通过 warp 等工具来解决不对应的情况。然而,本项目可以完全不需要考虑这些问题,可以任意对接,更加方便和简便</li><li>一条 Argo 隧道分流多个域名和协议 --- 建立一条内网穿透的 Argo 隧道,即可分流三个域名(hostname)和协议(protocal),分别用于面板的访问(http),客户端上报数据(tcp)和 ssh(可选)</li><li>GrpcWebProxy 反向代理的 gRPC 数据端口 --- 配上证书做 tls 终结,然后 Argo 的隧道配置用 https 服务指向这个反向代理,启用http2回源,grpc(nezha)->GrpcWebProxy->h2(argo)->cf cdn edge->agent</li><li>每天自动备份 --- 北京时间每天 4 时 0 分自动备份整个哪吒面板文件夹到指定的 github 私库,包括面板主题,面板设置,探针数据和隧道信息,备份保留近 5 天数据;鉴于内容十分重要,必须要放在私库</li><li>每天自动更新面板 -- 北京时间每天 4 时 0 分自动检测最新的官方面板版本,有升级时自动更新</li><li>手/自一体还原备份 --- 每分钟检测一次在线还原文件的内容,遇到有更新立刻还原</li><li>默认内置本机探针 --- 能很方便的监控自身服务器信息</li><li>数据更安全 --- Argo 隧道使用TLS加密通信,可以将应用程序流量安全地传输到 Cloudflare 网络,提高了应用程序的安全性和可靠性。此外,Argo Tunnel也可以防止IP泄露和DDoS攻击等网络威胁</li></ul><img width="1609" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/4893c3cd-5055-468f-8138-6c5460bdd1e4"><h2 id="准备需要用的变量" tabindex="-1">准备需要用的变量 <a class="header-anchor" href="#准备需要用的变量" aria-label="Permalink to "准备需要用的变量""></a></h2><ul><li>到 Cloudflare 官网,选择使用的域名,打开 <code>网络</code> 选项将 <code>gRPC</code> 开
Line truncated
|
||||
<span class="line"><span> --name nezha_dashboard \\</span></span>
|
||||
<span class="line"><span> --pull always \\</span></span>
|
||||
<span class="line"><span> --restart always \\</span></span>
|
||||
<span class="line"><span> -e GH_USER=<填 github 用户名> \\</span></span>
|
||||
<span class="line"><span> -e GH_EMAIL=<填 github 邮箱> \\</span></span>
|
||||
<span class="line"><span> -e GH_PAT=<填获取的> \\</span></span>
|
||||
<span class="line"><span> -e GH_REPO=<填自定义的> \\</span></span>
|
||||
<span class="line"><span> -e GH_CLIENTID=<填获取的> \\</span></span>
|
||||
<span class="line"><span> -e GH_CLIENTSECRET=<填获取的> \\</span></span>
|
||||
<span class="line"><span> -e ARGO_AUTH='<填获取的 Argo json 或者 token>' \\</span></span>
|
||||
<span class="line"><span> -e ARGO_DOMAIN=<填自定义的> \\</span></span>
|
||||
<span class="line"><span> -e GH_BACKUP_USER=<如与 GH_USER 一致,可以不要该环境变量> \\</span></span>
|
||||
<span class="line"><span> fscarmen/argo-nezha</span></span></code></pre></div><h3 id="docker-compose-部署" tabindex="-1">docker-compose 部署 <a class="header-anchor" href="#docker-compose-部署" aria-label="Permalink to "docker-compose 部署""></a></h3><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>version: '3.8'</span></span>
|
||||
<span class="line"><span>services:</span></span>
|
||||
<span class="line"><span> argo-nezha:</span></span>
|
||||
<span class="line"><span> image: fscarmen/argo-nezha</span></span>
|
||||
<span class="line"><span> pull: always</span></span>
|
||||
<span class="line"><span> container_name: nezha_dashboard</span></span>
|
||||
<span class="line"><span> restart: always</span></span>
|
||||
<span class="line"><span> environment:</span></span>
|
||||
<span class="line"><span> - GH_USER=<填 github 用户名></span></span>
|
||||
<span class="line"><span> - GH_EMAIL=<<填 github 邮箱></span></span>
|
||||
<span class="line"><span> - GH_PAT=<填获取的></span></span>
|
||||
<span class="line"><span> - GH_REPO=<填自定义的></span></span>
|
||||
<span class="line"><span> - GH_CLIENTID=<填获取的></span></span>
|
||||
<span class="line"><span> - GH_CLIENTSECRET=<填获取的></span></span>
|
||||
<span class="line"><span> - ARGO_AUTH='<填获取的 Argo json 或者 token>'</span></span>
|
||||
<span class="line"><span> - ARGO_DOMAIN=<填自定义的></span></span>
|
||||
<span class="line"><span> - GH_BACKUP_USER=<如与 GH_USER 一致,可以不要该环境变量></span></span></code></pre></div><h2 id="vps-部署方式-2-宿主机" tabindex="-1">VPS 部署方式 2 --- 宿主机 <a class="header-anchor" href="#vps-部署方式-2-宿主机" aria-label="Permalink to "VPS 部署方式 2 --- 宿主机""></a></h2><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bash <(wget -qO- https://raw.githubusercontent.com/fscarmen2/Argo-Nezha-Service-Container/main/dashboard.sh)</span></span></code></pre></div><h2 id="客户端接入" tabindex="-1">客户端接入 <a class="header-anchor" href="#客户端接入" aria-label="Permalink to "客户端接入""></a></h2><p>通过gRPC传输,无需额外配置。使用面板给到的安装方式,举例</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh install_agent nezha.seales.nom.za 443 eAxO9IF519fKFODlW0 --tls</span></span></code></pre></div><h2 id="ssh-接入" tabindex="-1">SSH 接入 <a class="header-anchor" href="#ssh-接入" aria-label="Permalink to "SSH 接入""></a></h2><ul><li>以 macOS + WindTerm 为例,其他根据使用的 SSH 工具,结合官方官方说明文档: <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/use_cases/ssh/#2-connect-as-a-user" target="_blank" rel="noreferrer">https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/use_cases/ssh/#2-connect-as-a-user</a></li><li>官方 cloudflared 下载: <a href="https://github.com/cloudflare/cloudflared/releases" target="_blank" rel="noreferrer">https://github.com/cloudflare/cloudflared/releases</a></li><li>以下输入命令举例: SSH 用户名: root, 密码:<GH_CLIENTSECRET></li></ul><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span><file path>/cloudflared access ssh --hostname nezha.seales.nom.za/<GH_CLIENTID></span></span></code></pre></div><img width="1180" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/507b037a-25c6-457f-b2b5-d54f4b70a2b6"><img width="828" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/80284f0b-e2d7-4adb-982a-969aca0cb5f6"><img width="955" alt="image" src="https://user-images.githubusercontent.com/92626977/233350802-754624e0-8456-4353-8577-1f5385fb8723.png"><h2 id="手动备份数据" tabindex="-1">手动备份数据 <a class="header-anchor" href="#手动备份数据" aria-label="Permalink to "手动备份数据""></a></h2><p>方法一: 把 Github 备份库里的 <code>README.md</code> 文件内容改为 <code>backup</code></p><img width="970" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/c5b6bc4b-e69c-48ce-97d4-3f9be88515f3"><p>方法二: ssh 进去后,容器版本运行 <code>/dashboard/backup.sh</code>; 非容器版本运行 <code>/opt/nezha/dashboard/backup.sh</code></p><h2 id="自动还原备份" tabindex="-1">自动还原备份 <a class="header-anchor" href="#自动还原备份" aria-label="Permalink to "自动还原备份""></a></h2><ul><li>把需要还原的文件名改到 github 备份库里的 <code>README.md</code>,定时服务会每分钟检测更新,并把上次同步的文件名记录在本地 <code>/dbfile</code> 处以与在线的文件内容作比对</li></ul><p>下图为以还原文件名为 <code>dashboard-2023-04-23-13:08:37.tar.gz</code> 作示例</p><p><img src="https://user-images.githubusercontent.com/92626977/233822466-c24e94f6-ba8a-47c9-b77d-aa62a56cc929.png" alt="image"></p><h2 id="手动还原备份" tabindex="-1">手动还原备份 <a class="header-anchor" href="#手动还原备份" aria-label="Permalink to "手动还原备份""></a></h2><ul><li>ssh 进入容器后运行,github 备份库里的 tar.gz 文件名,格式: dashboard-2023-04-22-21:42:10.tar.gz</li></ul><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bash /dashboard/restore.sh <文件名></span></span></code></pre></div><img width="1209" alt="image" src="https://user-images.githubusercontent.com/92626977/23379Line truncated
|
||||
<span class="line"><span>|-- app # 哪吒面板主程序</span></span>
|
||||
<span class="line"><span>|-- argo.json # Argo 隧道 json 文件,记录着使用隧道的信息</span></span>
|
||||
<span class="line"><span>|-- argo.yml # Argo 隧道 yml 文件,用于在一同隧道下,根据不同域名来分流 web, gRPC 和 ssh 协议的作用</span></span>
|
||||
<span class="line"><span>|-- backup.sh # 备份数据脚本</span></span>
|
||||
<span class="line"><span>|-- restore.sh # 还原备份脚本</span></span>
|
||||
<span class="line"><span>|-- dbfile # 记录最新的还原或备份文件名</span></span>
|
||||
<span class="line"><span>|-- resource # 面板主题、语言和旗帜等资料的文件夹</span></span>
|
||||
<span class="line"><span>|-- data</span></span>
|
||||
<span class="line"><span>| |-- config.yaml # 哪吒面板的配置,如 Github OAuth2 / gRPC 域名 / 端口 / 是否启用 TLS 等信息</span></span>
|
||||
<span class="line"><span>| \`-- sqlite.db # SQLite 数据库文件,记录着面板设置的所有 severs 和 cron 等信息</span></span>
|
||||
<span class="line"><span>|-- entrypoint.sh # 主脚本,容器运行后执行</span></span>
|
||||
<span class="line"><span>|-- nezha.csr # SSL/TLS 证书签名请求</span></span>
|
||||
<span class="line"><span>|-- nezha.key # SSL/TLS 证书的私钥信息</span></span>
|
||||
<span class="line"><span>|-- nezha.pem # SSL/TLS 证书文件</span></span>
|
||||
<span class="line"><span>|-- cloudflared # Cloudflare Argo 隧道主程序</span></span>
|
||||
<span class="line"><span>|-- grpcwebproxy # gRPC 反代主程序</span></span>
|
||||
<span class="line"><span>\`-- nezha-agent # 哪吒客户端,用于监控本地 localhost</span></span></code></pre></div><h2 id="鸣谢下列作者的文章和项目" tabindex="-1">鸣谢下列作者的文章和项目: <a class="header-anchor" href="#鸣谢下列作者的文章和项目" aria-label="Permalink to "鸣谢下列作者的文章和项目:""></a></h2><ul><li>热心的朝阳群众 Robin,讨论哪吒服务端与客户端的关系,从而诞生了此项目</li><li>哪吒官网: <a href="https://nezha.wiki/" target="_blank" rel="noreferrer">https://nezha.wiki/</a> , TG 群: <a href="https://t.me/nezhamonitoring" target="_blank" rel="noreferrer">https://t.me/nezhamonitoring</a></li><li>共穷国际老中医: <a href="http://solitud.es/" target="_blank" rel="noreferrer">http://solitud.es/</a></li><li>Akkia's Blog: <a href="https://blog.akkia.moe/" target="_blank" rel="noreferrer">https://blog.akkia.moe/</a></li><li>胡桃's Blog: <a href="https://blog.xn--pn1aul.org/" target="_blank" rel="noreferrer">https://blog.萝莉.org/</a></li><li>HiFeng's Blog: <a href="https://www.hicairo.com/" target="_blank" rel="noreferrer">https://www.hicairo.com/</a></li><li>用 Cloudflare Tunnel 进行内网穿透: <a href="https://blog.outv.im/2021/cloudflared-tunnel/" target="_blank" rel="noreferrer">https://blog.outv.im/2021/cloudflared-tunnel/</a></li><li>如何给 GitHub Actions 添加自己的 Runner 主机: <a href="https://cloud.tencent.com/developer/article/1756690" target="_blank" rel="noreferrer">https://cloud.tencent.com/developer/article/1756690</a></li><li>github self-hosted runner 添加与启动: <a href="https://blog.csdn.net/sinat_32188225/article/details/125978331" target="_blank" rel="noreferrer">https://blog.csdn.net/sinat_32188225/article/details/125978331</a></li><li>如何从Docker镜像中导出文件: <a href="https://www.pkslow.com/archives/extract-files-from-docker-image" target="_blank" rel="noreferrer">https://www.pkslow.com/archives/extract-files-from-docker-image</a></li><li>grpcwebproxy: <a href="https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy" target="_blank" rel="noreferrer">https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy</a></li><li>Applexad 的哪吒官方改版的面板二进制文件: <a href="https://github.com/applexad/nezha-binary-build" target="_blank" rel="noreferrer">https://github.com/applexad/nezha-binary-build</a></li></ul><h2 id="免责声明" tabindex="-1">免责声明: <a class="header-anchor" href="#免责声明" aria-label="Permalink to "免责声明:""></a></h2><ul><li>本程序仅供学习了解, 非盈利目的,请于下载后 24 小时内删除, 不得用作任何商业用途, 文字、数据及图片均有所属版权, 如转载须注明来源。</li><li>使用本程序必循遵守部署免责声明。使用本程序必循遵守部署服务器所在地、所在国家和用户所在国家的法律法规, 程序作者不对使用者任何不当行为负责。</li></ul>`,89),l=[r];function i(o,c,h,p,d,g){return s(),e("div",null,l)}const m=a(n,[["render",i]]);export{u as __pageData,m as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as a,c as e,o as s,a4 as t}from"./chunks/framework.BmdFiWrL.js";const u=JSON.parse('{"title":"使用 Argo 隧道的哪吒服务端","description":"","frontmatter":{},"headers":[],"relativePath":"case/case5.md","filePath":"case/case5.md","lastUpdated":1719239024000}'),n={name:"case/case5.md"},r=t("",89),l=[r];function i(o,c,h,p,d,g){return s(),e("div",null,l)}const m=a(n,[["render",i]]);export{u as __pageData,m as default};
|
||||
@@ -1 +1 @@
|
||||
import{_ as e,o as t,c as a}from"./chunks/framework.44fd0451.js";const p=JSON.parse('{"title":"哪吒监控","titleTemplate":"社区项目","description":"","frontmatter":{"layout":"home","title":"哪吒监控","titleTemplate":"社区项目","hero":{"name":"哪吒监控社区项目","text":"社区贡献的相关项目","tagline":"为哪吒监控提供了更多扩展","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"查看项目 →","link":"/case/case1"}]},"features":[{"title":"提交项目","details":"我们欢迎您提交自己的项目,请加入TG群联系管理员了解相关事宜"},{"title":"注意事项","details":"所有项目均由社区成员贡献,请您知悉哪吒监控团队无法为社区项目承担包括且不限于:保修、可用性、安全性等责任"}]},"headers":[],"relativePath":"case/index.md","filePath":"case/index.md","lastUpdated":1718495592000}'),s={name:"case/index.md"};function n(i,r,c,o,d,l){return t(),a("div")}const _=e(s,[["render",n]]);export{p as __pageData,_ as default};
|
||||
import{_ as e,c as t,o as a}from"./chunks/framework.BmdFiWrL.js";const p=JSON.parse('{"title":"哪吒监控","titleTemplate":"社区项目","description":"","frontmatter":{"layout":"home","title":"哪吒监控","titleTemplate":"社区项目","hero":{"name":"哪吒监控社区项目","text":"社区贡献的相关项目","tagline":"为哪吒监控提供了更多扩展","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"查看项目 →","link":"/case/case1"}]},"features":[{"title":"提交项目","details":"我们欢迎您提交自己的项目,请加入TG群联系管理员了解相关事宜"},{"title":"注意事项","details":"所有项目均由社区成员贡献,请您知悉哪吒监控团队无法为社区项目承担包括且不限于:保修、可用性、安全性等责任"}]},"headers":[],"relativePath":"case/index.md","filePath":"case/index.md","lastUpdated":1719239024000}'),s={name:"case/index.md"};function n(i,r,c,o,d,l){return a(),t("div")}const _=e(s,[["render",n]]);export{p as __pageData,_ as default};
|
||||
@@ -1 +1 @@
|
||||
import{_ as e,o as t,c as a}from"./chunks/framework.44fd0451.js";const p=JSON.parse('{"title":"哪吒监控","titleTemplate":"社区项目","description":"","frontmatter":{"layout":"home","title":"哪吒监控","titleTemplate":"社区项目","hero":{"name":"哪吒监控社区项目","text":"社区贡献的相关项目","tagline":"为哪吒监控提供了更多扩展","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"查看项目 →","link":"/case/case1"}]},"features":[{"title":"提交项目","details":"我们欢迎您提交自己的项目,请加入TG群联系管理员了解相关事宜"},{"title":"注意事项","details":"所有项目均由社区成员贡献,请您知悉哪吒监控团队无法为社区项目承担包括且不限于:保修、可用性、安全性等责任"}]},"headers":[],"relativePath":"case/index.md","filePath":"case/index.md","lastUpdated":1718495592000}'),s={name:"case/index.md"};function n(i,r,c,o,d,l){return t(),a("div")}const _=e(s,[["render",n]]);export{p as __pageData,_ as default};
|
||||
import{_ as e,c as t,o as a}from"./chunks/framework.BmdFiWrL.js";const p=JSON.parse('{"title":"哪吒监控","titleTemplate":"社区项目","description":"","frontmatter":{"layout":"home","title":"哪吒监控","titleTemplate":"社区项目","hero":{"name":"哪吒监控社区项目","text":"社区贡献的相关项目","tagline":"为哪吒监控提供了更多扩展","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"查看项目 →","link":"/case/case1"}]},"features":[{"title":"提交项目","details":"我们欢迎您提交自己的项目,请加入TG群联系管理员了解相关事宜"},{"title":"注意事项","details":"所有项目均由社区成员贡献,请您知悉哪吒监控团队无法为社区项目承担包括且不限于:保修、可用性、安全性等责任"}]},"headers":[],"relativePath":"case/index.md","filePath":"case/index.md","lastUpdated":1719239024000}'),s={name:"case/index.md"};function n(i,r,c,o,d,l){return a(),t("div")}const _=e(s,[["render",n]]);export{p as __pageData,_ as default};
|
||||
@@ -1,17 +0,0 @@
|
||||
import{d as fo,ai as mo,x as po,p as vo,w as ho,o as yo,c as go}from"./framework.44fd0451.js";import{u as bo}from"./theme.ccb07a11.js";/*! @docsearch/js 3.5.1 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */function cn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function I(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?cn(Object(n),!0).forEach(function(r){_o(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):cn(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Be(t){return Be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Be(t)}function _o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qt(){return qt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},qt.apply(this,arguments)}function Oo(t,e){if(t==null)return{};var n,r,o=function(a,u){if(a==null)return{};var c,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)c=m[s],u.indexOf(c)>=0||(l[c]=a[c]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function st(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var o=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(o!=null){var i,a,u=[],c=!0,s=!1;try{for(o=o.call(n);!(c=(i=o.next()).done)&&(u.push(i.value),!r||u.length!==r);c=!0);}catch(l){s=!0,a=l}finally{try{c||o.return==null||o.return()}finally{if(s)throw a}}return u}}(t,e)||yr(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ft(t){return function(e){if(Array.isArray(e))return Lt(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||yr(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function yr(t,e){if(t){if(typeof t=="string")return Lt(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Lt(t,e):void 0}}function Lt(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var w,Ee,gr,un,br,mt={},Qt=[],So=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function $(t,e){for(var n in e)t[n]=e[n];return t}function _r(t){var e=t.parentNode;e&&e.removeChild(t)}function V(t,e,n){var r,o,i,a=arguments,u={};for(i in e)i=="key"?r=e[i]:i=="ref"?o=e[i]:u[i]=e[i];if(arguments.length>3)for(n=[n],i=3;i<arguments.length;i++)n.push(a[i]);if(n!=null&&(u.children=n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)u[i]===void 0&&(u[i]=t.defaultProps[i]);return Pe(t,u,r,o,null)}function Pe(t,e,n,r,o){var i={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:o??++w.__v};return w.vnode!=null&&w.vnode(i),i}function X(t){return t.children}function W(t,e){this.props=t,this.context=e}function Ve(t,e){if(e==null)return t.__?Ve(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Ve(t):null}function Or(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Or(t)}}function Mt(t){(!t.__d&&(t.__d=!0)&&Ee.push(t)&&!pt.__r++||un!==w.debounceRendering)&&((un=w.debounceRendering)||gr)(pt)}function pt(){for(var t;pt.__r=Ee.length;)t=Ee.sort(function(e,n){return e.__v.__b-n.__v.__b}),Ee=[],t.some(function(e){var n,r,o,i,a,u;e.__d&&(a=(i=(n=e).__v).__e,(u=n.__P)&&(r=[],(o=$({},i)).__v=i.__v+1,Zt(u,i,o,n.__n,u.ownerSVGElement!==void 0,i.__h!=null?[a]:null,r,a??Ve(i),i.__h),Er(r,i),i.__e!=a&&Or(i)))})}function Sr(t,e,n,r,o,i,a,u,c,s){var l,m,p,v,d,h,y,b=r&&r.__k||Qt,_=b.length;for(n.__k=[],l=0;l<e.length;l++)if((v=n.__k[l]=(v=e[l])==null||typeof v=="boolean"?null:typeof v=="string"||typeof v=="number"?Pe(null,v,null,null,v):Array.isArray(v)?Pe(X,{children:v},null,null,null):v.__b>0?Pe(v.type,v.props,v.key,null,v.__v):v)!=null){if(v.__=n,v.__b=n.__b+1,(p=b[l])===null||p&&v.key==p.key&&v.type===p.type)b[l]=void 0;else for(m=0;m<_;m++){if((p=b[m])&&v.key==p.key&&v.type===p.type){b[m]=void 0;break}p=null}Zt(t,v,p=p||mt,o,i,a,u,c,s),d=v.__e,(m=v.ref)&&p.ref!=m&&(y||(y=[]),p.ref&&y.push(p.ref,null,v),y.push(m,v.__c||d,v)),d!=null?(h==null&&(h=d),typeof v.type=="function"&&v.__k!=null&&v.__k===p.__k?v.__d=c=wr(v,c,t):c=jr(t,v,p,b,d,c),s||n.type!=="option"?typeof n.type=="function"&&(n.__d=c):t.value=""):c&&p.__e==c&&c.parentNode!=t&&(c=Ve(p))}for(n.__e=h,l=_;l--;)b[l]!=null&&(typeof n.type=="function"&&b[l].__e!=null&&b[l].__e==n.__d&&(n.__d=Ve(r,l+1)),Ir(b[l],b[l]));if(y)for(l=0;l<y.length;l++)Pr(y[l],y[++l],y[++l])}function wr(t,e,n){var r,o;for(r=0;r<t.__k.length;r++)(o=t.__k[r])&&(o.__=t,e=typeof o.type=="function"?wr(o,e,n):jr(n,o,o,t.__k,o.__e,e));return e}function J(t,e){return e=e||[],t==null||typeof t=="boolean"||(Array.isArray(t)?t.some(function(n){J(n,e)}):e.push(t)),e}function jr(t,e,n,r,o,i){var a,u,c;if(e.__d!==void 0)a=e.__d,e.__d=void 0;else if(n==null||o!=i||o.parentNode==null)e:if(i==null||i.parentNode!==t)t.appendChild(o),a=null;else{for(u=i,c=0;(u=u.nextSibling)&&c<r.length;c+=2)if(u==o)break e;t.insertBefore(o,i),a=i}return a!==void 0?a:o.nextSibling}function ln(t,e,n){e[0]==="-"?t.setProperty(e,n):t[e]=n==null?"":typeof n!="number"||So.test(e)?n:n+"px"}function Ze(t,e,n,r,o){var i;e:if(e==="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||ln(t.style,e,"");if(n)for(e in n)r&&n[e]===r[e]||ln(t.style,e,n[e])}else if(e[0]==="o"&&e[1]==="n")i=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?r||t.addEventListener(e,i?fn:sn,i):t.removeEventListener(e,i?fn:sn,i);else if(e!=="dangerouslySetInnerHTML"){if(o)e=e.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if(e!=="href"&&e!=="list"&&e!=="form"&&e!=="download"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n!=null&&(n!==!1||e[0]==="a"&&e[1]==="r")?t.setAttribute(e,n):t.removeAttribute(e))}}function sn(t){this.l[t.type+!1](w.event?w.event(t):t)}function fn(t){this.l[t.type+!0](w.event?w.event(t):t)}function Zt(t,e,n,r,o,i,a,u,c){var s,l,m,p,v,d,h,y,b,_,S,O=e.type;if(e.constructor!==void 0)return null;n.__h!=null&&(c=n.__h,u=e.__e=n.__e,e.__h=null,i=[u]),(s=w.__b)&&s(e);try{e:if(typeof O=="function"){if(y=e.props,b=(s=O.contextType)&&r[s.__c],_=s?b?b.props.value:s.__:r,n.__c?h=(l=e.__c=n.__c).__=l.__E:("prototype"in O&&O.prototype.rend
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Dn(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Fo(t,e){if(t==null)return{};var n,r,o=function(a,u){if(a==null)return{};var c,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)c=m[s],u.indexOf(c)>=0||(l[c]=a[c]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var Bo=f.forwardRef(function(t,e){var n=t.translations,r=n===void 0?{}:n,o=Fo(t,Ho),i=r.buttonText,a=i===void 0?"Search":i,u=r.buttonAriaLabel,c=u===void 0?"Search":u,s=Uo(kr(null),2),l=s[0],m=s[1];return Cr(function(){typeof navigator<"u"&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?m("⌘"):m("Ctrl"))},[]),f.createElement("button",Vt({type:"button",className:"DocSearch DocSearch-Button","aria-label":c},o,{ref:e}),f.createElement("span",{className:"DocSearch-Button-Container"},f.createElement(Hr,null),f.createElement("span",{className:"DocSearch-Button-Placeholder"},a)),f.createElement("span",{className:"DocSearch-Button-Keys"},l!==null&&f.createElement(f.Fragment,null,f.createElement("kbd",{className:"DocSearch-Button-Key"},l==="Ctrl"?f.createElement(Mo,null):l),f.createElement("kbd",{className:"DocSearch-Button-Key"},"K"))))});function Ur(t,e){var n=void 0;return function(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];n&&clearTimeout(n),n=setTimeout(function(){return t.apply(void 0,o)},e)}}function Ke(t){return t.reduce(function(e,n){return e.concat(n)},[])}var Vo=0;function Wt(t){return t.collections.length===0?0:t.collections.reduce(function(e,n){return e+n.items.length},0)}function kn(t){return t!==Object(t)}function Fr(t,e){if(t===e)return!0;if(kn(t)||kn(e)||typeof t=="function"||typeof e=="function")return t===e;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n=0,r=Object.keys(t);n<r.length;n++){var o=r[n];if(!(o in e)||!Fr(t[o],e[o]))return!1}return!0}var vt=function(){},Wo=[{segment:"autocomplete-core",version:"1.9.3"}];function An(t){var e=t.item,n=t.items;return{index:e.__autocomplete_indexName,items:[e],positions:[1+n.findIndex(function(r){return r.objectID===e.objectID})],queryID:e.__autocomplete_queryID,algoliaSource:["autocomplete"]}}function Ko(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var o=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(o!=null){var i,a,u,c,s=[],l=!0,m=!1;try{if(u=(o=o.call(n)).next,r===0){if(Object(o)!==o)return;l=!1}else for(;!(l=(i=u.call(o)).done)&&(s.push(i.value),s.length!==r);l=!0);}catch(p){m=!0,a=p}finally{try{if(!l&&o.return!=null&&(c=o.return(),Object(c)!==c))return}finally{if(m)throw a}}return s}}(t,e)||function(n,r){if(n){if(typeof n=="string")return Cn(n,r);var o=Object.prototype.toString.call(n).slice(8,-1);if(o==="Object"&&n.constructor&&(o=n.constructor.name),o==="Map"||o==="Set")return Array.from(n);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Cn(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Cn(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var zo=["items"],$o=["items"];function Ie(t){return Ie=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ie(t)}function Ye(t){return function(e){if(Array.isArray(e))return It(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||function(e,n){if(e){if(typeof e=="string")return It(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return It(e,n)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function It(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Br(t,e){if(t==null)return{};var n,r,o=function(a,u){if(a==null)return{};var c,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)c=m[s],u.indexOf(c)>=0||(l[c]=a[c]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function xn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function ve(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?xn(Object(n),!0).forEach(function(r){Jo(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xn(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Jo(t,e,n){return(e=function(r){var o=function(i,a){if(Ie(i)!=="object"||i===null)return i;var u=i[Symbol.toPrimitive];if(u!==void 0){var c=u.call(i,a||"default");if(Ie(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(r,"string");return Ie(o)==="symbol"?o:String(o)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qo(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20,n=[],r=0;r<t.objectIDs.length;r+=e)n.push(ve(ve({},t),{},{objectIDs:t.objectIDs.slice(r,r+e)}));return n}function Ge(t){return t.map(function(e){var n=e.items,r=Br(e,zo);return ve(ve({},r),{},{objectIDs:(n==null?void 0:n.map(function(o){return o.objectID}))||r.objectIDs})})}function Zo(t){var e,n,r,o=(e=Ko((t.version||"").split(".").map(Number),2),n=e[0],r=e[1],n>=3||n===2&&r>=4||n===1&&r>=10);function i(a,u,c){if(o&&c!==void 0){var s=c[0].__autocomplete_algoliaCredentials,l={"X-Algolia-Application-Id":s.appId,"X-Algolia-API-Key":s.apiKey};t.apply(void 0,[a].concat(Ye(u),[{headers:l}]))}else t.apply(void 0,[a].concat(Ye(u)))}return{init:function(a,u){t("init",{appId:a,apiKey:u})},setUserToken:function(a){t("setUserToken",a)},clickedObjectIDsAfterSearch:function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];u.length>0&&i("clickedObjectIDsAfterSearch",Ge(u),u[0].items)},clickedObjectIDs:function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];u.length>0&&i("clickedObjectIDs",Ge(u),u[0].items)},clickedFilters:function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];u.length>0&&t.apply(void 0,["clickedFilters"].concat(u))},convertedObjectIDsAfterSearch:function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];u.length>0&&i("convertedObjectIDsAfterSearch",Ge(u),u[0].items)},convertedObjectIDs:function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];u.length>0&&i("convertedObjectIDs",Ge(u),u[0].items)},convertedFilters:function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];u.length>0&&t.apply(void 0,["convertedFilters"].concat(u))},viewedObjectIDs:function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];u.length>0&&u.reduce(function(s,l){var m=l.items,p=Br(l,$o);return[].concat(Ye(s),Ye(Qo(ve(ve({},p),{},{objectIDs:(m==null?void 0:m.map(function(v){return v.objectID}))||p.objectIDs})).map(function(v){return{items:m,payload:v}})))},[]).forEach(function(s){var l=s.items;return i("viewedObjectIDs",[s.payload],l)})},viewedFilters:function(){for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];u.length>0&&t.apply(void 0,["viewedFilters"].concat(u))}}}function Yo(t){var e=t.items.reduce(function(n,r){var o;return n[r.__autocomplete_indexName]=((o=n[r.__autocomplete_indexName])!==null&&o!==void 0?o:[]).concat(r),n},{});return Object.keys(e).map(function(n){return{index:n,items:e[n],algoliaSource:["autocomplete"]}})}function Dt(t){return t.objectID&&t.__autocomplete_indexName&&t.__autocomplete_queryID}function De(t){return De=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},De(t)}function ae(t){return function(e){if(Array.isArray(e))return kt(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||function(e,n){if(e){if(typeof e=="string")return kt(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function kt(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Nn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function G(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Nn(Object(n),!0).forEach(function(r){Go(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nn(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Go(t,e,n){return(e=function(r){var o=function(i,a){if(De(i)!=="object"||i===null)return i;var u=i[Symbol.toPrimitive];if(u!==void 0){var c=u.call(i,a||"default");if(De(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(r,"string");return De(o)==="symbol"?o:String(o)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Xo="https://cdn.jsdelivr.net/npm/search-insights@".concat("2.6.0","/dist/search-insights.min.js"),ei=Ur(function(t){var e=t.onItemsChange,n=t.items,r=t.insights,o=t.state;e({insights:r,insightsEvents:Yo({items:n}).map(function(i){return G({eventName:"Items Viewed"},i)}),state:o})},400);function ti(t){var e=function(l){return G({onItemsChange:function(m){var p=m.insights,v=m.insightsEvents;p.viewedObjectIDs.apply(p,ae(v.map(function(d){return G(G({},d),{},{algoliaSource:[].concat(ae(d.algoliaSource||[]),["autocomplete-internal"])})})))},onSelect:function(m){var p=m.insights,v=m.insightsEvents;p.clickedObjectIDsAfterSearch.apply(p,ae(v.map(function(d){return G(G({},d),{},{algoliaSource:[].concat(ae(d.algoliaSource||[]),["autocomplete-internal"])})})))},onActive:vt},l)}(t),n=e.insightsClient,r=e.onItemsChange,o=e.onSelect,i=e.onActive,a=n;n||function(l){typeof window<"u"&&l({window})}(function(l){var m=l.window,p=m.AlgoliaAnalyticsObject||"aa";typeof p=="string"&&(a=m[p]),a||(m.AlgoliaAnalyticsObject=p,m[p]||(m[p]=function(){m[p].queue||(m[p].queue=[]);for(var v=arguments.length,d=new Array(v),h=0;h<v;h++)d[h]=arguments[h];m[p].queue.push(d)}),m[p].version="2.6.0",a=m[p],function(v){var d="[Autocomplete]: Could not load search-insights.js. Please load it manually following https://alg.li/insights-autocomplete";try{var h=v.document.createElement("script");h.async=!0,h.src=Xo,h.onerror=function(){console.error(d)},document.body.appendChild(h)}catch{console.error(d)}}(m))});var u=Zo(a),c={current:[]},s=Ur(function(l){var m=l.state;if(m.isOpen){var p=m.collections.reduce(function(v,d){return[].concat(ae(v),ae(d.items))},[]).filter(Dt);Fr(c.current.map(function(v){return v.objectID}),p.map(function(v){return v.objectID}))||(c.current=p,p.length>0&&ei({onItemsChange:r,items:p,insights:u,state:m}))}},0);return{name:"aa.algoliaInsightsPlugin",subscribe:function(l){var m=l.setContext,p=l.onSelect,v=l.onActive;a("addAlgoliaAgent","insights-plugin"),m({algoliaInsightsPlugin:{__algoliaSearchParameters:{clickAnalytics:!0},insights:u}}),p(function(d){var h=d.item,y=d.state,b=d.event;Dt(h)&&o({state:y,event:b,insights:u,item:h,insightsEvents:[G({eventName:"Item Selected"},An({item:h,items:c.current}))]})}),v(function(d){var h=d.item,y=d.state,b=d.event;Dt(h)&&i({state:y,event:b,insights:u,item:h,insightsEvents:[G({eventName:"Item Active"},An({item:h,items:c.current}))]})})},onStateChange:function(l){var m=l.state;s({state:m})},__autocomplete_pluginOptions:t}}function ut(t,e){var n=e;return{then:function(r,o){return ut(t.then(Xe(r,n,t),Xe(o,n,t)),n)},catch:function(r){return ut(t.catch(Xe(r,n,t)),n)},finally:function(r){return r&&n.onCancelList.push(r),ut(t.finally(Xe(r&&function(){return n.onCancelList=[],r()},n,t)),n)},cancel:function(){n.isCanceled=!0;var r=n.onCancelList;n.onCancelList=[],r.forEach(function(o){o()})},isCanceled:function(){return n.isCanceled===!0}}}function Tn(t){return ut(t,{isCanceled:!1,onCancelList:[]})}function Xe(t,e,n){return t?function(r){return e.isCanceled?r:t(r)}:n}function Rn(t,e,n,r){if(!n)return null;if(t<0&&(e===null||r!==null&&e===0))return n+t;var o=(e===null?-1:e)+t;return o<=-1||o>=n?r===null?null:0:o}function qn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Ln(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?qn(Object(n),!0).forEach(function(r){ni(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):qn(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ni(t,e,n){re
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function At(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Un(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function ce(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Un(Object(n),!0).forEach(function(r){ui(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Un(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ui(t,e,n){return(e=function(r){var o=function(i,a){if(xe(i)!=="object"||i===null)return i;var u=i[Symbol.toPrimitive];if(u!==void 0){var c=u.call(i,a||"default");if(xe(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(r,"string");return xe(o)==="symbol"?o:String(o)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function li(t,e){var n,r=typeof window<"u"?window:{},o=t.plugins||[];return ce(ce({debug:!1,openOnFocus:!1,placeholder:"",autoFocus:!1,defaultActiveItemId:null,stallThreshold:300,insights:!1,environment:r,shouldPanelOpen:function(i){return Wt(i.state)>0},reshape:function(i){return i.sources}},t),{},{id:(n=t.id)!==null&&n!==void 0?n:"autocomplete-".concat(Vo++),plugins:o,initialState:ce({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},t.initialState),onStateChange:function(i){var a;(a=t.onStateChange)===null||a===void 0||a.call(t,i),o.forEach(function(u){var c;return(c=u.onStateChange)===null||c===void 0?void 0:c.call(u,i)})},onSubmit:function(i){var a;(a=t.onSubmit)===null||a===void 0||a.call(t,i),o.forEach(function(u){var c;return(c=u.onSubmit)===null||c===void 0?void 0:c.call(u,i)})},onReset:function(i){var a;(a=t.onReset)===null||a===void 0||a.call(t,i),o.forEach(function(u){var c;return(c=u.onReset)===null||c===void 0?void 0:c.call(u,i)})},getSources:function(i){return Promise.all([].concat(ci(o.map(function(a){return a.getSources})),[t.getSources]).filter(Boolean).map(function(a){return function(u,c){var s=[];return Promise.resolve(u(c)).then(function(l){return Promise.all(l.filter(function(m){return!!m}).map(function(m){if(m.sourceId,s.includes(m.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(m.sourceId)," is not unique."));s.push(m.sourceId);var p={getItemInputValue:function(d){return d.state.query},getItemUrl:function(){},onSelect:function(d){(0,d.setIsOpen)(!1)},onActive:vt,onResolve:vt};Object.keys(p).forEach(function(d){p[d].__default=!0});var v=Ln(Ln({},p),m);return Promise.resolve(v)}))})}(a,i)})).then(function(a){return Ke(a)}).then(function(a){return a.map(function(u){return ce(ce({},u),{},{onSelect:function(c){u.onSelect(c),e.forEach(function(s){var l;return(l=s.onSelect)===null||l===void 0?void 0:l.call(s,c)})},onActive:function(c){u.onActive(c),e.forEach(function(s){var l;return(l=s.onActive)===null||l===void 0?void 0:l.call(s,c)})},onResolve:function(c){u.onResolve(c),e.forEach(function(s){var l;return(l=s.onResolve)===null||l===void 0?void 0:l.call(s,c)})}})})})},navigator:ce({navigate:function(i){var a=i.itemUrl;r.location.assign(a)},navigateNewTab:function(i){var a=i.itemUrl,u=r.open(a,"_blank","noopener");u==null||u.focus()},navigateNewWindow:function(i){var a=i.itemUrl;r.open(a,"_blank","noopener")}},t.navigator)})}function Ne(t){return Ne=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ne(t)}function Fn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function tt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Fn(Object(n),!0).forEach(function(r){Vr(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fn(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Vr(t,e,n){return(e=function(r){var o=function(i,a){if(Ne(i)!=="object"||i===null)return i;var u=i[Symbol.toPrimitive];if(u!==void 0){var c=u.call(i,a||"default");if(Ne(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(r,"string");return Ne(o)==="symbol"?o:String(o)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Te(t){return Te=typeof Symbol=="function"&&typeof
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ct(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function nt(t){return!!t.execute}function fi(t,e,n){if(o=t,!!(o!=null&&o.execute)){var r=t.requesterId==="algolia"?Object.assign.apply(Object,[{}].concat(Wr(Object.keys(n.context).map(function(i){var a;return(a=n.context[i])===null||a===void 0?void 0:a.__algoliaSearchParameters})))):{};return ue(ue({},t),{},{requests:t.queries.map(function(i){return{query:t.requesterId==="algolia"?ue(ue({},i),{},{params:ue(ue({},r),i.params)}):i,sourceId:e,transformResponse:t.transformResponse}})})}var o;return{items:t,sourceId:e}}function mi(t){var e=t.reduce(function(n,r){if(!nt(r))return n.push(r),n;var o=r.searchClient,i=r.execute,a=r.requesterId,u=r.requests,c=n.find(function(m){return nt(r)&&nt(m)&&m.searchClient===o&&!!a&&m.requesterId===a});if(c){var s;(s=c.items).push.apply(s,Wr(u))}else{var l={execute:i,requesterId:a,items:u,searchClient:o};n.push(l)}return n},[]).map(function(n){if(!nt(n))return Promise.resolve(n);var r=n,o=r.execute,i=r.items;return o({searchClient:r.searchClient,requests:i})});return Promise.all(e).then(function(n){return Ke(n)})}function pi(t,e,n){return e.map(function(r){var o,i=t.filter(function(s){return s.sourceId===r.sourceId}),a=i.map(function(s){return s.items}),u=i[0].transformResponse,c=u?u({results:o=a,hits:o.map(function(s){return s.hits}).filter(Boolean),facetHits:o.map(function(s){var l;return(l=s.facetHits)===null||l===void 0?void 0:l.map(function(m){return{label:m.value,count:m.count,_highlightResult:{label:{value:m.highlighted}}}})}).filter(Boolean)}):a;return r.onResolve({source:r,results:a,items:c,state:n.getState()}),c.every(Boolean),'The `getItems` function from source "'.concat(r.sourceId,'" must return an array of items but returned ').concat(JSON.stringify(void 0),`.
|
||||
|
||||
Did you forget to return items?
|
||||
|
||||
See: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems`),{source:r,items:c}})}function Re(t){return Re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Re(t)}var vi=["event","nextState","props","query","refresh","store"];function Vn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function Oe(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Vn(Object(n),!0).forEach(function(r){di(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vn(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function di(t,e,n){return(e=function(r){var o=function(i,a){if(Re(i)!=="object"||i===null)return i;var u=i[Symbol.toPrimitive];if(u!==void 0){var c=u.call(i,a||"default");if(Re(c)!=="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(r,"string");return Re(o)==="symbol"?o:String(o)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function hi(t,e){if(t==null)return{};var n,r,o=function(a,u){if(a==null)return{};var c,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)c=m[s],u.indexOf(c)>=0||(l[c]=a[c]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var Wn,xt,rt,Se=null,Kn=(Wn=-1,xt=-1,rt=void 0,function(t){var e=++Wn;return Promise.resolve(t).then(function(n){return rt&&e<xt?rt:(xt=e,rt=n,n)})});function se(t){var e=t.event,n=t.nextState,r=n===void 0?{}:n,o=t.props,i=t.query,a=t.refresh,u=t.store,c=hi(t,vi);Se&&o.environment.clearTimeout(Se);var s=c.setCollections,l=c.setIsOpen,m=c.setQuery,p=c.setActiveItemId,v=c.setStatus;if(m(i),p(o.defaultActiveItemId),!i&&o.openOnFocus===!1){var d,h=u.getState().collections.map(function(_){return Oe(Oe({},_),{},{items:[]})});v("idle"),s(h),l((d=r.isOpen)!==null&&d!==void 0?d:o.shouldPanelOpen({state:u.getState()}));var y=Tn(Kn(h).then(function(){return Promise.resolve()}));return u.pendingRequests.add(y)}v("loading"),Se=o.environment.setTimeout(function(){v("stalled")},o.stallThreshold);var b=Tn(Kn(o.getSources(Oe({query:i,refresh:a,state:u.getState()},c)).then(function(_){return Promise.all(_.map(function(S){return Promise.resolve(S.getItems(Oe({query:i,refresh:a,state:u.getState()},c))).then(function(O){return fi(O,S.sourceId,u.getState())})})).then(mi).then(function(S){return pi(S,_,u)}).then(function(S){return function(O){var g=O.collections,P=O.props,C=O.state,L=g.reduce(function(k,N){return tt(tt({},k),{},Vr({},N.source.sourceId,tt(tt({},N.source),{},{getItems:function(){return Ke(N.items)}})))},{}),x=P.plugins.reduce(function(k,N){return N.reshape?N.reshape(k):k},{sourcesBySourceId:L,state:C}).sourcesBySourceId;return Ke(P.reshape({sourcesBySourceId:x,sources:Object.values(x),state:C})).filter(Boolean).map(function(k){return{source:k,items:k.getItems()}})}({collections:S,props:o,state:u.getState()})})}))).then(function(_){var S;v("idle"),s(_);var O=o.shouldPanelOpen({state:u.getState()});l((S=r.isOpen)!==null&&S!==void 0?S:o.openOnFocus&&!i&&O||O);var g=fe(u.getState());if(u.getState().activeItemId!==null&&g){var P=g.item,C=g.itemInputValue,L=g.itemUrl,x=g.source;x.onActive(Oe({event:e,item:P,itemInputValue:C,itemUrl:L,refresh:a,source:x,state:u.getState()},c))}}).finally(function(){v("idle"),Se&&o.environment.clearTimeout(Se)});return u.pendingRequests.add(b)}function qe(t){return qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qe(t)}var yi=["event","props","refresh","store"];function zn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function te(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?zn(Object(n),!0).forEach(function(r){gi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):zn(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function gi(t,e,n){return(e=function(r){var o=function(i,a){if(qe(i)!=="object"||i===null)return i;var u=i[Symbol.toPrimitive];if(u!==void 0){var c=u.call(i,a||"default");if(qe(c)!=="object")return c;throw new TypeError("@@toPrimitive m
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Nt(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Zi(t,e){if(t==null)return{};var n,r,o=function(a,u){if(a==null)return{};var c,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)c=m[s],u.indexOf(c)>=0||(l[c]=a[c]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function Yi(t){var e=t.translations,n=e===void 0?{}:e,r=Zi(t,Ji),o=n.noResultsText,i=o===void 0?"No results for":o,a=n.suggestedQueryText,u=a===void 0?"Try searching for":a,c=n.reportMissingResultsText,s=c===void 0?"Believe this query should return results?":c,l=n.reportMissingResultsLinkText,m=l===void 0?"Let us know.":l,p=r.state.context.searchSuggestions;return f.createElement("div",{className:"DocSearch-NoResults"},f.createElement("div",{className:"DocSearch-Screen-Icon"},f.createElement(zi,null)),f.createElement("p",{className:"DocSearch-Title"},i,' "',f.createElement("strong",null,r.state.query),'"'),p&&p.length>0&&f.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},f.createElement("p",{className:"DocSearch-Help"},u,":"),f.createElement("ul",null,p.slice(0,3).reduce(function(v,d){return[].concat(Qi(v),[f.createElement("li",{key:d},f.createElement("button",{className:"DocSearch-Prefill",key:d,type:"button",onClick:function(){r.setQuery(d.toLowerCase()+" "),r.refresh(),r.inputRef.current.focus()}},d))])},[]))),r.getMissingResultsUrl&&f.createElement("p",{className:"DocSearch-Help"},"".concat(s," "),f.createElement("a",{href:r.getMissingResultsUrl({query:r.state.query}),target:"_blank",rel:"noopener noreferrer"},m)))}var Gi=["hit","attribute","tagName"];function Xn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function er(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Xn(Object(n),!0).forEach(function(r){Xi(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xn(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Xi(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ea(t,e){if(t==null)return{};var n,r,o=function(a,u){if(a==null)return{};var c,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)c=m[s],u.indexOf(c)>=0||(l[c]=a[c]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function tr(t,e){return e.split(".").reduce(function(n,r){return n!=null&&n[r]?n[r]:null},t)}function le(t){var e=t.hit,n=t.attribute,r=t.tagName;return V(r===void 0?"span":r,er(er({},ea(t,Gi)),{},{dangerouslySetInnerHTML:{__html:tr(e,"_snippetResult.".concat(n,".value"))||tr(e,n)}}))}function nr(t,e){return function(n){if(Array.isArray(n))return n}(t)||function(n,r){var o=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(o!=null){var i,a,u=[],c=!0,s=!1;try{for(o=o.call(n);!(c=(i=o.next()).done)&&(u.push(i.value),!r||u.length!==r);c=!0);}catch(l){s=!0,a=l}finally{try{c||o.return==null||o.return()}finally{if(s)throw a}}return u}}(t,e)||function(n,r){if(n){if(typeof n=="string")return rr(n,r);var o=Object.prototype.toString.call(n).slice(8,-1);if(o==="Object"&&n.constructor&&(o=n.constructor.name),o==="Map"||o==="Set")return Array.from(n);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return rr(n,r)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function rr(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function dt(){return dt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},dt.apply(this,arguments)}function zt(t){return t.collection&&t.collection.items.length!==0?f.createElement("section",{className:"DocSearch-Hits"},f.createElement("div",{className:"DocSearch-Hit-source"},t.title),f.createElement("ul",t.getListProps(),t.collection.items.map(function(e,n){return f.createElement(ta,dt({key:[t.title,e.objectID].join(":"),item:e,index:n},t))}))):null}function ta(t){var e=t.item,n=t.index,r=t.renderIcon,o=t.renderAction,i=t.getItemProps,a=t.onItemClick,u=t.collection,c=t.hitComponent,s=nr(f.useState(!1),2),l=s[0],m=s[1],p=nr(f.useState(!1),2),v=p[0],d=p[1],h=f.useRef(null),y=c;return f.createElement("li",dt({className:["DocSearch-Hit",e.__docsearch_parent&&"DocSearch-Hit--Child",l&&"DocSearch-Hit--deleting",v&&"DocSearch-Hit--favoriting"].filter(Boolean).join(" "),onTransitionEnd:function(){h.current&&h.current()}},i({item:e,source:u.source,onClick:function(b){a(e,b)}})),f.createElement(y,{hit:e},f.createElement("div",{className:"DocSearch-Hit-Container"},r({item:e,index:n}),e.hierarchy[e.type]&&e.type==="lvl1"&&f.createElement("div",{className:"DocSearch-Hit-content-wrapper"},f.createElement(le,{className:"DocSearch-Hit-title",hit:e,attribute:"hierarchy.lvl1"}),e.content&&f.createElement(le,{className:"DocSearch-Hit-path",hit:e,attribute:"content"})),e.hierarchy[e.type]&&(e.type==="lvl2"||e.type==="lvl3"||e.type==="lvl4"||e.type==="lvl5"||e.type==="lvl6")&&f.createElement("div",{className:"DocSearch-Hit-content-wrapper"},f.createElement(le,{className:"DocSearch-Hit-title",hit:e,attribute:"hierarchy.".concat(e.type)}),f.createElement(le,{className:"DocSearch-Hit-path",hit:e,attribute:"hierarchy.lvl1"})),e.type==="content"&&f.createElement("div",{className:"DocSearch-Hit-content-wrapper"},f.createElement(le,{className:"DocSearch-Hit-title",hit:e,attribute:"content"}),f.createElement(le,{className:"DocSearch-Hit-path",hit:e,attribute:"hierarchy.lvl1"})),o({item:e,runDeleteTransition:function(b){m(!0),h.current=b},runFavoriteTransition:function(b){d(!0),h.current=b}}))))}function or(t,e,n){return t.reduce(function(r,o){var i=e(o);return r.hasOwnProperty(i)||(r[i]=[]),r[i].length<(n||5)&&r[i].push(o),r},{})}function ir(t){return t}function it(t){return t.button===1||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}function na(){}var zr=/(<mark>|<\/mark>)/g,ra=RegExp(zr.source);function $r(t){var e,n,r,o,i,a=t;if(!a.__docsearch_parent&&!t._highlightResult)return t.hierarchy.lvl0;var u=((a.__docsearch_parent?(e=a.__docsearch_parent)===null||e===void 0||(n=e._highlightResult)===null||n===void 0||(r=n.hierarchy)===null||r===void 0?void 0:r.lvl0:(o=t._highlightResult)===null||o===void 0||(i=o.hierarchy)===null||i===void 0?void 0:i.lvl0)||{}).value;return u&&ra.test(u)?u.replace(zr,""):u}function $t(){return $t=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},$t.apply(this,arguments)}function oa(t){return f.createElement("div",{className:"DocSearch-Dropdown-Container"},t.state.collections.map(function(e){if(e.items.length===0)return null;var n=$r(e.items[0]);return f.createElement(zt,$t({},t,{key:e.source.sourceId,title:n,collection:e,renderIcon:function(r){var o,i=r.item,a=r.index;return f.createElement(f.Fragment,null,i.__docsearch_parent&&f.createElement("svg",{className:"DocSearch-Hit-Tree",viewBox:"0 0 24 54"},f.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},i.__docsearch_parent!==((o=e.items[a+1])===null||o===void 0?void 0:o.__docsearch_parent)?f.createElement("path",{d:"M8 6v21M20 27H8.3"}):f.createElement("path",{d:"M8 6v42M20 27H8.3"}))),f.createElement("div",{className:"DocSearch-Hit-icon"},f.createElement(Bi,{type:i.type})))},renderAction:function(){return f.createElement("div",{className:"DocSearch-Hit-action"},f.createElement(Ui,null))}}))}),t.resultsFooterComponent&&f.createElement("section",{className:"DocSearch-HitsFooter"},f.createElement(t.resultsFooterComponent,{state:t.state})))}var ia=["translations"];function ht(){return ht=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ht.apply(this,arguments)}function aa(t,e){if(t==null)return{};var n,r,o=function(a,u){if(a==null)return{};var c,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)c=m[s],u.indexOf(c)>=0||(l[c]=a[c]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototyp
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function vr(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Na(t,e){if(t==null)return{};var n,r,o=function(a,u){if(a==null)return{};var c,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)c=m[s],u.indexOf(c)>=0||(l[c]=a[c]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function Ta(t){var e=t.appId,n=t.apiKey,r=t.indexName,o=t.placeholder,i=o===void 0?"Search docs":o,a=t.searchParameters,u=t.maxResultsPerGroup,c=t.onClose,s=c===void 0?na:c,l=t.transformItems,m=l===void 0?ir:l,p=t.hitComponent,v=p===void 0?Li:p,d=t.resultsFooterComponent,h=d===void 0?function(){return null}:d,y=t.navigator,b=t.initialScrollY,_=b===void 0?0:b,S=t.transformSearchClient,O=S===void 0?ir:S,g=t.disableUserPersonalization,P=g!==void 0&&g,C=t.initialQuery,L=C===void 0?"":C,x=t.translations,k=x===void 0?{}:x,N=t.getMissingResultsUrl,U=t.insights,F=U!==void 0&&U,M=k.footer,Ot=k.searchBox,St=Na(k,Aa),$e=xa(f.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),B=$e[0],oo=$e[1],Gt=f.useRef(null),wt=f.useRef(null),Xt=f.useRef(null),Je=f.useRef(null),he=f.useRef(null),Q=f.useRef(10),en=f.useRef(typeof window<"u"?window.getSelection().toString().slice(0,64):"").current,ee=f.useRef(L||en).current,tn=function(j,D,T){return f.useMemo(function(){var H=ro(j,D);return H.addAlgoliaAgent("docsearch","3.5.1"),/docsearch.js \(.*\)/.test(H.transporter.userAgent.value)===!1&&H.addAlgoliaAgent("docsearch-react","3.5.1"),T(H)},[j,D,T])}(e,n,O),oe=f.useRef(ar({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(r),limit:10})).current,ye=f.useRef(ar({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(r),limit:oe.getAll().length===0?7:4})).current,ge=f.useCallback(function(j){if(!P){var D=j.type==="content"?j.__docsearch_parent:j;D&&oe.getAll().findIndex(function(T){return T.objectID===D.objectID})===-1&&ye.add(D)}},[oe,ye,P]),io=f.useCallback(function(j){if(B.context.algoliaInsightsPlugin&&j.__autocomplete_id){var D=j,T={eventName:"Item Selected",index:D.__autocomplete_indexName,items:[D],positions:[j.__autocomplete_id],queryID:D.__autocomplete_queryID};B.context.algoliaInsightsPlugin.insights.clickedObjectIDsAfterSearch(T)}},[B.context.algoliaInsightsPlugin]),be=f.useMemo(function(){return Ti({id:"docsearch",defaultActiveItemId:0,placeholder:i,openOnFocus:!0,initialState:{query:ee,context:{searchSuggestions:[]}},insights:F,navigator:y,onStateChange:function(j){oo(j.state)},getSources:function(j){var D=j.query,T=j.state,H=j.setContext,Z=j.setStatus;if(!D)return P?[]:[{sourceId:"recentSearches",onSelect:function(A){var K=A.item,ie=A.event;ge(K),it(ie)||s()},getItemUrl:function(A){return A.item.url},getItems:function(){return ye.getAll()}},{sourceId:"favoriteSearches",onSelect:function(A){var K=A.item,ie=A.event;ge(K),it(ie)||s()},getItemUrl:function(A){return A.item.url},getItems:function(){return oe.getAll()}}];var Y=!!F;return tn.search([{query:D,indexName:r,params:Rt({attributesToRetrieve:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:["hierarchy.lvl1:".concat(Q.current),"hierarchy.lvl2:".concat(Q.current),"hierarchy.lvl3:".concat(Q.current),"hierarchy.lvl4:".concat(Q.current),"hierarchy.lvl5:".concat(Q.current),"hierarchy.lvl6:".concat(Q.current),"content:".concat(Q.current)],snippetEllipsisText:"…",highlightPreTag:"<mark>",highlightPostTag:"</mark>",hitsPerPage:20,clickAnalytics:Y},a)}]).catch(function(A){throw A.name==="RetryError"&&Z("error"),A}).then(function(A){var K=A.results,ie=K[0],uo=ie.hits,lo=ie.nbHits,jt=or(uo,function(Et){return $r(Et)},u);T.context.searchSuggestions.length<Object.keys(jt).length&&H({searchSuggestions:Object.keys(jt)}),H({nbHits:lo});var rn={};return Y&&(rn={__autocomplete_indexName:r,__autocomplete_queryID:K[0].queryID,__autocomplete_algoliaCredentials:{appId:e,apiKey:n}}),Object.values(jt).map(function(Et,so){return{sourceId:"hits".concat(so),onSelect:function(z){var _e=z.item,Qe=z.event;ge(_e),it(Qe)||s()},getItemUrl:function(z){return z.item.url},getItems:function(){return Object.values(or(Et,function(z){return z.hierarchy.lvl1},u)).map(m).map(function(z){return z.map(function(_e){var Qe=null,on=z.find(function(an){return an.type==="lvl1"&&an.hierarchy.lvl1===_e.hierarchy.lvl1});return _e.type!=="lvl1"&&on&&(Qe=on),Rt(Rt({},_e),{},{__docsearch_parent:Qe},rn)})}).flat()}}})})}})},[r,a,u,tn,s,ye,oe,ge,ee,i,y,m,P,F,e,n]),ao=be.getEnvironmentProps,co=be.getRootProps,nn=be.refresh;return function(j){var D=j.getEnvironmentProps,T=j.panelElement,H=j.formElement,Z=j.inputElement;f.useEffect(function(){if(T&&H&&Z){var Y=D({panelElement:T,formElement:H,inputElement:Z}),A=Y.onTouch
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function hr(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Ra(t){var e,n,r=f.useRef(null),o=dr(f.useState(!1),2),i=o[0],a=o[1],u=dr(f.useState((t==null?void 0:t.initialQuery)||void 0),2),c=u[0],s=u[1],l=f.useCallback(function(){a(!0)},[a]),m=f.useCallback(function(){a(!1)},[a]);return function(p){var v=p.isOpen,d=p.onOpen,h=p.onClose,y=p.onInput,b=p.searchButtonRef;f.useEffect(function(){function _(S){var O;(S.keyCode===27&&v||((O=S.key)===null||O===void 0?void 0:O.toLowerCase())==="k"&&(S.metaKey||S.ctrlKey)||!function(g){var P=g.target,C=P.tagName;return P.isContentEditable||C==="INPUT"||C==="SELECT"||C==="TEXTAREA"}(S)&&S.key==="/"&&!v)&&(S.preventDefault(),v?h():document.body.classList.contains("DocSearch--active")||document.body.classList.contains("DocSearch--active")||d()),b&&b.current===document.activeElement&&y&&/[a-zA-Z0-9]/.test(String.fromCharCode(S.keyCode))&&y(S)}return window.addEventListener("keydown",_),function(){window.removeEventListener("keydown",_)}},[v,d,h,y,b])}({isOpen:i,onOpen:l,onClose:m,onInput:f.useCallback(function(p){a(!0),s(p.key)},[a,s]),searchButtonRef:r}),f.createElement(f.Fragment,null,f.createElement(Bo,{ref:r,translations:t==null||(e=t.translations)===null||e===void 0?void 0:e.button,onClick:l}),i&&Rr(f.createElement(Ta,Jt({},t,{initialScrollY:window.scrollY,initialQuery:c,translations:t==null||(n=t.translations)===null||n===void 0?void 0:n.modal,onClose:m})),document.body))}function qa(t){Lr(f.createElement(Ra,qt({},t,{transformSearchClient:function(e){return e.addAlgoliaAgent("docsearch.js","3.5.1"),t.transformSearchClient?t.transformSearchClient(e):e}})),function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return typeof e=="string"?n.document.querySelector(e):e}(t.container,t.environment))}const La={id:"docsearch"},Ua=fo({__name:"VPAlgoliaSearchBox",props:{algolia:{}},setup(t){const e=t,n=mo(),r=po(),{site:o,localeIndex:i,lang:a}=bo();vo(u),ho(i,u);function u(){var v,d;const l={...e.algolia,...(v=e.algolia.locales)==null?void 0:v[i.value]},m=((d=l.searchParameters)==null?void 0:d.facetFilters)??[],p=[...(Array.isArray(m)?m:[m]).filter(h=>!h.startsWith("lang:")),`lang:${a.value}`];c({...l,searchParameters:{...l.searchParameters,facetFilters:p}})}function c(l){const m=Object.assign({},l,{container:"#docsearch",navigator:{navigate({itemUrl:p}){const{pathname:v}=new URL(window.location.origin+p);r.path===v?window.location.assign(window.location.origin+p):n.go(p)}},transformItems(p){return p.map(v=>Object.assign({},v,{url:s(v.url)}))},hitComponent({hit:p,children:v}){return{__v:null,type:"a",ref:void 0,constructor:void 0,key:void 0,props:{href:p.url,children:v}}}});qa(m)}function s(l){const{pathname:m,hash:p}=new URL(l);return m.replace(/\.html$/,o.value.cleanUrls?"":".html")+p}return(l,m)=>(yo(),go("div",La))}});export{Ua as default};
|
||||
@@ -0,0 +1,17 @@
|
||||
import{d as mo,ai as po,L as vo,y as ho,v as yo,R as go,o as bo,c as _o}from"./framework.BmdFiWrL.js";import{u as Oo}from"./theme.DAaY-8e0.js";/*! @docsearch/js 3.6.0 | MIT License | © Algolia, Inc. and contributors | https://docsearch.algolia.com */function lr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?lr(Object(r),!0).forEach(function(n){So(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):lr(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ve(t){return Ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ve(t)}function So(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lt(){return Lt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Lt.apply(this,arguments)}function wo(t,e){if(t==null)return{};var r,n,o=function(a,c){if(a==null)return{};var u,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)u=m[s],c.indexOf(u)>=0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function se(t,e){return function(r){if(Array.isArray(r))return r}(t)||function(r,n){var o=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(o!=null){var i,a,c=[],u=!0,s=!1;try{for(o=o.call(r);!(u=(i=o.next()).done)&&(c.push(i.value),!n||c.length!==n);u=!0);}catch(l){s=!0,a=l}finally{try{u||o.return==null||o.return()}finally{if(s)throw a}}return c}}(t,e)||_n(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ft(t){return function(e){if(Array.isArray(e))return qt(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||_n(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function _n(t,e){if(t){if(typeof t=="string")return qt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?qt(t,e):void 0}}function qt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var w,Pe,On,sr,Sn,mt={},Zt=[],jo=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function J(t,e){for(var r in e)t[r]=e[r];return t}function wn(t){var e=t.parentNode;e&&e.removeChild(t)}function K(t,e,r){var n,o,i,a=arguments,c={};for(i in e)i=="key"?n=e[i]:i=="ref"?o=e[i]:c[i]=e[i];if(arguments.length>3)for(r=[r],i=3;i<arguments.length;i++)r.push(a[i]);if(r!=null&&(c.children=r),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)c[i]===void 0&&(c[i]=t.defaultProps[i]);return Ie(t,c,n,o,null)}function Ie(t,e,r,n,o){var i={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:o??++w.__v};return w.vnode!=null&&w.vnode(i),i}function X(t){return t.children}function W(t,e){this.props=t,this.context=e}function Ke(t,e){if(e==null)return t.__?Ke(t.__,t.__.__k.indexOf(t)+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?Ke(t):null}function jn(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return jn(t)}}function Mt(t){(!t.__d&&(t.__d=!0)&&Pe.push(t)&&!pt.__r++||sr!==w.debounceRendering)&&((sr=w.debounceRendering)||On)(pt)}function pt(){for(var t;pt.__r=Pe.length;)t=Pe.sort(function(e,r){return e.__v.__b-r.__v.__b}),Pe=[],t.some(function(e){var r,n,o,i,a,c;e.__d&&(a=(i=(r=e).__v).__e,(c=r.__P)&&(n=[],(o=J({},i)).__v=i.__v+1,Yt(c,i,o,r.__n,c.ownerSVGElement!==void 0,i.__h!=null?[a]:null,n,a??Ke(i),i.__h),kn(n,i),i.__e!=a&&jn(i)))})}function En(t,e,r,n,o,i,a,c,u,s){var l,m,p,v,d,h,y,b=n&&n.__k||Zt,_=b.length;for(r.__k=[],l=0;l<e.length;l++)if((v=r.__k[l]=(v=e[l])==null||typeof v=="boolean"?null:typeof v=="string"||typeof v=="number"?Ie(null,v,null,null,v):Array.isArray(v)?Ie(X,{children:v},null,null,null):v.__b>0?Ie(v.type,v.props,v.key,null,v.__v):v)!=null){if(v.__=r,v.__b=r.__b+1,(p=b[l])===null||p&&v.key==p.key&&v.type===p.type)b[l]=void 0;else for(m=0;m<_;m++){if((p=b[m])&&v.key==p.key&&v.type===p.type){b[m]=void 0;break}p=null}Yt(t,v,p=p||mt,o,i,a,c,u,s),d=v.__e,(m=v.ref)&&p.ref!=m&&(y||(y=[]),p.ref&&y.push(p.ref,null,v),y.push(m,v.__c||d,v)),d!=null?(h==null&&(h=d),typeof v.type=="function"&&v.__k!=null&&v.__k===p.__k?v.__d=u=Pn(v,u,t):u=In(t,v,p,b,d,u),s||r.type!=="option"?typeof r.type=="function"&&(r.__d=u):t.value=""):u&&p.__e==u&&u.parentNode!=t&&(u=Ke(p))}for(r.__e=h,l=_;l--;)b[l]!=null&&(typeof r.type=="function"&&b[l].__e!=null&&b[l].__e==r.__d&&(r.__d=Ke(n,l+1)),An(b[l],b[l]));if(y)for(l=0;l<y.length;l++)Dn(y[l],y[++l],y[++l])}function Pn(t,e,r){var n,o;for(n=0;n<t.__k.length;n++)(o=t.__k[n])&&(o.__=t,e=typeof o.type=="function"?Pn(o,e,r):In(r,o,o,t.__k,o.__e,e));return e}function $(t,e){return e=e||[],t==null||typeof t=="boolean"||(Array.isArray(t)?t.some(function(r){$(r,e)}):e.push(t)),e}function In(t,e,r,n,o,i){var a,c,u;if(e.__d!==void 0)a=e.__d,e.__d=void 0;else if(r==null||o!=i||o.parentNode==null)e:if(i==null||i.parentNode!==t)t.appendChild(o),a=null;else{for(c=i,u=0;(c=c.nextSibling)&&u<n.length;u+=2)if(c==o)break e;t.insertBefore(o,i),a=i}return a!==void 0?a:o.nextSibling}function fr(t,e,r){e[0]==="-"?t.setProperty(e,r):t[e]=r==null?"":typeof r!="number"||jo.test(e)?r:r+"px"}function Ye(t,e,r,n,o){var i;e:if(e==="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||fr(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||fr(t.style,e,r[e])}else if(e[0]==="o"&&e[1]==="n")i=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=r,r?n||t.addEventListener(e,i?pr:mr,i):t.removeEventListener(e,i?pr:mr,i);else if(e!=="dangerouslySetInnerHTML"){if(o)e=e.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if(e!=="href"&&e!=="list"&&e!=="form"&&e!=="download"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r!=null&&(r!==!1||e[0]==="a"&&e[1]==="r")?t.setAttribute(e,r):t.removeAttribute(e))}}function mr(t){this.l[t.type+!1](w.event?w.event(t):t)}function pr(t){this.l[t.type+!0](w.event?w.event(t):t)}function Yt(t,e,r,n,o,i,a,c,u){var s,l,m,p,v,d,h,y,b,_,S,O=e.type;if(e.constructor!==void 0)return null;r.__h!=null&&(u=r.__h,c=e.__e=r.__e,e.__h=null,i=[c]),(s=w.__b)&&s(e);try{e:if(typeof O=="function"){if(y=e.props,b=(s=O.contextType)&&n[s.__c],_=s?b?b.props.value:s.__:n,r.__c?h=(l=e.__c=r.__c).__=l.__E:("prototype"in O&&O.prototype.rend
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ar(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Bo(t,e){if(t==null)return{};var r,n,o=function(a,c){if(a==null)return{};var u,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)u=m[s],c.indexOf(u)>=0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var Vo=f.forwardRef(function(t,e){var r=t.translations,n=r===void 0?{}:r,o=Bo(t,Fo),i=n.buttonText,a=i===void 0?"Search":i,c=n.buttonAriaLabel,u=c===void 0?"Search":c,s=Fn(Gt(null),2),l=s[0],m=s[1];return Xt(function(){typeof navigator<"u"&&(/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)?m("⌘"):m("Ctrl"))},[]),f.createElement("button",Vt({type:"button",className:"DocSearch DocSearch-Button","aria-label":u},o,{ref:e}),f.createElement("span",{className:"DocSearch-Button-Container"},f.createElement(Un,null),f.createElement("span",{className:"DocSearch-Button-Placeholder"},a)),f.createElement("span",{className:"DocSearch-Button-Keys"},l!==null&&f.createElement(f.Fragment,null,f.createElement(Cr,{reactsToKey:l==="Ctrl"?"Ctrl":"Meta"},l==="Ctrl"?f.createElement(Uo,null):l),f.createElement(Cr,{reactsToKey:"k"},"K"))))});function Cr(t){var e=t.reactsToKey,r=t.children,n=Fn(Gt(!1),2),o=n[0],i=n[1];return Xt(function(){if(e)return window.addEventListener("keydown",a),window.addEventListener("keyup",c),function(){window.removeEventListener("keydown",a),window.removeEventListener("keyup",c)};function a(u){u.key===e&&i(!0)}function c(u){u.key!==e&&u.key!=="Meta"||i(!1)}},[e]),f.createElement("kbd",{className:o?"DocSearch-Button-Key DocSearch-Button-Key--pressed":"DocSearch-Button-Key"},r)}function Bn(t,e){var r=void 0;return function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];r&&clearTimeout(r),r=setTimeout(function(){return t.apply(void 0,o)},e)}}function ze(t){return t.reduce(function(e,r){return e.concat(r)},[])}var Ko=0;function Kt(t){return t.collections.length===0?0:t.collections.reduce(function(e,r){return e+r.items.length},0)}function xr(t){return t!==Object(t)}function Vn(t,e){if(t===e)return!0;if(xr(t)||xr(e)||typeof t=="function"||typeof e=="function")return t===e;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var r=0,n=Object.keys(t);r<n.length;r++){var o=n[r];if(!(o in e)||!Vn(t[o],e[o]))return!1}return!0}var vt=function(){},Wo=[{segment:"autocomplete-core",version:"1.9.3"}];function Nr(t){var e=t.item,r=t.items;return{index:e.__autocomplete_indexName,items:[e],positions:[1+r.findIndex(function(n){return n.objectID===e.objectID})],queryID:e.__autocomplete_queryID,algoliaSource:["autocomplete"]}}function zo(t,e){return function(r){if(Array.isArray(r))return r}(t)||function(r,n){var o=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(o!=null){var i,a,c,u,s=[],l=!0,m=!1;try{if(c=(o=o.call(r)).next,n!==0)for(;!(l=(i=c.call(o)).done)&&(s.push(i.value),s.length!==n);l=!0);}catch(p){m=!0,a=p}finally{try{if(!l&&o.return!=null&&(u=o.return(),Object(u)!==u))return}finally{if(m)throw a}}return s}}(t,e)||function(r,n){if(r){if(typeof r=="string")return Tr(r,n);var o=Object.prototype.toString.call(r).slice(8,-1);if(o==="Object"&&r.constructor&&(o=r.constructor.name),o==="Map"||o==="Set")return Array.from(r);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return Tr(r,n)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Tr(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var Jo=["items"],$o=["items"];function ke(t){return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ke(t)}function Ge(t){return function(e){if(Array.isArray(e))return It(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||function(e,r){if(e){if(typeof e=="string")return It(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return It(e,r)}}(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function It(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Kn(t,e){if(t==null)return{};var r,n,o=function(a,c){if(a==null)return{};var u,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)u=m[s],c.indexOf(u)>=0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Rr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function ve(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Rr(Object(r),!0).forEach(function(n){Qo(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Rr(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Qo(t,e,r){return(e=function(n){var o=function(i,a){if(ke(i)!=="object"||i===null)return i;var c=i[Symbol.toPrimitive];if(c!==void 0){var u=c.call(i,a||"default");if(ke(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(n,"string");return ke(o)==="symbol"?o:String(o)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zo(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20,r=[],n=0;n<t.objectIDs.length;n+=e)r.push(ve(ve({},t),{},{objectIDs:t.objectIDs.slice(n,n+e)}));return r}function Xe(t){return t.map(function(e){var r=e.items,n=Kn(e,Jo);return ve(ve({},n),{},{objectIDs:(r==null?void 0:r.map(function(o){return o.objectID}))||n.objectIDs})})}function Yo(t){var e,r,n,o=(e=zo((t.version||"").split(".").map(Number),2),r=e[0],n=e[1],r>=3||r===2&&n>=4||r===1&&n>=10);function i(a,c,u){if(o&&u!==void 0){var s=u[0].__autocomplete_algoliaCredentials,l={"X-Algolia-Application-Id":s.appId,"X-Algolia-API-Key":s.apiKey};t.apply(void 0,[a].concat(Ge(c),[{headers:l}]))}else t.apply(void 0,[a].concat(Ge(c)))}return{init:function(a,c){t("init",{appId:a,apiKey:c})},setUserToken:function(a){t("setUserToken",a)},clickedObjectIDsAfterSearch:function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];c.length>0&&i("clickedObjectIDsAfterSearch",Xe(c),c[0].items)},clickedObjectIDs:function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];c.length>0&&i("clickedObjectIDs",Xe(c),c[0].items)},clickedFilters:function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];c.length>0&&t.apply(void 0,["clickedFilters"].concat(c))},convertedObjectIDsAfterSearch:function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];c.length>0&&i("convertedObjectIDsAfterSearch",Xe(c),c[0].items)},convertedObjectIDs:function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];c.length>0&&i("convertedObjectIDs",Xe(c),c[0].items)},convertedFilters:function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];c.length>0&&t.apply(void 0,["convertedFilters"].concat(c))},viewedObjectIDs:function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];c.length>0&&c.reduce(function(s,l){var m=l.items,p=Kn(l,$o);return[].concat(Ge(s),Ge(Zo(ve(ve({},p),{},{objectIDs:(m==null?void 0:m.map(function(v){return v.objectID}))||p.objectIDs})).map(function(v){return{items:m,payload:v}})))},[]).forEach(function(s){var l=s.items;return i("viewedObjectIDs",[s.payload],l)})},viewedFilters:function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];c.length>0&&t.apply(void 0,["viewedFilters"].concat(c))}}}function Go(t){var e=t.items.reduce(function(r,n){var o;return r[n.__autocomplete_indexName]=((o=r[n.__autocomplete_indexName])!==null&&o!==void 0?o:[]).concat(n),r},{});return Object.keys(e).map(function(r){return{index:r,items:e[r],algoliaSource:["autocomplete"]}})}function kt(t){return t.objectID&&t.__autocomplete_indexName&&t.__autocomplete_queryID}function De(t){return De=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},De(t)}function ie(t){return function(e){if(Array.isArray(e))return Dt(e)}(t)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(t)||function(e,r){if(e){if(typeof e=="string")return Dt(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Dt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Lr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function G(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(r),!0).forEach(function(n){Xo(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Lr(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Xo(t,e,r){return(e=function(n){var o=function(i,a){if(De(i)!=="object"||i===null)return i;var c=i[Symbol.toPrimitive];if(c!==void 0){var u=c.call(i,a||"default");if(De(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(n,"string");return De(o)==="symbol"?o:String(o)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ei="https://cdn.jsdelivr.net/npm/search-insights@".concat("2.6.0","/dist/search-insights.min.js"),ti=Bn(function(t){var e=t.onItemsChange,r=t.items,n=t.insights,o=t.state;e({insights:n,insightsEvents:Go({items:r}).map(function(i){return G({eventName:"Items Viewed"},i)}),state:o})},400);function ri(t){var e=function(l){return G({onItemsChange:function(m){var p=m.insights,v=m.insightsEvents;p.viewedObjectIDs.apply(p,ie(v.map(function(d){return G(G({},d),{},{algoliaSource:[].concat(ie(d.algoliaSource||[]),["autocomplete-internal"])})})))},onSelect:function(m){var p=m.insights,v=m.insightsEvents;p.clickedObjectIDsAfterSearch.apply(p,ie(v.map(function(d){return G(G({},d),{},{algoliaSource:[].concat(ie(d.algoliaSource||[]),["autocomplete-internal"])})})))},onActive:vt},l)}(t),r=e.insightsClient,n=e.onItemsChange,o=e.onSelect,i=e.onActive,a=r;r||function(l){typeof window<"u"&&l({window})}(function(l){var m=l.window,p=m.AlgoliaAnalyticsObject||"aa";typeof p=="string"&&(a=m[p]),a||(m.AlgoliaAnalyticsObject=p,m[p]||(m[p]=function(){m[p].queue||(m[p].queue=[]);for(var v=arguments.length,d=new Array(v),h=0;h<v;h++)d[h]=arguments[h];m[p].queue.push(d)}),m[p].version="2.6.0",a=m[p],function(v){var d="[Autocomplete]: Could not load search-insights.js. Please load it manually following https://alg.li/insights-autocomplete";try{var h=v.document.createElement("script");h.async=!0,h.src=ei,h.onerror=function(){console.error(d)},document.body.appendChild(h)}catch{console.error(d)}}(m))});var c=Yo(a),u={current:[]},s=Bn(function(l){var m=l.state;if(m.isOpen){var p=m.collections.reduce(function(v,d){return[].concat(ie(v),ie(d.items))},[]).filter(kt);Vn(u.current.map(function(v){return v.objectID}),p.map(function(v){return v.objectID}))||(u.current=p,p.length>0&&ti({onItemsChange:n,items:p,insights:c,state:m}))}},0);return{name:"aa.algoliaInsightsPlugin",subscribe:function(l){var m=l.setContext,p=l.onSelect,v=l.onActive;a("addAlgoliaAgent","insights-plugin"),m({algoliaInsightsPlugin:{__algoliaSearchParameters:{clickAnalytics:!0},insights:c}}),p(function(d){var h=d.item,y=d.state,b=d.event;kt(h)&&o({state:y,event:b,insights:c,item:h,insightsEvents:[G({eventName:"Item Selected"},Nr({item:h,items:u.current}))]})}),v(function(d){var h=d.item,y=d.state,b=d.event;kt(h)&&i({state:y,event:b,insights:c,item:h,insightsEvents:[G({eventName:"Item Active"},Nr({item:h,items:u.current}))]})})},onStateChange:function(l){var m=l.state;s({state:m})},__autocomplete_pluginOptions:t}}function lt(t,e){var r=e;return{then:function(n,o){return lt(t.then(et(n,r,t),et(o,r,t)),r)},catch:function(n){return lt(t.catch(et(n,r,t)),r)},finally:function(n){return n&&r.onCancelList.push(n),lt(t.finally(et(n&&function(){return r.onCancelList=[],n()},r,t)),r)},cancel:function(){r.isCanceled=!0;var n=r.onCancelList;r.onCancelList=[],n.forEach(function(o){o()})},isCanceled:function(){return r.isCanceled===!0}}}function qr(t){return lt(t,{isCanceled:!1,onCancelList:[]})}function et(t,e,r){return t?function(n){return e.isCanceled?n:t(n)}:r}function Mr(t,e,r,n){if(!r)return null;if(t<0&&(e===null||n!==null&&e===0))return r+t;var o=(e===null?-1:e)+t;return o<=-1||o>=r?n===null?null:0:o}function Hr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function Ur(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Hr(Object(r),!0).forEach(function(n){ni(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Hr(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ni(t,e,r){re
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function At(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Vr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function ae(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Vr(Object(r),!0).forEach(function(n){li(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Vr(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function li(t,e,r){return(e=function(n){var o=function(i,a){if(Ne(i)!=="object"||i===null)return i;var c=i[Symbol.toPrimitive];if(c!==void 0){var u=c.call(i,a||"default");if(Ne(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(n,"string");return Ne(o)==="symbol"?o:String(o)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function si(t,e){var r,n=typeof window<"u"?window:{},o=t.plugins||[];return ae(ae({debug:!1,openOnFocus:!1,placeholder:"",autoFocus:!1,defaultActiveItemId:null,stallThreshold:300,insights:!1,environment:n,shouldPanelOpen:function(i){return Kt(i.state)>0},reshape:function(i){return i.sources}},t),{},{id:(r=t.id)!==null&&r!==void 0?r:"autocomplete-".concat(Ko++),plugins:o,initialState:ae({activeItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},t.initialState),onStateChange:function(i){var a;(a=t.onStateChange)===null||a===void 0||a.call(t,i),o.forEach(function(c){var u;return(u=c.onStateChange)===null||u===void 0?void 0:u.call(c,i)})},onSubmit:function(i){var a;(a=t.onSubmit)===null||a===void 0||a.call(t,i),o.forEach(function(c){var u;return(u=c.onSubmit)===null||u===void 0?void 0:u.call(c,i)})},onReset:function(i){var a;(a=t.onReset)===null||a===void 0||a.call(t,i),o.forEach(function(c){var u;return(u=c.onReset)===null||u===void 0?void 0:u.call(c,i)})},getSources:function(i){return Promise.all([].concat(ci(o.map(function(a){return a.getSources})),[t.getSources]).filter(Boolean).map(function(a){return function(c,u){var s=[];return Promise.resolve(c(u)).then(function(l){return Promise.all(l.filter(function(m){return!!m}).map(function(m){if(m.sourceId,s.includes(m.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(m.sourceId)," is not unique."));s.push(m.sourceId);var p={getItemInputValue:function(d){return d.state.query},getItemUrl:function(){},onSelect:function(d){(0,d.setIsOpen)(!1)},onActive:vt,onResolve:vt};Object.keys(p).forEach(function(d){p[d].__default=!0});var v=Ur(Ur({},p),m);return Promise.resolve(v)}))})}(a,i)})).then(function(a){return ze(a)}).then(function(a){return a.map(function(c){return ae(ae({},c),{},{onSelect:function(u){c.onSelect(u),e.forEach(function(s){var l;return(l=s.onSelect)===null||l===void 0?void 0:l.call(s,u)})},onActive:function(u){c.onActive(u),e.forEach(function(s){var l;return(l=s.onActive)===null||l===void 0?void 0:l.call(s,u)})},onResolve:function(u){c.onResolve(u),e.forEach(function(s){var l;return(l=s.onResolve)===null||l===void 0?void 0:l.call(s,u)})}})})})},navigator:ae({navigate:function(i){var a=i.itemUrl;n.location.assign(a)},navigateNewTab:function(i){var a=i.itemUrl,c=n.open(a,"_blank","noopener");c==null||c.focus()},navigateNewWindow:function(i){var a=i.itemUrl;n.open(a,"_blank","noopener")}},t.navigator)})}function Te(t){return Te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Te(t)}function Kr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function rt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Kr(Object(r),!0).forEach(function(n){Wn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Kr(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Wn(t,e,r){return(e=function(n){var o=function(i,a){if(Te(i)!=="object"||i===null)return i;var c=i[Symbol.toPrimitive];if(c!==void 0){var u=c.call(i,a||"default");if(Te(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(n,"string");return Te(o)==="symbol"?o:String(o)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Re(t){return Re=typeof Symbol=="function"&&typeof
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ct(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function nt(t){return!!t.execute}function mi(t,e,r){if(o=t,!!(o!=null&&o.execute)){var n=t.requesterId==="algolia"?Object.assign.apply(Object,[{}].concat(zn(Object.keys(r.context).map(function(i){var a;return(a=r.context[i])===null||a===void 0?void 0:a.__algoliaSearchParameters})))):{};return ue(ue({},t),{},{requests:t.queries.map(function(i){return{query:t.requesterId==="algolia"?ue(ue({},i),{},{params:ue(ue({},n),i.params)}):i,sourceId:e,transformResponse:t.transformResponse}})})}var o;return{items:t,sourceId:e}}function pi(t){var e=t.reduce(function(r,n){if(!nt(n))return r.push(n),r;var o=n.searchClient,i=n.execute,a=n.requesterId,c=n.requests,u=r.find(function(m){return nt(n)&&nt(m)&&m.searchClient===o&&!!a&&m.requesterId===a});if(u){var s;(s=u.items).push.apply(s,zn(c))}else{var l={execute:i,requesterId:a,items:c,searchClient:o};r.push(l)}return r},[]).map(function(r){if(!nt(r))return Promise.resolve(r);var n=r,o=n.execute,i=n.items;return o({searchClient:n.searchClient,requests:i})});return Promise.all(e).then(function(r){return ze(r)})}function vi(t,e,r){return e.map(function(n){var o,i=t.filter(function(s){return s.sourceId===n.sourceId}),a=i.map(function(s){return s.items}),c=i[0].transformResponse,u=c?c({results:o=a,hits:o.map(function(s){return s.hits}).filter(Boolean),facetHits:o.map(function(s){var l;return(l=s.facetHits)===null||l===void 0?void 0:l.map(function(m){return{label:m.value,count:m.count,_highlightResult:{label:{value:m.highlighted}}}})}).filter(Boolean)}):a;return n.onResolve({source:n,results:a,items:u,state:r.getState()}),u.every(Boolean),'The `getItems` function from source "'.concat(n.sourceId,'" must return an array of items but returned ').concat(JSON.stringify(void 0),`.
|
||||
|
||||
Did you forget to return items?
|
||||
|
||||
See: https://www.algolia.com/doc/ui-libraries/autocomplete/core-concepts/sources/#param-getitems`),{source:n,items:u}})}function Le(t){return Le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Le(t)}var di=["event","nextState","props","query","refresh","store"];function zr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zr(Object(r),!0).forEach(function(n){hi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zr(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function hi(t,e,r){return(e=function(n){var o=function(i,a){if(Le(i)!=="object"||i===null)return i;var c=i[Symbol.toPrimitive];if(c!==void 0){var u=c.call(i,a||"default");if(Le(u)!=="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(n,"string");return Le(o)==="symbol"?o:String(o)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function yi(t,e){if(t==null)return{};var r,n,o=function(a,c){if(a==null)return{};var u,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)u=m[s],c.indexOf(u)>=0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var Jr,xt,ot,we=null,$r=(Jr=-1,xt=-1,ot=void 0,function(t){var e=++Jr;return Promise.resolve(t).then(function(r){return ot&&e<xt?ot:(xt=e,ot=r,r)})});function le(t){var e=t.event,r=t.nextState,n=r===void 0?{}:r,o=t.props,i=t.query,a=t.refresh,c=t.store,u=yi(t,di);we&&o.environment.clearTimeout(we);var s=u.setCollections,l=u.setIsOpen,m=u.setQuery,p=u.setActiveItemId,v=u.setStatus;if(m(i),p(o.defaultActiveItemId),!i&&o.openOnFocus===!1){var d,h=c.getState().collections.map(function(_){return Se(Se({},_),{},{items:[]})});v("idle"),s(h),l((d=n.isOpen)!==null&&d!==void 0?d:o.shouldPanelOpen({state:c.getState()}));var y=qr($r(h).then(function(){return Promise.resolve()}));return c.pendingRequests.add(y)}v("loading"),we=o.environment.setTimeout(function(){v("stalled")},o.stallThreshold);var b=qr($r(o.getSources(Se({query:i,refresh:a,state:c.getState()},u)).then(function(_){return Promise.all(_.map(function(S){return Promise.resolve(S.getItems(Se({query:i,refresh:a,state:c.getState()},u))).then(function(O){return mi(O,S.sourceId,c.getState())})})).then(pi).then(function(S){return vi(S,_,c)}).then(function(S){return function(O){var g=O.collections,P=O.props,C=O.state,q=g.reduce(function(D,N){return rt(rt({},D),{},Wn({},N.source.sourceId,rt(rt({},N.source),{},{getItems:function(){return ze(N.items)}})))},{}),x=P.plugins.reduce(function(D,N){return N.reshape?N.reshape(D):D},{sourcesBySourceId:q,state:C}).sourcesBySourceId;return ze(P.reshape({sourcesBySourceId:x,sources:Object.values(x),state:C})).filter(Boolean).map(function(D){return{source:D,items:D.getItems()}})}({collections:S,props:o,state:c.getState()})})}))).then(function(_){var S;v("idle"),s(_);var O=o.shouldPanelOpen({state:c.getState()});l((S=n.isOpen)!==null&&S!==void 0?S:o.openOnFocus&&!i&&O||O);var g=fe(c.getState());if(c.getState().activeItemId!==null&&g){var P=g.item,C=g.itemInputValue,q=g.itemUrl,x=g.source;x.onActive(Se({event:e,item:P,itemInputValue:C,itemUrl:q,refresh:a,source:x,state:c.getState()},u))}}).finally(function(){v("idle"),we&&o.environment.clearTimeout(we)});return c.pendingRequests.add(b)}function qe(t){return qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qe(t)}var gi=["event","props","refresh","store"];function Qr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function te(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qr(Object(r),!0).forEach(function(n){bi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qr(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function bi(t,e,r){return(e=function(n){var o=function(i,a){if(qe(i)!=="object"||i===null)return i;var c=i[Symbol.toPrimitive];if(c!==void 0){var u=c.call(i,a||"default");if(qe(u)!=="object")return u;throw new TypeError("@@toPrimitive m
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Nt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Yi(t,e){if(t==null)return{};var r,n,o=function(a,c){if(a==null)return{};var u,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)u=m[s],c.indexOf(u)>=0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function Gi(t){var e=t.translations,r=e===void 0?{}:e,n=Yi(t,Qi),o=r.noResultsText,i=o===void 0?"No results for":o,a=r.suggestedQueryText,c=a===void 0?"Try searching for":a,u=r.reportMissingResultsText,s=u===void 0?"Believe this query should return results?":u,l=r.reportMissingResultsLinkText,m=l===void 0?"Let us know.":l,p=n.state.context.searchSuggestions;return f.createElement("div",{className:"DocSearch-NoResults"},f.createElement("div",{className:"DocSearch-Screen-Icon"},f.createElement(Ji,null)),f.createElement("p",{className:"DocSearch-Title"},i,' "',f.createElement("strong",null,n.state.query),'"'),p&&p.length>0&&f.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},f.createElement("p",{className:"DocSearch-Help"},c,":"),f.createElement("ul",null,p.slice(0,3).reduce(function(v,d){return[].concat(Zi(v),[f.createElement("li",{key:d},f.createElement("button",{className:"DocSearch-Prefill",key:d,type:"button",onClick:function(){n.setQuery(d.toLowerCase()+" "),n.refresh(),n.inputRef.current.focus()}},d))])},[]))),n.getMissingResultsUrl&&f.createElement("p",{className:"DocSearch-Help"},"".concat(s," "),f.createElement("a",{href:n.getMissingResultsUrl({query:n.state.query}),target:"_blank",rel:"noopener noreferrer"},m)))}var Xi=["hit","attribute","tagName"];function rn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),r.push.apply(r,n)}return r}function nn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?rn(Object(r),!0).forEach(function(n){ea(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rn(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ea(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ta(t,e){if(t==null)return{};var r,n,o=function(a,c){if(a==null)return{};var u,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)u=m[s],c.indexOf(u)>=0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function on(t,e){return e.split(".").reduce(function(r,n){return r!=null&&r[n]?r[n]:null},t)}function ce(t){var e=t.hit,r=t.attribute,n=t.tagName;return K(n===void 0?"span":n,nn(nn({},ta(t,Xi)),{},{dangerouslySetInnerHTML:{__html:on(e,"_snippetResult.".concat(r,".value"))||on(e,r)}}))}function an(t,e){return function(r){if(Array.isArray(r))return r}(t)||function(r,n){var o=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(o!=null){var i,a,c=[],u=!0,s=!1;try{for(o=o.call(r);!(u=(i=o.next()).done)&&(c.push(i.value),!n||c.length!==n);u=!0);}catch(l){s=!0,a=l}finally{try{u||o.return==null||o.return()}finally{if(s)throw a}}return c}}(t,e)||function(r,n){if(r){if(typeof r=="string")return un(r,n);var o=Object.prototype.toString.call(r).slice(8,-1);if(o==="Object"&&r.constructor&&(o=r.constructor.name),o==="Map"||o==="Set")return Array.from(r);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return un(r,n)}}(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function un(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function dt(){return dt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},dt.apply(this,arguments)}function zt(t){return t.collection&&t.collection.items.length!==0?f.createElement("section",{className:"DocSearch-Hits"},f.createElement("div",{className:"DocSearch-Hit-source"},t.title),f.createElement("ul",t.getListProps(),t.collection.items.map(function(e,r){return f.createElement(ra,dt({key:[t.title,e.objectID].join(":"),item:e,index:r},t))}))):null}function ra(t){var e=t.item,r=t.index,n=t.renderIcon,o=t.renderAction,i=t.getItemProps,a=t.onItemClick,c=t.collection,u=t.hitComponent,s=an(f.useState(!1),2),l=s[0],m=s[1],p=an(f.useState(!1),2),v=p[0],d=p[1],h=f.useRef(null),y=u;return f.createElement("li",dt({className:["DocSearch-Hit",e.__docsearch_parent&&"DocSearch-Hit--Child",l&&"DocSearch-Hit--deleting",v&&"DocSearch-Hit--favoriting"].filter(Boolean).join(" "),onTransitionEnd:function(){h.current&&h.current()}},i({item:e,source:c.source,onClick:function(b){a(e,b)}})),f.createElement(y,{hit:e},f.createElement("div",{className:"DocSearch-Hit-Container"},n({item:e,index:r}),e.hierarchy[e.type]&&e.type==="lvl1"&&f.createElement("div",{className:"DocSearch-Hit-content-wrapper"},f.createElement(ce,{className:"DocSearch-Hit-title",hit:e,attribute:"hierarchy.lvl1"}),e.content&&f.createElement(ce,{className:"DocSearch-Hit-path",hit:e,attribute:"content"})),e.hierarchy[e.type]&&(e.type==="lvl2"||e.type==="lvl3"||e.type==="lvl4"||e.type==="lvl5"||e.type==="lvl6")&&f.createElement("div",{className:"DocSearch-Hit-content-wrapper"},f.createElement(ce,{className:"DocSearch-Hit-title",hit:e,attribute:"hierarchy.".concat(e.type)}),f.createElement(ce,{className:"DocSearch-Hit-path",hit:e,attribute:"hierarchy.lvl1"})),e.type==="content"&&f.createElement("div",{className:"DocSearch-Hit-content-wrapper"},f.createElement(ce,{className:"DocSearch-Hit-title",hit:e,attribute:"content"}),f.createElement(ce,{className:"DocSearch-Hit-path",hit:e,attribute:"hierarchy.lvl1"})),o({item:e,runDeleteTransition:function(b){m(!0),h.current=b},runFavoriteTransition:function(b){d(!0),h.current=b}}))))}function cn(t,e,r){return t.reduce(function(n,o){var i=e(o);return n.hasOwnProperty(i)||(n[i]=[]),n[i].length<(r||5)&&n[i].push(o),n},{})}function ln(t){return t}function at(t){return t.button===1||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey}function na(){}var $n=/(<mark>|<\/mark>)/g,oa=RegExp($n.source);function Qn(t){var e,r,n=t;if(!n.__docsearch_parent&&!t._highlightResult)return t.hierarchy.lvl0;var o=((n.__docsearch_parent?(e=n.__docsearch_parent)===null||e===void 0||(e=e._highlightResult)===null||e===void 0||(e=e.hierarchy)===null||e===void 0?void 0:e.lvl0:(r=t._highlightResult)===null||r===void 0||(r=r.hierarchy)===null||r===void 0?void 0:r.lvl0)||{}).value;return o&&oa.test(o)?o.replace($n,""):o}function Jt(){return Jt=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Jt.apply(this,arguments)}function ia(t){return f.createElement("div",{className:"DocSearch-Dropdown-Container"},t.state.collections.map(function(e){if(e.items.length===0)return null;var r=Qn(e.items[0]);return f.createElement(zt,Jt({},t,{key:e.source.sourceId,title:r,collection:e,renderIcon:function(n){var o,i=n.item,a=n.index;return f.createElement(f.Fragment,null,i.__docsearch_parent&&f.createElement("svg",{className:"DocSearch-Hit-Tree",viewBox:"0 0 24 54"},f.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},i.__docsearch_parent!==((o=e.items[a+1])===null||o===void 0?void 0:o.__docsearch_parent)?f.createElement("path",{d:"M8 6v21M20 27H8.3"}):f.createElement("path",{d:"M8 6v42M20 27H8.3"}))),f.createElement("div",{className:"DocSearch-Hit-icon"},f.createElement(Vi,{type:i.type})))},renderAction:function(){return f.createElement("div",{className:"DocSearch-Hit-action"},f.createElement(Fi,null))}}))}),t.resultsFooterComponent&&f.createElement("section",{className:"DocSearch-HitsFooter"},f.createElement(t.resultsFooterComponent,{state:t.state})))}var aa=["translations"];function ht(){return ht=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ht.apply(this,arguments)}function ua(t,e){if(t==null)return{};var r,n,o=function(a,c){if(a==null)return{};var u,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)u=m[s],c.indexOf(u)>=0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.prop
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function yn(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ra(t,e){if(t==null)return{};var r,n,o=function(a,c){if(a==null)return{};var u,s,l={},m=Object.keys(a);for(s=0;s<m.length;s++)u=m[s],c.indexOf(u)>=0||(l[u]=a[u]);return l}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function La(t){var e=t.appId,r=t.apiKey,n=t.indexName,o=t.placeholder,i=o===void 0?"Search docs":o,a=t.searchParameters,c=t.maxResultsPerGroup,u=t.onClose,s=u===void 0?na:u,l=t.transformItems,m=l===void 0?ln:l,p=t.hitComponent,v=p===void 0?Mi:p,d=t.resultsFooterComponent,h=d===void 0?function(){return null}:d,y=t.navigator,b=t.initialScrollY,_=b===void 0?0:b,S=t.transformSearchClient,O=S===void 0?ln:S,g=t.disableUserPersonalization,P=g!==void 0&&g,C=t.initialQuery,q=C===void 0?"":C,x=t.translations,D=x===void 0?{}:x,N=t.getMissingResultsUrl,U=t.insights,F=U!==void 0&&U,M=D.footer,Ot=D.searchBox,St=Ra(D,xa),$e=Ta(f.useState({query:"",collections:[],completion:null,context:{},isOpen:!1,activeItemId:null,status:"idle"}),2),B=$e[0],ao=$e[1],tr=f.useRef(null),wt=f.useRef(null),rr=f.useRef(null),Qe=f.useRef(null),he=f.useRef(null),Q=f.useRef(10),nr=f.useRef(typeof window<"u"?window.getSelection().toString().slice(0,64):"").current,ee=f.useRef(q||nr).current,or=function(j,k,T){return f.useMemo(function(){var H=io(j,k);return H.addAlgoliaAgent("docsearch","3.6.0"),/docsearch.js \(.*\)/.test(H.transporter.userAgent.value)===!1&&H.addAlgoliaAgent("docsearch-react","3.6.0"),T(H)},[j,k,T])}(e,r,O),oe=f.useRef(sn({key:"__DOCSEARCH_FAVORITE_SEARCHES__".concat(n),limit:10})).current,ye=f.useRef(sn({key:"__DOCSEARCH_RECENT_SEARCHES__".concat(n),limit:oe.getAll().length===0?7:4})).current,ge=f.useCallback(function(j){if(!P){var k=j.type==="content"?j.__docsearch_parent:j;k&&oe.getAll().findIndex(function(T){return T.objectID===k.objectID})===-1&&ye.add(k)}},[oe,ye,P]),uo=f.useCallback(function(j){if(B.context.algoliaInsightsPlugin&&j.__autocomplete_id){var k=j,T={eventName:"Item Selected",index:k.__autocomplete_indexName,items:[k],positions:[j.__autocomplete_id],queryID:k.__autocomplete_queryID};B.context.algoliaInsightsPlugin.insights.clickedObjectIDsAfterSearch(T)}},[B.context.algoliaInsightsPlugin]),be=f.useMemo(function(){return Ri({id:"docsearch",defaultActiveItemId:0,placeholder:i,openOnFocus:!0,initialState:{query:ee,context:{searchSuggestions:[]}},insights:F,navigator:y,onStateChange:function(j){ao(j.state)},getSources:function(j){var k=j.query,T=j.state,H=j.setContext,Z=j.setStatus;if(!k)return P?[]:[{sourceId:"recentSearches",onSelect:function(A){var V=A.item,_e=A.event;ge(V),at(_e)||s()},getItemUrl:function(A){return A.item.url},getItems:function(){return ye.getAll()}},{sourceId:"favoriteSearches",onSelect:function(A){var V=A.item,_e=A.event;ge(V),at(_e)||s()},getItemUrl:function(A){return A.item.url},getItems:function(){return oe.getAll()}}];var Y=!!F;return or.search([{query:k,indexName:n,params:Rt({attributesToRetrieve:["hierarchy.lvl0","hierarchy.lvl1","hierarchy.lvl2","hierarchy.lvl3","hierarchy.lvl4","hierarchy.lvl5","hierarchy.lvl6","content","type","url"],attributesToSnippet:["hierarchy.lvl1:".concat(Q.current),"hierarchy.lvl2:".concat(Q.current),"hierarchy.lvl3:".concat(Q.current),"hierarchy.lvl4:".concat(Q.current),"hierarchy.lvl5:".concat(Q.current),"hierarchy.lvl6:".concat(Q.current),"content:".concat(Q.current)],snippetEllipsisText:"…",highlightPreTag:"<mark>",highlightPostTag:"</mark>",hitsPerPage:20,clickAnalytics:Y},a)}]).catch(function(A){throw A.name==="RetryError"&&Z("error"),A}).then(function(A){var V=A.results[0],_e=V.hits,so=V.nbHits,jt=cn(_e,function(Et){return Qn(Et)},c);T.context.searchSuggestions.length<Object.keys(jt).length&&H({searchSuggestions:Object.keys(jt)}),H({nbHits:so});var ar={};return Y&&(ar={__autocomplete_indexName:n,__autocomplete_queryID:V.queryID,__autocomplete_algoliaCredentials:{appId:e,apiKey:r}}),Object.values(jt).map(function(Et,fo){return{sourceId:"hits".concat(fo),onSelect:function(z){var Oe=z.item,Ze=z.event;ge(Oe),at(Ze)||s()},getItemUrl:function(z){return z.item.url},getItems:function(){return Object.values(cn(Et,function(z){return z.hierarchy.lvl1},c)).map(m).map(function(z){return z.map(function(Oe){var Ze=null,ur=z.find(function(cr){return cr.type==="lvl1"&&cr.hierarchy.lvl1===Oe.hierarchy.lvl1});return Oe.type!=="lvl1"&&ur&&(Ze=ur),Rt(Rt({},Oe),{},{__docsearch_parent:Ze},ar)})}).flat()}}})})}})},[n,a,c,or,s,ye,oe,ge,ee,i,y,m,P,F,e,r]),co=be.getEnvironmentProps,lo=be.getRootProps,ir=be.refresh;return function(j){var k=j.getEnvironmentProps,T=j.panelElement,H=j.formElement,Z=j.inputElement;f.useEffect(function(){if(T&&H&&Z){var Y=k({panelElement:T,formElement:H,inputElement:Z}),A=Y.onTouchStart,V=Y.
Line truncated
|
||||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function bn(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function qa(t){var e,r,n=f.useRef(null),o=gn(f.useState(!1),2),i=o[0],a=o[1],c=gn(f.useState((t==null?void 0:t.initialQuery)||void 0),2),u=c[0],s=c[1],l=f.useCallback(function(){a(!0)},[a]),m=f.useCallback(function(){a(!1)},[a]);return function(p){var v=p.isOpen,d=p.onOpen,h=p.onClose,y=p.onInput,b=p.searchButtonRef;f.useEffect(function(){function _(S){var O;(S.keyCode===27&&v||((O=S.key)===null||O===void 0?void 0:O.toLowerCase())==="k"&&(S.metaKey||S.ctrlKey)||!function(g){var P=g.target,C=P.tagName;return P.isContentEditable||C==="INPUT"||C==="SELECT"||C==="TEXTAREA"}(S)&&S.key==="/"&&!v)&&(S.preventDefault(),v?h():document.body.classList.contains("DocSearch--active")||document.body.classList.contains("DocSearch--active")||d()),b&&b.current===document.activeElement&&y&&/[a-zA-Z0-9]/.test(String.fromCharCode(S.keyCode))&&y(S)}return window.addEventListener("keydown",_),function(){window.removeEventListener("keydown",_)}},[v,d,h,y,b])}({isOpen:i,onOpen:l,onClose:m,onInput:f.useCallback(function(p){a(!0),s(p.key)},[a,s]),searchButtonRef:n}),f.createElement(f.Fragment,null,f.createElement(Vo,{ref:n,translations:t==null||(e=t.translations)===null||e===void 0?void 0:e.button,onClick:l}),i&&Ln(f.createElement(La,Qt({},t,{initialScrollY:window.scrollY,initialQuery:u,translations:t==null||(r=t.translations)===null||r===void 0?void 0:r.modal,onClose:m})),document.body))}function Ma(t){Mn(f.createElement(qa,Lt({},t,{transformSearchClient:function(e){return e.addAlgoliaAgent("docsearch.js","3.6.0"),t.transformSearchClient?t.transformSearchClient(e):e}})),function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:window;return typeof e=="string"?r.document.querySelector(e):e}(t.container,t.environment))}const Ha={id:"docsearch"},Ba=mo({__name:"VPAlgoliaSearchBox",props:{algolia:{}},setup(t){const e=t,r=po(),n=vo(),{site:o,localeIndex:i,lang:a}=Oo();ho(c),yo(i,c);async function c(){var v,d;await go();const l={...e.algolia,...(v=e.algolia.locales)==null?void 0:v[i.value]},m=((d=l.searchParameters)==null?void 0:d.facetFilters)??[],p=[...(Array.isArray(m)?m:[m]).filter(h=>!h.startsWith("lang:")),`lang:${a.value}`];u({...l,searchParameters:{...l.searchParameters,facetFilters:p}})}function u(l){const m=Object.assign({},l,{container:"#docsearch",navigator:{navigate({itemUrl:p}){const{pathname:v}=new URL(window.location.origin+p);n.path===v?window.location.assign(window.location.origin+p):r.go(p)}},transformItems(p){return p.map(v=>Object.assign({},v,{url:s(v.url)}))},hitComponent({hit:p,children:v}){return{__v:null,type:"a",ref:void 0,constructor:void 0,key:void 0,props:{href:p.url,children:v}}}});Ma(m)}function s(l){const{pathname:m,hash:p}=new URL(l,location.origin);return m.replace(/\.html$/,o.value.cleanUrls?"":".html")+p}return(l,m)=>(bo(),_o("div",Ha))}});export{Ba as default};
|
||||
@@ -1,2 +0,0 @@
|
||||
function Yn(e,t){const n=Object.create(null),s=e.split(",");for(let r=0;r<s.length;r++)n[s[r]]=!0;return t?r=>!!n[r.toLowerCase()]:r=>!!n[r]}const te={},ft=[],Pe=()=>{},xi=()=>!1,Ei=/^on[^a-z]/,Ht=e=>Ei.test(e),Jn=e=>e.startsWith("onUpdate:"),oe=Object.assign,Xn=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ti=Object.prototype.hasOwnProperty,q=(e,t)=>Ti.call(e,t),N=Array.isArray,at=e=>an(e)==="[object Map]",hr=e=>an(e)==="[object Set]",B=e=>typeof e=="function",re=e=>typeof e=="string",Zn=e=>typeof e=="symbol",ee=e=>e!==null&&typeof e=="object",pr=e=>ee(e)&&B(e.then)&&B(e.catch),gr=Object.prototype.toString,an=e=>gr.call(e),Ai=e=>an(e).slice(8,-1),mr=e=>an(e)==="[object Object]",Qn=e=>re(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,At=Yn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),un=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Ri=/-(\w)/g,Me=un(e=>e.replace(Ri,(t,n)=>n?n.toUpperCase():"")),Pi=/\B([A-Z])/g,rt=un(e=>e.replace(Pi,"-$1").toLowerCase()),dn=un(e=>e.charAt(0).toUpperCase()+e.slice(1)),Xt=un(e=>e?`on${dn(e)}`:""),Ft=(e,t)=>!Object.is(e,t),Tn=(e,t)=>{for(let n=0;n<e.length;n++)e[n](t)},en=(e,t,n)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},Ii=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Oi=e=>{const t=re(e)?Number(e):NaN;return isNaN(t)?e:t};let xs;const Nn=()=>xs||(xs=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Gn(e){if(N(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=re(s)?Li(s):Gn(s);if(r)for(const i in r)t[i]=r[i]}return t}else{if(re(e))return e;if(ee(e))return e}}const Fi=/;(?![^(]*\))/g,Si=/:([^]+)/,Mi=/\/\*[^]*?\*\//g;function Li(e){const t={};return e.replace(Mi,"").split(Fi).forEach(n=>{if(n){const s=n.split(Si);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function es(e){let t="";if(re(e))t=e;else if(N(e))for(let n=0;n<e.length;n++){const s=es(e[n]);s&&(t+=s+" ")}else if(ee(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Ni="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Hi=Yn(Ni);function _r(e){return!!e||e===""}const Fc=e=>re(e)?e:e==null?"":N(e)||ee(e)&&(e.toString===gr||!B(e.toString))?JSON.stringify(e,br,2):String(e),br=(e,t)=>t&&t.__v_isRef?br(e,t.value):at(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,r])=>(n[`${s} =>`]=r,n),{})}:hr(t)?{[`Set(${t.size})`]:[...t.values()]}:ee(t)&&!N(t)&&!mr(t)?String(t):t;let _e;class $i{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=_e,!t&&_e&&(this.index=(_e.scopes||(_e.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=_e;try{return _e=this,t()}finally{_e=n}}}on(){_e=this}off(){_e=this.parent}stop(t){if(this._active){let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.scopes)for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0,this._active=!1}}}function Ui(e,t=_e){t&&t.active&&t.effects.push(e)}function ji(){return _e}function Sc(e){_e&&_e.cleanups.push(e)}const ts=e=>{const t=new Set(e);return t.w=0,t.n=0,t},yr=e=>(e.w&Ve)>0,vr=e=>(e.n&Ve)>0,Bi=({deps:e})=>{if(e.length)for(let t=0;t<e.length;t++)e[t].w|=Ve},Di=e=>{const{deps:t}=e;if(t.length){let n=0;for(let s=0;s<t.length;s++){const r=t[s];yr(r)&&!vr(r)?r.delete(e):t[n++]=r,r.w&=~Ve,r.n&=~Ve}t.length=n}},tn=new WeakMap;let Et=0,Ve=1;const Hn=30;let Ae;const nt=Symbol(""),$n=Symbol("");class ns{constructor(t,n=null,s){this.fn=t,this.scheduler=n,this.active=!0,this.deps=[],this.parent=void 0,Ui(this,s)}run(){if(!this.active)return this.fn();let t=Ae,n=ke;for(;t;){if(t===this)return;t=t.parent}try{return this.parent=Ae,Ae=this,ke=!0,Ve=1<<++Et,Et<=Hn?Bi(this):Es(this),this.fn()}finally{Et<=Hn&&Di(this),Ve=1<<--Et,Ae=this.parent,ke=n,this.parent=void 0,this.deferStop&&this.stop()}}stop(){Ae===this?this.deferStop=!0:this.active&&(Es(this),this.onStop&&this.onStop(),this.active=!1)}}function Es(e){const{deps:t}=e;if(t.length){for(let n=0;n<t.length;n++)t[n].delete(e);t.length=0}}let ke=!0;const Cr=[];function vt(){Cr.push(ke),ke=!1}function Ct(){const e=Cr.pop();ke=e===void 0?!0:e}function pe(e,t,n){if(ke&&Ae){let s=tn.get(e);s||tn.set(e,s=new Map);let r=s.get(n);r||s.set(n,r=ts()),wr(r)}}function wr(e,t){let n=!1;Et<=Hn?vr(e)||(e.n|=Ve,n=!yr(e)):n=!e.has(Ae),n&&(e.add(Ae),Ae.deps.push(e))}function He(e,t,n,s,r,i){const o=tn.get(e);if(!o)return;let l=[];if(t==="clear")l=[...o.values()];else if(n==="length"&&N(e)){const c=Number(s);o.forEach((a,d)=>{(d==="length"||d>=c)&&l.push(a)})}else switch(n!==void 0&&l.push(o.get(n)),t){case"add":N(e)?Qn(n)&&l.push(o.get("length")):(l.push(o.get(nt)),at(e)&&l.pushLine truncated
|
||||
`),l=l.slice(0,-1),o&&(l=l.replace(/^ *(\$|>) /gm,"").trim()),Oc(l).then(()=>{n.classList.add("copied"),clearTimeout(e.get(n));const c=setTimeout(()=>{n.classList.remove("copied"),n.blur(),e.delete(n)},2e3);e.set(n,c)})}})}}async function Oc(e){try{return navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea"),n=document.activeElement;t.value=e,t.setAttribute("readonly",""),t.style.contain="strict",t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="12pt";const s=document.getSelection(),r=s?s.rangeCount>0&&s.getRangeAt(0):null;document.body.appendChild(t),t.select(),t.selectionStart=0,t.selectionEnd=e.length,document.execCommand("copy"),document.body.removeChild(t),r&&(s.removeAllRanges(),s.addRange(r)),n&&n.focus()}}function uf(){Ce&&window.addEventListener("click",e=>{var n,s;const t=e.target;if(t.matches(".vp-code-group input")){const r=(n=t.parentElement)==null?void 0:n.parentElement,i=Array.from((r==null?void 0:r.querySelectorAll("input"))||[]).indexOf(t),o=r==null?void 0:r.querySelector('div[class*="language-"].active'),l=(s=r==null?void 0:r.querySelectorAll('div[class*="language-"]:not(.language-id)'))==null?void 0:s[i];o&&l&&o!==l&&(o.classList.remove("active"),l.classList.add("active"))}})}export{Jc as $,ri as A,Fo as B,zc as C,jc as D,Cl as E,he as F,se as G,Gn as H,Uc as I,Qc as J,Bc as K,pi as L,Ce as M,Dc as N,Nc as O,Gc as P,Hc as Q,qc as R,ef as S,di as T,gt as U,ll as V,zo as W,sf as X,Lr as Y,go as Z,Zc as _,li as a,kc as a0,$c as a1,Yc as a2,Wc as a3,qn as a4,lf as a5,Cc as a6,tf as a7,bc as a8,of as a9,ff as aa,tt as ab,Xc as ac,rf as ad,vc as ae,cf as af,af as ag,uf as ah,xc as ai,_o as b,Vc as c,us as d,Lc as e,Ir as f,Mc as g,dt as h,ji as i,Sc as j,$o as k,Ee as l,ci as m,es as n,ni as o,vn as p,dc as q,Kc as r,cr as s,Fc as t,nf as u,uc as v,Zt as w,yi as x,Cn as y,oi as z};
|
||||
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @vue/shared v3.4.30
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**//*! #__NO_SIDE_EFFECTS__ */function hr(e,t){const n=new Set(e.split(","));return r=>n.has(r)}const te={},gt=[],Se=()=>{},ho=()=>!1,Vt=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),pr=e=>e.startsWith("onUpdate:"),le=Object.assign,gr=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},po=Object.prototype.hasOwnProperty,Y=(e,t)=>po.call(e,t),B=Array.isArray,mt=e=>vn(e)==="[object Map]",Fs=e=>vn(e)==="[object Set]",W=e=>typeof e=="function",ie=e=>typeof e=="string",Ze=e=>typeof e=="symbol",Z=e=>e!==null&&typeof e=="object",$s=e=>(Z(e)||W(e))&&W(e.then)&&W(e.catch),Hs=Object.prototype.toString,vn=e=>Hs.call(e),go=e=>vn(e).slice(8,-1),js=e=>vn(e)==="[object Object]",mr=e=>ie(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,yt=hr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),bn=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},mo=/-(\w)/g,Ne=bn(e=>e.replace(mo,(t,n)=>n?n.toUpperCase():"")),yo=/\B([A-Z])/g,ft=bn(e=>e.replace(yo,"-$1").toLowerCase()),wn=bn(e=>e.charAt(0).toUpperCase()+e.slice(1)),sn=bn(e=>e?`on${wn(e)}`:""),Je=(e,t)=>!Object.is(e,t),$n=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Vs=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},_o=e=>{const t=parseFloat(e);return isNaN(t)?e:t},vo=e=>{const t=ie(e)?Number(e):NaN;return isNaN(t)?e:t};let Dr;const Ds=()=>Dr||(Dr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function yr(e){if(B(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=ie(r)?Co(r):yr(r);if(s)for(const i in s)t[i]=s[i]}return t}else if(ie(e)||Z(e))return e}const bo=/;(?![^(]*\))/g,wo=/:([^]+)/,Eo=/\/\*[^]*?\*\//g;function Co(e){const t={};return e.replace(Eo,"").split(bo).forEach(n=>{if(n){const r=n.split(wo);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function _r(e){let t="";if(ie(e))t=e;else if(B(e))for(let n=0;n<e.length;n++){const r=_r(e[n]);r&&(t+=r+" ")}else if(Z(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const So="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",xo=hr(So);function Us(e){return!!e||e===""}const Ua=e=>ie(e)?e:e==null?"":B(e)||Z(e)&&(e.toString===Hs||!W(e.toString))?JSON.stringify(e,Bs,2):String(e),Bs=(e,t)=>t&&t.__v_isRef?Bs(e,t.value):mt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],i)=>(n[Hn(r,i)+" =>"]=s,n),{})}:Fs(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Hn(n))}:Ze(t)?Hn(t):Z(t)&&!B(t)&&!js(t)?String(t):t,Hn=(e,t="")=>{var n;return Ze(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
||||
* @vue/reactivity v3.4.30
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/let we;class To{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=we,!t&&we&&(this.index=(we.scopes||(we.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const n=we;try{return we=this,t()}finally{we=n}}}on(){we=this}off(){we=this.parent}stop(t){if(this._active){let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.scopes)for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0,this._active=!1}}}function Ao(e,t=we){t&&t.active&&t.effects.push(e)}function Ks(){return we}function Ro(e){we&&we.cleanups.push(e)}let ct;class vr{constructor(t,n,r,s){this.fn=t,this.trigger=n,this.scheduler=r,this.active=!0,this.deps=[],this._dirtyLevel=5,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,Ao(this,s)}get dirty(){if(this._dirtyLevel===2)return!1;if(this._dirtyLevel===3||this._dirtyLevel===4){this._dirtyLevel=1,et();for(let t=0;t<this._depsLength;t++){const n=this.deps[t];if(n.computed){if(n.computed.effect._dirtyLevel===2)return Ve(),!0;if(Oo(n.computed),this._dirtyLevel>=5)break}}this._dirtyLevel===1&&(this._dirtyLevel=0),Ve()}return this._dirtyLevel>=5}set dirty(t){this._dirtyLevel=t?5:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=ze,n=ct;try{return ze=!0,ct=this,this._runnings++,Ur(this),this.fn()}finally{Br(this),this._runnings--,ct=n,ze=t}}stop(){this.active&&(Ur(this),Br(this),this.onStop&&this.onStop(),this.active=!1)}}function Oo(e){return e.value}function Ur(e){e._trackId++,e._depsLength=0}function Br(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)ks(e.deps[t],e);e.deps.length=e._depsLength}}function ks(e,t){const n=e.get(t);n!==void 0&&t._trackId!==n&&(e.delete(t),e.size===0&&e.cleanup())}let ze=!0,nr=0;const Ws=[];function et(){Ws.push(ze),ze=!1}function Ve(){const e=Ws.pop();ze=e===void 0?!0:e}function br(){nr++}function wr(){for(nr--;!nr&&rr.length;)rr.shift()()}function qs(e,t,n){if(t.get(e)!==e._trackId){t.set(e,e._trackId);const r=e.deps[e._depsLength];r!==t?(r&&ks(r,e),e.deps[e._depsLength++]=t):e._depsLength++}}const rr=[];function Gs(e,t,n){br();for(const r of e.keys()){let s;if(!e.computed&&r.computed&&r._runnings>0&&(s??(s=e.get(r)===r._trackId))){r._dirtyLevel=2;continue}r._dirtyLevel<t&&(s??(s=e.get(r)===r._trackId))&&(r._shouldSchedule||(r._shouldSchedule=r._dirtyLevel===0),r.computed&&r._dirtyLevel===2&&(r._shouldSchedule=!0),r._dirtyLevel=t),r._shouldSchedule&&(s??(s=e.get(r)===r._trackId))&&(r.trigger(),(!r._runnings||r.allowRecurse)&&r._dirtyLevel!==3&&(r._shouldSchedule=!1,r.scheduler&&rr.push(r.scheduler)))}wr()}const zs=(e,t)=>{const n=new Map;return n.cleanup=e,n.computed=t,n},un=new WeakMap,at=Symbol(""),sr=Symbol("");function ve(e,t,n){if(ze&&ct){let r=un.get(e);r||un.set(e,r=new Map);let s=r.get(n);s||r.set(n,s=zs(()=>r.delete(n))),qs(ct,s)}}function je(e,t,n,r,s,i){const o=un.get(e);if(!o)return;let l=[];if(t==="clear")l=[...o.values()];else if(n==="length"&&B(e)){const c=Number(r);o.forEach((u,d)=>{(d==="length"||!Ze(d)&&d>=c)&&l.push(u)})}else switch(n!==void 0&&l.push(o.get(n)),t){case"add":B(e)?mr(n)&&l.push(o.get("length")):(l.push(o.get(at)),mt(e)&&l.push(o.get(sr)));break;case"delete":B(e)||(l.push(o.get(at)),mt(e)&&l.push(o.get(sr)));break;case"set":mt(e)&&l.push(o.get(at));break}br();for(const c of l)c&&Gs(c,5);wr()}function Lo(e,t){const n=un.get(e);return n&&n.get(t)}const Io=hr("__proto__,__v_isRef,__isVue"),Xs=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ze)),Kr=Po();function Po(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const r=J(this);for(let i=0,o=this.length;i<o;i++)ve(r,"get",i+"");const s=r[t](...n);return s===-1||s===!1?r[t](...n.map(J)):s}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){et(),br();const r=J(this)[t].apply(this,n);return wr(),Ve(),r}}),e}function Mo(e){Ze(e)||(e=String(e));const t=J(this);return ve(t,"has",e),t.hasOwnProperty(e)}class Ys{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return r===(s?i?qo:ei:i?Zs:Qs).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const o=B(t);if(!s){if(o&&Y(Kr,n))return Reflect.get(Kr,n,r);if(n==="hasOwnProperty")return Mo}const l=Reflect.get(t,n,r);return(Ze(n)?Xs.has(n):Io(n))||(s||ve(t,"get",n),i)?l:pe(l)?o&&mr(n)?l:l.value:Z(l)?s?Sn(l):Cn(l):l}}class Js extends Ys{constructor(t=!1){super(!1,t)}set(t,n,r,s){let i=t[n];if(!this._isShallow){const c=Mt(i);if(!fn(r)&&!Mt(r)&&(i=J(i),r=J(r)),Line truncated
|
||||
* @vue/runtime-core v3.4.30
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/function Xe(e,t,n,r){try{return r?e(...r):e()}catch(s){Dt(s,t,n)}}function xe(e,t,n,r){if(W(e)){const s=Xe(e,t,n,r);return s&&$s(s)&&s.catch(i=>{Dt(i,t,n)}),s}if(B(e)){const s=[];for(let i=0;i<e.length;i++)s.push(xe(e[i],t,n,r));return s}}function Dt(e,t,n,r=!0){const s=t?t.vnode:null;if(t){let i=t.parent;const o=t.proxy,l=`https://vuejs.org/error-reference/#runtime-${n}`;for(;i;){const u=i.ec;if(u){for(let d=0;d<u.length;d++)if(u[d](e,o,l)===!1)return}i=i.parent}const c=t.appContext.config.errorHandler;if(c){et(),Xe(c,null,10,[e,o,l]),Ve();return}}il(e,n,s,r)}function il(e,t,n,r=!0){console.error(e)}let Ft=!1,ir=!1;const de=[];let Pe=0;const _t=[];let We=null,it=0;const li=Promise.resolve();let Ar=null;function xn(e){const t=Ar||li;return e?t.then(this?e.bind(this):e):t}function ol(e){let t=Pe+1,n=de.length;for(;t<n;){const r=t+n>>>1,s=de[r],i=$t(s);i<e||i===e&&s.pre?t=r+1:n=r}return t}function Tn(e){(!de.length||!de.includes(e,Ft&&e.allowRecurse?Pe+1:Pe))&&(e.id==null?de.push(e):de.splice(ol(e.id),0,e),ci())}function ci(){!Ft&&!ir&&(ir=!0,Ar=li.then(ai))}function ll(e){const t=de.indexOf(e);t>Pe&&de.splice(t,1)}function cl(e){B(e)?_t.push(...e):(!We||!We.includes(e,e.allowRecurse?it+1:it))&&_t.push(e),ci()}function zr(e,t,n=Ft?Pe+1:0){for(;n<de.length;n++){const r=de[n];if(r&&r.pre){if(e&&r.id!==e.uid)continue;de.splice(n,1),n--,r()}}}function dn(e){if(_t.length){const t=[...new Set(_t)].sort((n,r)=>$t(n)-$t(r));if(_t.length=0,We){We.push(...t);return}for(We=t,it=0;it<We.length;it++){const n=We[it];n.active!==!1&&n()}We=null,it=0}}const $t=e=>e.id==null?1/0:e.id,al=(e,t)=>{const n=$t(e)-$t(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function ai(e){ir=!1,Ft=!0,de.sort(al);try{for(Pe=0;Pe<de.length;Pe++){const t=de[Pe];t&&t.active!==!1&&Xe(t,null,14)}}finally{Pe=0,de.length=0,dn(),Ft=!1,Ar=null,(de.length||_t.length)&&ai()}}function ul(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||te;let s=n;const i=t.startsWith("update:"),o=i&&t.slice(7);if(o&&o in r){const d=`${o==="modelValue"?"model":o}Modifiers`,{number:h,trim:y}=r[d]||te;y&&(s=n.map(E=>ie(E)?E.trim():E)),h&&(s=n.map(_o))}let l,c=r[l=sn(t)]||r[l=sn(Ne(t))];!c&&i&&(c=r[l=sn(ft(t))]),c&&xe(c,e,6,s);const u=r[l+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,xe(u,e,6,s)}}function ui(e,t,n=!1){const r=t.emitsCache,s=r.get(e);if(s!==void 0)return s;const i=e.emits;let o={},l=!1;if(!W(e)){const c=u=>{const d=ui(u,t,!0);d&&(l=!0,le(o,d))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!i&&!l?(Z(e)&&r.set(e,null),null):(B(i)?i.forEach(c=>o[c]=null):le(o,i),Z(e)&&r.set(e,o),o)}function An(e,t){return!e||!Vt(t)?!1:(t=t.slice(2).replace(/Once$/,""),Y(e,t[0].toLowerCase()+t.slice(1))||Y(e,ft(t))||Y(e,t))}let he=null,Rn=null;function hn(e){const t=he;return he=e,Rn=e&&e.type.__scopeId||null,t}function Ba(e){Rn=e}function Ka(){Rn=null}function fl(e,t=he,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&cs(-1);const i=hn(t);let o;try{o=e(...s)}finally{hn(i),r._d&&cs(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function jn(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[i],slots:o,attrs:l,emit:c,render:u,renderCache:d,props:h,data:y,setupState:E,ctx:A,inheritAttrs:P}=e,$=hn(e);let q,D;try{if(n.shapeFlag&4){const m=s||r,M=m;q=Ae(u.call(M,m,d,h,E,y,A)),D=l}else{const m=t;q=Ae(m.length>1?m(h,{attrs:l,slots:o,emit:c}):m(h,null)),D=t.props?l:dl(l)}}catch(m){Pt.length=0,Dt(m,e,1),q=se(me)}let g=q;if(D&&P!==!1){const m=Object.keys(D),{shapeFlag:M}=g;m.length&&M&7&&(i&&m.some(pr)&&(D=hl(D,i)),g=Qe(g,D,!1,!0))}return n.dirs&&(g=Qe(g,null,!1,!0),g.dirs=g.dirs?g.dirs.concat(n.dirs):n.dirs),n.transition&&(g.transition=n.transition),q=g,hn($),q}const dl=e=>{let t;for(const n in e)(n==="class"||n==="style"||Vt(n))&&((t||(t={}))[n]=e[n]);return t},hl=(e,t)=>{const n={};for(const r in e)(!pr(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function pl(e,t,n){const{props:r,children:s,component:i}=e,{props:o,children:l,patchFlag:c}=t,u=i.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Xr(r,o,u):!!o;if(c&8){const d=t.dynamicProps;for(let h=0;h<d.length;h++){const y=d[h];if(o[y]!==r[y]&&!An(u,y))return!0}}}else return(s||l)&&(!l||!l.$stable)?!0:r===o?!1:r?o?Xr(r,o,u):!0:!!o;return!1}function Xr(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let s=0;s<r.length;s++){const i=r[s];if(t[i]!==e[i]&&!An(n,i))return!0}return!1}function gl({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r===e)(e=t.vnode).el=n,t=t.parent;else break}}const fi="components";function ka(e,t){return hi(fi,e,!0,t)||e}const di=Symbol.for("v-ndc");function Wa(e){return ie(e)?hi(fi,e,!1)||e:e||di}function hi(e,t,n=!0,r=!1){const s=he||ue;if(s){const i=s.type;{const l=fc(i,!1);if(l&&(l===t||l===Ne(t)||l===wn(Ne(t))))return i}const o=Yr(s[e]||i[e],t)||Y
Line truncated
|
||||
* @vue/runtime-dom v3.4.30
|
||||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||||
* @license MIT
|
||||
**/const pc="http://www.w3.org/2000/svg",gc="http://www.w3.org/1998/Math/MathML",He=typeof document<"u"?document:null,ds=He&&He.createElement("template"),mc={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?He.createElementNS(pc,e):t==="mathml"?He.createElementNS(gc,e):n?He.createElement(e,{is:n}):He.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>He.createTextNode(e),createComment:e=>He.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>He.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,i){const o=n?n.previousSibling:t.lastChild;if(s&&(s===i||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{ds.innerHTML=r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e;const l=ds.content;if(r==="svg"||r==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ke="transition",xt="animation",jt=Symbol("_vtc"),qi=(e,{slots:t})=>dr(Zl,yc(e),t);qi.displayName="Transition";const Gi={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String};qi.props=le({},Mi,Gi);const rt=(e,t=[])=>{B(e)?e.forEach(n=>n(...t)):e&&e(...t)},hs=e=>e?B(e)?e.some(t=>t.length>1):e.length>1:!1;function yc(e){const t={};for(const x in e)x in Gi||(t[x]=e[x]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=i,appearActiveClass:u=o,appearToClass:d=l,leaveFromClass:h=`${n}-leave-from`,leaveActiveClass:y=`${n}-leave-active`,leaveToClass:E=`${n}-leave-to`}=e,A=_c(s),P=A&&A[0],$=A&&A[1],{onBeforeEnter:q,onEnter:D,onEnterCancelled:g,onLeave:m,onLeaveCancelled:M,onBeforeAppear:O=q,onAppear:K=D,onAppearCancelled:U=g}=t,I=(x,G,ne)=>{st(x,G?d:l),st(x,G?u:o),ne&&ne()},w=(x,G)=>{x._isLeaving=!1,st(x,h),st(x,E),st(x,y),G&&G()},N=x=>(G,ne)=>{const ce=x?K:D,j=()=>I(G,x,ne);rt(ce,[G,j]),ps(()=>{st(G,x?c:i),ke(G,x?d:l),hs(ce)||gs(G,r,P,j)})};return le(t,{onBeforeEnter(x){rt(q,[x]),ke(x,i),ke(x,o)},onBeforeAppear(x){rt(O,[x]),ke(x,c),ke(x,u)},onEnter:N(!1),onAppear:N(!0),onLeave(x,G){x._isLeaving=!0;const ne=()=>w(x,G);ke(x,h),ke(x,y),wc(),ps(()=>{x._isLeaving&&(st(x,h),ke(x,E),hs(m)||gs(x,r,$,ne))}),rt(m,[x,ne])},onEnterCancelled(x){I(x,!1),rt(g,[x])},onAppearCancelled(x){I(x,!0),rt(U,[x])},onLeaveCancelled(x){w(x),rt(M,[x])}})}function _c(e){if(e==null)return null;if(Z(e))return[Kn(e.enter),Kn(e.leave)];{const t=Kn(e);return[t,t]}}function Kn(e){return vo(e)}function ke(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[jt]||(e[jt]=new Set)).add(t)}function st(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[jt];n&&(n.delete(t),n.size||(e[jt]=void 0))}function ps(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let vc=0;function gs(e,t,n,r){const s=e._endId=++vc,i=()=>{s===e._endId&&r()};if(n)return setTimeout(i,n);const{type:o,timeout:l,propCount:c}=bc(e,t);if(!o)return r();const u=o+"end";let d=0;const h=()=>{e.removeEventListener(u,y),i()},y=E=>{E.target===e&&++d>=c&&h()};setTimeout(()=>{d<c&&h()},l+1),e.addEventListener(u,y)}function bc(e,t){const n=window.getComputedStyle(e),r=A=>(n[A]||"").split(", "),s=r(`${Ke}Delay`),i=r(`${Ke}Duration`),o=ms(s,i),l=r(`${xt}Delay`),c=r(`${xt}Duration`),u=ms(l,c);let d=null,h=0,y=0;t===Ke?o>0&&(d=Ke,h=o,y=i.length):t===xt?u>0&&(d=xt,h=u,y=c.length):(h=Math.max(o,u),d=h>0?o>u?Ke:xt:null,y=d?d===Ke?i.length:c.length:0);const E=d===Ke&&/\b(transform|all)(,|$)/.test(r(`${Ke}Property`).toString());return{type:d,timeout:h,propCount:y,hasTransform:E}}function ms(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>ys(n)+ys(e[r])))}function ys(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function wc(){return document.body.offsetHeight}function Ec(e,t,n){const r=e[jt];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const _s=Symbol("_vod"),Cc=Symbol("_vsh"),Sc=Symbol(""),xc=/(^|;)\s*display\s*:/;function Tc(e,t,n){const r=e.style,s=ie(n);let i=!1;if(n&&!s){if(t)if(ie(t))for(const o of t.split(";")){const l=o.slice(0,o.indexOf(":")).trim();n[l]==null&&cn(r,l,"")}else for(const o in t)n[o]==null&&cn(r,o,"");for(const o in n)o==="display"&&(i=!0),cn(r,o,n[o])}else if(s){if(t!==n){const o=r[Sc];o&&(n+=";"+o),r.cssText=n,i=xc.test(n)}}else t&&e.removeAttribute("style");_s i
Line truncated
|
||||
@@ -1 +0,0 @@
|
||||
const s="/assets/qrcode.0a61500e.png";export{s as _};
|
||||
@@ -0,0 +1 @@
|
||||
const s="/assets/qrcode.b_bFVwtg.png";export{s as _};
|
||||
@@ -0,0 +1,2 @@
|
||||
const __vite__fileDeps=["assets/chunks/VPAlgoliaSearchBox.BRY8HxQs.js","assets/chunks/framework.BmdFiWrL.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
|
||||
import{d as _,o as a,c,r as l,n as M,a as D,t as T,b,w as d,e as f,T as pe,_ as k,u as Ge,i as je,f as ze,g as he,h as $,j as v,k as r,p as B,l as H,m as z,q as ce,s as N,v as j,x as Z,y as W,z as x,A as Pe,B as Ke,C as qe,D as K,F as C,E,G as Le,H as ee,I as m,J as R,K as Ve,L as te,M as Y,N as oe,O as Re,P as Se,Q as We,R as Je,S as we,U as se,V as Ye,W as Xe,X as Qe,Y as Ie,Z as Te,$ as Ze,a0 as xe,a1 as et,a2 as tt,a3 as ie}from"./framework.BmdFiWrL.js";const ot=_({__name:"VPBadge",props:{text:{},type:{default:"tip"}},setup(o){return(e,t)=>(a(),c("span",{class:M(["VPBadge",e.type])},[l(e.$slots,"default",{},()=>[D(T(e.text),1)])],2))}}),st={key:0,class:"VPBackdrop"},nt=_({__name:"VPBackdrop",props:{show:{type:Boolean}},setup(o){return(e,t)=>(a(),b(pe,{name:"fade"},{default:d(()=>[e.show?(a(),c("div",st)):f("",!0)]),_:1}))}}),at=k(nt,[["__scopeId","data-v-c79a1216"]]),S=Ge;function rt(o,e){let t,n=!1;return()=>{t&&clearTimeout(t),n?t=setTimeout(o,e):(o(),(n=!0)&&setTimeout(()=>n=!1,e))}}function ue(o){return/^\//.test(o)?o:`/${o}`}function fe(o){const{pathname:e,search:t,hash:n,protocol:s}=new URL(o,"http://a.com");if(je(o)||o.startsWith("#")||!s.startsWith("http")||!ze(e))return o;const{site:i}=S(),u=e.endsWith("/")||e.endsWith(".html")?o:o.replace(/(?:(^\.+)\/)?.*$/,`$1${e.replace(/(\.md)?$/,i.value.cleanUrls?"":".html")}${t}${n}`);return he(u)}function J({correspondingLink:o=!1}={}){const{site:e,localeIndex:t,page:n,theme:s,hash:i}=S(),u=$(()=>{var p,g;return{label:(p=e.value.locales[t.value])==null?void 0:p.label,link:((g=e.value.locales[t.value])==null?void 0:g.link)||(t.value==="root"?"/":`/${t.value}/`)}});return{localeLinks:$(()=>Object.entries(e.value.locales).flatMap(([p,g])=>u.value.label===g.label?[]:{text:g.label,link:it(g.link||(p==="root"?"/":`/${p}/`),s.value.i18nRouting!==!1&&o,n.value.relativePath.slice(u.value.link.length-1),!e.value.cleanUrls)+i.value})),currentLang:u}}function it(o,e,t,n){return e?o.replace(/\/$/,"")+ue(t.replace(/(^|\/)index\.md$/,"$1").replace(/\.md$/,n?".html":"")):o}const lt=o=>(B("data-v-d6be1790"),o=o(),H(),o),ct={class:"NotFound"},ut={class:"code"},dt={class:"title"},vt=lt(()=>v("div",{class:"divider"},null,-1)),pt={class:"quote"},ht={class:"action"},ft=["href","aria-label"],_t=_({__name:"NotFound",setup(o){const{theme:e}=S(),{currentLang:t}=J();return(n,s)=>{var i,u,h,p,g;return a(),c("div",ct,[v("p",ut,T(((i=r(e).notFound)==null?void 0:i.code)??"404"),1),v("h1",dt,T(((u=r(e).notFound)==null?void 0:u.title)??"PAGE NOT FOUND"),1),vt,v("blockquote",pt,T(((h=r(e).notFound)==null?void 0:h.quote)??"But if you don't change your direction, and if you keep looking, you may end up where you are heading."),1),v("div",ht,[v("a",{class:"link",href:r(he)(r(t).link),"aria-label":((p=r(e).notFound)==null?void 0:p.linkLabel)??"go to home"},T(((g=r(e).notFound)==null?void 0:g.linkText)??"Take me home"),9,ft)])])}}}),mt=k(_t,[["__scopeId","data-v-d6be1790"]]);function Ne(o,e){if(Array.isArray(o))return X(o);if(o==null)return[];e=ue(e);const t=Object.keys(o).sort((s,i)=>i.split("/").length-s.split("/").length).find(s=>e.startsWith(ue(s))),n=t?o[t]:[];return Array.isArray(n)?X(n):X(n.items,n.base)}function kt(o){const e=[];let t=0;for(const n in o){const s=o[n];if(s.items){t=e.push(s);continue}e[t]||e.push({items:[]}),e[t].items.push(s)}return e}function bt(o){const e=[];function t(n){for(const s of n)s.text&&s.link&&e.push({text:s.text,link:s.link,docFooterText:s.docFooterText}),s.items&&t(s.items)}return t(o),e}function de(o,e){return Array.isArray(e)?e.some(t=>de(o,t)):z(o,e.link)?!0:e.items?de(o,e.items):!1}function X(o,e){return[...o].map(t=>{const n={...t},s=n.base||e;return s&&n.link&&(n.link=s+n.link),n.items&&(n.items=X(n.items,s)),n})}function O(){const{frontmatter:o,page:e,theme:t}=S(),n=ce("(min-width: 960px)"),s=N(!1),i=$(()=>{const A=t.value.sidebar,I=e.value.relativePath;return A?Ne(A,I):[]}),u=N(i.value);j(i,(A,I)=>{JSON.stringify(A)!==JSON.stringify(I)&&(u.value=i.value)});const h=$(()=>o.value.sidebar!==!1&&u.value.length>0&&o.value.layout!=="home"),p=$(()=>g?o.value.aside==null?t.value.aside==="left":o.value.aside==="left":!1),g=$(()=>o.value.layout==="home"?!1:o.value.aside!=null?!!o.value.aside:t.value.aside!==!1),V=$(()=>h.value&&n.value),y=$(()=>h.value?kt(u.value):[]);function P(){s.value=!0}function w(){s.value=!1}function L(){s.value?w():P()}return{isOpen:s,sidebar:u,sidebarGroups:y,hasSidebar:h,hasAside:g,leftAside:p,isSidebarEnabled:V,open:P,close:w,toggle:L}}function $t(o,e){let t;Z(()=>{t=o.value?document.activeElement:void 0}),W(()=>{window.addEventListener("keyup",n)}),x(()=>{window.removeEventListener("keyup",n)});function n(s){s.key==="Escape"&&o.value&&(e(),t==null||t.focus())}}function gt(o){const{page:e,hash:t}=S(),n=N(!1),s=$(()=>o.value.collapsed!=null),i=$(()=>!!o.value.link),u=N(!1),h=()=>{u.value=z(e.value.relativePath,o.value.link)};j([e,o,t],h),W(h);const p=$(()=>u.value?!0:o.value.items?de(e.value.relativePath,o.value.items):!1),g=$(Line truncated
|
||||
@@ -1,7 +0,0 @@
|
||||
import{d as g,o as a,c as l,r as c,n as C,a as A,t as V,_ as f,u as tt,b as i,e as nt,f as He,g as st,h as L,i as ot,j as at,w as j,k as Q,l as $,m as rt,p as F,q as it,P as lt,s as he,v as K,x as ee,y as le,z as u,F as M,A as y,B as v,T as fe,C as m,D as R,E as se,G as h,H as ze,I as ct,J as ut,K as U,L as De,M as Fe,N as x,O as H,Q as z,R as dt,S as Ne,U as me,V as oe,W as _t,X as J,Y as vt,Z as ge,$ as pt,a0 as ht,a1 as ft,a2 as mt,a3 as gt}from"./framework.44fd0451.js";const yt=g({__name:"VPBadge",props:{text:{},type:{}},setup(n){return(e,t)=>(a(),l("span",{class:C(["VPBadge",e.type??"tip"])},[c(e.$slots,"default",{},()=>[A(V(e.text),1)],!0)],2))}});const bt=f(yt,[["__scopeId","data-v-350d3852"]]),w=tt;function Oe(n){return ot()?(at(n),!0):!1}function Ge(n){return typeof n=="function"?n():i(n)}const $t=typeof window<"u",Re=()=>{};function kt(...n){if(n.length!==1)return nt(...n);const e=n[0];return typeof e=="function"?He(st(()=>({get:e,set:Re}))):L(e)}function Pt(n){var e;const t=Ge(n);return(e=t==null?void 0:t.$el)!=null?e:t}const ye=$t?window:void 0;function Vt(...n){let e,t,o,s;if(typeof n[0]=="string"||Array.isArray(n[0])?([t,o,s]=n,e=ye):[e,t,o,s]=n,!e)return Re;Array.isArray(t)||(t=[t]),Array.isArray(o)||(o=[o]);const r=[],d=()=>{r.forEach(T=>T()),r.length=0},p=(T,I,B,S)=>(T.addEventListener(I,B,S),()=>T.removeEventListener(I,B,S)),_=j(()=>[Pt(e),Ge(s)],([T,I])=>{d(),T&&r.push(...t.flatMap(B=>o.map(S=>p(T,B,S,I))))},{immediate:!0,flush:"post"}),k=()=>{_(),d()};return Oe(k),k}function wt(){const n=L(!1);return rt()&&F(()=>{n.value=!0}),n}function St(n){const e=wt();return $(()=>(e.value,!!n()))}function _e(n,e={}){const{window:t=ye}=e,o=St(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function");let s;const r=L(!1),d=()=>{s&&("removeEventListener"in s?s.removeEventListener("change",p):s.removeListener(p))},p=()=>{o.value&&(d(),s=t.matchMedia(kt(n).value),r.value=!!(s!=null&&s.matches),s&&("addEventListener"in s?s.addEventListener("change",p):s.addListener(p)))};return Q(p),Oe(()=>d()),r}function Ue({window:n=ye}={}){if(!n)return{x:L(0),y:L(0)};const e=L(n.scrollX),t=L(n.scrollY);return Vt(n,"scroll",()=>{e.value=n.scrollX,t.value=n.scrollY},{capture:!1,passive:!0}),{x:e,y:t}}function Lt(n,e){let t,o=!1;return()=>{t&&clearTimeout(t),o?t=setTimeout(n,e):(n(),o=!0,setTimeout(()=>{o=!1},e))}}function ve(n){return/^\//.test(n)?n:`/${n}`}function Z(n){if(it(n))return n.replace(lt,"");const{site:e}=w(),{pathname:t,search:o,hash:s}=new URL(n,"http://example.com"),r=t.endsWith("/")||t.endsWith(".html")?n:n.replace(/(?:(^\.+)\/)?.*$/,`$1${t.replace(/(\.md)?$/,e.value.cleanUrls?"":".html")}${o}${s}`);return he(r)}function qe(n,e){if(Array.isArray(n))return n;if(n==null)return[];e=ve(e);const t=Object.keys(n).sort((o,s)=>s.split("/").length-o.split("/").length).find(o=>e.startsWith(ve(o)));return t?n[t]:[]}function Mt(n){const e=[];let t=0;for(const o in n){const s=n[o];if(s.items){t=e.push(s);continue}e[t]||e.push({items:[]}),e[t].items.push(s)}return e}function Ct(n){const e=[];function t(o){for(const s of o)s.text&&s.link&&e.push({text:s.text,link:s.link}),s.items&&t(s.items)}return t(n),e}function pe(n,e){return Array.isArray(e)?e.some(t=>pe(n,t)):K(n,e.link)?!0:e.items?pe(n,e.items):!1}function D(){const n=ee(),{theme:e,frontmatter:t}=w(),o=_e("(min-width: 960px)"),s=L(!1),r=$(()=>{const P=e.value.sidebar,N=n.data.relativePath;return P?qe(P,N):[]}),d=$(()=>t.value.sidebar!==!1&&r.value.length>0&&t.value.layout!=="home"),p=$(()=>_?t.value.aside==null?e.value.aside==="left":t.value.aside==="left":!1),_=$(()=>t.value.layout==="home"?!1:t.value.aside!=null?!!t.value.aside:e.value.aside!==!1),k=$(()=>d.value&&o.value),T=$(()=>d.value?Mt(r.value):[]);function I(){s.value=!0}function B(){s.value=!1}function S(){s.value?B():I()}return{isOpen:s,sidebar:r,sidebarGroups:T,hasSidebar:d,hasAside:_,leftAside:p,isSidebarEnabled:k,open:I,close:B,toggle:S}}function It(n,e){let t;Q(()=>{t=n.value?document.activeElement:void 0}),F(()=>{window.addEventListener("keyup",o)}),le(()=>{window.removeEventListener("keyup",o)});function o(s){s.key==="Escape"&&n.value&&(e(),t==null||t.focus())}}function Bt(n){const{page:e}=w(),t=L(!1),o=$(()=>n.value.collapsed!=null),s=$(()=>!!n.value.link),r=$(()=>K(e.value.relativePath,n.value.link)),d=$(()=>r.value?!0:n.value.items?pe(e.value.relativePath,n.value.items):!1),p=$(()=>!!(n.value.items&&n.value.items.length));Q(()=>{t.value=!!(o.value&&n.value.collapsed)}),Q(()=>{(r.value||d.value)&&(t.value=!1)});function _(){o.value&&(t.value=!t.value)}return{collapsed:t,collapsible:o,isLink:s,isActiveLink:r,hasActiveLink:d,hasChildren:p,toggle:_}}const Tt=g({__name:"VPSkipLink",setup(n){const e=ee(),t=L();j(()=>e.path,()=>t.value.focus());function o({target:s}){const r=document.querySelector(decodeURIComponent(s.hash));if(r){const d=()=>{r.removeAttribute("tabindex"),r.removeEventListener("blur",d)};r.setAttribute("tabindex","-1"),r.addEventListener("blur",d),r.focus(),window.scrollTo(0,0)}}retuLine truncated
|
||||
-webkit-transition: none !important;
|
||||
-moz-transition: none !important;
|
||||
-o-transition: none !important;
|
||||
-ms-transition: none !important;
|
||||
transition: none !important;
|
||||
}`)),document.head.appendChild(S),o.value=B,p[B?"add":"remove"]("dark"),window.getComputedStyle(S).opacity,document.head.removeChild(S)}return T}return j(o,d=>{t.value=d}),(d,p)=>(a(),y(is,{title:"toggle dark mode",class:"VPSwitchAppearance","aria-checked":o.value,onClick:i(s)},{default:v(()=>[h(vs,{class:"sun"}),h(ys,{class:"moon"})]),_:1},8,["aria-checked","onClick"]))}});const Pe=f(bs,[["__scopeId","data-v-82b282f1"]]),$s={key:0,class:"VPNavBarAppearance"},ks=g({__name:"VPNavBarAppearance",setup(n){const{site:e}=w();return(t,o)=>i(e).appearance?(a(),l("div",$s,[h(Pe)])):m("",!0)}});const Ps=f(ks,[["__scopeId","data-v-f6a63727"]]),Vs={discord:'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Discord</title><path d="M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"/></svg>',facebook:'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Facebook</title><path d="M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"/></svg>',github:'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub</title><path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/></svg>',instagram:'<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Instagram</title><path d="M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.
Line truncated
|
||||
@@ -1 +1 @@
|
||||
import{_ as e,o as t,c as a}from"./chunks/framework.44fd0451.js";const m=JSON.parse('{"title":"哪吒监控","titleTemplate":"开发手册","description":"","frontmatter":{"layout":"home","title":"哪吒监控","titleTemplate":"开发手册","hero":{"name":"开发手册","text":"哪吒监控开发手册","tagline":"我们欢迎你提出高质量的Pull Request,帮助哪吒监控变得更好!","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"开始使用 →","link":"/developer/theme"}]}},"headers":[],"relativePath":"developer/index.md","filePath":"developer/index.md","lastUpdated":1718495592000}'),r={name:"developer/index.md"};function n(o,s,i,d,l,c){return t(),a("div")}const h=e(r,[["render",n]]);export{m as __pageData,h as default};
|
||||
import{_ as e,c as t,o as a}from"./chunks/framework.BmdFiWrL.js";const m=JSON.parse('{"title":"哪吒监控","titleTemplate":"开发手册","description":"","frontmatter":{"layout":"home","title":"哪吒监控","titleTemplate":"开发手册","hero":{"name":"开发手册","text":"哪吒监控开发手册","tagline":"我们欢迎你提出高质量的Pull Request,帮助哪吒监控变得更好!","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"开始使用 →","link":"/developer/theme"}]}},"headers":[],"relativePath":"developer/index.md","filePath":"developer/index.md","lastUpdated":1719239024000}'),r={name:"developer/index.md"};function n(o,s,i,d,l,c){return a(),t("div")}const h=e(r,[["render",n]]);export{m as __pageData,h as default};
|
||||
@@ -1 +1 @@
|
||||
import{_ as e,o as t,c as a}from"./chunks/framework.44fd0451.js";const m=JSON.parse('{"title":"哪吒监控","titleTemplate":"开发手册","description":"","frontmatter":{"layout":"home","title":"哪吒监控","titleTemplate":"开发手册","hero":{"name":"开发手册","text":"哪吒监控开发手册","tagline":"我们欢迎你提出高质量的Pull Request,帮助哪吒监控变得更好!","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"开始使用 →","link":"/developer/theme"}]}},"headers":[],"relativePath":"developer/index.md","filePath":"developer/index.md","lastUpdated":1718495592000}'),r={name:"developer/index.md"};function n(o,s,i,d,l,c){return t(),a("div")}const h=e(r,[["render",n]]);export{m as __pageData,h as default};
|
||||
import{_ as e,c as t,o as a}from"./chunks/framework.BmdFiWrL.js";const m=JSON.parse('{"title":"哪吒监控","titleTemplate":"开发手册","description":"","frontmatter":{"layout":"home","title":"哪吒监控","titleTemplate":"开发手册","hero":{"name":"开发手册","text":"哪吒监控开发手册","tagline":"我们欢迎你提出高质量的Pull Request,帮助哪吒监控变得更好!","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"开始使用 →","link":"/developer/theme"}]}},"headers":[],"relativePath":"developer/index.md","filePath":"developer/index.md","lastUpdated":1719239024000}'),r={name:"developer/index.md"};function n(o,s,i,d,l,c){return a(),t("div")}const h=e(r,[["render",n]]);export{m as __pageData,h as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as o,o as a,a4 as t}from"./chunks/framework.BmdFiWrL.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"developer/l10n.md","filePath":"developer/l10n.md","lastUpdated":1719239024000}'),l={name:"developer/l10n.md"},r=t('<p><strong>哪吒监控的 Dashboard 已经添加本地化,支持多个语言,你可以在开发新功能时遵循以下步骤来支持本地化</strong></p><h2 id="介绍" tabindex="-1">介绍 <a class="header-anchor" href="#介绍" aria-label="Permalink to "介绍""></a></h2><ol><li>你可以直接使用 <code>/resource/l10n/zh-CN.toml</code> 中已有的文本配置来替换新功能中的文本</li><li>如果新功能中有新增文本,请参考 <code>zh-CN.toml</code> 的配置文本,将新文本拉取到 <code>zh-CN.toml</code> 等其他语言的配置文件中,并添加翻译</li></ol><h2 id="新本地化文本的添加" tabindex="-1">新本地化文本的添加 <a class="header-anchor" href="#新本地化文本的添加" aria-label="Permalink to "新本地化文本的添加""></a></h2><ol><li>在 <code>/resource/l10n/</code> 中添加新的语言文本配置</li><li>在新的语言文本配置中拉取其他语言已有的文本配置</li><li>为新的语言文本配置添加翻译</li></ol>',5),c=[r];function d(n,i,s,_,h,p){return a(),o("div",null,c)}const f=e(l,[["render",d]]);export{u as __pageData,f as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as o,o as a,a4 as t}from"./chunks/framework.BmdFiWrL.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"developer/l10n.md","filePath":"developer/l10n.md","lastUpdated":1719239024000}'),l={name:"developer/l10n.md"},r=t("",5),c=[r];function d(n,i,s,_,h,p){return a(),o("div",null,c)}const f=e(l,[["render",d]]);export{u as __pageData,f as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o,c as a,R as t}from"./chunks/framework.44fd0451.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"developer/l10n.md","filePath":"developer/l10n.md","lastUpdated":1718495592000}'),l={name:"developer/l10n.md"},r=t('<p><strong>哪吒监控的 Dashboard 已经添加本地化,支持多个语言,你可以在开发新功能时遵循以下步骤来支持本地化</strong></p><h2 id="介绍" tabindex="-1">介绍 <a class="header-anchor" href="#介绍" aria-label="Permalink to "介绍""></a></h2><ol><li>你可以直接使用 <code>/resource/l10n/zh-CN.toml</code> 中已有的文本配置来替换新功能中的文本</li><li>如果新功能中有新增文本,请参考 <code>zh-CN.toml</code> 的配置文本,将新文本拉取到 <code>zh-CN.toml</code> 等其他语言的配置文件中,并添加翻译</li></ol><h2 id="新本地化文本的添加" tabindex="-1">新本地化文本的添加 <a class="header-anchor" href="#新本地化文本的添加" aria-label="Permalink to "新本地化文本的添加""></a></h2><ol><li>在 <code>/resource/l10n/</code> 中添加新的语言文本配置</li><li>在新的语言文本配置中拉取其他语言已有的文本配置</li><li>为新的语言文本配置添加翻译</li></ol>',5),c=[r];function d(n,i,s,_,h,p){return o(),a("div",null,c)}const f=e(l,[["render",d]]);export{u as __pageData,f as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o,c as a,R as t}from"./chunks/framework.44fd0451.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"developer/l10n.md","filePath":"developer/l10n.md","lastUpdated":1718495592000}'),l={name:"developer/l10n.md"},r=t("",5),c=[r];function d(n,i,s,_,h,p){return o(),a("div",null,c)}const f=e(l,[["render",d]]);export{u as __pageData,f as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o,c as a,R as t}from"./chunks/framework.44fd0451.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"developer/theme.md","filePath":"developer/theme.md","lastUpdated":1718495592000}'),c={name:"developer/theme.md"},l=t('<h2 id="哪吒主题开发环境" tabindex="-1">哪吒主题开发环境 <a class="header-anchor" href="#哪吒主题开发环境" aria-label="Permalink to "哪吒主题开发环境""></a></h2><p>哪吒面板提供了主题开发环境,你可以使用它来创建新的哪吒监控主题</p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>请注意: 此开发环境仅支持 <code>dashboard v0.13.16</code> 及更新版本。</p></div><h2 id="使用说明" tabindex="-1">使用说明 <a class="header-anchor" href="#使用说明" aria-label="Permalink to "使用说明""></a></h2><ol><li>克隆<a href="https://github.com/nezhahq/skeleton-custom-theme" target="_blank" rel="noreferrer">此仓库</a>到本地</li><li>修改 <code>data/config.yaml</code> 中的 Oauth2 配置(回调连接可以填 <code>http://localhost</code>)</li><li>运行 <code>docker-compose up</code></li><li>开始开发</li><li>主题制作完成之后可以将 <code>theme-custom</code> 放置到服务器上的 <code>/opt/nezha/dashboard/theme-custom</code> 位置</li></ol><h2 id="faq" tabindex="-1">FAQ <a class="header-anchor" href="#faq" aria-label="Permalink to "FAQ""></a></h2><ul><li>如果不能使用 <code>80</code> 端口,在 <code>docker-compose.yaml</code> 中修改配置。</li></ul>',7),d=[l];function r(s,i,h,n,m,_){return o(),a("div",null,d)}const f=e(c,[["render",r]]);export{u as __pageData,f as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o,c as a,R as t}from"./chunks/framework.44fd0451.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"developer/theme.md","filePath":"developer/theme.md","lastUpdated":1718495592000}'),c={name:"developer/theme.md"},l=t("",7),d=[l];function r(s,i,h,n,m,_){return o(),a("div",null,d)}const f=e(c,[["render",r]]);export{u as __pageData,f as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as a,o,a4 as t}from"./chunks/framework.BmdFiWrL.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"developer/theme.md","filePath":"developer/theme.md","lastUpdated":1719239024000}'),c={name:"developer/theme.md"},l=t('<h2 id="哪吒主题开发环境" tabindex="-1">哪吒主题开发环境 <a class="header-anchor" href="#哪吒主题开发环境" aria-label="Permalink to "哪吒主题开发环境""></a></h2><p>哪吒面板提供了主题开发环境,你可以使用它来创建新的哪吒监控主题</p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>请注意: 此开发环境仅支持 <code>dashboard v0.13.16</code> 及更新版本。</p></div><h2 id="使用说明" tabindex="-1">使用说明 <a class="header-anchor" href="#使用说明" aria-label="Permalink to "使用说明""></a></h2><ol><li>克隆<a href="https://github.com/nezhahq/skeleton-custom-theme" target="_blank" rel="noreferrer">此仓库</a>到本地</li><li>修改 <code>data/config.yaml</code> 中的 Oauth2 配置(回调连接可以填 <code>http://localhost</code>)</li><li>运行 <code>docker-compose up</code></li><li>开始开发</li><li>主题制作完成之后可以将 <code>theme-custom</code> 放置到服务器上的 <code>/opt/nezha/dashboard/theme-custom</code> 位置</li></ol><h2 id="faq" tabindex="-1">FAQ <a class="header-anchor" href="#faq" aria-label="Permalink to "FAQ""></a></h2><ul><li>如果不能使用 <code>80</code> 端口,在 <code>docker-compose.yaml</code> 中修改配置。</li></ul>',7),d=[l];function r(s,i,h,n,m,_){return o(),a("div",null,d)}const f=e(c,[["render",r]]);export{u as __pageData,f as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as a,o,a4 as t}from"./chunks/framework.BmdFiWrL.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"developer/theme.md","filePath":"developer/theme.md","lastUpdated":1719239024000}'),c={name:"developer/theme.md"},l=t("",7),d=[l];function r(s,i,h,n,m,_){return o(),a("div",null,d)}const f=e(c,[["render",r]]);export{u as __pageData,f as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as r,a4 as o}from"./chunks/framework.BmdFiWrL.js";const d=JSON.parse('{"title":"Build your own Telegram bot to query server information","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case1.md","filePath":"en_US/case/case1.md","lastUpdated":1719239024000}'),a={name:"en_US/case/case1.md"},n=o('<h1 id="build-your-own-telegram-bot-to-query-server-information" tabindex="-1">Build your own Telegram bot to query server information <a class="header-anchor" href="#build-your-own-telegram-bot-to-query-server-information" aria-label="Permalink to "Build your own Telegram bot to query server information""></a></h1><p>Contributors:</p><ul><li><a href="https://github.com/spiritLHLS" target="_blank" rel="noreferrer">spiritLHLS</a></li><li><a href="https://github.com/Erope/" target="_blank" rel="noreferrer">Erope</a></li></ul><p><strong>Project</strong>: <a href="https://github.com/spiritLHLS/nezha_api_tgbot" target="_blank" rel="noreferrer">nezha_api_tgbot</a> (Chinese)</p><p><strong>Mirror backup, non-real-time update</strong>: <a href="https://github.com/nezhahq/nezha_api_tgbot" target="_blank" rel="noreferrer">nezha_api_tgbot</a> (Chinese)</p><p>The bot can request server status information from the Dashboard through the API, and then send the information to the user.<br> You can build this bot to easily view the current status of a given server without opening the Dashboard.</p>',6),i=[n];function s(h,_,l,u,c,p){return r(),t("div",null,i)}const m=e(a,[["render",s]]);export{d as __pageData,m as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as r,a4 as o}from"./chunks/framework.BmdFiWrL.js";const d=JSON.parse('{"title":"Build your own Telegram bot to query server information","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case1.md","filePath":"en_US/case/case1.md","lastUpdated":1719239024000}'),a={name:"en_US/case/case1.md"},n=o("",6),i=[n];function s(h,_,l,u,c,p){return r(),t("div",null,i)}const m=e(a,[["render",s]]);export{d as __pageData,m as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o as t,c as r,R as o}from"./chunks/framework.44fd0451.js";const d=JSON.parse('{"title":"Build your own Telegram bot to query server information","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case1.md","filePath":"en_US/case/case1.md","lastUpdated":1718495592000}'),a={name:"en_US/case/case1.md"},n=o('<h1 id="build-your-own-telegram-bot-to-query-server-information" tabindex="-1">Build your own Telegram bot to query server information <a class="header-anchor" href="#build-your-own-telegram-bot-to-query-server-information" aria-label="Permalink to "Build your own Telegram bot to query server information""></a></h1><p>Contributors:</p><ul><li><a href="https://github.com/spiritLHLS" target="_blank" rel="noreferrer">spiritLHLS</a></li><li><a href="https://github.com/Erope/" target="_blank" rel="noreferrer">Erope</a></li></ul><p><strong>Project</strong>: <a href="https://github.com/spiritLHLS/nezha_api_tgbot" target="_blank" rel="noreferrer">nezha_api_tgbot</a> (Chinese)</p><p><strong>Mirror backup, non-real-time update</strong>: <a href="https://github.com/nezhahq/nezha_api_tgbot" target="_blank" rel="noreferrer">nezha_api_tgbot</a> (Chinese)</p><p>The bot can request server status information from the Dashboard through the API, and then send the information to the user.<br> You can build this bot to easily view the current status of a given server without opening the Dashboard.</p>',6),i=[n];function s(h,_,l,u,c,p){return t(),r("div",null,i)}const m=e(a,[["render",s]]);export{d as __pageData,m as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o as t,c as r,R as o}from"./chunks/framework.44fd0451.js";const d=JSON.parse('{"title":"Build your own Telegram bot to query server information","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case1.md","filePath":"en_US/case/case1.md","lastUpdated":1718495592000}'),a={name:"en_US/case/case1.md"},n=o("",6),i=[n];function s(h,_,l,u,c,p){return t(),r("div",null,i)}const m=e(a,[["render",s]]);export{d as __pageData,m as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e}from"./chunks/qrcode.59c44dde.js";import{_ as t,o as r,c as o,R as s}from"./chunks/framework.44fd0451.js";const f=JSON.parse('{"title":"Use Siri to run shortcut to check server status in iOS/MacOS","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case2.md","filePath":"en_US/case/case2.md","lastUpdated":1718495592000}'),a={name:"en_US/case/case2.md"},c=s('<h1 id="use-siri-to-run-shortcut-to-check-server-status-in-ios-macos" tabindex="-1">Use Siri to run shortcut to check server status in iOS/MacOS <a class="header-anchor" href="#use-siri-to-run-shortcut-to-check-server-status-in-ios-macos" aria-label="Permalink to "Use Siri to run shortcut to check server status in iOS/MacOS""></a></h1><p>Current Version:V1.0 (Chinese)<br> Contributor:</p><ul><li>白歌 <a href="https://github.com/hhhkkk520" target="_blank" rel="noreferrer">hhhkkk520</a></li></ul><h2 id="get-shortcut-command" tabindex="-1">Get shortcut command <a class="header-anchor" href="#get-shortcut-command" aria-label="Permalink to "Get shortcut command""></a></h2><p>Scan the following QR code with your iPhone or iPad to get the shortcut<br><br><img src="'+e+'" alt="coode"><br><br><br> MacOS users please visit <a href="https://www.icloud.com/shortcuts/312005bf5ffd4387ac92a84056db9f09" target="_blank" rel="noreferrer">here</a> to get the shortcut</p><h2 id="how-to-use" tabindex="-1">How to use <a class="header-anchor" href="#how-to-use" aria-label="Permalink to "How to use""></a></h2><ul><li>After getting the shortcut, open and edit the shortcut</li><li>Fill in <code>Dashboard URL</code>, <code>API Token</code>, <code>Server ID</code> in the three text boxes</li><li>Save the edit and test run, if you can get the result, the setting is correct.</li><li>Modify the name of the shortcut, such as: Server Status, then you can use Siri command: "Hey Siri, Server Status" to get the server status.</li></ul><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>Each shortcut can only monitor one server, if you need to monitor more than one server, please copy this shortcut several times and configure them separately, then modify the shortcut name separately, such as; Server 1 Status, Server 2 Status, etc.</p></div>',8),i=[c];function h(n,u,l,d,m,_){return r(),o("div",null,i)}const b=t(a,[["render",h]]);export{f as __pageData,b as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e}from"./chunks/qrcode.59c44dde.js";import{_ as t,o as r,c as o,R as s}from"./chunks/framework.44fd0451.js";const f=JSON.parse('{"title":"Use Siri to run shortcut to check server status in iOS/MacOS","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case2.md","filePath":"en_US/case/case2.md","lastUpdated":1718495592000}'),a={name:"en_US/case/case2.md"},c=s("",8),i=[c];function h(n,u,l,d,m,_){return r(),o("div",null,i)}const b=t(a,[["render",h]]);export{f as __pageData,b as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e}from"./chunks/qrcode.CZOxHFH-.js";import{_ as t,c as r,o,a4 as s}from"./chunks/framework.BmdFiWrL.js";const f=JSON.parse('{"title":"Use Siri to run shortcut to check server status in iOS/MacOS","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case2.md","filePath":"en_US/case/case2.md","lastUpdated":1719239024000}'),a={name:"en_US/case/case2.md"},c=s('<h1 id="use-siri-to-run-shortcut-to-check-server-status-in-ios-macos" tabindex="-1">Use Siri to run shortcut to check server status in iOS/MacOS <a class="header-anchor" href="#use-siri-to-run-shortcut-to-check-server-status-in-ios-macos" aria-label="Permalink to "Use Siri to run shortcut to check server status in iOS/MacOS""></a></h1><p>Current Version:V1.0 (Chinese)<br> Contributor:</p><ul><li>白歌 <a href="https://github.com/hhhkkk520" target="_blank" rel="noreferrer">hhhkkk520</a></li></ul><h2 id="get-shortcut-command" tabindex="-1">Get shortcut command <a class="header-anchor" href="#get-shortcut-command" aria-label="Permalink to "Get shortcut command""></a></h2><p>Scan the following QR code with your iPhone or iPad to get the shortcut<br><br><img src="'+e+'" alt="coode"><br><br><br> MacOS users please visit <a href="https://www.icloud.com/shortcuts/312005bf5ffd4387ac92a84056db9f09" target="_blank" rel="noreferrer">here</a> to get the shortcut</p><h2 id="how-to-use" tabindex="-1">How to use <a class="header-anchor" href="#how-to-use" aria-label="Permalink to "How to use""></a></h2><ul><li>After getting the shortcut, open and edit the shortcut</li><li>Fill in <code>Dashboard URL</code>, <code>API Token</code>, <code>Server ID</code> in the three text boxes</li><li>Save the edit and test run, if you can get the result, the setting is correct.</li><li>Modify the name of the shortcut, such as: Server Status, then you can use Siri command: "Hey Siri, Server Status" to get the server status.</li></ul><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>Each shortcut can only monitor one server, if you need to monitor more than one server, please copy this shortcut several times and configure them separately, then modify the shortcut name separately, such as; Server 1 Status, Server 2 Status, etc.</p></div>',8),i=[c];function h(n,u,l,d,m,_){return o(),r("div",null,i)}const b=t(a,[["render",h]]);export{f as __pageData,b as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e}from"./chunks/qrcode.CZOxHFH-.js";import{_ as t,c as r,o,a4 as s}from"./chunks/framework.BmdFiWrL.js";const f=JSON.parse('{"title":"Use Siri to run shortcut to check server status in iOS/MacOS","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case2.md","filePath":"en_US/case/case2.md","lastUpdated":1719239024000}'),a={name:"en_US/case/case2.md"},c=s("",8),i=[c];function h(n,u,l,d,m,_){return o(),r("div",null,i)}const b=t(a,[["render",h]]);export{f as __pageData,b as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as t,c as e,o as r,a4 as a}from"./chunks/framework.BmdFiWrL.js";const g=JSON.parse('{"title":"Build your own server status query Telegram bot with multi-language and multi-user support","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case3.md","filePath":"en_US/case/case3.md","lastUpdated":1719239024000}'),d={name:"en_US/case/case3.md"},i=a('<h1 id="build-your-own-server-status-query-telegram-bot-with-multi-language-and-multi-user-support" tabindex="-1">Build your own server status query Telegram bot with multi-language and multi-user support <a class="header-anchor" href="#build-your-own-server-status-query-telegram-bot-with-multi-language-and-multi-user-support" aria-label="Permalink to "Build your own server status query Telegram bot with multi-language and multi-user support""></a></h1><p>Contributor:</p><ul><li><a href="https://github.com/tech-fever" target="_blank" rel="noreferrer">tech-fever</a></li></ul><p>GitHub project: <a href="https://github.com/tech-fever/nezha_telegram_bot" target="_blank" rel="noreferrer">nezha_telegram_bot</a>(English is already supported)</p><p>Mirror backup, non-real-time update : <a href="https://github.com/nezhahq/nezha_telegram_bot" target="_blank" rel="noreferrer">nezha_telegram_bot</a>(English is already supported)</p><h2 id="features" tabindex="-1">Features <a class="header-anchor" href="#features" aria-label="Permalink to "Features""></a></h2><ul><li>[x] Support Chinese/English multi-language switch</li><li>[x] Support tag statistics (CPU, disk, memory, upstream and downstream speed, traffic statistics, etc.)</li><li>[x] Support real-time refresh of single server data</li><li>[x] Support keyboard interactive query</li><li>[x] Support query by command</li><li>[x] Support adding bot to group, privacy protection of bot replies in group chat</li><li>[x] Support bot messages automatic deletion in group chat within 20 seconds</li><li>[x] Support docker deployment</li></ul><h2 id="commands-list" tabindex="-1">Commands list <a class="header-anchor" href="#commands-list" aria-label="Permalink to "Commands list""></a></h2><table tabindex="0"><thead><tr><th>Command</th><th>Description</th><th>Private chat only</th></tr></thead><tbody><tr><td>start</td><td>Getting started with the keyboard main menu</td><td>✔️</td></tr><tr><td>help</td><td>help message</td><td>❌</td></tr><tr><td>add</td><td>Add Nezha monitoring url link and token</td><td>✔️</td></tr><tr><td>url</td><td>Add Nezha monitoring url link</td><td>✔️</td></tr><tr><td>token</td><td>Add Nezha monitoring token</td><td>✔️</td></tr><tr><td>info</td><td>Get saved Nezha monitoring url link and token</td><td>✔️</td></tr><tr><td>delete</td><td>Delete saved Nezha monitoring url link and token</td><td>✔️</td></tr><tr><td>id</td><td>Add an integer id after the command to query the information of a single server (refresh button only available in private chat)</td><td>❌</td></tr><tr><td>all</td><td>Query statistics for all servers</td><td>❌</td></tr><tr><td>search</td><td>Search for keywords in server names (multiple keywords supported, split by spaces)</td><td>❌</td></tr></tbody></table>',9),o=[i];function s(l,n,u,h,p,m){return r(),e("div",null,o)}const _=t(d,[["render",s]]);export{g as __pageData,_ as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as t,c as e,o as r,a4 as a}from"./chunks/framework.BmdFiWrL.js";const g=JSON.parse('{"title":"Build your own server status query Telegram bot with multi-language and multi-user support","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case3.md","filePath":"en_US/case/case3.md","lastUpdated":1719239024000}'),d={name:"en_US/case/case3.md"},i=a("",9),o=[i];function s(l,n,u,h,p,m){return r(),e("div",null,o)}const _=t(d,[["render",s]]);export{g as __pageData,_ as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as t,o as e,c as r,R as a}from"./chunks/framework.44fd0451.js";const g=JSON.parse('{"title":"Build your own server status query Telegram bot with multi-language and multi-user support","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case3.md","filePath":"en_US/case/case3.md","lastUpdated":1718495592000}'),d={name:"en_US/case/case3.md"},i=a('<h1 id="build-your-own-server-status-query-telegram-bot-with-multi-language-and-multi-user-support" tabindex="-1">Build your own server status query Telegram bot with multi-language and multi-user support <a class="header-anchor" href="#build-your-own-server-status-query-telegram-bot-with-multi-language-and-multi-user-support" aria-label="Permalink to "Build your own server status query Telegram bot with multi-language and multi-user support""></a></h1><p>Contributor:</p><ul><li><a href="https://github.com/tech-fever" target="_blank" rel="noreferrer">tech-fever</a></li></ul><p>GitHub project: <a href="https://github.com/tech-fever/nezha_telegram_bot" target="_blank" rel="noreferrer">nezha_telegram_bot</a>(English is already supported)</p><p>Mirror backup, non-real-time update : <a href="https://github.com/nezhahq/nezha_telegram_bot" target="_blank" rel="noreferrer">nezha_telegram_bot</a>(English is already supported)</p><h2 id="features" tabindex="-1">Features <a class="header-anchor" href="#features" aria-label="Permalink to "Features""></a></h2><ul><li>[x] Support Chinese/English multi-language switch</li><li>[x] Support tag statistics (CPU, disk, memory, upstream and downstream speed, traffic statistics, etc.)</li><li>[x] Support real-time refresh of single server data</li><li>[x] Support keyboard interactive query</li><li>[x] Support query by command</li><li>[x] Support adding bot to group, privacy protection of bot replies in group chat</li><li>[x] Support bot messages automatic deletion in group chat within 20 seconds</li><li>[x] Support docker deployment</li></ul><h2 id="commands-list" tabindex="-1">Commands list <a class="header-anchor" href="#commands-list" aria-label="Permalink to "Commands list""></a></h2><table><thead><tr><th>Command</th><th>Description</th><th>Private chat only</th></tr></thead><tbody><tr><td>start</td><td>Getting started with the keyboard main menu</td><td>✔️</td></tr><tr><td>help</td><td>help message</td><td>❌</td></tr><tr><td>add</td><td>Add Nezha monitoring url link and token</td><td>✔️</td></tr><tr><td>url</td><td>Add Nezha monitoring url link</td><td>✔️</td></tr><tr><td>token</td><td>Add Nezha monitoring token</td><td>✔️</td></tr><tr><td>info</td><td>Get saved Nezha monitoring url link and token</td><td>✔️</td></tr><tr><td>delete</td><td>Delete saved Nezha monitoring url link and token</td><td>✔️</td></tr><tr><td>id</td><td>Add an integer id after the command to query the information of a single server (refresh button only available in private chat)</td><td>❌</td></tr><tr><td>all</td><td>Query statistics for all servers</td><td>❌</td></tr><tr><td>search</td><td>Search for keywords in server names (multiple keywords supported, split by spaces)</td><td>❌</td></tr></tbody></table>',9),o=[i];function s(l,n,u,h,p,m){return e(),r("div",null,o)}const _=t(d,[["render",s]]);export{g as __pageData,_ as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as t,o as e,c as r,R as a}from"./chunks/framework.44fd0451.js";const g=JSON.parse('{"title":"Build your own server status query Telegram bot with multi-language and multi-user support","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case3.md","filePath":"en_US/case/case3.md","lastUpdated":1718495592000}'),d={name:"en_US/case/case3.md"},i=a("",9),o=[i];function s(l,n,u,h,p,m){return e(),r("div",null,o)}const _=t(d,[["render",s]]);export{g as __pageData,_ as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as a,o as t,a4 as r}from"./chunks/framework.BmdFiWrL.js";const g=JSON.parse('{"title":"Fake-agent, monitoring data cheater","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case4.md","filePath":"en_US/case/case4.md","lastUpdated":1719239024000}'),n={name:"en_US/case/case4.md"},o=r('<h1 id="fake-agent-monitoring-data-cheater" tabindex="-1">Fake-agent, monitoring data cheater <a class="header-anchor" href="#fake-agent-monitoring-data-cheater" aria-label="Permalink to "Fake-agent, monitoring data cheater""></a></h1><p>Contributor:</p><ul><li><a href="https://github.com/dysf888" target="_blank" rel="noreferrer">dysf888</a></li></ul><p>GitHub project: <a href="https://github.com/dysf888/fake-nezha-agent" target="_blank" rel="noreferrer">fake-nezha-agent</a>(Chinese)<br> Mirror backup, non-real-time update :<a href="https://github.com/nezhahq/fake-nezha-agent" target="_blank" rel="noreferrer">fake-nezha-agent</a>(Chinese)</p><p>You can modify the monitoring data uploaded to Dashboard by the Agent<br> Use it for cheating 😈</p>',5),i=[o];function s(c,h,_,d,f,l){return t(),a("div",null,i)}const m=e(n,[["render",s]]);export{g as __pageData,m as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as a,o as t,a4 as r}from"./chunks/framework.BmdFiWrL.js";const g=JSON.parse('{"title":"Fake-agent, monitoring data cheater","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case4.md","filePath":"en_US/case/case4.md","lastUpdated":1719239024000}'),n={name:"en_US/case/case4.md"},o=r("",5),i=[o];function s(c,h,_,d,f,l){return t(),a("div",null,i)}const m=e(n,[["render",s]]);export{g as __pageData,m as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o as a,c as t,R as r}from"./chunks/framework.44fd0451.js";const g=JSON.parse('{"title":"Fake-agent, monitoring data cheater","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case4.md","filePath":"en_US/case/case4.md","lastUpdated":1718495592000}'),n={name:"en_US/case/case4.md"},o=r('<h1 id="fake-agent-monitoring-data-cheater" tabindex="-1">Fake-agent, monitoring data cheater <a class="header-anchor" href="#fake-agent-monitoring-data-cheater" aria-label="Permalink to "Fake-agent, monitoring data cheater""></a></h1><p>Contributor:</p><ul><li><a href="https://github.com/dysf888" target="_blank" rel="noreferrer">dysf888</a></li></ul><p>GitHub project: <a href="https://github.com/dysf888/fake-nezha-agent" target="_blank" rel="noreferrer">fake-nezha-agent</a>(Chinese)<br> Mirror backup, non-real-time update :<a href="https://github.com/nezhahq/fake-nezha-agent" target="_blank" rel="noreferrer">fake-nezha-agent</a>(Chinese)</p><p>You can modify the monitoring data uploaded to Dashboard by the Agent<br> Use it for cheating 😈</p>',5),i=[o];function s(c,h,_,d,f,l){return a(),t("div",null,i)}const m=e(n,[["render",s]]);export{g as __pageData,m as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o as a,c as t,R as r}from"./chunks/framework.44fd0451.js";const g=JSON.parse('{"title":"Fake-agent, monitoring data cheater","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case4.md","filePath":"en_US/case/case4.md","lastUpdated":1718495592000}'),n={name:"en_US/case/case4.md"},o=r("",5),i=[o];function s(c,h,_,d,f,l){return a(),t("div",null,i)}const m=e(n,[["render",s]]);export{g as __pageData,m as default};
|
||||
@@ -0,0 +1,47 @@
|
||||
import{_ as e,c as a,o as t,a4 as n}from"./chunks/framework.BmdFiWrL.js";const g=JSON.parse('{"title":"Nezha server over Argo tunnel","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case5.md","filePath":"en_US/case/case5.md","lastUpdated":1719239024000}'),s={name:"en_US/case/case5.md"},o=n(`<h1 id="nezha-server-over-argo-tunnel" tabindex="-1">Nezha server over Argo tunnel <a class="header-anchor" href="#nezha-server-over-argo-tunnel" aria-label="Permalink to "Nezha server over Argo tunnel""></a></h1><p>Contributors:</p><ul><li><a href="https://github.com/fscarmen2" target="_blank" rel="noreferrer">fscarmen</a></li></ul><p>GitHub project: <a href="https://github.com/fscarmen2/Argo-Nezha-Service-Container" target="_blank" rel="noreferrer">Argo-Nezha-Service-Container</a></p><p>Mirror backup (not live update): <a href="https://github.com/nezhahq/Argo-Nezha-Service-Container" target="_blank" rel="noreferrer">Argo-Nezha-Service-Container</a></p><hr><h1 id="catalog" tabindex="-1">Catalog <a class="header-anchor" href="#catalog" aria-label="Permalink to "Catalog""></a></h1><ul><li><a href="./case5.html#project-features">Project Features</a></li><li><a href="./case5.html#How-to-get-Argo-authentication-json-or-token">How to get Argo authentication: json or token</a></li><li><a href="./case5.html#prepare-variables-to-be-used">Variables to be used</a></li><li><a href="./case5.html#paas-deployment-example">PaaS Deployment Example</a></li><li><a href="./case5.html#vps-deployment-method-1-----docker">VPS Deployment Method 1 --- docker</a></li><li><a href="./case5.html#vps-deployment-method-2-----hosts">VPS Deployment Method 2 --- hosts</a></li><li><a href="./case5.html#client-access">Client Access</a></li><li><a href="./case5.html#ssh-access">SSH Access</a></li><li><a href="./case5.html#manual-backup-data">Manual Backup data</a></li><li><a href="./case5.html#automatically-restore-backups">Auto Restore Backup</a></li><li><a href="./case5.html#manually-restore-the-backup">Manual Restore Backup</a></li><li><a href="./case5.html#migrating-data">Migrating data</a></li><li><a href="./case5.html#main-catalog-files-and-descriptions">Main Directory Files and Descriptions</a></li><li><a href="./case5.html#acknowledgements-for-articles-and-projects-by">Acknowledgment of articles and projects by the following authors</a></li><li><a href="./case5.html#disclaimer">Disclaimer</a></li></ul><hr><h2 id="project-features" tabindex="-1">Project Features. <a class="header-anchor" href="#project-features" aria-label="Permalink to "Project Features.""></a></h2><ul><li>Wider scope of application --- As long as there is a network connection, Nezha server can be installed, such as LXC, OpenVZ VPS, Nas Virtual Machine, Container PaaS, etc.</li><li>Argo tunnel breaks through the restriction of requiring a public network portal --- The traditional Nezha requires two public network ports, one for panel visiting and the other for client reporting, this project uses Cloudflare Argo tunnels and uses intranet tunneling.</li><li>IPv4 / v6 with higher flexibility --- The traditional Nezha needs to deal with IPv4/v6 compatibility between server and client, and also needs to resolve mismatches through tools such as warp. However, this project does not need to consider these issues at all, and can be docked arbitrarily, which is much more convenient and easy!</li><li>One Argo tunnel for multiple domains and protocols --- Create an intranet-penetrating Argo tunnel for three domains (hostname) and protocols, which can be used for panel access (http), client reporting (tcp) and ssh (optional).</li><li>GrpcWebProxy reverse proxy gRPC data port --- with a certificate for tls termination, then Argo's tunnel configuration with https service pointing to this reverse proxy, enable http2 back to the source, grpc(nezha)->GrpcWebProxy->h2(argo)->cf cdn edge->agent</li><li>Daily automatic backup --- every day at 04:00 BST, the entire Nezha panel folder is automatically backed up to a designated private github repository, including panel themes, panel settings, probe data and tunnel information, the backup retains nearly 5 days of data; the content is so important that it must be placed in the private repository.</li><li>Automatic daily panel update -- the latest official panel version is automatically detected every day at 4:00 BST, and updated when there is an upgrade.</li><li>Manual/automatic restore backup --- check the content of online restore file once a minute, and restore immediately when there is any update.</li><li>Default built-in local probes --- can easily monitor their own server information</li><li>More secure data --- Argo Tunnel uses TLS encrypted communication to securely transmit application traffic to the Cloudflare network, improving application security and reliability. In addition, Argo Tunnel protects against network threats such as IP leaks and DDoS attacks.</li></ul
Line truncated
|
||||
<span class="line"><span> --name nezha_dashboard \\</span></span>
|
||||
<span class="line"><span> --pull always \\</span></span>
|
||||
<span class="line"><span> --restart always \\</span></span>
|
||||
<span class="line"><span> -e GH_USER=<fill in github username> \\</span></span>
|
||||
<span class="line"><span> -e GH_EMAIL=<fill in github email> \\</span></span>
|
||||
<span class="line"><span> -e GH_PAT=<fill in the obtained> \\</span></span>
|
||||
<span class="line"><span> -e GH_REPO=<fill in customized> \\</span></span>
|
||||
<span class="line"><span> -e GH_CLIENTID=<fill in acquired> \\</span></span>
|
||||
<span class="line"><span> -e GH_CLIENTSECRET=<fill in acquired> \\</span></span>
|
||||
<span class="line"><span> -e ARGO_AUTH='<Fill in the fetched Argo json or token>' \\</span></span>
|
||||
<span class="line"><span> -e ARGO_DOMAIN=<fill in customized> \\</span></span>
|
||||
<span class="line"><span> -e GH_BACKUP_USER=<If it is consistent with GH_USER, you can leave it blank> \\</span></span>
|
||||
<span class="line"><span> fscarmen/argo-nezha</span></span></code></pre></div><h3 id="docker-compose-deployment" tabindex="-1">docker-compose deployment <a class="header-anchor" href="#docker-compose-deployment" aria-label="Permalink to "docker-compose deployment""></a></h3><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>version: '3.8'</span></span>
|
||||
<span class="line"><span>services.</span></span>
|
||||
<span class="line"><span> argo-nezha.</span></span>
|
||||
<span class="line"><span> image: fscarmen/argo-nezha</span></span>
|
||||
<span class="line"><span> --pull always</span></span>
|
||||
<span class="line"><span> container_name: nezha_dashboard</span></span>
|
||||
<span class="line"><span> restart: always</span></span>
|
||||
<span class="line"><span> environment:</span></span>
|
||||
<span class="line"><span> - GH_USER=<fill in github username></span></span>
|
||||
<span class="line"><span> - GH_EMAIL=<fill in your github email></span></span>
|
||||
<span class="line"><span> - GH_PAT=<<fill in obtained></span></span>
|
||||
<span class="line"><span> - GH_REPO=<fill in customized></span></span>
|
||||
<span class="line"><span> - GH_CLIENTID=<fill in obtained></span></span>
|
||||
<span class="line"><span> - GH_CLIENTSECRET=<fill in fetched></span></span>
|
||||
<span class="line"><span> - ARGO_AUTH='<Fill in the fetched Argo json or token>'</span></span>
|
||||
<span class="line"><span> - ARGO_DOMAIN=<fill in customized></span></span>
|
||||
<span class="line"><span> - GH_BACKUP_USER=<If it is consistent with GH_USER, you can leave it blank></span></span></code></pre></div><h2 id="vps-deployment-method-2-hosts" tabindex="-1">VPS Deployment Method 2 --- hosts <a class="header-anchor" href="#vps-deployment-method-2-hosts" aria-label="Permalink to "VPS Deployment Method 2 --- hosts""></a></h2><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>bash <(wget -qO- https://raw.githubusercontent.com/fscarmen2/Argo-Nezha-Service-Container/main/dashboard.sh)</span></span></code></pre></div><h2 id="client-access" tabindex="-1">Client Access <a class="header-anchor" href="#client-access" aria-label="Permalink to "Client Access""></a></h2><p>Transfer via gRPC, no additional configuration required. Use the installation method given in the panel, for example</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh install_agent data.seales.nom.za 443 eAxO9IF519fKFODlW0 --tls</span></span></code></pre></div><h2 id="ssh-access" tabindex="-1">SSH access <a class="header-anchor" href="#ssh-access" aria-label="Permalink to "SSH access""></a></h2><ul><li>Take macOS + WindTerm as an example, and other SSH tools depending on the one used, combined with the official documentation: <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/use_cases/ssh" target="_blank" rel="noreferrer">https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/use_cases/ssh</a> /#2-connect-as-a-user</li><li>Official cloudflared download: <a href="https://github.com/cloudflare/cloudflared/releases" target="_blank" rel="noreferrer">https://github.com/cloudflare/cloudflared/releases</a></li><li>The following are examples of input commands. SSH user: root, SSH password:<GH_CLIENTSECRET></li></ul><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span><filepath>/cloudflared access ssh --hostname ssh.seals.nom.za/<GH_CLIENTID></span></span></code></pre></div><img width="1189" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/0aeb3939-51c7-47ac-a7fd-25a8a01d3df5"><img width="840" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/16961ade-aafc-4132-92a1-aa218e0fead9"><img width="1201" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/3146b2e2-f988-487f-ab63-00218eb4d570"><h2 id="manually-backing-up-your-data" tabindex="-1">Manually backing up your data <a class="header-anchor" href="#manually-backing-up-your-data" aria-label="Permalink to "Manually backing up your data""></a></h2><p>Method 1: Change the contents of the <code>README.md</code> file in the Github backup repository to <code>backup</code></p><img width="970" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/c5b6bc4b-e69c-48ce-97d4- 3f9be88515f3"><p>Method 2: After ssh, run <code>/dashboard/backup.sh</code> for container version; <code>/opt/nezha/dashboard/backup.sh</code> for VPS host version.</p><h2 id="automatically-restore-backups" tabindex="-1">Automatically restore backups <a class="header-anchor" href="#automatically-restore-backups" aria-label="Permalink to "Automatically restore backups""></a></h2><ul><li>Change the name of the file to be restored to <code>README.md</code> in the github backup repository, the timer service will check for updates every minute and record the last synchronized filename in the local <code>/dbfile</code> to compare with the online file content.</li></ul><p>The following is an example of restoring a file with the name <code>dashboard-2023-04-23-13:08:37.tar.gz</code>.</p><p>! <a href="https://user-images.githubusercontent.com/92626977/233822466-c24e94f6-ba8a-47c9-b77d-aa62a56cc929.png" target="_blank" rel="noreferrer">image</a></p><h2 id="manually-restore-the-backup" tabindex="-1">Manually restore the backup <a class="header-anchor" href="#manually-restore-the-backup" aria-label="Permalink to "Manually restore the backup""></a></h2><ul><li>ssh into the container and run, tar.gz filename from the github backup repository, format: dashboard-2023-04-22-21:42:10.tar.gz</li></ul><div class="language- vp-adaptive-theme"><button title="Copy Line truncated
|
||||
<span class="line"><span>|-- app # Nezha panel main program</span></span>
|
||||
<span class="line"><span>|-- argo.json # Argo tunnel json file, which records information about using the tunnel.</span></span>
|
||||
<span class="line"><span>|-- argo.yml # Argo tunnel yml file, used for streaming web, gRPC and ssh protocols under a single tunnel with different domains.</span></span>
|
||||
<span class="line"><span>|-- backup.sh # Backup data scripts</span></span>
|
||||
<span class="line"><span>|-- restore.sh # Restore backup scripts</span></span>
|
||||
<span class="line"><span>|-- dbfile # Record the name of the latest restore or backup file</span></span>
|
||||
<span class="line"><span>|-- resource # Folders of information on panel themes, languages, flags, etc.</span></span>
|
||||
<span class="line"><span>|-- data</span></span>
|
||||
<span class="line"><span>| |-- config.yaml # Configuration for the Nezha panel, e.g. Github OAuth2 / gRPC domain / port / TLS enabled or not.</span></span>
|
||||
<span class="line"><span>| \`-- sqlite.db # SQLite database file that records all severs and cron settings for the panel.</span></span>
|
||||
<span class="line"><span>|-- entrypoint.sh # The main script, which is executed after the container is run.</span></span>
|
||||
<span class="line"><span>|-- nezha.csr # SSL/TLS certificate signing request</span></span>
|
||||
<span class="line"><span>|-- nezha.key # Private key information for SSL/TLS certificate.</span></span>
|
||||
<span class="line"><span>|-- nezha.pem # SSL/TLS certificate file.</span></span>
|
||||
<span class="line"><span>|-- cloudflared # Cloudflare Argo tunnel main program.</span></span>
|
||||
<span class="line"><span>|-- grpcwebproxy # gRPC reverse proxy main program.</span></span>
|
||||
<span class="line"><span>\`-- nezha-agent # Nezha client, used to monitor the localhost.</span></span></code></pre></div><h2 id="acknowledgements-for-articles-and-projects-by" tabindex="-1">Acknowledgements for articles and projects by <a class="header-anchor" href="#acknowledgements-for-articles-and-projects-by" aria-label="Permalink to "Acknowledgements for articles and projects by""></a></h2><ul><li>Robin, an enthusiastic sunrise crowd, for discussing the relationship between Nezha's server and client, which led to the birth of this project.</li><li>Nezha website: <a href="https://nezha.wiki/" target="_blank" rel="noreferrer">https://nezha.wiki/</a> , TG Group: <a href="https://t.me/nezhamonitoring" target="_blank" rel="noreferrer">https://t.me/nezhamonitoring</a></li><li>Common Poverty International Old Chinese Medicine: <a href="http://solitud.es/" target="_blank" rel="noreferrer">http://solitud.es/</a></li><li>Akkia's Blog: <a href="https://blog.akkia.moe/" target="_blank" rel="noreferrer">https://blog.akkia.moe/</a></li><li>Ayaka's Blog: <a href="https://blog.xn--pn1aul.org/" target="_blank" rel="noreferrer">https://blog.萝莉.org/</a></li><li>HiFeng's Blog: <a href="https://www.hicairo.com/" target="_blank" rel="noreferrer">https://www.hicairo.com/</a></li><li>Intranet Penetration with Cloudflare Tunnel: <a href="https://blog.outv.im/2021/cloudflared-tunnel/" target="_blank" rel="noreferrer">https://blog.outv.im/2021/cloudflared-tunnel/</a></li><li>How to add your own Runner host to GitHub Actions: <a href="https://cloud.tencent.com/developer/article/1756690" target="_blank" rel="noreferrer">https://cloud.tencent.com/developer/article/1756690</a></li><li>github self-hosted runner addition and startup: <a href="https://blog.csdn.net/sinat_32188225/article/details/125978331" target="_blank" rel="noreferrer">https://blog.csdn.net/sinat_32188225/article/details/125978331</a></li><li>How to export a file from a Docker image: <a href="https://www.pkslow.com/archives/extract-files-from-docker-image" target="_blank" rel="noreferrer">https://www.pkslow.com/archives/extract-files-from-docker-image</a></li><li>grpcwebproxy: <a href="https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy" target="_blank" rel="noreferrer">https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy</a></li><li>Applexad's binary of Nezha's officially dashboard: <a href="https://github.com/applexad/nezha-binary-build" target="_blank" rel="noreferrer">https://github.com/applexad/nezha-binary-build</a></li></ul><h2 id="disclaimer" tabindex="-1">Disclaimer <a class="header-anchor" href="#disclaimer" aria-label="Permalink to "Disclaimer""></a></h2><ul><li>This program is only for learning and understanding, non-profit purposes, please delete within 24 hours after downloading, not for any commercial purposes, text, data and images are copyrighted, if reproduced must indicate the source.</li><li>Use of this program is subject to the deployment disclaimer. Use of this program must follow the deployment of the server location, the country and the user's country laws and regulations, the author of the program is not responsible for any misconduct of the user.</li></ul>`,89),r=[o];function i(l,c,h,d,p,u){return t(),a("div",null,r)}const f=e(s,[["render",i]]);export{g as __pageData,f as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as a,o as t,a4 as n}from"./chunks/framework.BmdFiWrL.js";const g=JSON.parse('{"title":"Nezha server over Argo tunnel","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case5.md","filePath":"en_US/case/case5.md","lastUpdated":1719239024000}'),s={name:"en_US/case/case5.md"},o=n("",89),r=[o];function i(l,c,h,d,p,u){return t(),a("div",null,r)}const f=e(s,[["render",i]]);export{g as __pageData,f as default};
|
||||
@@ -1,47 +0,0 @@
|
||||
import{_ as e,o as a,c as t,R as s}from"./chunks/framework.44fd0451.js";const g=JSON.parse('{"title":"Nezha server over Argo tunnel","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case5.md","filePath":"en_US/case/case5.md","lastUpdated":1718495592000}'),n={name:"en_US/case/case5.md"},o=s(`<h1 id="nezha-server-over-argo-tunnel" tabindex="-1">Nezha server over Argo tunnel <a class="header-anchor" href="#nezha-server-over-argo-tunnel" aria-label="Permalink to "Nezha server over Argo tunnel""></a></h1><p>Contributors:</p><ul><li><a href="https://github.com/fscarmen2" target="_blank" rel="noreferrer">fscarmen</a></li></ul><p>GitHub project: <a href="https://github.com/fscarmen2/Argo-Nezha-Service-Container" target="_blank" rel="noreferrer">Argo-Nezha-Service-Container</a></p><p>Mirror backup (not live update): <a href="https://github.com/nezhahq/Argo-Nezha-Service-Container" target="_blank" rel="noreferrer">Argo-Nezha-Service-Container</a></p><hr><h1 id="catalog" tabindex="-1">Catalog <a class="header-anchor" href="#catalog" aria-label="Permalink to "Catalog""></a></h1><ul><li><a href="./case5.html#project-features">Project Features</a></li><li><a href="./case5.html#How-to-get-Argo-authentication-json-or-token">How to get Argo authentication: json or token</a></li><li><a href="./case5.html#prepare-variables-to-be-used">Variables to be used</a></li><li><a href="./case5.html#paas-deployment-example">PaaS Deployment Example</a></li><li><a href="./case5.html#vps-deployment-method-1-----docker">VPS Deployment Method 1 --- docker</a></li><li><a href="./case5.html#vps-deployment-method-2-----hosts">VPS Deployment Method 2 --- hosts</a></li><li><a href="./case5.html#client-access">Client Access</a></li><li><a href="./case5.html#ssh-access">SSH Access</a></li><li><a href="./case5.html#manual-backup-data">Manual Backup data</a></li><li><a href="./case5.html#automatically-restore-backups">Auto Restore Backup</a></li><li><a href="./case5.html#manually-restore-the-backup">Manual Restore Backup</a></li><li><a href="./case5.html#migrating-data">Migrating data</a></li><li><a href="./case5.html#main-catalog-files-and-descriptions">Main Directory Files and Descriptions</a></li><li><a href="./case5.html#acknowledgements-for-articles-and-projects-by">Acknowledgment of articles and projects by the following authors</a></li><li><a href="./case5.html#disclaimer">Disclaimer</a></li></ul><hr><h2 id="project-features" tabindex="-1">Project Features. <a class="header-anchor" href="#project-features" aria-label="Permalink to "Project Features.""></a></h2><ul><li>Wider scope of application --- As long as there is a network connection, Nezha server can be installed, such as LXC, OpenVZ VPS, Nas Virtual Machine, Container PaaS, etc.</li><li>Argo tunnel breaks through the restriction of requiring a public network portal --- The traditional Nezha requires two public network ports, one for panel visiting and the other for client reporting, this project uses Cloudflare Argo tunnels and uses intranet tunneling.</li><li>IPv4 / v6 with higher flexibility --- The traditional Nezha needs to deal with IPv4/v6 compatibility between server and client, and also needs to resolve mismatches through tools such as warp. However, this project does not need to consider these issues at all, and can be docked arbitrarily, which is much more convenient and easy!</li><li>One Argo tunnel for multiple domains and protocols --- Create an intranet-penetrating Argo tunnel for three domains (hostname) and protocols, which can be used for panel access (http), client reporting (tcp) and ssh (optional).</li><li>GrpcWebProxy reverse proxy gRPC data port --- with a certificate for tls termination, then Argo's tunnel configuration with https service pointing to this reverse proxy, enable http2 back to the source, grpc(nezha)->GrpcWebProxy->h2(argo)->cf cdn edge->agent</li><li>Daily automatic backup --- every day at 04:00 BST, the entire Nezha panel folder is automatically backed up to a designated private github repository, including panel themes, panel settings, probe data and tunnel information, the backup retains nearly 5 days of data; the content is so important that it must be placed in the private repository.</li><li>Automatic daily panel update -- the latest official panel version is automatically detected every day at 4:00 BST, and updated when there is an upgrade.</li><li>Manual/automatic restore backup --- check the content of online restore file once a minute, and restore immediately when there is any update.</li><li>Default built-in local probes --- can easily monitor their own server information</li><li>More secure data --- Argo Tunnel uses TLS encrypted communication to securely transmit application traffic to the Cloudflare network, improving application security and reliability. In addition, Argo Tunnel protects against network threats such as IP leaks and DDoS attacks.</li></ul>
Line truncated
|
||||
<span class="line"><span style="color:#A6ACCD;"> --name nezha_dashboard \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> --pull always \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> --restart always \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e GH_USER=<fill in github username> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e GH_EMAIL=<fill in github email> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e GH_PAT=<fill in the obtained> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e GH_REPO=<fill in customized> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e GH_CLIENTID=<fill in acquired> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e GH_CLIENTSECRET=<fill in acquired> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e ARGO_AUTH='<Fill in the fetched Argo json or token>' \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e ARGO_DOMAIN=<fill in customized> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> -e GH_BACKUP_USER=<If it is consistent with GH_USER, you can leave it blank> \\</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> fscarmen/argo-nezha</span></span></code></pre></div><h3 id="docker-compose-deployment" tabindex="-1">docker-compose deployment <a class="header-anchor" href="#docker-compose-deployment" aria-label="Permalink to "docker-compose deployment""></a></h3><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">version: '3.8'</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">services.</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> argo-nezha.</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> image: fscarmen/argo-nezha</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> --pull always</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> container_name: nezha_dashboard</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> restart: always</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> environment:</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - GH_USER=<fill in github username></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - GH_EMAIL=<fill in your github email></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - GH_PAT=<<fill in obtained></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - GH_REPO=<fill in customized></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - GH_CLIENTID=<fill in obtained></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - GH_CLIENTSECRET=<fill in fetched></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - ARGO_AUTH='<Fill in the fetched Argo json or token>'</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - ARGO_DOMAIN=<fill in customized></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> - GH_BACKUP_USER=<If it is consistent with GH_USER, you can leave it blank></span></span></code></pre></div><h2 id="vps-deployment-method-2-hosts" tabindex="-1">VPS Deployment Method 2 --- hosts <a class="header-anchor" href="#vps-deployment-method-2-hosts" aria-label="Permalink to "VPS Deployment Method 2 --- hosts""></a></h2><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">bash <(wget -qO- https://raw.githubusercontent.com/fscarmen2/Argo-Nezha-Service-Container/main/dashboard.sh)</span></span></code></pre></div><h2 id="client-access" tabindex="-1">Client Access <a class="header-anchor" href="#client-access" aria-label="Permalink to "Client Access""></a></h2><p>Transfer via gRPC, no additional configuration required. Use the installation method given in the panel, for example</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh -o nezha.sh && chmod +x nezha.sh && sudo ./nezha.sh install_agent data.seales.nom.za 443 eAxO9IF519fKFODlW0 --tls</span></span></code></pre></div><h2 id="ssh-access" tabindex="-1">SSH access <a class="header-anchor" href="#ssh-access" aria-label="Permalink to "SSH access""></a></h2><ul><li>Take macOS + WindTerm as an example, and other SSH tools depending on the one used, combined with the official documentation: <a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/use_cases/ssh" target="_blank" rel="noreferrer">https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/use_cases/ssh</a> /#2-connect-as-a-user</li><li>Official cloudflared download: <a href="https://github.com/cloudflare/cloudflared/releases" target="_blank" rel="noreferrer">https://github.com/cloudflare/cloudflared/releases</a></li><li>The following are examples of input commands. SSH user: root, SSH password:<GH_CLIENTSECRET></li></ul><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;"><filepath>/cloudflared access ssh --hostname ssh.seals.nom.za/<GH_CLIENTID></span></span></code></pre></div><img width="1189" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/0aeb3939-51c7-47ac-a7fd-25a8a01d3df5"><img width="840" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/16961ade-aafc-4132-92a1-aa218e0fead9"><img width="1201" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/3146b2e2-f988-487f-ab63-00218eb4d570"><h2 id="manually-backing-up-your-data" tabindex="-1">Manually backing up your data <a class="header-anchor" href="#manually-backing-up-your-data" aria-label="Permalink to "Manually backing up your data""></a></h2><p>Method 1: Change the contents of the <code>README.md</code> file in the Github backup repository to <code>backup</code></p><img width="970" alt="image" src="https://github.com/fscarmen2/Argo-Nezha-Service-Container/assets/92626977/c5b6bc4b-e69c-48ce-97d4- 3f9be88515f3"><p>Method 2: After ssh, run <code>/dashboard/backup.sh</code> for container version; <code>/opt/nezha/dashboard/backup.sh</code> for VPS host version.</p><h2 id="automatically-restore-backups" tabindex="-1">Automatically restore backups <a class="header-anchor" href="#automatically-restore-backups" aria-label="Permalink to "Automatically restore backups""></a></h2><ul><li>Change the name of the file to be restored to <code>README.md</code> in the github backup repository, the timer service will check for updates every minute and record the last synchronized filename in the local <code>/dbfile</code> to compare with the online file content.</li></ul><p>The following is an example of restoring a file with the name <code>dashboard-2023-04-23-13:08:37.tar.gz</code>.</p><p>! <a href="https://user-images.githubusercontent.com/92626977/233822466-c24e94f6-ba8a-47c9-b77d-aa62a56cc929.png" target="_blank" rel="noreferrer">image</a></p><h2 id="manually-restore-the-backup" tabindex="-1">Manually restore the backup <a class="header-anchor" href="#manually-restore-the-backup" aria-label="Permalink to "Manually restore the backup""></a></h2><ul><li>ssh into the container and run, tar.gz filename from the github backup repository, format: dashboard-2023-04-22-21:42:10.tar.gz</li></ul><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-tLine truncated
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- app # Nezha panel main program</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- argo.json # Argo tunnel json file, which records information about using the tunnel.</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- argo.yml # Argo tunnel yml file, used for streaming web, gRPC and ssh protocols under a single tunnel with different domains.</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- backup.sh # Backup data scripts</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- restore.sh # Restore backup scripts</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- dbfile # Record the name of the latest restore or backup file</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- resource # Folders of information on panel themes, languages, flags, etc.</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- data</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">| |-- config.yaml # Configuration for the Nezha panel, e.g. Github OAuth2 / gRPC domain / port / TLS enabled or not.</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">| \`-- sqlite.db # SQLite database file that records all severs and cron settings for the panel.</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- entrypoint.sh # The main script, which is executed after the container is run.</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- nezha.csr # SSL/TLS certificate signing request</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- nezha.key # Private key information for SSL/TLS certificate.</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- nezha.pem # SSL/TLS certificate file.</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- cloudflared # Cloudflare Argo tunnel main program.</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">|-- grpcwebproxy # gRPC reverse proxy main program.</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">\`-- nezha-agent # Nezha client, used to monitor the localhost.</span></span></code></pre></div><h2 id="acknowledgements-for-articles-and-projects-by" tabindex="-1">Acknowledgements for articles and projects by <a class="header-anchor" href="#acknowledgements-for-articles-and-projects-by" aria-label="Permalink to "Acknowledgements for articles and projects by""></a></h2><ul><li>Robin, an enthusiastic sunrise crowd, for discussing the relationship between Nezha's server and client, which led to the birth of this project.</li><li>Nezha website: <a href="https://nezha.wiki/" target="_blank" rel="noreferrer">https://nezha.wiki/</a> , TG Group: <a href="https://t.me/nezhamonitoring" target="_blank" rel="noreferrer">https://t.me/nezhamonitoring</a></li><li>Common Poverty International Old Chinese Medicine: <a href="http://solitud.es/" target="_blank" rel="noreferrer">http://solitud.es/</a></li><li>Akkia's Blog: <a href="https://blog.akkia.moe/" target="_blank" rel="noreferrer">https://blog.akkia.moe/</a></li><li>Ayaka's Blog: <a href="https://blog.xn--pn1aul.org/" target="_blank" rel="noreferrer">https://blog.萝莉.org/</a></li><li>HiFeng's Blog: <a href="https://www.hicairo.com/" target="_blank" rel="noreferrer">https://www.hicairo.com/</a></li><li>Intranet Penetration with Cloudflare Tunnel: <a href="https://blog.outv.im/2021/cloudflared-tunnel/" target="_blank" rel="noreferrer">https://blog.outv.im/2021/cloudflared-tunnel/</a></li><li>How to add your own Runner host to GitHub Actions: <a href="https://cloud.tencent.com/developer/article/1756690" target="_blank" rel="noreferrer">https://cloud.tencent.com/developer/article/1756690</a></li><li>github self-hosted runner addition and startup: <a href="https://blog.csdn.net/sinat_32188225/article/details/125978331" target="_blank" rel="noreferrer">https://blog.csdn.net/sinat_32188225/article/details/125978331</a></li><li>How to export a file from a Docker image: <a href="https://www.pkslow.com/archives/extract-files-from-docker-image" target="_blank" rel="noreferrer">https://www.pkslow.com/archives/extract-files-from-docker-image</a></li><li>grpcwebproxy: <a href="https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy" target="_blank" rel="noreferrer">https://github.com/improbable-eng/grpc-web/tree/master/go/grpcwebproxy</a></li><li>Applexad's binary of Nezha's officially dashboard: <a href="https://github.com/applexad/nezha-binary-build" target="_blank" rel="noreferrer">https://github.com/applexad/nezha-binary-build</a></li></ul><h2 id="disclaimer" tabindex="-1">Disclaimer <a class="header-anchor" href="#disclaimer" aria-label="Permalink to "Disclaimer""></a></h2><ul><li>This program is only for learning and understanding, non-profit purposes, please delete within 24 hours after downloading, not for any commercial purposes, text, data and images are copyrighted, if reproduced must indicate the source.</li><li>Use of this program is subject to the deployment disclaimer. Use of this program must follow the deployment of the server location, the country and the user's country laws and regulations, the author of the program is not responsible for any misconduct of the user.</li></ul>`,89),r=[o];function l(i,c,h,p,d,u){return a(),t("div",null,r)}const f=e(n,[["render",l]]);export{g as __pageData,f as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o as a,c as t,R as s}from"./chunks/framework.44fd0451.js";const g=JSON.parse('{"title":"Nezha server over Argo tunnel","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/case/case5.md","filePath":"en_US/case/case5.md","lastUpdated":1718495592000}'),n={name:"en_US/case/case5.md"},o=s("",89),r=[o];function l(i,c,h,p,d,u){return a(),t("div",null,r)}const f=e(n,[["render",l]]);export{g as __pageData,f as default};
|
||||
@@ -1 +1 @@
|
||||
import{_ as e,o as t,c as a}from"./chunks/framework.44fd0451.js";const u=JSON.parse('{"title":"Nezha Monitoring","titleTemplate":"Community Project","description":"","frontmatter":{"layout":"home","title":"Nezha Monitoring","titleTemplate":"Community Project","hero":{"name":"Nezha Monitoring","text":"Community Project","tagline":"Nezha Monitoring has benefited from various projects contributed by the community, which have provided it with additional extensions.","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"Learn More →","link":"/en_US/case/case1"}]},"features":[{"title":"Submit a project","details":"We welcome you to submit your own project. Please join the Telegram group to contact the administrator for further information."},{"title":"Important Notes","details":"All projects are contributed by community members. Please be aware that the Nezha Monitoring Team cannot assume responsibility for community projects, including but not limited to warranty, availability, security, etc."}]},"headers":[],"relativePath":"en_US/case/index.md","filePath":"en_US/case/index.md","lastUpdated":1718495592000}'),o={name:"en_US/case/index.md"};function i(n,r,s,c,m,l){return t(),a("div")}const h=e(o,[["render",i]]);export{u as __pageData,h as default};
|
||||
import{_ as e,c as t,o as a}from"./chunks/framework.BmdFiWrL.js";const u=JSON.parse('{"title":"Nezha Monitoring","titleTemplate":"Community Project","description":"","frontmatter":{"layout":"home","title":"Nezha Monitoring","titleTemplate":"Community Project","hero":{"name":"Nezha Monitoring","text":"Community Project","tagline":"Nezha Monitoring has benefited from various projects contributed by the community, which have provided it with additional extensions.","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"Learn More →","link":"/en_US/case/case1"}]},"features":[{"title":"Submit a project","details":"We welcome you to submit your own project. Please join the Telegram group to contact the administrator for further information."},{"title":"Important Notes","details":"All projects are contributed by community members. Please be aware that the Nezha Monitoring Team cannot assume responsibility for community projects, including but not limited to warranty, availability, security, etc."}]},"headers":[],"relativePath":"en_US/case/index.md","filePath":"en_US/case/index.md","lastUpdated":1719239024000}'),o={name:"en_US/case/index.md"};function i(n,r,s,c,m,l){return a(),t("div")}const h=e(o,[["render",i]]);export{u as __pageData,h as default};
|
||||
@@ -1 +1 @@
|
||||
import{_ as e,o as t,c as a}from"./chunks/framework.44fd0451.js";const u=JSON.parse('{"title":"Nezha Monitoring","titleTemplate":"Community Project","description":"","frontmatter":{"layout":"home","title":"Nezha Monitoring","titleTemplate":"Community Project","hero":{"name":"Nezha Monitoring","text":"Community Project","tagline":"Nezha Monitoring has benefited from various projects contributed by the community, which have provided it with additional extensions.","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"Learn More →","link":"/en_US/case/case1"}]},"features":[{"title":"Submit a project","details":"We welcome you to submit your own project. Please join the Telegram group to contact the administrator for further information."},{"title":"Important Notes","details":"All projects are contributed by community members. Please be aware that the Nezha Monitoring Team cannot assume responsibility for community projects, including but not limited to warranty, availability, security, etc."}]},"headers":[],"relativePath":"en_US/case/index.md","filePath":"en_US/case/index.md","lastUpdated":1718495592000}'),o={name:"en_US/case/index.md"};function i(n,r,s,c,m,l){return t(),a("div")}const h=e(o,[["render",i]]);export{u as __pageData,h as default};
|
||||
import{_ as e,c as t,o as a}from"./chunks/framework.BmdFiWrL.js";const u=JSON.parse('{"title":"Nezha Monitoring","titleTemplate":"Community Project","description":"","frontmatter":{"layout":"home","title":"Nezha Monitoring","titleTemplate":"Community Project","hero":{"name":"Nezha Monitoring","text":"Community Project","tagline":"Nezha Monitoring has benefited from various projects contributed by the community, which have provided it with additional extensions.","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"Learn More →","link":"/en_US/case/case1"}]},"features":[{"title":"Submit a project","details":"We welcome you to submit your own project. Please join the Telegram group to contact the administrator for further information."},{"title":"Important Notes","details":"All projects are contributed by community members. Please be aware that the Nezha Monitoring Team cannot assume responsibility for community projects, including but not limited to warranty, availability, security, etc."}]},"headers":[],"relativePath":"en_US/case/index.md","filePath":"en_US/case/index.md","lastUpdated":1719239024000}'),o={name:"en_US/case/index.md"};function i(n,r,s,c,m,l){return a(),t("div")}const h=e(o,[["render",i]]);export{u as __pageData,h as default};
|
||||
@@ -1 +1 @@
|
||||
import{_ as e,o as t,c as a}from"./chunks/framework.44fd0451.js";const c=JSON.parse('{"title":"Nezha Monitoring","titleTemplate":"Development Manual","description":"","frontmatter":{"layout":"home","title":"Nezha Monitoring","titleTemplate":"Development Manual","hero":{"name":"Development Manual","text":"Nezha Monitoring Development Manual.","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"Start Now →","link":"/en_US/developer/theme"}]}},"headers":[],"relativePath":"en_US/developer/index.md","filePath":"en_US/developer/index.md","lastUpdated":1718495592000}'),n={name:"en_US/developer/index.md"};function o(r,i,l,s,p,d){return t(),a("div")}const _=e(n,[["render",o]]);export{c as __pageData,_ as default};
|
||||
import{_ as e,c as t,o as a}from"./chunks/framework.BmdFiWrL.js";const c=JSON.parse('{"title":"Nezha Monitoring","titleTemplate":"Development Manual","description":"","frontmatter":{"layout":"home","title":"Nezha Monitoring","titleTemplate":"Development Manual","hero":{"name":"Development Manual","text":"Nezha Monitoring Development Manual.","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"Start Now →","link":"/en_US/developer/theme"}]}},"headers":[],"relativePath":"en_US/developer/index.md","filePath":"en_US/developer/index.md","lastUpdated":1719239024000}'),n={name:"en_US/developer/index.md"};function o(r,i,l,s,p,d){return a(),t("div")}const _=e(n,[["render",o]]);export{c as __pageData,_ as default};
|
||||
@@ -1 +1 @@
|
||||
import{_ as e,o as t,c as a}from"./chunks/framework.44fd0451.js";const c=JSON.parse('{"title":"Nezha Monitoring","titleTemplate":"Development Manual","description":"","frontmatter":{"layout":"home","title":"Nezha Monitoring","titleTemplate":"Development Manual","hero":{"name":"Development Manual","text":"Nezha Monitoring Development Manual.","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"Start Now →","link":"/en_US/developer/theme"}]}},"headers":[],"relativePath":"en_US/developer/index.md","filePath":"en_US/developer/index.md","lastUpdated":1718495592000}'),n={name:"en_US/developer/index.md"};function o(r,i,l,s,p,d){return t(),a("div")}const _=e(n,[["render",o]]);export{c as __pageData,_ as default};
|
||||
import{_ as e,c as t,o as a}from"./chunks/framework.BmdFiWrL.js";const c=JSON.parse('{"title":"Nezha Monitoring","titleTemplate":"Development Manual","description":"","frontmatter":{"layout":"home","title":"Nezha Monitoring","titleTemplate":"Development Manual","hero":{"name":"Development Manual","text":"Nezha Monitoring Development Manual.","image":"https://raw.githubusercontent.com/naiba/nezha/master/resource/static/brand.svg","actions":[{"theme":"brand","text":"Start Now →","link":"/en_US/developer/theme"}]}},"headers":[],"relativePath":"en_US/developer/index.md","filePath":"en_US/developer/index.md","lastUpdated":1719239024000}'),n={name:"en_US/developer/index.md"};function o(r,i,l,s,p,d){return a(),t("div")}const _=e(n,[["render",o]]);export{c as __pageData,_ as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as a,a4 as n}from"./chunks/framework.BmdFiWrL.js";const g=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/developer/l10n.md","filePath":"en_US/developer/l10n.md","lastUpdated":1719239024000}'),o={name:"en_US/developer/l10n.md"},i=n('<p><strong>Nezha Monitoring's Dashboard has added localization to support multiple languages, and you can follow these steps to support localization when developing new features</strong></p><h2 id="introduction" tabindex="-1">Introduction <a class="header-anchor" href="#introduction" aria-label="Permalink to "Introduction""></a></h2><ol><li>You can directly use the text configuration already available in <code>/resource/l10n/en-US.toml</code> to replace the text in the new feature.</li><li>If there is new text in the new feature, please refer to the configuration text in <code>en-US.toml</code>, pull the new text into the configuration files of other languages such as <code>en-US.toml</code>, and add translations.</li></ol><h2 id="adding-a-new-localized-text-file" tabindex="-1">Adding a new localized text file <a class="header-anchor" href="#adding-a-new-localized-text-file" aria-label="Permalink to "Adding a new localized text file""></a></h2><ol><li>Add a new language text configuration in <code>/resource/l10n/</code>.</li><li>Pull existing text configurations from other languages in the new language text configuration.</li><li>Add translations for the new language text configuration.</li></ol>',5),l=[i];function r(d,c,s,u,h,f){return a(),t("div",null,l)}const p=e(o,[["render",r]]);export{g as __pageData,p as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as a,a4 as n}from"./chunks/framework.BmdFiWrL.js";const g=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/developer/l10n.md","filePath":"en_US/developer/l10n.md","lastUpdated":1719239024000}'),o={name:"en_US/developer/l10n.md"},i=n("",5),l=[i];function r(d,c,s,u,h,f){return a(),t("div",null,l)}const p=e(o,[["render",r]]);export{g as __pageData,p as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o as t,c as a,R as n}from"./chunks/framework.44fd0451.js";const g=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/developer/l10n.md","filePath":"en_US/developer/l10n.md","lastUpdated":1718495592000}'),o={name:"en_US/developer/l10n.md"},i=n('<p><strong>Nezha Monitoring's Dashboard has added localization to support multiple languages, and you can follow these steps to support localization when developing new features</strong></p><h2 id="introduction" tabindex="-1">Introduction <a class="header-anchor" href="#introduction" aria-label="Permalink to "Introduction""></a></h2><ol><li>You can directly use the text configuration already available in <code>/resource/l10n/en-US.toml</code> to replace the text in the new feature.</li><li>If there is new text in the new feature, please refer to the configuration text in <code>en-US.toml</code>, pull the new text into the configuration files of other languages such as <code>en-US.toml</code>, and add translations.</li></ol><h2 id="adding-a-new-localized-text-file" tabindex="-1">Adding a new localized text file <a class="header-anchor" href="#adding-a-new-localized-text-file" aria-label="Permalink to "Adding a new localized text file""></a></h2><ol><li>Add a new language text configuration in <code>/resource/l10n/</code>.</li><li>Pull existing text configurations from other languages in the new language text configuration.</li><li>Add translations for the new language text configuration.</li></ol>',5),l=[i];function r(d,c,s,u,h,f){return t(),a("div",null,l)}const p=e(o,[["render",r]]);export{g as __pageData,p as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o as t,c as a,R as n}from"./chunks/framework.44fd0451.js";const g=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/developer/l10n.md","filePath":"en_US/developer/l10n.md","lastUpdated":1718495592000}'),o={name:"en_US/developer/l10n.md"},i=n("",5),l=[i];function r(d,c,s,u,h,f){return t(),a("div",null,l)}const p=e(o,[["render",r]]);export{g as __pageData,p as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o,c as t,R as a}from"./chunks/framework.44fd0451.js";const _=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/developer/theme.md","filePath":"en_US/developer/theme.md","lastUpdated":1718495592000}'),n={name:"en_US/developer/theme.md"},c=a('<h2 id="nezha-theme-development-environment" tabindex="-1">Nezha Theme Development Environment <a class="header-anchor" href="#nezha-theme-development-environment" aria-label="Permalink to "Nezha Theme Development Environment""></a></h2><p>Nezha Monitoring provides a theme development environment that you can use to create new Nezha Monitoring themes</p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>Please note: This development environment only supports <code>dashboard v0.13.16</code> and newer versions.</p></div><h2 id="how-to-use" tabindex="-1">How to use <a class="header-anchor" href="#how-to-use" aria-label="Permalink to "How to use""></a></h2><ol><li>Clone <a href="https://github.com/nezhahq/skeleton-custom-theme" target="_blank" rel="noreferrer">this repository</a> to local</li><li>Modify the Oauth2 configuration in <code>data/config.yaml</code>(The callback connection can be filled with <code>http://localhost</code>)</li><li>Run <code>docker-compose up</code></li><li>Start development</li><li>Once the theme has been created, you can place <code>theme-custom</code> in <code>/opt/nezha/dashboard/theme-custom</code> on the server</li></ol><h2 id="faq" tabindex="-1">FAQ <a class="header-anchor" href="#faq" aria-label="Permalink to "FAQ""></a></h2><ul><li>If you can't use port <code>80</code>, change the configuration in <code>docker-compose.yaml</code>.</li></ul>',7),r=[c];function l(i,h,d,s,m,p){return o(),t("div",null,r)}const v=e(n,[["render",l]]);export{_ as __pageData,v as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o,c as t,R as a}from"./chunks/framework.44fd0451.js";const _=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/developer/theme.md","filePath":"en_US/developer/theme.md","lastUpdated":1718495592000}'),n={name:"en_US/developer/theme.md"},c=a("",7),r=[c];function l(i,h,d,s,m,p){return o(),t("div",null,r)}const v=e(n,[["render",l]]);export{_ as __pageData,v as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as o,o as t,a4 as a}from"./chunks/framework.BmdFiWrL.js";const _=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/developer/theme.md","filePath":"en_US/developer/theme.md","lastUpdated":1719239024000}'),n={name:"en_US/developer/theme.md"},c=a('<h2 id="nezha-theme-development-environment" tabindex="-1">Nezha Theme Development Environment <a class="header-anchor" href="#nezha-theme-development-environment" aria-label="Permalink to "Nezha Theme Development Environment""></a></h2><p>Nezha Monitoring provides a theme development environment that you can use to create new Nezha Monitoring themes</p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>Please note: This development environment only supports <code>dashboard v0.13.16</code> and newer versions.</p></div><h2 id="how-to-use" tabindex="-1">How to use <a class="header-anchor" href="#how-to-use" aria-label="Permalink to "How to use""></a></h2><ol><li>Clone <a href="https://github.com/nezhahq/skeleton-custom-theme" target="_blank" rel="noreferrer">this repository</a> to local</li><li>Modify the Oauth2 configuration in <code>data/config.yaml</code>(The callback connection can be filled with <code>http://localhost</code>)</li><li>Run <code>docker-compose up</code></li><li>Start development</li><li>Once the theme has been created, you can place <code>theme-custom</code> in <code>/opt/nezha/dashboard/theme-custom</code> on the server</li></ol><h2 id="faq" tabindex="-1">FAQ <a class="header-anchor" href="#faq" aria-label="Permalink to "FAQ""></a></h2><ul><li>If you can't use port <code>80</code>, change the configuration in <code>docker-compose.yaml</code>.</li></ul>',7),r=[c];function l(i,h,d,s,m,p){return t(),o("div",null,r)}const v=e(n,[["render",l]]);export{_ as __pageData,v as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as o,o as t,a4 as a}from"./chunks/framework.BmdFiWrL.js";const _=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en_US/developer/theme.md","filePath":"en_US/developer/theme.md","lastUpdated":1719239024000}'),n={name:"en_US/developer/theme.md"},c=a("",7),r=[c];function l(i,h,d,s,m,p){return t(),o("div",null,r)}const v=e(n,[["render",l]]);export{_ as __pageData,v as default};
|
||||
@@ -1,144 +0,0 @@
|
||||
import{_ as s,o as n,c as a,R as l}from"./chunks/framework.44fd0451.js";const h=JSON.parse('{"title":"Install Agent","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/agent.md","filePath":"en_US/guide/agent.md","lastUpdated":1718495592000}'),o={name:"en_US/guide/agent.md"},e=l(`<h1 id="install-agent" tabindex="-1">Install Agent <a class="header-anchor" href="#install-agent" aria-label="Permalink to "Install Agent""></a></h1><p><strong>This document will introduce how to install the Agent on the monitored server and connect it to the Dashboard.</strong></p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The repository for Agent binaries can be found at: <a href="https://github.com/nezhahq/agent/releases" target="_blank" rel="noreferrer">https://github.com/nezhahq/agent/releases</a></p></div><h2 id="one-click-installation-of-the-agent" tabindex="-1">One-Click Installation of the Agent <a class="header-anchor" href="#one-click-installation-of-the-agent" aria-label="Permalink to "One-Click Installation of the Agent""></a></h2><p>Nezha Monitoring supports one-click installation of the Agent on both Windows and Linux. By following the steps in this document, you can easily deploy it on your server.</p><h3 id="preparation" tabindex="-1">Preparation <a class="header-anchor" href="#preparation" aria-label="Permalink to "Preparation""></a></h3><p>You need to set up a communication domain in the admin panel in advance, and this domain should not be connected to a CDN. This document uses the example communication domain “data.example.com”.<br> Go to the settings page in the admin panel, fill in the communication domain in the “Non-CDN Dashboard Server Domain/IP” field, and click "Save".</p><h3 id="one-click-installation-on-linux-ubuntu-debian-centos" tabindex="-1">One-Click Installation on Linux (Ubuntu, Debian, CentOS) <a class="header-anchor" href="#one-click-installation-on-linux-ubuntu-debian-centos" aria-label="Permalink to "One-Click Installation on Linux (Ubuntu, Debian, CentOS)""></a></h3><ol><li>First, add a server in the admin panel.</li><li>Click the green Linux icon button next to the newly added server and copy the one-click installation command.</li><li>Run the copied installation command on the monitored server, and wait for the installation to complete. Then, check if the server is online in the Dashboard home page.</li></ol><h3 id="one-click-installation-on-windows" tabindex="-1">One-Click Installation on Windows <a class="header-anchor" href="#one-click-installation-on-windows" aria-label="Permalink to "One-Click Installation on Windows""></a></h3><ol><li>First, add a server in the admin panel.</li><li>Click the green Windows icon button next to the newly added server and copy the one-click installation command.</li><li>Go to the Windows server, run PowerShell, and execute the copied installation command in PowerShell.</li><li>If you encounter a prompt to "change execution policy," choose Y.</li><li>Wait for the installation to complete, then check if the server is online in the Dashboard home page.</li></ol><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>If you encounter errors when running the one-click installation command in PowerShell, try the <strong>Manual Installation of the Agent on Windows</strong> below.</p></div><h2 id="other-ways-to-install-the-agent" tabindex="-1">Other Ways to Install the Agent <a class="header-anchor" href="#other-ways-to-install-the-agent" aria-label="Permalink to "Other Ways to Install the Agent""></a></h2><h3 id="installing-the-agent-on-linux-ubuntu-debian-centos" tabindex="-1">Installing the Agent on Linux (Ubuntu, Debian, CentOS) <a class="header-anchor" href="#installing-the-agent-on-linux-ubuntu-debian-centos" aria-label="Permalink to "Installing the Agent on Linux (Ubuntu, Debian, CentOS)""></a></h3><details><summary>Click to expand/collapse</summary><ol><li>First, add a server in the admin panel.</li><li>Run the script on the monitored server:</li></ol><div class="language-bash"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">curl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-L</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">https://raw.githubusercontent.com/naiba/nezha/master/script/install_en.sh</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-o</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha.sh</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">&&</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">chmod</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E8
Line truncated
|
||||
<span class="line"><span style="color:#C3E88D;">#!/sbin/openrc-run</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">SERVER="" # Dashboard domain ip:port</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">SECRET="" # SECRET</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">TLS="" # Enable TLS if yes "--tls", leave empty if no</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">NZ_BASE_PATH="/opt/nezha"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">NZ_AGENT_PATH="</span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">NZ_BASE_PATH</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">/agent"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">pidfile="/run/</span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">RC_SVCNAME</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">.pid"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">command="/opt/nezha/agent/nezha-agent"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">command_args="-s </span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">SERVER</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;"> -p </span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">SECRET</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">TLS</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">command_background=true</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">depend() {</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> need net</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">}</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">checkconfig() {</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> GITHUB_URL="github.com"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> if [ ! -f "</span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">NZ_AGENT_PATH</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">/nezha-agent" ]; then</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> if [[ </span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">uname</span><span style="color:#C3E88D;"> -m </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">x86_64</span><span style="color:#89DDFF;">')</span><span style="color:#C3E88D;"> != "" ]]; then</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> os_arch="amd64"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> elif [[ </span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">uname</span><span style="color:#C3E88D;"> -m </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">i386\\|i686</span><span style="color:#89DDFF;">')</span><span style="color:#C3E88D;"> != "" ]]; then</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> os_arch="386"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> elif [[ </span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">uname</span><span style="color:#C3E88D;"> -m </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">aarch64\\|armv8b\\|armv8l</span><span style="color:#89DDFF;">')</span><span style="color:#C3E88D;"> != "" ]]; then</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> os_arch="arm64"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> elif [[ </span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">uname</span><span style="color:#C3E88D;"> -m </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">arm</span><span style="color:#89DDFF;">')</span><span style="color:#C3E88D;"> != "" ]]; then</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> os_arch="arm"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> elif [[ </span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">uname</span><span style="color:#C3E88D;"> -m </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">s390x</span><span style="color:#89DDFF;">')</span><span style="color:#C3E88D;"> != "" ]]; then</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> os_arch="s390x"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> elif [[ </span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">uname</span><span style="color:#C3E88D;"> -m </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">riscv64</span><span style="color:#89DDFF;">')</span><span style="color:#C3E88D;"> != "" ]]; then</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> os_arch="riscv64"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> fi</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> local version=</span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">curl</span><span style="color:#C3E88D;"> -m </span><span style="color:#F78C6C;">10</span><span style="color:#C3E88D;"> -sL </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">https://api.github.com/repos/nezhahq/agent/releases/latest</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">tag_name</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">head</span><span style="color:#C3E88D;"> -n </span><span style="color:#F78C6C;">1</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">awk</span><span style="color:#C3E88D;"> -F </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">:</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">{print $2}</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">sed</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">s/\\"//g;s/,//g;s/ //g</span><span style="color:#89DDFF;">')</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> if [ ! -n "</span><span style="color:#A6ACCD;">$version</span><span style="color:#C3E88D;">" ]; then</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> version=</span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">curl</span><span style="color:#C3E88D;"> -m </span><span style="color:#F78C6C;">10</span><span style="color:#C3E88D;"> -sL </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">https://fastly.jsdelivr.net/gh/nezhahq/agent/</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">option\\.value</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">awk</span><span style="color:#C3E88D;"> -F </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">'</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">{print $2}</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">sed</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">s/nezhahq\\/agent@/v/g</span><span style="color:#89DDFF;">')</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> fi</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> if [ ! -n "</span><span style="color:#A6ACCD;">$version</span><span style="color:#C3E88D;">" ]; then</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> version=</span><span style="color:#89DDFF;">$(</span><span style="color:#FFCB6B;">curl</span><span style="color:#C3E88D;"> -m </span><span style="color:#F78C6C;">10</span><span style="color:#C3E88D;"> -sL </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">https://gcore.jsdelivr.net/gh/nezhahq/agent/</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">option\\.value</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">awk</span><span style="color:#C3E88D;"> -F </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">'</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">{print $2}</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">|</span><span style="color:#C3E88D;"> </span><span style="color:#FFCB6B;">sed</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">s/nezhahq\\/agent@/v/g</span><span style="color:#89DDFF;">')</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> fi</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> if [ ! -n "</span><span style="color:#A6ACCD;">$version</span><span style="color:#C3E88D;">" ]; then</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> echo -e "Failed to get the version number. Please check if the server can connect to https://api.github.com/repos/nezhahq/agent/releases/latest"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> return 0</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> else</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> echo -e "The latest version is: </span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">version</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> fi</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> wget -t 2 -T 10 -O nezha-agent_linux_</span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">os_arch</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">.zip https://</span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">GITHUB_URL</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">/nezhahq/agent/releases/download/</span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">version</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">/nezha-agent_linux_</span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">os_arch</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">.zip >/dev/null 2>&1</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> if [[ </span><span style="color:#A6ACCD;">$?</span><span style="color:#C3E88D;"> != 0 ]]; then</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> echo -e "Failed to download Release. Please check if the server can connect to </span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">GITHUB_URL</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">"</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> return 0</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> fi</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> mkdir -p </span><span style="color:#A6ACCD;">$NZ_AGENT_PATH</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> chmod 755 -R </span><span style="color:#A6ACCD;">$NZ_AGENT_PATH</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> unzip -qo nezha-agent_linux_</span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">os_arch</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">.zip && mv nezha-agent </span><span style="color:#A6ACCD;">$NZ_AGENT_PATH</span><span style="color:#C3E88D;"> && rm -rf nezha-agent_linux_</span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">os_arch</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">.zip README.md</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> fi</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> if [ ! -x "</span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">NZ_AGENT_PATH</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">/nezha-agent" ]; then</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> chmod +x </span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">NZ_AGENT_PATH</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">/nezha-agent</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> fi</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">}</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">start_pre() {</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> if [ "</span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">RC_CMD</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">" != "restart" ]; then</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> checkconfig || return </span><span style="color:#A6ACCD;">$?</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;"> fi</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">}</span></span>
|
||||
<span class="line"><span style="color:#89DDFF;">EOF</span></span></code></pre></div><ol start="2"><li>Add execute permissions</li></ol><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">chmod</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">+x</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">/etc/init.d/nezha-agent</span></span></code></pre></div><ol start="3"><li>Start Nezha-Agent</li></ol><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">rc-service</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha-agent</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">start</span></span></code></pre></div><ol start="4"><li>Add to startup</li></ol><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">rc-update</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">add</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha-agent</span></span></code></pre></div></details><h3 id="manual-installation-of-the-agent-on-windows" tabindex="-1">Manual Installation of the Agent on Windows <a class="header-anchor" href="#manual-installation-of-the-agent-on-windows" aria-label="Permalink to "Manual Installation of the Agent on Windows""></a></h3><ul><li>Refer to the community article:<br><a href="https://nyko.me/2020/12/13/nezha-windows-client.html" target="_blank" rel="noreferrer">Nezha - Windows Client Installation</a> (Chinese)</li></ul><h3 id="installing-the-agent-on-synology-dsm" tabindex="-1">Installing the Agent on Synology DSM <a class="header-anchor" href="#installing-the-agent-on-synology-dsm" aria-label="Permalink to "Installing the Agent on Synology DSM""></a></h3><details><summary>Click to expand/collapse</summary><ul><li><p>Refer to community articles:<br><a href="https://blog.mitsea.com/3929551d08bd4bb0a8baa453e2d92b0c/" target="_blank" rel="noreferrer">Installing Nezha Monitoring Agent on Synology DSM 7.x</a> (Chinese)<br><a href="https://wl.gta5pdx.cn/archives/546/" target="_blank" rel="noreferrer">Nezha - Synology Client (Agent) Installation Tutorial</a> (Chinese)</p></li><li><p>Using Systemd <em>for DSM7 only</em>:</p></li></ul><div class="language-sh"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#676E95;font-style:italic;"># Agent path</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">EXEC</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">/PATH/TO/nezha-agent</span><span style="color:#89DDFF;">"</span></span>
|
||||
<span class="line"><span style="color:#676E95;font-style:italic;"># Log path</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">LOG</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">"\${</span><span style="color:#A6ACCD;">EXEC</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;">.log</span><span style="color:#89DDFF;">"</span></span>
|
||||
<span class="line"><span style="color:#676E95;font-style:italic;"># Additional execution parameters, can be empty</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">ARGS</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">""</span></span>
|
||||
<span class="line"><span style="color:#676E95;font-style:italic;"># Nezha server gRPC address</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">SERVER</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">HOST_OR_IP:gRPC_PORT</span><span style="color:#89DDFF;">"</span></span>
|
||||
<span class="line"><span style="color:#676E95;font-style:italic;"># The secret key obtained in the previous step</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">SECRET</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">APP_SECRET</span><span style="color:#89DDFF;">"</span></span>
|
||||
<span class="line"><span style="color:#676E95;font-style:italic;"># User running the service, *strongly recommended to use non-root user*</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">RUN_USER</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">nezha</span><span style="color:#89DDFF;">"</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#676E95;font-style:italic;"># Write to systemd service file</span></span>
|
||||
<span class="line"><span style="color:#FFCB6B;">cat</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><<</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">EOF</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">></span><span style="color:#A6ACCD;"> /usr/lib/systemd/system/nezha.service</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">[Unit]</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">Description=Nezha Agent Service</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">After=network.target</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#C3E88D;">[Service]</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">Type=simple</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">ExecStart=/bin/nohup </span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">EXEC</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;"> </span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">ARGS</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;"> -s </span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">SERVER</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;"> -p </span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">SECRET</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;"> &>> </span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">LOG</span><span style="color:#89DDFF;">}</span><span style="color:#C3E88D;"> &</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">ExecStop=ps -fe |grep nezha-agent|awk '{print </span><span style="color:#A6ACCD;">\\$</span><span style="color:#C3E88D;">2}'|xargs kill</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">User=</span><span style="color:#89DDFF;">\${</span><span style="color:#A6ACCD;">RUN_USER</span><span style="color:#89DDFF;">}</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#C3E88D;">Restart=on-abort</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#C3E88D;">[Install]</span></span>
|
||||
<span class="line"><span style="color:#C3E88D;">WantedBy=multi-user.target</span></span>
|
||||
<span class="line"><span style="color:#89DDFF;">EOF</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#676E95;font-style:italic;"># Reload service</span></span>
|
||||
<span class="line"><span style="color:#FFCB6B;">systemctl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">daemon-reload</span></span>
|
||||
<span class="line"><span style="color:#676E95;font-style:italic;"># Start service</span></span>
|
||||
<span class="line"><span style="color:#FFCB6B;">systemctl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">start</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha</span></span>
|
||||
<span class="line"><span style="color:#676E95;font-style:italic;"># Enable service startup</span></span>
|
||||
<span class="line"><span style="color:#FFCB6B;">systemctl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">enable</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha</span></span></code></pre></div><p>‼️ Modify the corresponding information before running the above commands with the <code>root</code> account to complete the installation.</p></details><h3 id="installing-the-agent-on-macos" tabindex="-1">Installing the Agent on macOS <a class="header-anchor" href="#installing-the-agent-on-macos" aria-label="Permalink to "Installing the Agent on macOS""></a></h3><details><summary>Click to expand/collapse</summary><p><em><strong>This section is adapted from <a href="https://blog.mitsea.com/e796f93db38d49e4b18df234c6ee75f5" target="_blank" rel="noreferrer">Mitsea Blog</a> with the author's permission</strong></em></p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>If you are prompted "macOS cannot verify this app" during installation, manually allow the program to run in System Settings.</p></div><ol><li>First, add a server in the admin panel.</li><li>Go to the <a href="https://github.com/nezhahq/agent/releases" target="_blank" rel="noreferrer">Release</a> page to download the Agent binary file. Choose to download the darwin amd64 or arm64 Agent according to your CPU architecture. Download the amd64 version for Intel CPU, or the arm64 version for Apple Silicon. After downloading, unzip the Agent binary file, such as unzipping it to the Downloads folder.</li><li>Create a file named <code>nezha_agent.plist</code> and save it with the following content:</li></ol><div class="language-xml"><button title="Copy Code" class="copy"></button><span class="lang">xml</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;"><?</span><span style="color:#F07178;">xml</span><span style="color:#C792EA;"> version</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">1.0</span><span style="color:#89DDFF;">"</span><span style="color:#C792EA;"> encoding</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">UTF-8</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">?></span></span>
|
||||
<span class="line"><span style="color:#89DDFF;"><!</span><span style="color:#F78C6C;">DOCTYPE</span><span style="color:#89DDFF;"> </span><span style="color:#A6ACCD;">plist</span><span style="color:#89DDFF;"> PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"></span></span>
|
||||
<span class="line"><span style="color:#89DDFF;"><</span><span style="color:#F07178;">plist</span><span style="color:#89DDFF;"> </span><span style="color:#C792EA;">version</span><span style="color:#89DDFF;">=</span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">1.0</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#89DDFF;"><</span><span style="color:#F07178;">dict</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">key</span><span style="color:#89DDFF;">></span><span style="color:#A6ACCD;">KeepAlive</span><span style="color:#89DDFF;"></</span><span style="color:#F07178;">key</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">true</span><span style="color:#89DDFF;">/></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">key</span><span style="color:#89DDFF;">></span><span style="color:#A6ACCD;">Label</span><span style="color:#89DDFF;"></</span><span style="color:#F07178;">key</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">string</span><span style="color:#89DDFF;">></span><span style="color:#A6ACCD;">nezha_agent</span><span style="color:#89DDFF;"></</span><span style="color:#F07178;">string</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">key</span><span style="color:#89DDFF;">></span><span style="color:#A6ACCD;">Program</span><span style="color:#89DDFF;"></</span><span style="color:#F07178;">key</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">string</span><span style="color:#89DDFF;">></span><span style="color:#A6ACCD;">Modify the path to the Agent binary file here, such as: /Users/123/Downloads/nezha-agent</span><span style="color:#89DDFF;"></</span><span style="color:#F07178;">string</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">key</span><span style="color:#89DDFF;">></span><span style="color:#A6ACCD;">ProgramArguments</span><span style="color:#89DDFF;"></</span><span style="color:#F07178;">key</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">array</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">string</span><span style="color:#89DDFF;">></span><span style="color:#A6ACCD;">Modify the path to the Agent binary file here, same as above</span><span style="color:#89DDFF;"></</span><span style="color:#F07178;">string</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">string</span><span style="color:#89DDFF;">></span><span style="color:#A6ACCD;">--password</span><span style="color:#89DDFF;"></</span><span style="color:#F07178;">string</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">string</span><span style="color:#89DDFF;">></span><span style="color:#A6ACCD;">The communication secret, such as: 529664783eeb23cc25</span><span style="color:#89DDFF;"></</span><span style="color:#F07178;">string</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">string</span><span style="color:#89DDFF;">></span><span style="color:#A6ACCD;">--server</span><span style="color:#89DDFF;"></</span><span style="color:#F07178;">string</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">string</span><span style="color:#89DDFF;">></span><span style="color:#A6ACCD;">The communication URL and gRPC port, such as: data.example.com:5555</span><span style="color:#89DDFF;"></</span><span style="color:#F07178;">string</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"></</span><span style="color:#F07178;">array</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">key</span><span style="color:#89DDFF;">></span><span style="color:#A6ACCD;">RunAtLoad</span><span style="color:#89DDFF;"></</span><span style="color:#F07178;">key</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"><</span><span style="color:#F07178;">true</span><span style="color:#89DDFF;">/></span></span>
|
||||
<span class="line"><span style="color:#89DDFF;"></</span><span style="color:#F07178;">dict</span><span style="color:#89DDFF;">></span></span>
|
||||
<span class="line"><span style="color:#89DDFF;"></</span><span style="color:#F07178;">plist</span><span style="color:#89DDFF;">></span></span></code></pre></div><ol start="4"><li>Load the plist file into launchd using the following command in Terminal, <strong>make sure to replace the file path</strong>:</li></ol><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">launchctl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">load</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">/Users/123/Desktop/nezha_agent.plist</span></span></code></pre></div><ol start="5"><li>Start the process:</li></ol><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">launchctl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">start</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha_agent</span></span></code></pre></div><ol start="6"><li>Check if the process is running:</li></ol><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">launchctl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">list</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">|</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">grep</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha_agent</span></span></code></pre></div><ol start="7"><li>Stop the process and remove it:</li></ol><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">launchctl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">stop</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha_agent</span></span></code></pre></div><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">launchctl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">remove</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha_agent</span></span></code></pre></div></details><h3 id="installing-the-agent-on-macos-using-homebrew" tabindex="-1">Installing the Agent on macOS Using Homebrew <a class="header-anchor" href="#installing-the-agent-on-macos-using-homebrew" aria-label="Permalink to "Installing the Agent on macOS Using Homebrew""></a></h3><details><summary>Click to expand/collapse</summary><p><em><strong>This section is adapted from <a href="https://blog.mre.red/archives/install_nezha_monitoring_agent_service_with_homebrew" target="_blank" rel="noreferrer">🐿️松鼠收集🌰</a> with the author's permission</strong></em></p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>Please be sure to add environment variables before installing nezha-agent through Homebrew! Homebrew creates the service-required plist file during software installation, and if you add the environment variables after installation, it will fail to start due to missing parameters.</p></div><ol><li>Add environment variables:</li></ol><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">export HOMEBREW_NEZHA_AGENT_PASSWORD="Communication key, obtained from the service page"</span><span style="color:#89DDFF;">'</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">>></span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">~/.zshrc</span></span>
|
||||
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">export HOMEBREW_NEZHA_AGENT_SERVER="Your server and port, format your.domain:5555 "</span><span style="color:#89DDFF;">'</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">>></span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">~/.zshrc</span></span>
|
||||
<span class="line"><span style="color:#82AAFF;">source</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">~/.zshrc</span></span></code></pre></div><ol start="2"><li>Install Nezha Agent:</li></ol><div class="danger custom-block"><p class="custom-block-title">DANGER</p><p>Note that this Homebrew repository is maintained by a third party and is unrelated to Nezha Monitoring. The Nezha project team does not endorse this repository's usability, security, etc. Please evaluate the risks yourself before using!</p></div><p>Since it has not yet been submitted to the Homebrew Core official library, it is temporarily placed in the <a href="https://github.com/Brewforge/homebrew-chinese" target="_blank" rel="noreferrer">third-party Homebrew repository</a> maintained by the author of the blog:</p><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">brew</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">install</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">brewforge/chinese/nezha-agent</span></span></code></pre></div><ol start="3"><li>Start Nezha Agent service through Homebrew:</li></ol><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">brew</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">services</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">start</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha-agent</span></span></code></pre></div><ol start="4"><li>Check the service status:</li></ol><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">brew</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">services</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">info</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha-agent</span></span></code></pre></div><ol start="5"><li>Stop the service:</li></ol><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">brew</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">services</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">stop</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha-agent</span></span></code></pre></div><ol start="6"><li>Uninstall Nezha Agent:</li></ol><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">brew</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">rm</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha-agent</span></span></code></pre></div><ol start="7"><li>If there is an error, first check the environment variables:</li></ol><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> $HOMEBREW_NEZHA_AGENT_PASSWORD</span></span>
|
||||
<span class="line"><span style="color:#82AAFF;">echo</span><span style="color:#A6ACCD;"> $HOMEBREW_NEZHA_AGENT_SERVER</span></span></code></pre></div><ol start="8"><li>If the environment variables are configured correctly, try reinstalling:</li></ol><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">brew</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">services</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">stop</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha-agent</span></span>
|
||||
<span class="line"><span style="color:#FFCB6B;">brew</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">reinstall</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha-agent</span></span>
|
||||
<span class="line"><span style="color:#FFCB6B;">brew</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">services</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">start</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha-agent</span></span></code></pre></div><ol start="9"><li>If the issue persists, submit a issue to the <a href="https://github.com/Brewforge/homebrew-chinese" target="_blank" rel="noreferrer">third-party Homebrew repository</a>.</li></ol></details><h3 id="installing-the-agent-on-openwrt" tabindex="-1">Installing the Agent on OpenWRT <a class="header-anchor" href="#installing-the-agent-on-openwrt" aria-label="Permalink to "Installing the Agent on OpenWRT""></a></h3><details><summary>Click to expand/collapse</summary><p><strong>How to solve installation difficulties and issues in one step?</strong></p><ul><li>Refer to the project:<br><a href="https://github.com/dysf888/NZ-OpenWrt" target="_blank" rel="noreferrer">NZ-OpenWrt</a></li></ul><p><strong>How to enable autostart on older OpenWRT/LEDE?</strong></p><ul><li>Refer to the project:<br><a href="https://github.com/Erope/openwrt_nezha" target="_blank" rel="noreferrer">Nezha Monitoring for OpenWRT</a></li></ul><p><strong>How to enable autostart on newer OpenWRT? Contributor: @艾斯德斯</strong></p><ul><li>First, download the corresponding binary from the release, unzip the zip package, and place it in <code>/root</code>.</li><li>Run <code>chmod +x /root/nezha-agent</code> to grant execution permission, then create <code>/etc/init.d/nezha-service</code>:</li></ul><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#676E95;font-style:italic;">#!/bin/sh /etc/rc.common</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">START</span><span style="color:#89DDFF;">=</span><span style="color:#F78C6C;">99</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">USE_PROCD</span><span style="color:#89DDFF;">=</span><span style="color:#F78C6C;">1</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#82AAFF;">start_service</span><span style="color:#89DDFF;">()</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">procd_open_instance</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">procd_set_param</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">command</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">/root/nezha-agent</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-s</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">Dashboard</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">communication</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">domain:port</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-p</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">Key</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">-d</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">procd_set_param</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">respawn</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">procd_close_instance</span></span>
|
||||
<span class="line"><span style="color:#89DDFF;">}</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#82AAFF;">stop_service</span><span style="color:#89DDFF;">()</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">killall</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">nezha-agent</span></span>
|
||||
<span class="line"><span style="color:#89DDFF;">}</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#82AAFF;">restart</span><span style="color:#89DDFF;">()</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">stop</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">sleep</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">2</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">start</span></span>
|
||||
<span class="line"><span style="color:#89DDFF;">}</span></span></code></pre></div><ul><li>Run <code>chmod +x /etc/init.d/nezha-service</code> to grant execution permission.</li><li>Start the service: <code>/etc/init.d/nezha-service enable && /etc/init.d/nezha-service start</code></li></ul></details><h2 id="does-the-agent-have-a-docker-image" tabindex="-1">Does the Agent Have a Docker Image? <a class="header-anchor" href="#does-the-agent-have-a-docker-image" aria-label="Permalink to "Does the Agent Have a Docker Image?""></a></h2><p><strong>The Agent does not currently have a Docker image.</strong><br> The design philosophy of the Agent is opposite to that of the Dashboard. While the Dashboard should minimally impact the server, the Agent needs to execute monitoring services and run commands within the server.<br> Running the Agent inside a container can still perform monitoring tasks, but features like WebShell will not function properly, so no Docker image is provided.</p>`,29),p=[e];function t(r,c,i,y,D,C){return n(),a("div",null,p)}const d=s(o,[["render",t]]);export{h as __pageData,d as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as s,o as n,c as a,R as l}from"./chunks/framework.44fd0451.js";const h=JSON.parse('{"title":"Install Agent","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/agent.md","filePath":"en_US/guide/agent.md","lastUpdated":1718495592000}'),o={name:"en_US/guide/agent.md"},e=l("",29),p=[e];function t(r,c,i,y,D,C){return n(),a("div",null,p)}const d=s(o,[["render",t]]);export{h as __pageData,d as default};
|
||||
@@ -0,0 +1,144 @@
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.BmdFiWrL.js";const c=JSON.parse('{"title":"Install Agent","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/agent.md","filePath":"en_US/guide/agent.md","lastUpdated":1719239024000}'),t={name:"en_US/guide/agent.md"},e=n(`<h1 id="install-agent" tabindex="-1">Install Agent <a class="header-anchor" href="#install-agent" aria-label="Permalink to "Install Agent""></a></h1><p><strong>This document will introduce how to install the Agent on the monitored server and connect it to the Dashboard.</strong></p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The repository for Agent binaries can be found at: <a href="https://github.com/nezhahq/agent/releases" target="_blank" rel="noreferrer">https://github.com/nezhahq/agent/releases</a></p></div><h2 id="one-click-installation-of-the-agent" tabindex="-1">One-Click Installation of the Agent <a class="header-anchor" href="#one-click-installation-of-the-agent" aria-label="Permalink to "One-Click Installation of the Agent""></a></h2><p>Nezha Monitoring supports one-click installation of the Agent on both Windows and Linux. By following the steps in this document, you can easily deploy it on your server.</p><h3 id="preparation" tabindex="-1">Preparation <a class="header-anchor" href="#preparation" aria-label="Permalink to "Preparation""></a></h3><p>You need to set up a communication domain in the admin panel in advance, and this domain should not be connected to a CDN. This document uses the example communication domain “data.example.com”.<br> Go to the settings page in the admin panel, fill in the communication domain in the “Non-CDN Dashboard Server Domain/IP” field, and click "Save".</p><h3 id="one-click-installation-on-linux-ubuntu-debian-centos" tabindex="-1">One-Click Installation on Linux (Ubuntu, Debian, CentOS) <a class="header-anchor" href="#one-click-installation-on-linux-ubuntu-debian-centos" aria-label="Permalink to "One-Click Installation on Linux (Ubuntu, Debian, CentOS)""></a></h3><ol><li>First, add a server in the admin panel.</li><li>Click the green Linux icon button next to the newly added server and copy the one-click installation command.</li><li>Run the copied installation command on the monitored server, and wait for the installation to complete. Then, check if the server is online in the Dashboard home page.</li></ol><h3 id="one-click-installation-on-windows" tabindex="-1">One-Click Installation on Windows <a class="header-anchor" href="#one-click-installation-on-windows" aria-label="Permalink to "One-Click Installation on Windows""></a></h3><ol><li>First, add a server in the admin panel.</li><li>Click the green Windows icon button next to the newly added server and copy the one-click installation command.</li><li>Go to the Windows server, run PowerShell, and execute the copied installation command in PowerShell.</li><li>If you encounter a prompt to "change execution policy," choose Y.</li><li>Wait for the installation to complete, then check if the server is online in the Dashboard home page.</li></ol><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>If you encounter errors when running the one-click installation command in PowerShell, try the <strong>Manual Installation of the Agent on Windows</strong> below.</p></div><h2 id="other-ways-to-install-the-agent" tabindex="-1">Other Ways to Install the Agent <a class="header-anchor" href="#other-ways-to-install-the-agent" aria-label="Permalink to "Other Ways to Install the Agent""></a></h2><h3 id="installing-the-agent-on-linux-ubuntu-debian-centos" tabindex="-1">Installing the Agent on Linux (Ubuntu, Debian, CentOS) <a class="header-anchor" href="#installing-the-agent-on-linux-ubuntu-debian-centos" aria-label="Permalink to "Installing the Agent on Linux (Ubuntu, Debian, CentOS)""></a></h3><details><summary>Click to expand/collapse</summary><ol><li>First, add a server in the admin panel.</li><li>Run the script on the monitored server:</li></ol><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -L</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://raw.githubusercontent.com/naiba/nezha/master/script/install_en.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha.sh</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> && </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">chmod</span><span style="--shiki-
Line truncated
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">#!/sbin/openrc-run</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">SERVER="" # Dashboard domain ip:port</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">SECRET="" # SECRET</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">TLS="" # Enable TLS if yes "--tls", leave empty if no</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">NZ_BASE_PATH="/opt/nezha"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">NZ_AGENT_PATH="\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">NZ_BASE_PATH</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}/agent"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">pidfile="/run/\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">RC_SVCNAME</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}.pid"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">command="/opt/nezha/agent/nezha-agent"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">command_args="-s \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">SERVER</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">} -p \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">SECRET</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">} \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">TLS</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">command_background=true</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">depend() {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> need net</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">checkconfig() {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> GITHUB_URL="github.com"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> if [ ! -f "\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">NZ_AGENT_PATH</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}/nezha-agent" ]; then</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> if [[ $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">uname</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -m</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> grep</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'x86_64') != "" ]]; then</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> os_arch="amd64"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> elif [[ $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">uname</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -m</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> grep</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'i386\\|i686') != "" ]]; then</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> os_arch="386"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> elif [[ $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">uname</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -m</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> grep</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'aarch64\\|armv8b\\|armv8l') != "" ]]; then</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> os_arch="arm64"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> elif [[ $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">uname</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -m</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> grep</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'arm') != "" ]]; then</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> os_arch="arm"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> elif [[ $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">uname</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -m</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> grep</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 's390x') != "" ]]; then</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> os_arch="s390x"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> elif [[ $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">uname</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -m</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> grep</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'riscv64') != "" ]]; then</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> os_arch="riscv64"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fi</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> local version=$(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -m</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -sL</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "https://api.github.com/repos/nezhahq/agent/releases/latest" </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> grep</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "tag_name" </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> head</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -n</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> awk</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -F</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ":" '{print $2}' </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sed</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 's/\\"//g;s/,//g;s/ //g')</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> if [ ! -n "</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$version</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">" ]; then</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> version=$(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -m</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -sL</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "https://fastly.jsdelivr.net/gh/nezhahq/agent/" </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> grep</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "option\\.value" </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> awk</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -F</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "'" '{print $2}' </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sed</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 's/nezhahq\\/agent@/v/g')</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fi</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> if [ ! -n "</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$version</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">" ]; then</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> version=$(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -m</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 10</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -sL</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "https://gcore.jsdelivr.net/gh/nezhahq/agent/" </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> grep</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "option\\.value" </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> awk</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -F</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "'" '{print $2}' </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">|</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sed</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 's/nezhahq\\/agent@/v/g')</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fi</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> if [ ! -n "</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$version</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">" ]; then</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> echo -e "Failed to get the version number. Please check if the server can connect to https://api.github.com/repos/nezhahq/agent/releases/latest"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> return 0</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> else</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> echo -e "The latest version is: \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">version</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fi</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> wget -t 2 -T 10 -O nezha-agent_linux_\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">os_arch</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}.zip https://\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">GITHUB_URL</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}/nezhahq/agent/releases/download/\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">version</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}/nezha-agent_linux_\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">os_arch</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}.zip >/dev/null 2>&1</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> if [[ </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">$?</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> != 0 ]]; then</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> echo -e "Failed to download Release. Please check if the server can connect to \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">GITHUB_URL</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> return 0</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fi</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mkdir -p </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$NZ_AGENT_PATH</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> chmod 755 -R </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$NZ_AGENT_PATH</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> unzip -qo nezha-agent_linux_\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">os_arch</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}.zip && mv nezha-agent </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$NZ_AGENT_PATH</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> && rm -rf nezha-agent_linux_\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">os_arch</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}.zip README.md</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fi</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> if [ ! -x "\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">NZ_AGENT_PATH</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}/nezha-agent" ]; then</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> chmod +x \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">NZ_AGENT_PATH</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}/nezha-agent</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fi</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">start_pre() {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> if [ "\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">RC_CMD</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}" != "restart" ]; then</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> checkconfig || return </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">$?</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fi</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">EOF</span></span></code></pre></div><ol start="2"><li>Add execute permissions</li></ol><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">chmod</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> +x</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /etc/init.d/nezha-agent</span></span></code></pre></div><ol start="3"><li>Start Nezha-Agent</li></ol><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">rc-service</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha-agent</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> start</span></span></code></pre></div><ol start="4"><li>Add to startup</li></ol><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">rc-update</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> add</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha-agent</span></span></code></pre></div></details><h3 id="manual-installation-of-the-agent-on-windows" tabindex="-1">Manual Installation of the Agent on Windows <a class="header-anchor" href="#manual-installation-of-the-agent-on-windows" aria-label="Permalink to "Manual Installation of the Agent on Windows""></a></h3><ul><li>Refer to the community article:<br><a href="https://nyko.me/2020/12/13/nezha-windows-client.html" target="_blank" rel="noreferrer">Nezha - Windows Client Installation</a> (Chinese)</li></ul><h3 id="installing-the-agent-on-synology-dsm" tabindex="-1">Installing the Agent on Synology DSM <a class="header-anchor" href="#installing-the-agent-on-synology-dsm" aria-label="Permalink to "Installing the Agent on Synology DSM""></a></h3><details><summary>Click to expand/collapse</summary><ul><li><p>Refer to community articles:<br><a href="https://blog.mitsea.com/3929551d08bd4bb0a8baa453e2d92b0c/" target="_blank" rel="noreferrer">Installing Nezha Monitoring Agent on Synology DSM 7.x</a> (Chinese)<br><a href="https://wl.gta5pdx.cn/archives/546/" target="_blank" rel="noreferrer">Nezha - Synology Client (Agent) Installation Tutorial</a> (Chinese)</p></li><li><p>Using Systemd <em>for DSM7 only</em>:</p></li></ul><div class="language-sh vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">sh</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Agent path</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">EXEC</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"/PATH/TO/nezha-agent"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Log path</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">LOG</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">EXEC</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}.log"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Additional execution parameters, can be empty</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">ARGS</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Nezha server gRPC address</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">SERVER</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"HOST_OR_IP:gRPC_PORT"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># The secret key obtained in the previous step</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">SECRET</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"APP_SECRET"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># User running the service, *strongly recommended to use non-root user*</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">RUN_USER</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"nezha"</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Write to systemd service file</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">cat</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> <<</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> EOF</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /usr/lib/systemd/system/nezha.service</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">[Unit]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Description=Nezha Agent Service</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">After=network.target</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">[Service]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Type=simple</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ExecStart=/bin/nohup \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">EXEC</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">} \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">ARGS</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">} -s \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">SERVER</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">} -p \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">SECRET</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">} &>> \${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">LOG</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">} &</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ExecStop=ps -fe |grep nezha-agent|awk '{print </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\$</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">2}'|xargs kill</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">User=\${</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">RUN_USER</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">}</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Restart=on-abort</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">[Install]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">WantedBy=multi-user.target</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">EOF</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Reload service</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> daemon-reload</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Start service</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> start</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Enable service startup</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> enable</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha</span></span></code></pre></div><p>‼️ Modify the corresponding information before running the above commands with the <code>root</code> account to complete the installation.</p></details><h3 id="installing-the-agent-on-macos" tabindex="-1">Installing the Agent on macOS <a class="header-anchor" href="#installing-the-agent-on-macos" aria-label="Permalink to "Installing the Agent on macOS""></a></h3><details><summary>Click to expand/collapse</summary><p><em><strong>This section is adapted from <a href="https://blog.mitsea.com/e796f93db38d49e4b18df234c6ee75f5" target="_blank" rel="noreferrer">Mitsea Blog</a> with the author's permission</strong></em></p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>If you are prompted "macOS cannot verify this app" during installation, manually allow the program to run in System Settings.</p></div><ol><li>First, add a server in the admin panel.</li><li>Go to the <a href="https://github.com/nezhahq/agent/releases" target="_blank" rel="noreferrer">Release</a> page to download the Agent binary file. Choose to download the darwin amd64 or arm64 Agent according to your CPU architecture. Download the amd64 version for Intel CPU, or the arm64 version for Apple Silicon. After downloading, unzip the Agent binary file, such as unzipping it to the Downloads folder.</li><li>Create a file named <code>nezha_agent.plist</code> and save it with the following content:</li></ol><div class="language-xml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">xml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><?</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">xml</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> version</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"1.0"</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> encoding</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"UTF-8"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">?></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><!</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">DOCTYPE</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> plist</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">plist</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> version</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"1.0"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"><</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">dict</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">key</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>KeepAlive</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">key</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">key</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>Label</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">key</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>nezha_agent</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">key</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>Program</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">key</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>Modify the path to the Agent binary file here, such as: /Users/123/Downloads/nezha-agent</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">key</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>ProgramArguments</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">key</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>Modify the path to the Agent binary file here, same as above</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>--password</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>The communication secret, such as: 529664783eeb23cc25</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>--server</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>The communication URL and gRPC port, such as: data.example.com:5555</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> </</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">array</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">key</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">>RunAtLoad</</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">key</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> <</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">dict</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"></</span><span style="--shiki-light:#22863A;--shiki-dark:#85E89D;">plist</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">></span></span></code></pre></div><ol start="4"><li>Load the plist file into launchd using the following command in Terminal, <strong>make sure to replace the file path</strong>:</li></ol><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">launchctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> load</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /Users/123/Desktop/nezha_agent.plist</span></span></code></pre></div><ol start="5"><li>Start the process:</li></ol><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">launchctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> start</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha_agent</span></span></code></pre></div><ol start="6"><li>Check if the process is running:</li></ol><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">launchctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> list</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> grep</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha_agent</span></span></code></pre></div><ol start="7"><li>Stop the process and remove it:</li></ol><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">launchctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> stop</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha_agent</span></span></code></pre></div><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">launchctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> remove</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha_agent</span></span></code></pre></div></details><h3 id="installing-the-agent-on-macos-using-homebrew" tabindex="-1">Installing the Agent on macOS Using Homebrew <a class="header-anchor" href="#installing-the-agent-on-macos-using-homebrew" aria-label="Permalink to "Installing the Agent on macOS Using Homebrew""></a></h3><details><summary>Click to expand/collapse</summary><p><em><strong>This section is adapted from <a href="https://blog.mre.red/archives/install_nezha_monitoring_agent_service_with_homebrew" target="_blank" rel="noreferrer">🐿️松鼠收集🌰</a> with the author's permission</strong></em></p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>Please be sure to add environment variables before installing nezha-agent through Homebrew! Homebrew creates the service-required plist file during software installation, and if you add the environment variables after installation, it will fail to start due to missing parameters.</p></div><ol><li>Add environment variables:</li></ol><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'export HOMEBREW_NEZHA_AGENT_PASSWORD="Communication key, obtained from the service page"'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> >></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.zshrc</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 'export HOMEBREW_NEZHA_AGENT_SERVER="Your server and port, format your.domain:5555 "'</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> >></span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.zshrc</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">source</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ~/.zshrc</span></span></code></pre></div><ol start="2"><li>Install Nezha Agent:</li></ol><div class="danger custom-block"><p class="custom-block-title">DANGER</p><p>Note that this Homebrew repository is maintained by a third party and is unrelated to Nezha Monitoring. The Nezha project team does not endorse this repository's usability, security, etc. Please evaluate the risks yourself before using!</p></div><p>Since it has not yet been submitted to the Homebrew Core official library, it is temporarily placed in the <a href="https://github.com/Brewforge/homebrew-chinese" target="_blank" rel="noreferrer">third-party Homebrew repository</a> maintained by the author of the blog:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> brewforge/chinese/nezha-agent</span></span></code></pre></div><ol start="3"><li>Start Nezha Agent service through Homebrew:</li></ol><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> services</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> start</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha-agent</span></span></code></pre></div><ol start="4"><li>Check the service status:</li></ol><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> services</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> info</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha-agent</span></span></code></pre></div><ol start="5"><li>Stop the service:</li></ol><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> services</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> stop</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha-agent</span></span></code></pre></div><ol start="6"><li>Uninstall Nezha Agent:</li></ol><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> rm</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha-agent</span></span></code></pre></div><ol start="7"><li>If there is an error, first check the environment variables:</li></ol><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $HOMEBREW_NEZHA_AGENT_PASSWORD</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">echo</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $HOMEBREW_NEZHA_AGENT_SERVER</span></span></code></pre></div><ol start="8"><li>If the environment variables are configured correctly, try reinstalling:</li></ol><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> services</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> stop</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha-agent</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> reinstall</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha-agent</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">brew</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> services</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> start</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha-agent</span></span></code></pre></div><ol start="9"><li>If the issue persists, submit a issue to the <a href="https://github.com/Brewforge/homebrew-chinese" target="_blank" rel="noreferrer">third-party Homebrew repository</a>.</li></ol></details><h3 id="installing-the-agent-on-openwrt" tabindex="-1">Installing the Agent on OpenWRT <a class="header-anchor" href="#installing-the-agent-on-openwrt" aria-label="Permalink to "Installing the Agent on OpenWRT""></a></h3><details><summary>Click to expand/collapse</summary><p><strong>How to solve installation difficulties and issues in one step?</strong></p><ul><li>Refer to the project:<br><a href="https://github.com/dysf888/NZ-OpenWrt" target="_blank" rel="noreferrer">NZ-OpenWrt</a></li></ul><p><strong>How to enable autostart on older OpenWRT/LEDE?</strong></p><ul><li>Refer to the project:<br><a href="https://github.com/Erope/openwrt_nezha" target="_blank" rel="noreferrer">Nezha Monitoring for OpenWRT</a></li></ul><p><strong>How to enable autostart on newer OpenWRT? Contributor: @艾斯德斯</strong></p><ul><li>First, download the corresponding binary from the release, unzip the zip package, and place it in <code>/root</code>.</li><li>Run <code>chmod +x /root/nezha-agent</code> to grant execution permission, then create <code>/etc/init.d/nezha-service</code>:</li></ul><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">#!/bin/sh /etc/rc.common</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">START</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">99</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">USE_PROCD</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">1</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">start_service</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> procd_open_instance</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> procd_set_param</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> command</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /root/nezha-agent</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -s</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Dashboard</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> communication</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> domain:port</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> Key</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> procd_set_param</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> respawn</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> procd_close_instance</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">stop_service</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> killall</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nezha-agent</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">restart</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> stop</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> sleep</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 2</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> start</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><ul><li>Run <code>chmod +x /etc/init.d/nezha-service</code> to grant execution permission.</li><li>Start the service: <code>/etc/init.d/nezha-service enable && /etc/init.d/nezha-service start</code></li></ul></details><h2 id="does-the-agent-have-a-docker-image" tabindex="-1">Does the Agent Have a Docker Image? <a class="header-anchor" href="#does-the-agent-have-a-docker-image" aria-label="Permalink to "Does the Agent Have a Docker Image?""></a></h2><p><strong>The Agent does not currently have a Docker image.</strong><br> The design philosophy of the Agent is opposite to that of the Dashboard. While the Dashboard should minimally impact the server, the Agent needs to execute monitoring services and run commands within the server.<br> Running the Agent inside a container can still perform monitoring tasks, but features like WebShell will not function properly, so no Docker image is provided.</p>`,29),l=[e];function h(p,k,r,o,d,g){return a(),i("div",null,l)}const E=s(t,[["render",h]]);export{c as __pageData,E as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.BmdFiWrL.js";const c=JSON.parse('{"title":"Install Agent","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/agent.md","filePath":"en_US/guide/agent.md","lastUpdated":1719239024000}'),t={name:"en_US/guide/agent.md"},e=n("",29),l=[e];function h(p,k,r,o,d,g){return a(),i("div",null,l)}const E=s(t,[["render",h]]);export{c as __pageData,E as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o as t,c as a,R as n}from"./chunks/framework.44fd0451.js";const f=JSON.parse('{"title":"Frequently Asked Questions about the Agent","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/agentq.md","filePath":"en_US/guide/agentq.md","lastUpdated":1718495592000}'),i={name:"en_US/guide/agentq.md"},o=n('<h1 id="frequently-asked-questions-about-the-agent" tabindex="-1">Frequently Asked Questions about the Agent <a class="header-anchor" href="#frequently-asked-questions-about-the-agent" aria-label="Permalink to "Frequently Asked Questions about the Agent""></a></h1><h2 id="the-ip-displayed-in-the-admin-panel-is-different-from-the-actual-agent-ip" tabindex="-1">The IP Displayed in the Admin Panel is Different from the Actual Agent IP? <a class="header-anchor" href="#the-ip-displayed-in-the-admin-panel-is-different-from-the-actual-agent-ip" aria-label="Permalink to "The IP Displayed in the Admin Panel is Different from the Actual Agent IP?""></a></h2><p>Please refer to <a href="/en_US/guide/dashboardq.html#why-is-the-ip-displayed-in-the-admin-panel-different-from-the-actual-agent-ip">Dashboard Related - Why is the IP Displayed in the Admin Panel Different from the Actual Agent IP?</a>. This will not be repeated here.</p><h2 id="errors-during-one-click-script-installation" tabindex="-1">Errors During One-Click Script Installation <a class="header-anchor" href="#errors-during-one-click-script-installation" aria-label="Permalink to "Errors During One-Click Script Installation""></a></h2><h3 id="curl-failed-to-connect-to-raw-githubusercontent-com" tabindex="-1">curl: Failed to connect to raw.githubusercontent.com...... <a class="header-anchor" href="#curl-failed-to-connect-to-raw-githubusercontent-com" aria-label="Permalink to "curl: Failed to connect to raw.githubusercontent.com......""></a></h3><p>This mostly occurs on servers in mainland China. Currently, the one-click script fetches the installation script directly from Github. You may try several times, or <a href="/en_US/guide/agent.html#other-ways-to-install-agent">manually install the Agent</a>. Additionally, you can find third-party Github acceleration services or mirrors and set them in the one-click installation script.</p><h3 id="sudo-command-not-found" tabindex="-1">sudo: command not found <a class="header-anchor" href="#sudo-command-not-found" aria-label="Permalink to "sudo: command not found""></a></h3><p>Please manually install sudo first, for example, in Ubuntu:</p><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">apt</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">install</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">sudo</span></span></code></pre></div>',9),s=[o];function l(r,c,d,h,u,p){return t(),a("div",null,s)}const g=e(i,[["render",l]]);export{f as __pageData,g as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o as t,c as a,R as n}from"./chunks/framework.44fd0451.js";const f=JSON.parse('{"title":"Frequently Asked Questions about the Agent","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/agentq.md","filePath":"en_US/guide/agentq.md","lastUpdated":1718495592000}'),i={name:"en_US/guide/agentq.md"},o=n("",9),s=[o];function l(r,c,d,h,u,p){return t(),a("div",null,s)}const g=e(i,[["render",l]]);export{f as __pageData,g as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as a,a4 as n}from"./chunks/framework.BmdFiWrL.js";const f=JSON.parse('{"title":"Frequently Asked Questions about the Agent","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/agentq.md","filePath":"en_US/guide/agentq.md","lastUpdated":1719239024000}'),i={name:"en_US/guide/agentq.md"},s=n('<h1 id="frequently-asked-questions-about-the-agent" tabindex="-1">Frequently Asked Questions about the Agent <a class="header-anchor" href="#frequently-asked-questions-about-the-agent" aria-label="Permalink to "Frequently Asked Questions about the Agent""></a></h1><h2 id="the-ip-displayed-in-the-admin-panel-is-different-from-the-actual-agent-ip" tabindex="-1">The IP Displayed in the Admin Panel is Different from the Actual Agent IP? <a class="header-anchor" href="#the-ip-displayed-in-the-admin-panel-is-different-from-the-actual-agent-ip" aria-label="Permalink to "The IP Displayed in the Admin Panel is Different from the Actual Agent IP?""></a></h2><p>Please refer to <a href="/en_US/guide/dashboardq.html#why-is-the-ip-displayed-in-the-admin-panel-different-from-the-actual-agent-ip">Dashboard Related - Why is the IP Displayed in the Admin Panel Different from the Actual Agent IP?</a>. This will not be repeated here.</p><h2 id="errors-during-one-click-script-installation" tabindex="-1">Errors During One-Click Script Installation <a class="header-anchor" href="#errors-during-one-click-script-installation" aria-label="Permalink to "Errors During One-Click Script Installation""></a></h2><h3 id="curl-failed-to-connect-to-raw-githubusercontent-com" tabindex="-1">curl: Failed to connect to raw.githubusercontent.com...... <a class="header-anchor" href="#curl-failed-to-connect-to-raw-githubusercontent-com" aria-label="Permalink to "curl: Failed to connect to raw.githubusercontent.com......""></a></h3><p>This mostly occurs on servers in mainland China. Currently, the one-click script fetches the installation script directly from Github. You may try several times, or <a href="/en_US/guide/agent.html#other-ways-to-install-agent">manually install the Agent</a>. Additionally, you can find third-party Github acceleration services or mirrors and set them in the one-click installation script.</p><h3 id="sudo-command-not-found" tabindex="-1">sudo: command not found <a class="header-anchor" href="#sudo-command-not-found" aria-label="Permalink to "sudo: command not found""></a></h3><p>Please manually install sudo first, for example, in Ubuntu:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">apt</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> sudo</span></span></code></pre></div>',9),o=[s];function r(l,d,h,c,u,p){return a(),t("div",null,o)}const g=e(i,[["render",r]]);export{f as __pageData,g as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as e,c as t,o as a,a4 as n}from"./chunks/framework.BmdFiWrL.js";const f=JSON.parse('{"title":"Frequently Asked Questions about the Agent","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/agentq.md","filePath":"en_US/guide/agentq.md","lastUpdated":1719239024000}'),i={name:"en_US/guide/agentq.md"},s=n("",9),o=[s];function r(l,d,h,c,u,p){return a(),t("div",null,o)}const g=e(i,[["render",r]]);export{f as __pageData,g as default};
|
||||
@@ -1,138 +0,0 @@
|
||||
import{_ as s,o as a,c as n,R as o}from"./chunks/framework.44fd0451.js";const i=JSON.parse('{"title":"API Interface","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/api.md","filePath":"en_US/guide/api.md","lastUpdated":1718495592000}'),l={name:"en_US/guide/api.md"},p=o(`<h1 id="api-interface" tabindex="-1">API Interface <a class="header-anchor" href="#api-interface" aria-label="Permalink to "API Interface""></a></h1><p><strong>Nezha Monitoring supports querying the status information of Agents using the API interface</strong></p><h2 id="creating-a-token" tabindex="-1">Creating a Token <a class="header-anchor" href="#creating-a-token" aria-label="Permalink to "Creating a Token""></a></h2><p>Nezha Monitoring's API interface allows for Token authentication and Cookies authentication. To create a new Token, go to the admin panel, click on the avatar in the top right corner, select "API Token," and enter the Token management page. Click "Add Token", add a custom note, and click "Add".</p><p>To delete a Token, select the corresponding Token and click the delete icon on the right.</p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>Tokens are the authentication credentials for the API interface. They are critical to the security of your Dashboard's information, so do not share your Token with others.</p></div><h2 id="authentication-method" tabindex="-1">Authentication Method <a class="header-anchor" href="#authentication-method" aria-label="Permalink to "Authentication Method""></a></h2><p>Ensure the request header contains <code>Authorization: Token</code> for authentication.</p><p>Token authentication method:</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">Request Headers:</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">Authorization: Token</span></span></code></pre></div><h2 id="usage-instructions" tabindex="-1">Usage Instructions <a class="header-anchor" href="#usage-instructions" aria-label="Permalink to "Usage Instructions""></a></h2><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>Negative timestamps in the following examples represent <code>0000-00-00</code>. This currently indicates that the Agent has never reported since the Dashboard went online, but it is not recommended to use the positive or negative value to determine the status.</p></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><p><strong>The request method is <code>GET</code>, and the response format is <code>JSON</code>.</strong></p></div><h3 id="get-server-list" tabindex="-1">Get Server List <a class="header-anchor" href="#get-server-list" aria-label="Permalink to "Get Server List""></a></h3><p>Request:</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">GET /api/v1/server/list?tag=</span></span></code></pre></div><p>Parameters:</p><ul><li><code>tag</code> (optional): ServerTag is the server group. Provide this parameter to query only servers in that group.</li></ul><p>Example response:</p><div class="language-json"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C792EA;">code</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C792EA;">message</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">success</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C792EA;">result</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">[</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">id</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">1</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">name</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">Server1</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">tag</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">Tag1</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">last_active</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">1653014667</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">ipv4</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">1.1.1.1</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">ipv6</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">valid_ip</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">1.1.1.1</span><span style="color:#89DDFF;">"</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">},</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">id</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">2</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">name</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">Server2</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">tag</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">Tag2</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">last_active</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">-62135596800</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">ipv4</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">ipv6</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">valid_ip</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">}</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">]</span></span>
|
||||
<span class="line"><span style="color:#89DDFF;">}</span></span></code></pre></div><h3 id="get-server-details" tabindex="-1">Get Server Details <a class="header-anchor" href="#get-server-details" aria-label="Permalink to "Get Server Details""></a></h3><p>Request:</p><div class="language-"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">GET /api/v1/server/details?id=&tag=</span></span></code></pre></div><p>Parameters:</p><ul><li><code>id</code> (optional): ServerID, multiple IDs separated by commas. Provide this parameter to query the server corresponding to that ID and ignore the <code>tag</code> parameter.</li><li><code>tag</code> (optional): ServerTag, provide this parameter to query only servers in that group.</li></ul><p>Example response:</p><div class="language-json"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C792EA;">code</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C792EA;">message</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">success</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C792EA;">result</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">[</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">id</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">1</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">name</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">Server1</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">tag</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">Tag1</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">last_active</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">1653015042</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">ipv4</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">1.1.1.1</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">ipv6</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">valid_ip</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">1.1.1.1</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">host</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Platform</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">darwin</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">PlatformVersion</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">12.3.1</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">CPU</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">[</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">Apple M1 Pro 1 Physical Core</span><span style="color:#89DDFF;">"</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">],</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">MemTotal</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">17179869184</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">DiskTotal</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">2473496842240</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">SwapTotal</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Arch</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">arm64</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Virtualization</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">BootTime</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">1652683962</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">CountryCode</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">hk</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Version</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">},</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">status</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">CPU</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">17.33</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">MemUsed</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">14013841408</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">SwapUsed</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">DiskUsed</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">2335048912896</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">NetInTransfer</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">2710273234</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">NetOutTransfer</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">695454765</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">NetInSpeed</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">10806</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">NetOutSpeed</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">5303</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Uptime</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">331080</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Load1</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">5.23</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Load5</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">4.87</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Load15</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">3.99</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">TcpConnCount</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">195</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">UdpConnCount</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">70</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">ProcessCount</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">437</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">}</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">},</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">id</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">2</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">name</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">Server2</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">tag</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">Tag2</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">last_active</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">-62135596800</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">ipv4</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">ipv6</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">valid_ip</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">host</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Platform</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">PlatformVersion</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">CPU</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">null,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">MemTotal</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">DiskTotal</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">SwapTotal</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Arch</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Virtualization</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">BootTime</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">CountryCode</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Version</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">""</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">},</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#FFCB6B;">status</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">CPU</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">MemUsed</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">SwapUsed</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">DiskUsed</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">NetInTransfer</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">NetOutTransfer</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">NetInSpeed</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">NetOutSpeed</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Uptime</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Load1</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Load5</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">Load15</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">TcpConnCount</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">UdpConnCount</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">,</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#F78C6C;">ProcessCount</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">0</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">}</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">}</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">]</span></span>
|
||||
<span class="line"><span style="color:#89DDFF;">}</span></span></code></pre></div><h2 id="usage-examples" tabindex="-1">Usage Examples <a class="header-anchor" href="#usage-examples" aria-label="Permalink to "Usage Examples""></a></h2><h3 id="get-all-server-information" tabindex="-1">Get All Server Information <a class="header-anchor" href="#get-all-server-information" aria-label="Permalink to "Get All Server Information""></a></h3><div class="language-python"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;font-style:italic;">import</span><span style="color:#A6ACCD;"> requests</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">url </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">http://your-dashboard/api/v1/server/list</span><span style="color:#89DDFF;">"</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">headers </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">Authorization</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">your_token</span><span style="color:#89DDFF;">"</span></span>
|
||||
<span class="line"><span style="color:#89DDFF;">}</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">response </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> requests</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">get</span><span style="color:#89DDFF;">(</span><span style="color:#82AAFF;">url</span><span style="color:#89DDFF;">,</span><span style="color:#82AAFF;"> </span><span style="color:#A6ACCD;font-style:italic;">headers</span><span style="color:#89DDFF;">=</span><span style="color:#82AAFF;">headers</span><span style="color:#89DDFF;">)</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">data </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> response</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">json</span><span style="color:#89DDFF;">()</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#89DDFF;font-style:italic;">for</span><span style="color:#A6ACCD;"> server </span><span style="color:#89DDFF;font-style:italic;">in</span><span style="color:#A6ACCD;"> data</span><span style="color:#89DDFF;">[</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">result</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">]:</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#82AAFF;">print</span><span style="color:#89DDFF;">(</span><span style="color:#C792EA;">f</span><span style="color:#C3E88D;">"Server Name: </span><span style="color:#F78C6C;">{</span><span style="color:#82AAFF;">server</span><span style="color:#89DDFF;">[</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">name</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">]</span><span style="color:#F78C6C;">}</span><span style="color:#C3E88D;">, Last Active: </span><span style="color:#F78C6C;">{</span><span style="color:#82AAFF;">server</span><span style="color:#89DDFF;">[</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">last_active</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">]</span><span style="color:#F78C6C;">}</span><span style="color:#C3E88D;">, IP: </span><span style="color:#F78C6C;">{</span><span style="color:#82AAFF;">server</span><span style="color:#89DDFF;">[</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">valid_ip</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">]</span><span style="color:#F78C6C;">}</span><span style="color:#C3E88D;">"</span><span style="color:#89DDFF;">)</span></span></code></pre></div><h3 id="get-specific-server-details" tabindex="-1">Get Specific Server Details <a class="header-anchor" href="#get-specific-server-details" aria-label="Permalink to "Get Specific Server Details""></a></h3><div class="language-python"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;font-style:italic;">import</span><span style="color:#A6ACCD;"> requests</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">server_id </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#F78C6C;">1</span><span style="color:#A6ACCD;"> </span><span style="color:#676E95;font-style:italic;"># Replace with your server ID</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">url </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#C792EA;">f</span><span style="color:#C3E88D;">"http://your-dashboard/api/v1/server/details?id=</span><span style="color:#F78C6C;">{</span><span style="color:#A6ACCD;">server_id</span><span style="color:#F78C6C;">}</span><span style="color:#C3E88D;">"</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">headers </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">Authorization</span><span style="color:#89DDFF;">"</span><span style="color:#89DDFF;">:</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">"</span><span style="color:#C3E88D;">your_token</span><span style="color:#89DDFF;">"</span></span>
|
||||
<span class="line"><span style="color:#89DDFF;">}</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">response </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> requests</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">get</span><span style="color:#89DDFF;">(</span><span style="color:#82AAFF;">url</span><span style="color:#89DDFF;">,</span><span style="color:#82AAFF;"> </span><span style="color:#A6ACCD;font-style:italic;">headers</span><span style="color:#89DDFF;">=</span><span style="color:#82AAFF;">headers</span><span style="color:#89DDFF;">)</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">data </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> response</span><span style="color:#89DDFF;">.</span><span style="color:#82AAFF;">json</span><span style="color:#89DDFF;">()</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">server </span><span style="color:#89DDFF;">=</span><span style="color:#A6ACCD;"> data</span><span style="color:#89DDFF;">[</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">result</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">][</span><span style="color:#F78C6C;">0</span><span style="color:#89DDFF;">]</span></span>
|
||||
<span class="line"><span style="color:#82AAFF;">print</span><span style="color:#89DDFF;">(</span><span style="color:#C792EA;">f</span><span style="color:#C3E88D;">"Server Name: </span><span style="color:#F78C6C;">{</span><span style="color:#82AAFF;">server</span><span style="color:#89DDFF;">[</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">name</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">]</span><span style="color:#F78C6C;">}</span><span style="color:#C3E88D;">"</span><span style="color:#89DDFF;">)</span></span>
|
||||
<span class="line"><span style="color:#82AAFF;">print</span><span style="color:#89DDFF;">(</span><span style="color:#C792EA;">f</span><span style="color:#C3E88D;">"CPU Usage: </span><span style="color:#F78C6C;">{</span><span style="color:#82AAFF;">server</span><span style="color:#89DDFF;">[</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">status</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">][</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">CPU</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">]</span><span style="color:#F78C6C;">}</span><span style="color:#C3E88D;">%"</span><span style="color:#89DDFF;">)</span></span>
|
||||
<span class="line"><span style="color:#82AAFF;">print</span><span style="color:#89DDFF;">(</span><span style="color:#C792EA;">f</span><span style="color:#C3E88D;">"Memory Used: </span><span style="color:#F78C6C;">{</span><span style="color:#82AAFF;">server</span><span style="color:#89DDFF;">[</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">status</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">][</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">MemUsed</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">]</span><span style="color:#F78C6C;">}</span><span style="color:#C3E88D;"> bytes"</span><span style="color:#89DDFF;">)</span></span>
|
||||
<span class="line"><span style="color:#82AAFF;">print</span><span style="color:#89DDFF;">(</span><span style="color:#C792EA;">f</span><span style="color:#C3E88D;">"Disk Used: </span><span style="color:#F78C6C;">{</span><span style="color:#82AAFF;">server</span><span style="color:#89DDFF;">[</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">status</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">][</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">DiskUsed</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">]</span><span style="color:#F78C6C;">}</span><span style="color:#C3E88D;"> bytes"</span><span style="color:#89DDFF;">)</span></span>
|
||||
<span class="line"><span style="color:#82AAFF;">print</span><span style="color:#89DDFF;">(</span><span style="color:#C792EA;">f</span><span style="color:#C3E88D;">"Network In Speed: </span><span style="color:#F78C6C;">{</span><span style="color:#82AAFF;">server</span><span style="color:#89DDFF;">[</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">status</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">][</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">NetInSpeed</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">]</span><span style="color:#F78C6C;">}</span><span style="color:#C3E88D;"> bytes/s"</span><span style="color:#89DDFF;">)</span></span>
|
||||
<span class="line"><span style="color:#82AAFF;">print</span><span style="color:#89DDFF;">(</span><span style="color:#C792EA;">f</span><span style="color:#C3E88D;">"Network Out Speed: </span><span style="color:#F78C6C;">{</span><span style="color:#82AAFF;">server</span><span style="color:#89DDFF;">[</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">status</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">][</span><span style="color:#89DDFF;">'</span><span style="color:#C3E88D;">NetOutSpeed</span><span style="color:#89DDFF;">'</span><span style="color:#89DDFF;">]</span><span style="color:#F78C6C;">}</span><span style="color:#C3E88D;"> bytes/s"</span><span style="color:#89DDFF;">)</span></span></code></pre></div><p>With the above example code, you can easily obtain and process server status information, enabling automated monitoring and management.</p>`,33),e=[p];function t(D,r,c,F,y,C){return a(),n("div",null,e)}const u=s(l,[["render",t]]);export{i as __pageData,u as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as s,o as a,c as n,R as o}from"./chunks/framework.44fd0451.js";const i=JSON.parse('{"title":"API Interface","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/api.md","filePath":"en_US/guide/api.md","lastUpdated":1718495592000}'),l={name:"en_US/guide/api.md"},p=o("",33),e=[p];function t(D,r,c,F,y,C){return a(),n("div",null,e)}const u=s(l,[["render",t]]);export{i as __pageData,u as default};
|
||||
@@ -0,0 +1,138 @@
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.BmdFiWrL.js";const F=JSON.parse('{"title":"API Interface","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/api.md","filePath":"en_US/guide/api.md","lastUpdated":1719239024000}'),t={name:"en_US/guide/api.md"},h=n(`<h1 id="api-interface" tabindex="-1">API Interface <a class="header-anchor" href="#api-interface" aria-label="Permalink to "API Interface""></a></h1><p><strong>Nezha Monitoring supports querying the status information of Agents using the API interface</strong></p><h2 id="creating-a-token" tabindex="-1">Creating a Token <a class="header-anchor" href="#creating-a-token" aria-label="Permalink to "Creating a Token""></a></h2><p>Nezha Monitoring's API interface allows for Token authentication and Cookies authentication. To create a new Token, go to the admin panel, click on the avatar in the top right corner, select "API Token," and enter the Token management page. Click "Add Token", add a custom note, and click "Add".</p><p>To delete a Token, select the corresponding Token and click the delete icon on the right.</p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>Tokens are the authentication credentials for the API interface. They are critical to the security of your Dashboard's information, so do not share your Token with others.</p></div><h2 id="authentication-method" tabindex="-1">Authentication Method <a class="header-anchor" href="#authentication-method" aria-label="Permalink to "Authentication Method""></a></h2><p>Ensure the request header contains <code>Authorization: Token</code> for authentication.</p><p>Token authentication method:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>Request Headers:</span></span>
|
||||
<span class="line"><span>Authorization: Token</span></span></code></pre></div><h2 id="usage-instructions" tabindex="-1">Usage Instructions <a class="header-anchor" href="#usage-instructions" aria-label="Permalink to "Usage Instructions""></a></h2><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>Negative timestamps in the following examples represent <code>0000-00-00</code>. This currently indicates that the Agent has never reported since the Dashboard went online, but it is not recommended to use the positive or negative value to determine the status.</p></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><p><strong>The request method is <code>GET</code>, and the response format is <code>JSON</code>.</strong></p></div><h3 id="get-server-list" tabindex="-1">Get Server List <a class="header-anchor" href="#get-server-list" aria-label="Permalink to "Get Server List""></a></h3><p>Request:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>GET /api/v1/server/list?tag=</span></span></code></pre></div><p>Parameters:</p><ul><li><code>tag</code> (optional): ServerTag is the server group. Provide this parameter to query only servers in that group.</li></ul><p>Example response:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "code"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "message"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"success"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "result"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "id"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "name"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Server1"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "tag"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Tag1"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "last_active"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1653014667</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "ipv4"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"1.1.1.1"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "ipv6"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "valid_ip"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"1.1.1.1"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "id"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "name"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Server2"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "tag"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Tag2"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "last_active"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">-62135596800</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "ipv4"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "ipv6"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "valid_ip"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h3 id="get-server-details" tabindex="-1">Get Server Details <a class="header-anchor" href="#get-server-details" aria-label="Permalink to "Get Server Details""></a></h3><p>Request:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>GET /api/v1/server/details?id=&tag=</span></span></code></pre></div><p>Parameters:</p><ul><li><code>id</code> (optional): ServerID, multiple IDs separated by commas. Provide this parameter to query the server corresponding to that ID and ignore the <code>tag</code> parameter.</li><li><code>tag</code> (optional): ServerTag, provide this parameter to query only servers in that group.</li></ul><p>Example response:</p><div class="language-json vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">json</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "code"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "message"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"success"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "result"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "id"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "name"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Server1"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "tag"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Tag1"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "last_active"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1653015042</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "ipv4"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"1.1.1.1"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "ipv6"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "valid_ip"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"1.1.1.1"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "host"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Platform"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"darwin"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "PlatformVersion"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"12.3.1"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "CPU"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "Apple M1 Pro 1 Physical Core"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ],</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "MemTotal"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">17179869184</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "DiskTotal"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2473496842240</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "SwapTotal"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Arch"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"arm64"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Virtualization"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "BootTime"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1652683962</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "CountryCode"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"hk"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Version"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "status"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "CPU"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">17.33</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "MemUsed"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">14013841408</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "SwapUsed"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "DiskUsed"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2335048912896</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "NetInTransfer"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2710273234</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "NetOutTransfer"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">695454765</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "NetInSpeed"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">10806</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "NetOutSpeed"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">5303</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Uptime"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">331080</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Load1"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">5.23</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Load5"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">4.87</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Load15"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">3.99</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "TcpConnCount"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">195</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "UdpConnCount"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">70</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "ProcessCount"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">437</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "id"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "name"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Server2"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "tag"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Tag2"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "last_active"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">-62135596800</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "ipv4"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "ipv6"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "valid_ip"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "host"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Platform"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "PlatformVersion"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "CPU"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">null</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "MemTotal"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "DiskTotal"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "SwapTotal"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Arch"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Virtualization"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "BootTime"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "CountryCode"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Version"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">""</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> },</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "status"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "CPU"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "MemUsed"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "SwapUsed"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "DiskUsed"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "NetInTransfer"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "NetOutTransfer"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "NetInSpeed"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "NetOutSpeed"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Uptime"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Load1"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Load5"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "Load15"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "TcpConnCount"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "UdpConnCount"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">,</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> "ProcessCount"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div><h2 id="usage-examples" tabindex="-1">Usage Examples <a class="header-anchor" href="#usage-examples" aria-label="Permalink to "Usage Examples""></a></h2><h3 id="get-all-server-information" tabindex="-1">Get All Server Information <a class="header-anchor" href="#get-all-server-information" aria-label="Permalink to "Get All Server Information""></a></h3><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> requests</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">url </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "http://your-dashboard/api/v1/server/list"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">headers </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "Authorization"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"your_token"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">response </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> requests.get(url, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">headers</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">headers)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">data </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> response.json()</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> server </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> data[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'result'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> print</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Server Name: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">server[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'name'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">, Last Active: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">server[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'last_active'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">, IP: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">server[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'valid_ip'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><h3 id="get-specific-server-details" tabindex="-1">Get Specific Server Details <a class="header-anchor" href="#get-specific-server-details" aria-label="Permalink to "Get Specific Server Details""></a></h3><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> requests</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">server_id </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1</span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"> # Replace with your server ID</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">url </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"http://your-dashboard/api/v1/server/details?id=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">server_id</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">headers </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> "Authorization"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"your_token"</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">response </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> requests.get(url, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">headers</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">headers)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">data </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> response.json()</span></span>
|
||||
<span class="line"></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">server </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> data[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'result'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">][</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">0</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">print</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Server Name: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">server[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'name'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">print</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"CPU Usage: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">server[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'status'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">][</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'CPU'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">%"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">print</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Memory Used: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">server[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'status'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">][</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'MemUsed'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bytes"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">print</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Disk Used: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">server[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'status'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">][</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'DiskUsed'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bytes"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">print</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Network In Speed: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">server[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'status'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">][</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'NetInSpeed'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bytes/s"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">print</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Network Out Speed: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">server[</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'status'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">][</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'NetOutSpeed'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> bytes/s"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><p>With the above example code, you can easily obtain and process server status information, enabling automated monitoring and management.</p>`,33),k=[h];function p(l,e,E,r,d,o){return a(),i("div",null,k)}const y=s(t,[["render",p]]);export{F as __pageData,y as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as s,c as i,o as a,a4 as n}from"./chunks/framework.BmdFiWrL.js";const F=JSON.parse('{"title":"API Interface","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/api.md","filePath":"en_US/guide/api.md","lastUpdated":1719239024000}'),t={name:"en_US/guide/api.md"},h=n("",33),k=[h];function p(l,e,E,r,d,o){return a(),i("div",null,k)}const y=s(t,[["render",p]]);export{F as __pageData,y as default};
|
||||
@@ -1,21 +0,0 @@
|
||||
import{_ as a,o as e,c as s,R as o}from"./chunks/framework.44fd0451.js";const y=JSON.parse('{"title":"Install Dashboard","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/dashboard.md","filePath":"en_US/guide/dashboard.md","lastUpdated":1718495592000}'),t={name:"en_US/guide/dashboard.md"},n=o(`<h1 id="install-dashboard" tabindex="-1">Install Dashboard <a class="header-anchor" href="#install-dashboard" aria-label="Permalink to "Install Dashboard""></a></h1><h2 id="preparation" tabindex="-1">Preparation <a class="header-anchor" href="#preparation" aria-label="Permalink to "Preparation""></a></h2><p>To set up Nezha Monitoring, you need:</p><ol><li>A server with public internet access, with firewall and security policies allowing traffic on ports 8008 and 5555. These ports are necessary for accessing and receiving data. A server with a single core and 512MB of RAM is sufficient for most use cases.</li><li>A domain with an A record set to point to your Dashboard server IP.</li></ol><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>If you want to use a CDN, prepare two domains: one configured with CDN for public access (CDN must support WebSocket protocol), and another domain not using CDN for communication between the Agent and Dashboard.</p><p>This document uses "dashboard.example.com" and "data.example.com" as example domains.</p></div><ol start="3"><li>A Github account (or Gitlab, Gitee).</li></ol><p><strong>This document uses the aaPanel for reverse proxying the Dashboard as an example. As future versions change, some features may change their entry points. This document is for reference only.</strong></p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>This project does not depend on the aaPanel; you can choose any server panel you prefer or manually install Nginx or Caddy to configure SSL and reverse proxy.<br> If you do not need to use ports 80 and 443 to access the Dashboard, you can directly use the installation script to install and run Nezha Monitoring without installing Nginx.</p></div><h2 id="obtaining-github-client-id-and-secret" tabindex="-1">Obtaining Github Client ID and Secret <a class="header-anchor" href="#obtaining-github-client-id-and-secret" aria-label="Permalink to "Obtaining Github Client ID and Secret""></a></h2><p>Nezha Monitoring uses Github, Gitlab, or Gitee as admin accounts.</p><ol><li>First, create an OAuth application. For Github, log in to Github, open <a href="https://github.com/settings/developers" target="_blank" rel="noreferrer">Github OAuth Apps</a>, and select "OAuth Apps" -> "New OAuth App".<br><code>Application name</code> - Fill in as you like.<br><code>Homepage URL</code> - Fill in with the domain for accessing the dashboard, such as "<a href="http://dashboard.example.com" target="_blank" rel="noreferrer">http://dashboard.example.com</a>" (your domain).<br><code>Authorization callback URL</code> - Fill in with the callback address, such as "<a href="http://dashboard.example.com/oauth2/callback" target="_blank" rel="noreferrer">http://dashboard.example.com/oauth2/callback</a>" (don't forget <code>/oauth2/callback</code>).</li><li>Click “Register application”.</li><li>Save the Client ID on the page, then click “Generate a new client secret” to create a new Client Secret, which will be displayed only once, <strong>please keep it safe</strong>.</li></ol><h2 id="using-cloudflare-access-as-oauth2-provider" tabindex="-1">Using Cloudflare Access as OAuth2 Provider <a class="header-anchor" href="#using-cloudflare-access-as-oauth2-provider" aria-label="Permalink to "Using Cloudflare Access as OAuth2 Provider""></a></h2><p>If you encounter issues using Github, Gitlab, or Gitee as admin login, consider switching to <a href="/en_US/guide/q8.html">using Cloudflare Access as the OAuth2 provider</a>.</p><h3 id="creating-a-saas-oidc-application" tabindex="-1">Creating a SaaS-OIDC Application <a class="header-anchor" href="#creating-a-saas-oidc-application" aria-label="Permalink to "Creating a SaaS-OIDC Application""></a></h3><ol><li>Go to <a href="https://one.dash.cloudflare.com" target="_blank" rel="noreferrer">Zero Trust Dashboard</a> and log in with your Cloudflare account.</li><li><code>My Team</code> -> <code>Users</code> -> <code><specific user></code> -> Get <code>User ID</code> and save it.</li><li><code>Access</code> -> <code>Application</code> -> <code>Add an Application</code>.</li><li>Choose <code>SaaS</code>, enter a custom application name in <code>Application</code> (e.g., nezha), select <code>OIDC</code>, and click <code>Add application</code>.</li><li>Select <code>Scopes</code>: <code>openid</code>, <code>email</code>, <code>profile</code>, <code>groups</code>.</li><li>Fill in your callback address in <code>Redirect URLs<
Line truncated
|
||||
<span class="line"><span style="color:#C792EA;">location</span><span style="color:#A6ACCD;"> </span><span style="color:#FFCB6B;">/ </span><span style="color:#A6ACCD;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"> proxy_pass </span><span style="color:#A6ACCD;">http://127.0.0.1:8008</span><span style="color:#89DDFF;">;</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"> proxy_set_header </span><span style="color:#A6ACCD;">Host </span><span style="color:#89DDFF;">$</span><span style="color:#A6ACCD;">http_host</span><span style="color:#89DDFF;">;</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"> proxy_set_header </span><span style="color:#A6ACCD;">Upgrade </span><span style="color:#89DDFF;">$</span><span style="color:#A6ACCD;">http_upgrade</span><span style="color:#89DDFF;">;</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">}</span></span>
|
||||
<span class="line"><span style="color:#C792EA;">location</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">~</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">^/(ws|terminal/.+)$ </span><span style="color:#A6ACCD;">{</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"> proxy_pass </span><span style="color:#A6ACCD;">http://127.0.0.1:8008</span><span style="color:#89DDFF;">;</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"> proxy_http_version </span><span style="color:#A6ACCD;">1.1</span><span style="color:#89DDFF;">;</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"> proxy_set_header </span><span style="color:#A6ACCD;">Upgrade </span><span style="color:#89DDFF;">$</span><span style="color:#A6ACCD;">http_upgrade</span><span style="color:#89DDFF;">;</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"> proxy_set_header </span><span style="color:#A6ACCD;">Connection </span><span style="color:#C3E88D;">"Upgrade"</span><span style="color:#89DDFF;">;</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;"> proxy_set_header </span><span style="color:#A6ACCD;">Host </span><span style="color:#89DDFF;">$</span><span style="color:#A6ACCD;">http_host</span><span style="color:#89DDFF;">;</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">}</span></span>
|
||||
<span class="line"><span style="color:#676E95;font-style:italic;">#PROXY-END/</span></span></code></pre></div><p>Click “Save”.<br> Now you should be able to access the dashboard directly using the domain, such as “<a href="http://dashboard.example.com" target="_blank" rel="noreferrer">http://dashboard.example.com</a>”.</p><h3 id="additional-content" tabindex="-1">Additional Content: <a class="header-anchor" href="#additional-content" aria-label="Permalink to "Additional Content:""></a></h3><p>CaddyServer v1 (v2 does not require special configuration):</p><div class="language-caddy"><button title="Copy Code" class="copy"></button><span class="lang">caddy</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#A6ACCD;">proxy /ws http://ip:8008 {</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> websocket</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> header_upstream -Origin</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">}</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">proxy /terminal/* http://ip:8008 {</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> websocket</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> header_upstream -Origin</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;">}</span></span></code></pre></div><h2 id="configuring-ssl-in-the-aapanel" tabindex="-1">Configuring SSL in the aaPanel <a class="header-anchor" href="#configuring-ssl-in-the-aapanel" aria-label="Permalink to "Configuring SSL in the aaPanel""></a></h2><p>First, temporarily disable the reverse proxy.<br> Like configuring SSL certificates for other websites, enter the “SSL” in the site settings, and you can choose to automatically apply for a Let’s Encrypt certificate or manually configure an existing certificate.<br> After completing the SSL settings, go back to <a href="https://github.com/settings/developers" target="_blank" rel="noreferrer">Github OAuth Apps</a> and edit the previously created OAuth application. Change all the domain parts in "Homepage URL" and "Authorization callback URL" from <code>http</code> to <code>https</code>, such as "<a href="https://dashboard.example.com" target="_blank" rel="noreferrer">https://dashboard.example.com</a>" and "<a href="https://dashboard.example.com/oauth2/callback" target="_blank" rel="noreferrer">https://dashboard.example.com/oauth2/callback</a>". <strong>Failing to change this may result in being unable to log in to the admin panel.</strong></p><h2 id="updating-the-dashboard" tabindex="-1">Updating the Dashboard <a class="header-anchor" href="#updating-the-dashboard" aria-label="Permalink to "Updating the Dashboard""></a></h2><p>Run the script <code>./nezha.sh</code>, and select to restart and update the dashboard.</p>`,38),l=[n];function r(i,c,p,d,h,u){return e(),s("div",null,l)}const C=a(t,[["render",r]]);export{y as __pageData,C as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as a,o as e,c as s,R as o}from"./chunks/framework.44fd0451.js";const y=JSON.parse('{"title":"Install Dashboard","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/dashboard.md","filePath":"en_US/guide/dashboard.md","lastUpdated":1718495592000}'),t={name:"en_US/guide/dashboard.md"},n=o("",38),l=[n];function r(i,c,p,d,h,u){return e(),s("div",null,l)}const C=a(t,[["render",r]]);export{y as __pageData,C as default};
|
||||
@@ -0,0 +1,21 @@
|
||||
import{_ as a,c as e,o as s,a4 as t}from"./chunks/framework.BmdFiWrL.js";const k=JSON.parse('{"title":"Install Dashboard","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/dashboard.md","filePath":"en_US/guide/dashboard.md","lastUpdated":1719239024000}'),i={name:"en_US/guide/dashboard.md"},n=t(`<h1 id="install-dashboard" tabindex="-1">Install Dashboard <a class="header-anchor" href="#install-dashboard" aria-label="Permalink to "Install Dashboard""></a></h1><h2 id="preparation" tabindex="-1">Preparation <a class="header-anchor" href="#preparation" aria-label="Permalink to "Preparation""></a></h2><p>To set up Nezha Monitoring, you need:</p><ol><li>A server with public internet access, with firewall and security policies allowing traffic on ports 8008 and 5555. These ports are necessary for accessing and receiving data. A server with a single core and 512MB of RAM is sufficient for most use cases.</li><li>A domain with an A record set to point to your Dashboard server IP.</li></ol><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>If you want to use a CDN, prepare two domains: one configured with CDN for public access (CDN must support WebSocket protocol), and another domain not using CDN for communication between the Agent and Dashboard.</p><p>This document uses "dashboard.example.com" and "data.example.com" as example domains.</p></div><ol start="3"><li>A Github account (or Gitlab, Gitee).</li></ol><p><strong>This document uses the aaPanel for reverse proxying the Dashboard as an example. As future versions change, some features may change their entry points. This document is for reference only.</strong></p><div class="warning custom-block"><p class="custom-block-title">WARNING</p><p>This project does not depend on the aaPanel; you can choose any server panel you prefer or manually install Nginx or Caddy to configure SSL and reverse proxy.<br> If you do not need to use ports 80 and 443 to access the Dashboard, you can directly use the installation script to install and run Nezha Monitoring without installing Nginx.</p></div><h2 id="obtaining-github-client-id-and-secret" tabindex="-1">Obtaining Github Client ID and Secret <a class="header-anchor" href="#obtaining-github-client-id-and-secret" aria-label="Permalink to "Obtaining Github Client ID and Secret""></a></h2><p>Nezha Monitoring uses Github, Gitlab, or Gitee as admin accounts.</p><ol><li>First, create an OAuth application. For Github, log in to Github, open <a href="https://github.com/settings/developers" target="_blank" rel="noreferrer">Github OAuth Apps</a>, and select "OAuth Apps" -> "New OAuth App".<br><code>Application name</code> - Fill in as you like.<br><code>Homepage URL</code> - Fill in with the domain for accessing the dashboard, such as "<a href="http://dashboard.example.com" target="_blank" rel="noreferrer">http://dashboard.example.com</a>" (your domain).<br><code>Authorization callback URL</code> - Fill in with the callback address, such as "<a href="http://dashboard.example.com/oauth2/callback" target="_blank" rel="noreferrer">http://dashboard.example.com/oauth2/callback</a>" (don't forget <code>/oauth2/callback</code>).</li><li>Click “Register application”.</li><li>Save the Client ID on the page, then click “Generate a new client secret” to create a new Client Secret, which will be displayed only once, <strong>please keep it safe</strong>.</li></ol><h2 id="using-cloudflare-access-as-oauth2-provider" tabindex="-1">Using Cloudflare Access as OAuth2 Provider <a class="header-anchor" href="#using-cloudflare-access-as-oauth2-provider" aria-label="Permalink to "Using Cloudflare Access as OAuth2 Provider""></a></h2><p>If you encounter issues using Github, Gitlab, or Gitee as admin login, consider switching to <a href="/en_US/guide/q8.html">using Cloudflare Access as the OAuth2 provider</a>.</p><h3 id="creating-a-saas-oidc-application" tabindex="-1">Creating a SaaS-OIDC Application <a class="header-anchor" href="#creating-a-saas-oidc-application" aria-label="Permalink to "Creating a SaaS-OIDC Application""></a></h3><ol><li>Go to <a href="https://one.dash.cloudflare.com" target="_blank" rel="noreferrer">Zero Trust Dashboard</a> and log in with your Cloudflare account.</li><li><code>My Team</code> -> <code>Users</code> -> <code><specific user></code> -> Get <code>User ID</code> and save it.</li><li><code>Access</code> -> <code>Application</code> -> <code>Add an Application</code>.</li><li>Choose <code>SaaS</code>, enter a custom application name in <code>Application</code> (e.g., nezha), select <code>OIDC</code>, and click <code>Add application</code>.</li><li>Select <code>Scopes</code>: <code>openid</code>, <code>email</code>, <code>profile</code>, <code>groups</code>.</li><li>Fill in your callback address in <code>Redirect URLs
Line truncated
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">location</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> / </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> proxy_pass </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">http://127.0.0.1:8008;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> proxy_set_header </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Host $http_host;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> proxy_set_header </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Upgrade $http_upgrade;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">location</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ~</span><span style="--shiki-light:#032F62;--shiki-dark:#DBEDFF;"> ^/(ws|terminal/.+)$ </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">{</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> proxy_pass </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">http://127.0.0.1:8008;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> proxy_http_version </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">1.1</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> proxy_set_header </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Upgrade $http_upgrade;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> proxy_set_header </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Connection </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"Upgrade"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> proxy_set_header </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">Host $http_host;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">#PROXY-END/</span></span></code></pre></div><p>Click “Save”.<br> Now you should be able to access the dashboard directly using the domain, such as “<a href="http://dashboard.example.com" target="_blank" rel="noreferrer">http://dashboard.example.com</a>”.</p><h3 id="additional-content" tabindex="-1">Additional Content: <a class="header-anchor" href="#additional-content" aria-label="Permalink to "Additional Content:""></a></h3><p>CaddyServer v1 (v2 does not require special configuration):</p><div class="language-caddy vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">caddy</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>proxy /ws http://ip:8008 {</span></span>
|
||||
<span class="line"><span> websocket</span></span>
|
||||
<span class="line"><span> header_upstream -Origin</span></span>
|
||||
<span class="line"><span>}</span></span>
|
||||
<span class="line"><span>proxy /terminal/* http://ip:8008 {</span></span>
|
||||
<span class="line"><span> websocket</span></span>
|
||||
<span class="line"><span> header_upstream -Origin</span></span>
|
||||
<span class="line"><span>}</span></span></code></pre></div><h2 id="configuring-ssl-in-the-aapanel" tabindex="-1">Configuring SSL in the aaPanel <a class="header-anchor" href="#configuring-ssl-in-the-aapanel" aria-label="Permalink to "Configuring SSL in the aaPanel""></a></h2><p>First, temporarily disable the reverse proxy.<br> Like configuring SSL certificates for other websites, enter the “SSL” in the site settings, and you can choose to automatically apply for a Let’s Encrypt certificate or manually configure an existing certificate.<br> After completing the SSL settings, go back to <a href="https://github.com/settings/developers" target="_blank" rel="noreferrer">Github OAuth Apps</a> and edit the previously created OAuth application. Change all the domain parts in "Homepage URL" and "Authorization callback URL" from <code>http</code> to <code>https</code>, such as "<a href="https://dashboard.example.com" target="_blank" rel="noreferrer">https://dashboard.example.com</a>" and "<a href="https://dashboard.example.com/oauth2/callback" target="_blank" rel="noreferrer">https://dashboard.example.com/oauth2/callback</a>". <strong>Failing to change this may result in being unable to log in to the admin panel.</strong></p><h2 id="updating-the-dashboard" tabindex="-1">Updating the Dashboard <a class="header-anchor" href="#updating-the-dashboard" aria-label="Permalink to "Updating the Dashboard""></a></h2><p>Run the script <code>./nezha.sh</code>, and select to restart and update the dashboard.</p>`,38),o=[n];function r(l,h,d,p,c,u){return s(),e("div",null,o)}const b=a(i,[["render",r]]);export{k as __pageData,b as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as a,c as e,o as s,a4 as t}from"./chunks/framework.BmdFiWrL.js";const k=JSON.parse('{"title":"Install Dashboard","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/dashboard.md","filePath":"en_US/guide/dashboard.md","lastUpdated":1719239024000}'),i={name:"en_US/guide/dashboard.md"},n=t("",38),o=[n];function r(l,h,d,p,c,u){return s(),e("div",null,o)}const b=a(i,[["render",r]]);export{k as __pageData,b as default};
|
||||
@@ -1,10 +0,0 @@
|
||||
import{_ as a,o as e,c as t,R as o}from"./chunks/framework.44fd0451.js";const f=JSON.parse('{"title":"Frequently Asked Questions about the Dashboard","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/dashboardq.md","filePath":"en_US/guide/dashboardq.md","lastUpdated":1718495592000}'),s={name:"en_US/guide/dashboardq.md"},n=o(`<h1 id="frequently-asked-questions-about-the-dashboard" tabindex="-1">Frequently Asked Questions about the Dashboard <a class="header-anchor" href="#frequently-asked-questions-about-the-dashboard" aria-label="Permalink to "Frequently Asked Questions about the Dashboard""></a></h1><h2 id="why-is-the-ip-displayed-in-the-admin-panel-different-from-the-actual-agent-ip" tabindex="-1">Why is the IP Displayed in the Admin Panel Different from the Actual Agent IP? <a class="header-anchor" href="#why-is-the-ip-displayed-in-the-admin-panel-different-from-the-actual-agent-ip" aria-label="Permalink to "Why is the IP Displayed in the Admin Panel Different from the Actual Agent IP?""></a></h2><p>First, let's explain how the IP displayed in the Admin panel is obtained: The Agent periodically requests IP-API to get IP information and reports it to the Dashboard. The currently used IP-API can be viewed here: <a href="https://github.com/nezhahq/agent/blob/main/pkg/monitor/myip.go" target="_blank" rel="noreferrer">myip.go</a>.<br> If you find that the IP displayed in the Admin panel is different from the IP provided by your service provider, it is most likely that the service provider has given you an <strong>entry IP</strong>, but the Agent is testing your <strong>exit IP</strong>. This issue can also occur with multi-line servers and IPLC private lines.</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>For example, a common scenario is that the service provider gives you a high-defense server. To meet both high defense and low network interruption rate goals, the IP provided may be a mapped high-defense IP rather than your server's real exit IP.</p></div><p>You can also test the exit IP on the Agent server by running the following commands:</p><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">curl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">https://ipapi.co/ip/</span></span>
|
||||
<span class="line"><span style="color:#FFCB6B;">curl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">ip.sb</span></span>
|
||||
<span class="line"><span style="color:#FFCB6B;">curl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">ip-api.com</span></span></code></pre></div><h2 id="forgot-or-deleted-viewing-password" tabindex="-1">Forgot or Deleted Viewing Password <a class="header-anchor" href="#forgot-or-deleted-viewing-password" aria-label="Permalink to "Forgot or Deleted Viewing Password""></a></h2><p>Please view or edit the <code>/opt/nezha/dashboard/data/config.yaml</code> file.<br> The password is located under the <code>site-viewpassword</code> item.</p><h2 id="dashboard-installation-restart-update-failure-iptables" tabindex="-1">Dashboard Installation/Restart/Update Failure: iptables ...... <a class="header-anchor" href="#dashboard-installation-restart-update-failure-iptables" aria-label="Permalink to "Dashboard Installation/Restart/Update Failure: iptables ......""></a></h2><p>First, try restarting Docker before proceeding:</p><div class="language-shell"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#FFCB6B;">systemctl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">status</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">docker</span></span>
|
||||
<span class="line"><span style="color:#FFCB6B;">systemctl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">restart</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">docker</span></span>
|
||||
<span class="line"><span style="color:#FFCB6B;">systemctl</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">status</span><span style="color:#A6ACCD;"> </span><span style="color:#C3E88D;">docker</span></span></code></pre></div><p>After restarting, try reinstalling the Dashboard.<br> If iptables errors persist, consider disabling or removing iptables.<br> This issue might also be related to the kernel, so switching to the official kernel can be another solution.</p><h2 id="dashboard-restart-failure-invalid-hostport-nz-site-port" tabindex="-1">Dashboard Restart Failure: Invalid hostPort: nz_site_port <a class="header-anchor" href="#dashboard-restart-failure-invalid-hostport-nz-site-port" aria-label="Permalink to "Dashboard Restart Failure: Invalid hostPort: nz_site_port""></a></h2><p>If this issue occurs, you can modify the configuration via the installation script or directly edit the <code>/opt/nezha/dashboard/docker-compose.yaml</code> file.</p><h2 id="dashboard-layout-error-css-resources-not-loading" tabindex="-1">Dashboard Layout Error, CSS Resources Not Loading <a class="header-anchor" href="#dashboard-layout-error-css-resources-not-loading" aria-label="Permalink to "Dashboard Layout Error, CSS Resources Not Loading""></a></h2><p>If the Dashboard page layout is incorrect, it's usually due to missing or inaccessible CSS files.<br> To resolve this, try <code>restarting and updating the Dashboard</code> first.<br> If the problem persists after updating, the issue may be due to inappropriate configurations in your vhost file. You can edit the Nginx vhost file or use the aaPanel to:</p><ol><li><p>Find the site configured during Dashboard installation in <code>Websites</code> and click <code>Settings</code> on the right.</p></li><li><p>Select <code>Configuration File</code> and remove the following lines:</p><div class="language-nginx"><button title="Copy Code" class="copy"></button><span class="lang">nginx</span><pre class="shiki material-theme-palenight"><code><span class="line"><span style="color:#89DDFF;">location</span><span style="color:#A6ACCD;"> </span><span style="color:#89DDFF;">~</span><span style="color:#A6ACCD;"> .*\\.(js|css)?$</span></span>
|
||||
<span class="line"><span style="color:#A6ACCD;"> </span><span style="color:#F07178;">{</span></span>
|
||||
<span class="line"><span style="color:#F07178;"> </span><span style="color:#89DDFF;"> expires </span><span style="color:#F07178;"> </span><span style="color:#F78C6C;">12h</span><span style="color:#89DDFF;">;</span></span>
|
||||
<span class="line"><span style="color:#F07178;"> </span><span style="color:#89DDFF;"> error_log </span><span style="color:#F07178;">/dev/null</span><span style="color:#89DDFF;">;</span></span>
|
||||
<span class="line"><span style="color:#F07178;"> </span><span style="color:#89DDFF;"> access_log </span><span style="color:#F07178;">/dev/null</span><span style="color:#89DDFF;">;</span></span>
|
||||
<span class="line"><span style="color:#F07178;"> }</span></span></code></pre></div></li><li><p>Save the configuration, clear the browser, Nginx, and CDN caches, and refresh the page to see if it returns to normal.</p></li></ol><h2 id="dashboard-cannot-start-panic-unable-to-find-the-configured-ddns-provider" tabindex="-1">Dashboard Cannot Start: panic: Unable to find the configured DDNS provider... <a class="header-anchor" href="#dashboard-cannot-start-panic-unable-to-find-the-configured-ddns-provider" aria-label="Permalink to "Dashboard Cannot Start: panic: Unable to find the configured DDNS provider...""></a></h2><p>The value entered for the DDNS provider is incorrect. Currently, only <code>webhook</code>, <code>cloudflare</code>, <code>tencentcloud</code>, and <code>dummy</code> are supported.</p><h2 id="dashboard-ddns-update-crash-panic-interface-conversion-interface-is-nil-not-interface" tabindex="-1">Dashboard DDNS Update Crash: panic: interface conversion: interface {} is nil, not []interface {} <a class="header-anchor" href="#dashboard-ddns-update-crash-panic-interface-conversion-interface-is-nil-not-interface" aria-label="Permalink to "Dashboard DDNS Update Crash: panic: interface conversion: interface {} is nil, not []interface {}""></a></h2><p>The entered DDNS <code>AccessID</code> or <code>AccessSecret</code> is incorrect.</p><h2 id="network-monitoring-page-shows-server-monitor-history-not-found" tabindex="-1">Network Monitoring Page Shows: server monitor history not found <a class="header-anchor" href="#network-monitoring-page-shows-server-monitor-history-not-found" aria-label="Permalink to "Network Monitoring Page Shows: server monitor history not found""></a></h2><p>This error indicates that no TCP-Ping or ICMP-Ping type monitoring has been set in the services page or monitoring data has not yet been generated.<br> If it has been set up, wait for some time and then check again.</p><h3 id="what-to-do-if-terminal-or-ws-can-t-connect-properly-after-enabling-https" tabindex="-1">What to do if /terminal or /ws can't connect properly after enabling HTTPS? <a class="header-anchor" href="#what-to-do-if-terminal-or-ws-can-t-connect-properly-after-enabling-https" aria-label="Permalink to "What to do if /terminal or /ws can't connect properly after enabling HTTPS?""></a></h3><p>This is often due to an incomplete certificate. Add the -d parameter to the agent run command. If the log contains <code>x509:certificate signed by unknown authority</code>, replacing with a complete certificate will solve the problem.</p><h3 id="what-if-i-m-not-satisfied-with-the-data-modification-addition-functionality-provided-by-the-dashboard-and-want-to-modify-add-data-myself" tabindex="-1">What if I'm not satisfied with the data modification/addition functionality provided by the dashboard and want to modify/add data myself? <a class="header-anchor" href="#what-if-i-m-not-satisfied-with-the-data-modification-addition-functionality-provided-by-the-dashboard-and-want-to-modify-add-data-myself" aria-label="Permalink to "What if I'm not satisfied with the data modification/addition functionality provided by the dashboard and want to modify/add data myself?""></a></h3><p>Common in scenarios like batch adding Agents, you can directly modify the database.<br> Note that not everything in the database can be modified; incorrect modifications can lead to data corruption and inability to start the Dashboard. <strong>Do not modify the database casually!</strong></p><div class="danger custom-block"><p class="custom-block-title">DANGER</p><p>Again, <strong>do not modify the database casually!</strong></p></div><p>If you need to modify data in the database, <strong>stop</strong> the dashboard container first.<br> The database type is sqlite3, located at <code>/opt/nezha/dashboard/data/sqlite.db</code>. Backup before modifying.</p><h3 id="will-the-dashboard-automatically-update" tabindex="-1">Will the Dashboard automatically update? <a class="header-anchor" href="#will-the-dashboard-automatically-update" aria-label="Permalink to "Will the Dashboard automatically update?""></a></h3><p>Agents typically update automatically, but the Dashboard does not and requires manual updates.</p>`,31),i=[n];function r(l,d,c,p,h,u){return e(),t("div",null,i)}const y=a(s,[["render",r]]);export{f as __pageData,y as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as a,o as e,c as t,R as o}from"./chunks/framework.44fd0451.js";const f=JSON.parse('{"title":"Frequently Asked Questions about the Dashboard","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/dashboardq.md","filePath":"en_US/guide/dashboardq.md","lastUpdated":1718495592000}'),s={name:"en_US/guide/dashboardq.md"},n=o("",31),i=[n];function r(l,d,c,p,h,u){return e(),t("div",null,i)}const y=a(s,[["render",r]]);export{f as __pageData,y as default};
|
||||
@@ -0,0 +1,10 @@
|
||||
import{_ as a,c as e,o as t,a4 as i}from"./chunks/framework.BmdFiWrL.js";const g=JSON.parse('{"title":"Frequently Asked Questions about the Dashboard","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/dashboardq.md","filePath":"en_US/guide/dashboardq.md","lastUpdated":1719239024000}'),s={name:"en_US/guide/dashboardq.md"},o=i(`<h1 id="frequently-asked-questions-about-the-dashboard" tabindex="-1">Frequently Asked Questions about the Dashboard <a class="header-anchor" href="#frequently-asked-questions-about-the-dashboard" aria-label="Permalink to "Frequently Asked Questions about the Dashboard""></a></h1><h2 id="why-is-the-ip-displayed-in-the-admin-panel-different-from-the-actual-agent-ip" tabindex="-1">Why is the IP Displayed in the Admin Panel Different from the Actual Agent IP? <a class="header-anchor" href="#why-is-the-ip-displayed-in-the-admin-panel-different-from-the-actual-agent-ip" aria-label="Permalink to "Why is the IP Displayed in the Admin Panel Different from the Actual Agent IP?""></a></h2><p>First, let's explain how the IP displayed in the Admin panel is obtained: The Agent periodically requests IP-API to get IP information and reports it to the Dashboard. The currently used IP-API can be viewed here: <a href="https://github.com/nezhahq/agent/blob/main/pkg/monitor/myip.go" target="_blank" rel="noreferrer">myip.go</a>.<br> If you find that the IP displayed in the Admin panel is different from the IP provided by your service provider, it is most likely that the service provider has given you an <strong>entry IP</strong>, but the Agent is testing your <strong>exit IP</strong>. This issue can also occur with multi-line servers and IPLC private lines.</p><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>For example, a common scenario is that the service provider gives you a high-defense server. To meet both high defense and low network interruption rate goals, the IP provided may be a mapped high-defense IP rather than your server's real exit IP.</p></div><p>You can also test the exit IP on the Agent server by running the following commands:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://ipapi.co/ip/</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ip.sb</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ip-api.com</span></span></code></pre></div><h2 id="forgot-or-deleted-viewing-password" tabindex="-1">Forgot or Deleted Viewing Password <a class="header-anchor" href="#forgot-or-deleted-viewing-password" aria-label="Permalink to "Forgot or Deleted Viewing Password""></a></h2><p>Please view or edit the <code>/opt/nezha/dashboard/data/config.yaml</code> file.<br> The password is located under the <code>site-viewpassword</code> item.</p><h2 id="dashboard-installation-restart-update-failure-iptables" tabindex="-1">Dashboard Installation/Restart/Update Failure: iptables ...... <a class="header-anchor" href="#dashboard-installation-restart-update-failure-iptables" aria-label="Permalink to "Dashboard Installation/Restart/Update Failure: iptables ......""></a></h2><p>First, try restarting Docker before proceeding:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> status</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> docker</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> restart</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> docker</span></span>
|
||||
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> status</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> docker</span></span></code></pre></div><p>After restarting, try reinstalling the Dashboard.<br> If iptables errors persist, consider disabling or removing iptables.<br> This issue might also be related to the kernel, so switching to the official kernel can be another solution.</p><h2 id="dashboard-restart-failure-invalid-hostport-nz-site-port" tabindex="-1">Dashboard Restart Failure: Invalid hostPort: nz_site_port <a class="header-anchor" href="#dashboard-restart-failure-invalid-hostport-nz-site-port" aria-label="Permalink to "Dashboard Restart Failure: Invalid hostPort: nz_site_port""></a></h2><p>If this issue occurs, you can modify the configuration via the installation script or directly edit the <code>/opt/nezha/dashboard/docker-compose.yaml</code> file.</p><h2 id="dashboard-layout-error-css-resources-not-loading" tabindex="-1">Dashboard Layout Error, CSS Resources Not Loading <a class="header-anchor" href="#dashboard-layout-error-css-resources-not-loading" aria-label="Permalink to "Dashboard Layout Error, CSS Resources Not Loading""></a></h2><p>If the Dashboard page layout is incorrect, it's usually due to missing or inaccessible CSS files.<br> To resolve this, try <code>restarting and updating the Dashboard</code> first.<br> If the problem persists after updating, the issue may be due to inappropriate configurations in your vhost file. You can edit the Nginx vhost file or use the aaPanel to:</p><ol><li><p>Find the site configured during Dashboard installation in <code>Websites</code> and click <code>Settings</code> on the right.</p></li><li><p>Select <code>Configuration File</code> and remove the following lines:</p><div class="language-nginx vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">nginx</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">location</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> ~</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> .*\\.(js|css)?$</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> expires </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 12h</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> error_log </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/dev/null;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> access_log </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">/dev/null;</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> }</span></span></code></pre></div></li><li><p>Save the configuration, clear the browser, Nginx, and CDN caches, and refresh the page to see if it returns to normal.</p></li></ol><h2 id="dashboard-cannot-start-panic-unable-to-find-the-configured-ddns-provider" tabindex="-1">Dashboard Cannot Start: panic: Unable to find the configured DDNS provider... <a class="header-anchor" href="#dashboard-cannot-start-panic-unable-to-find-the-configured-ddns-provider" aria-label="Permalink to "Dashboard Cannot Start: panic: Unable to find the configured DDNS provider...""></a></h2><p>The value entered for the DDNS provider is incorrect. Currently, only <code>webhook</code>, <code>cloudflare</code>, <code>tencentcloud</code>, and <code>dummy</code> are supported.</p><h2 id="dashboard-ddns-update-crash-panic-interface-conversion-interface-is-nil-not-interface" tabindex="-1">Dashboard DDNS Update Crash: panic: interface conversion: interface {} is nil, not []interface {} <a class="header-anchor" href="#dashboard-ddns-update-crash-panic-interface-conversion-interface-is-nil-not-interface" aria-label="Permalink to "Dashboard DDNS Update Crash: panic: interface conversion: interface {} is nil, not []interface {}""></a></h2><p>The entered DDNS <code>AccessID</code> or <code>AccessSecret</code> is incorrect.</p><h2 id="network-monitoring-page-shows-server-monitor-history-not-found" tabindex="-1">Network Monitoring Page Shows: server monitor history not found <a class="header-anchor" href="#network-monitoring-page-shows-server-monitor-history-not-found" aria-label="Permalink to "Network Monitoring Page Shows: server monitor history not found""></a></h2><p>This error indicates that no TCP-Ping or ICMP-Ping type monitoring has been set in the services page or monitoring data has not yet been generated.<br> If it has been set up, wait for some time and then check again.</p><h3 id="what-to-do-if-terminal-or-ws-can-t-connect-properly-after-enabling-https" tabindex="-1">What to do if /terminal or /ws can't connect properly after enabling HTTPS? <a class="header-anchor" href="#what-to-do-if-terminal-or-ws-can-t-connect-properly-after-enabling-https" aria-label="Permalink to "What to do if /terminal or /ws can't connect properly after enabling HTTPS?""></a></h3><p>This is often due to an incomplete certificate. Add the -d parameter to the agent run command. If the log contains <code>x509:certificate signed by unknown authority</code>, replacing with a complete certificate will solve the problem.</p><h3 id="what-if-i-m-not-satisfied-with-the-data-modification-addition-functionality-provided-by-the-dashboard-and-want-to-modify-add-data-myself" tabindex="-1">What if I'm not satisfied with the data modification/addition functionality provided by the dashboard and want to modify/add data myself? <a class="header-anchor" href="#what-if-i-m-not-satisfied-with-the-data-modification-addition-functionality-provided-by-the-dashboard-and-want-to-modify-add-data-myself" aria-label="Permalink to "What if I'm not satisfied with the data modification/addition functionality provided by the dashboard and want to modify/add data myself?""></a></h3><p>Common in scenarios like batch adding Agents, you can directly modify the database.<br> Note that not everything in the database can be modified; incorrect modifications can lead to data corruption and inability to start the Dashboard. <strong>Do not modify the database casually!</strong></p><div class="danger custom-block"><p class="custom-block-title">DANGER</p><p>Again, <strong>do not modify the database casually!</strong></p></div><p>If you need to modify data in the database, <strong>stop</strong> the dashboard container first.<br> The database type is sqlite3, located at <code>/opt/nezha/dashboard/data/sqlite.db</code>. Backup before modifying.</p><h3 id="will-the-dashboard-automatically-update" tabindex="-1">Will the Dashboard automatically update? <a class="header-anchor" href="#will-the-dashboard-automatically-update" aria-label="Permalink to "Will the Dashboard automatically update?""></a></h3><p>Agents typically update automatically, but the Dashboard does not and requires manual updates.</p>`,31),n=[o];function r(d,h,l,c,p,u){return t(),e("div",null,n)}const f=a(s,[["render",r]]);export{g as __pageData,f as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{_ as a,c as e,o as t,a4 as i}from"./chunks/framework.BmdFiWrL.js";const g=JSON.parse('{"title":"Frequently Asked Questions about the Dashboard","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/dashboardq.md","filePath":"en_US/guide/dashboardq.md","lastUpdated":1719239024000}'),s={name:"en_US/guide/dashboardq.md"},o=i("",31),n=[o];function r(d,h,l,c,p,u){return t(),e("div",null,n)}const f=a(s,[["render",r]]);export{g as __pageData,f as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{_ as e,o,c as t,R as a}from"./chunks/framework.44fd0451.js";const m=JSON.parse('{"title":"Frequently Asked Questions about logging into the Dashboard","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en_US/guide/loginq.md","filePath":"en_US/guide/loginq.md","lastUpdated":1718495592000}'),i={name:"en_US/guide/loginq.md"},n=a('<h1 id="frequently-asked-questions-about-logging-into-the-dashboard" tabindex="-1">Frequently Asked Questions about logging into the Dashboard <a class="header-anchor" href="#frequently-asked-questions-about-logging-into-the-dashboard" aria-label="Permalink to "Frequently Asked Questions about logging into the Dashboard""></a></h1><h2 id="stuck-page-connection-refused-long-response-time-after-login-callback" tabindex="-1">Stuck Page/Connection Refused/Long Response Time After Login Callback <a class="header-anchor" href="#stuck-page-connection-refused-long-response-time-after-login-callback" aria-label="Permalink to "Stuck Page/Connection Refused/Long Response Time After Login Callback""></a></h2><p>These issues can manifest in various ways, but ultimately the browser cannot display correctly after login.</p><ol><li>Your server cannot connect to Github/Gitee, which is most common when configuring Github on servers in mainland China. You may try several times or switch to Cloudflare Access.</li><li>You have configured the callback address incorrectly. Ensure that your callback address is correct and that both the <strong>port and protocol</strong> are accurate!</li><li>An unknown error occurred on the Dashboard. You can use a script to check the logs.</li></ol><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>What is a protocol? In the browser, the string that ends your domain with <code>://</code> is the protocol, usually <code>http</code> or <code>https</code>. Since there may be multiple protocol+domain+port combinations available for accessing the Dashboard in a normal deployment, make sure to choose the most appropriate one as the callback.</p></div><h3 id="how-to-check-if-my-callback-address-is-wrong" tabindex="-1">How to Check if My Callback Address is Wrong? <a class="header-anchor" href="#how-to-check-if-my-callback-address-is-wrong" aria-label="Permalink to "How to Check if My Callback Address is Wrong?""></a></h3><p>Ensure that the protocol+domain+port displayed in the browser before login and after the callback are consistent.<br> Ensure that your path is <code>/oauth2/callback</code>, <strong>all in lowercase</strong>.</p><h2 id="errors-after-logging-into-the-admin-panel" tabindex="-1">Errors After Logging into the Admin Panel <a class="header-anchor" href="#errors-after-logging-into-the-admin-panel" aria-label="Permalink to "Errors After Logging into the Admin Panel""></a></h2><h3 id="http-named-cookie-not-present" tabindex="-1">http: named cookie not present <a class="header-anchor" href="#http-named-cookie-not-present" aria-label="Permalink to "http: named cookie not present""></a></h3><ol><li>Clear cookies and log in again, or try a different browser.</li><li>Check the callback address to ensure it is correct and that both the <strong>port and protocol</strong> are accurate! The address initiating the request must be in the same domain as the callback address, with the port, protocol, and domain (or IP) all matching.</li></ol><h3 id="lookup-xxx" tabindex="-1">lookup xxx <a class="header-anchor" href="#lookup-xxx" aria-label="Permalink to "lookup xxx""></a></h3><p>The container DNS resolution failed, usually due to modified iptables configurations.<br> It is recommended to restart Docker first, <code>sudo systemctl restart docker</code>, then restart the Dashboard using the script.<br> If the lookup error persists, check if there are other tools controlling iptables, such as firewall.<br> This issue might also be related to the kernel, so try switching to the official kernel.</p><h3 id="invalid-authorization-method-or-the-login-callback-address-is-invalid-expired-or-has-been-revoked" tabindex="-1">Invalid authorization method, or the login callback address is invalid, expired, or has been revoked <a class="header-anchor" href="#invalid-authorization-method-or-the-login-callback-address-is-invalid-expired-or-has-been-revoked" aria-label="Permalink to "Invalid authorization method, or the login callback address is invalid, expired, or has been revoked""></a></h3><p>This issue appears only when using Gitee login, and the reason is unclear. Switching to GitHub is recommended.</p><h3 id="oauth2-server-response-missing-access-token" tabindex="-1">oauth2: server response missing access_token <a class="header-anchor" href="#oauth2-server-response-missing-access-token" aria-label="Permalink to "oauth2: server response missing access_token""></a></h3><p>This could be caused by various factors, most likely a network issue. Line truncated
|
||||