docs: reorganize documentation with i18n and Swagger API reference
- Add per-submodule docs structure (server-core, dashboard-ui, device-agent) - Restructure VitePress with i18n support (Indonesian default + English) - Add Swagger API reference pages with Swagger UI CDN embed - Create merge.js script for combining sidebar manifests - Integrate docs build into Docker (update.sh + nginx volume mount) - Add documentation section to root README
This commit is contained in:
+1
-1
Submodule apps/dashboard-ui updated: d1ac7653f6...2dcab84274
+1
-1
Submodule apps/device-agent updated: 4f6277b5af...3f42833ed5
@@ -1,22 +1,50 @@
|
||||
import { defineConfig } from 'vitepress'
|
||||
|
||||
// Sidebar manifests from submodules
|
||||
import serverCoreSidebar from '../../server-core/docs/sidebar.json'
|
||||
import dashboardSidebar from '../../dashboard-ui/docs/sidebar.json'
|
||||
import agentSidebar from '../../device-agent/docs/sidebar.json'
|
||||
|
||||
export default defineConfig({
|
||||
title: 'NexusGuard Docs',
|
||||
description: 'Enterprise Zero-Trust SD-WAN Documentation',
|
||||
title: 'NexusGuard',
|
||||
description: 'Enterprise Zero-Trust SD-WAN Suite',
|
||||
base: '/docs/',
|
||||
cleanUrls: true,
|
||||
themeConfig: {
|
||||
sidebar: [
|
||||
{
|
||||
text: 'Guides',
|
||||
items: [
|
||||
{ text: 'Sign In', link: '/guides/sign-in' },
|
||||
{ text: 'Access Remote Server', link: '/guides/access-remote-server' },
|
||||
{ text: 'Add WireGuard Configuration', link: '/guides/add-wireguard-configuration' },
|
||||
{ text: 'Peers', link: '/guides/peers' },
|
||||
{ text: 'Email Service', link: '/guides/email-service' },
|
||||
{ text: 'WebHooks', link: '/guides/webhooks' },
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
locales: {
|
||||
root: {
|
||||
label: 'Bahasa Indonesia',
|
||||
lang: 'id',
|
||||
themeConfig: {
|
||||
sidebar: [
|
||||
serverCoreSidebar,
|
||||
dashboardSidebar,
|
||||
agentSidebar,
|
||||
],
|
||||
nav: [
|
||||
{ text: 'Beranda', link: '/' },
|
||||
{ text: 'Panduan', link: '/guides/' },
|
||||
{ text: 'API', link: '/api/' },
|
||||
{ text: 'GitHub', link: 'https://git.datadunia.com/nexusguard/Nexus-Guard-Suite' },
|
||||
],
|
||||
},
|
||||
},
|
||||
en: {
|
||||
label: 'English',
|
||||
lang: 'en',
|
||||
themeConfig: {
|
||||
sidebar: [
|
||||
serverCoreSidebar,
|
||||
dashboardSidebar,
|
||||
agentSidebar,
|
||||
],
|
||||
nav: [
|
||||
{ text: 'Home', link: '/en/' },
|
||||
{ text: 'Guides', link: '/en/guides/' },
|
||||
{ text: 'API', link: '/en/api/' },
|
||||
{ text: 'GitHub', link: 'https://git.datadunia.com/nexusguard/Nexus-Guard-Suite' },
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
# NexusGuard API Reference
|
||||
|
||||
This page provides interactive documentation for the NexusGuard Server Core API.
|
||||
|
||||
<div id="swagger-ui"></div>
|
||||
|
||||
<script setup>
|
||||
import { onMounted } from 'vue'
|
||||
|
||||
onMounted(() => {
|
||||
// Load Swagger UI from CDN
|
||||
const script = document.createElement('script')
|
||||
script.src = 'https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js'
|
||||
script.onload = () => {
|
||||
window.SwaggerUIBundle({
|
||||
url: '/server-core/docs/swagger.json',
|
||||
dom_id: '#swagger-ui',
|
||||
presets: [
|
||||
window.SwaggerUIBundle.presets.apis,
|
||||
window.SwaggerUIBundle.SwaggerUIStandalonePreset
|
||||
],
|
||||
layout: 'BaseLayout'
|
||||
})
|
||||
}
|
||||
document.head.appendChild(script)
|
||||
|
||||
const link = document.createElement('link')
|
||||
link.rel = 'stylesheet'
|
||||
link.href = 'https://unpkg.com/swagger-ui-dist@5/swagger-ui.css'
|
||||
document.head.appendChild(link)
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,31 @@
|
||||
# Referensi API NexusGuard
|
||||
|
||||
Halaman ini menyediakan dokumentasi interaktif untuk API Server Core NexusGuard.
|
||||
|
||||
<div id="swagger-ui"></div>
|
||||
|
||||
<script setup>
|
||||
import { onMounted } from 'vue'
|
||||
|
||||
onMounted(() => {
|
||||
const script = document.createElement('script')
|
||||
script.src = 'https://unpkg.com/swagger-ui-dist@5/swagger-ui-bundle.js'
|
||||
script.onload = () => {
|
||||
window.SwaggerUIBundle({
|
||||
url: '/server-core/docs/swagger.json',
|
||||
dom_id: '#swagger-ui',
|
||||
presets: [
|
||||
window.SwaggerUIBundle.presets.apis,
|
||||
window.SwaggerUIBundle.SwaggerUIStandalonePreset
|
||||
],
|
||||
layout: 'BaseLayout'
|
||||
})
|
||||
}
|
||||
document.head.appendChild(script)
|
||||
|
||||
const link = document.createElement('link')
|
||||
link.rel = 'stylesheet'
|
||||
link.href = 'https://unpkg.com/swagger-ui-dist@5/swagger-ui.css'
|
||||
document.head.appendChild(link)
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,26 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { join, dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
const submodules = [
|
||||
{ name: 'server-core', path: '../server-core/docs/sidebar.json' },
|
||||
{ name: 'dashboard-ui', path: '../dashboard-ui/docs/sidebar.json' },
|
||||
{ name: 'device-agent', path: '../device-agent/docs/sidebar.json' }
|
||||
];
|
||||
|
||||
const sidebar = [];
|
||||
|
||||
for (const mod of submodules) {
|
||||
const filePath = join(__dirname, mod.path);
|
||||
try {
|
||||
const content = JSON.parse(readFileSync(filePath, 'utf-8'));
|
||||
sidebar.push(content);
|
||||
console.error(`\u2713 Loaded ${mod.name}`);
|
||||
} catch (e) {
|
||||
console.error(`\u26A0 Skipping ${mod.name}: ${e.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(JSON.stringify(sidebar, null, 2));
|
||||
Generated
+2552
File diff suppressed because it is too large
Load Diff
+1
-1
Submodule apps/server-core updated: afd664d715...c861de2a43
Reference in New Issue
Block a user