c0ckp1t 1.0.11 → 1.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,8 +8,8 @@ import {markRaw, reactive, watch, defineAsyncComponent, createApp} from 'vue'
8
8
  import * as VueRouter from 'vue-router'
9
9
  import {getLogger} from 'Logging';
10
10
  import {transformRoutes, loadModule, options} from "VueUtils";
11
- import {validateIslandConfig, findHostnamePortProtocol, defaultVueComponents} from 'CoreUtils'
12
- import {substrAfterFirstSlash} from "JsUtils";
11
+ import {validateIslandConfig, findHostnamePortProtocol, validateAppConfig} from 'CoreUtils'
12
+ import {substrAfterFirstSlash, extractLastPath} from "JsUtils";
13
13
 
14
14
  import IslandDefault from 'IslandDefault'
15
15
  import Island from 'Island'
@@ -46,6 +46,7 @@ export const store = reactive({
46
46
  name: "C0ckp1t",
47
47
  id: LOG_HEADER,
48
48
  config: null,
49
+ appEndpoint: "",
49
50
  serverInfo: findHostnamePortProtocol(),
50
51
 
51
52
  // ________________________________________________________________________________
@@ -217,8 +218,15 @@ export const api = {
217
218
  },
218
219
 
219
220
  routeByEndpoint: async (endpoint) => {
220
- logger.info(`[routeByEndpoint] - endpoint=${endpoint}`)
221
+ const path = endpoint.split("/")
222
+ logger.info(`[routeByEndpoint] - endpoint=${endpoint}, path=${path}`)
221
223
  try {
224
+ if(path.length > 3) {
225
+ extractLastPath(endpoint)
226
+ document.title = `${path[2]}-${path[3]}`
227
+ } else if (path.length === 3) {
228
+ document.title = `${path[2]}`
229
+ }
222
230
  await store.router.push(endpoint)
223
231
  } catch (err) {
224
232
  console.error("Failed to navigate:", err)
@@ -283,7 +291,7 @@ export const api = {
283
291
  return null
284
292
  }
285
293
 
286
- validateIslandConfig(config)
294
+ validateAppConfig(config)
287
295
  //________________________________________________________________________________
288
296
  // Create Vue Application
289
297
  //________________________________________________________________________________
@@ -301,21 +309,21 @@ export const api = {
301
309
  //________________________________________________________________________________
302
310
  // Create Default Island
303
311
  //________________________________________________________________________________
312
+ config.routes ??= []
304
313
  if(config.routes.length === 0) {
305
314
  logger.warn(`config.routes is empty`)
306
315
  }
307
- config.appEndpoint = config.appEndpoint ?? ""
316
+ store.appEndpoint = config.appEndpoint ?? ""
308
317
  store.defaultInstanceId = config.instanceId ?? "default"
309
318
  store.name = config.appName ?? "C0ckp1t"
310
319
  store.config = config
311
320
  const vueRouterModeIsHash = config.vueRouterModeIsHash ?? true
312
321
 
322
+ // Load default island
313
323
  const decoratedIslandConfig = {
314
324
  ...config,
315
325
  SERVER_API_URL: store.serverInfo.serverUrl,
316
326
  }
317
-
318
- // Load default island first
319
327
  const islandDefault = new IslandDefault(api, decoratedIslandConfig)
320
328
  store.r[islandDefault.instanceId] = islandDefault
321
329
  await islandDefault.init()
@@ -328,12 +336,12 @@ export const api = {
328
336
  store.router = markRaw(router)
329
337
 
330
338
  // Main entry point for the app, this will load the main application
331
- app.component('app-main', createAsyncComponent(() => api.loadModule(`${config.appEndpoint}/core/PageMain.vue`)))
339
+ app.component('app-main', createAsyncComponent(() => api.loadModule(config.appMainComponent)))
332
340
 
333
341
  // Configure C0ckp1t Vue Components
334
- const vueComponents = defaultVueComponents()
342
+ const vueComponents = config.components ?? {}
335
343
  for (const [key, value] of Object.entries(vueComponents)) {
336
- app.component(key, defineAsyncComponent(() => api.loadModule(`${config.appEndpoint}${value}`)))
344
+ app.component(key, defineAsyncComponent(() => api.loadModule(`${value.path}`)))
337
345
  }
338
346
 
339
347
  app.use(router)
package/core/Island.mjs CHANGED
@@ -310,7 +310,7 @@ export default class Island {
310
310
  // HTTP
311
311
  // ________________________________________________________________________________
312
312
  resolver = async (endpoint, type) => {
313
- this.logger.info(`[resolver] - endpoint=${endpoint}`)
313
+ this.logger.debug(`[resolver] - endpoint=${endpoint}`)
314
314
 
315
315
  if (endpoint.startsWith('/c0ckp1t/')) {
316
316
  const endpointAdjusted = endpoint.replace("/c0ckp1t/", `/`)
@@ -419,7 +419,7 @@ export default class Island {
419
419
  // HELPER METHODS
420
420
  // ________________________________________________________________________________
421
421
  function adjustNode(node) {
422
- node._expanded = true;
422
+ node._expanded ??= true;
423
423
  node.children.forEach((child) => {
424
424
  adjustNode(child);
425
425
  });
@@ -210,7 +210,7 @@ export default class IslandDefault {
210
210
  // HELPER METHODS
211
211
  // ________________________________________________________________________________
212
212
  function adjustNode(node) {
213
- node._expanded = true;
213
+ node._expanded ??= true;
214
214
  node.children.forEach((child) => {
215
215
  adjustNode(child);
216
216
  });
package/core/PageMain.vue CHANGED
@@ -13,7 +13,7 @@ import {getLogger} from "Logging";
13
13
  import {api as apiTheme, store as storeTheme} from "./Theme.mjs"
14
14
  import PageFallback from "./PageFallback.vue"
15
15
  import MainOffcanvas from "./main-offcanvas.vue";
16
-
16
+ import NotifyToast from "./notify/toast.vue";
17
17
 
18
18
  // ________________________________________________________________________________
19
19
  // LOGGING
@@ -29,8 +29,12 @@ logger.debug("[INIT]")
29
29
  const local = reactive({
30
30
  id: LOG_HEADER,
31
31
  toggle: false,
32
- items: [
33
- ]
32
+ items: [ ],
33
+
34
+ navCloseLogo: storeMain.config?.navCloseLogo ?? "./img/logo_v1.svg",
35
+ navOpenLogo: storeMain.config?.navOpenLogo ?? "./img/logo_v2.svg",
36
+ navHasSearch: storeMain.config?.navHasSearch ?? true,
37
+ navHasThemeSel: storeMain.config?.navHasThemeSel ?? true,
34
38
  })
35
39
 
36
40
 
@@ -95,8 +99,8 @@ const mainContentStyle = computed(() => ({
95
99
 
96
100
  <a class="navbar-brand" @click.prevent="apiMain.selectLogo()" >
97
101
  <span class="me-2 text-warning" v-if="storeMain.showSidebar"><<</span>
98
- <img src="./img/logo_v1.svg" alt="Logo" height="24" class="d-inline-block align-text-top" v-if="!storeMain.showSidebar">
99
- <img src="./img/logo_v2.svg" alt="Logo" height="24" class="d-inline-block align-text-top" v-else>
102
+ <img :src="local.navCloseLogo" alt="Logo" height="24" class="d-inline-block align-text-top" v-if="!storeMain.showSidebar && local.navCloseLogo">
103
+ <img :src="local.navOpenLogo" alt="Logo" height="24" class="d-inline-block align-text-top" v-if="storeMain.showSidebar && local.navOpenLogo">
100
104
  <span class="text-warning fw-bold ms-2 brand-text">{{ storeMain.name }}</span>
101
105
  </a>
102
106
 
@@ -116,13 +120,13 @@ const mainContentStyle = computed(() => ({
116
120
  </ul>
117
121
 
118
122
  <form class="d-flex">
119
- <input class="form-control me-2" type="search" placeholder="Search" v-model="local.searchQuery">
120
- <button class="btn btn-outline-secondary me-2" type="button" @click="storeTheme.theme = storeTheme.theme === 'dark' ? 'light' : 'dark'" title="Toggle theme">
121
- <i class="fa-solid" :class="storeTheme.theme === 'dark' ? 'fa-sun' : 'fa-moon'"></i>
122
- </button>
123
- <button class="btn btn-outline-secondary" type="submit">
123
+ <input v-if="local.navHasSearch" class="form-control me-2" type="search" placeholder="Search" v-model="local.searchQuery">
124
+ <button v-if="local.navHasSearch" class="btn btn-outline-secondary" type="submit">
124
125
  <i class="fa-solid fa-search"></i>
125
126
  </button>
127
+ <button v-if="local.navHasThemeSel" class="btn btn-outline-secondary me-2" type="button" @click="storeTheme.theme = storeTheme.theme === 'dark' ? 'light' : 'dark'" title="Toggle theme">
128
+ <i class="fa-solid" :class="storeTheme.theme === 'dark' ? 'fa-sun' : 'fa-moon'"></i>
129
+ </button>
126
130
  </form>
127
131
 
128
132
  </div>
@@ -135,6 +139,7 @@ const mainContentStyle = computed(() => ({
135
139
  <RouterView/>
136
140
  </main>
137
141
 
142
+ <NotifyToast/>
138
143
  <!-- ========== FOOTER ========== -->
139
144
  <footer class="container-fluid p-4 bg-body-tertiary border-top">
140
145
  <div class="row mt-4 align-items-center justify-content-center">
package/core/VueUtils.mjs CHANGED
@@ -38,11 +38,18 @@ logger.debug("INIT")
38
38
  logger.info(`vue3-sfc-loader vue version ${vueVersion}`)
39
39
  logger.info(`vue.js version ${Vue.version}`)
40
40
 
41
-
41
+ function validateVueSFC(text) {
42
+ if(text.startsWith("<!DOCTYPE html")) {
43
+ throw Error(`[validateVueSFC] - Invalid SFC content: starts with !DOCTYPE html - likely an error page or non-SFC content`)
44
+ }
45
+ // if(!text.includes("<template>") || !text.includes("<script>")) { }
46
+ }
42
47
  //________________________________________________________________________________
43
48
  // LOCAL APP SFC LOADER OPTIONS
44
49
  //________________________________________________________________________________
50
+ // Configuration passed to vue3-sfc-loader's loadModule
45
51
  const options = {
52
+ devMode: false,
46
53
  // separate, custom cache of raw source text
47
54
  sourceCode: {},
48
55
  // ADD THIS:
@@ -68,37 +75,37 @@ const options = {
68
75
  GlobalStore: GlobalStore,
69
76
  },
70
77
 
71
- async getFile(path, type) {
72
- if(!type) {
73
- type = path.substring(path.lastIndexOf('.'));
74
- }
78
+ // Step 1. Fetch the file content
79
+ async getFile(path) {
75
80
 
76
81
  const instanceId = JsUtils.substrAfterFirstSlash(path)
77
82
 
78
83
  let res = null
79
84
  if(sourceCode[path]) {
80
- logger.debug(`[getFile] - cached - ${path} - type=${type}`)
85
+ logger.debug(`[getFile] - cached - ${path}`)
81
86
  const cached = sourceCode[path];
82
87
  res = new Response(cached.code, {status: 200, statusText: 'OK'});
83
88
  } else if (path.startsWith("http") || path.startsWith("HTTP")) {
84
- logger.debug(`[getFile] - default - ${path} - ${type}`)
85
- res = await GlobalStore.store.r["default"].resolver(path, type)
89
+ logger.debug(`[getFile] - http - ${path}`)
90
+ res = await GlobalStore.store.r["default"].resolver(path)
86
91
  } else if (GlobalStore.store.r[instanceId]) {
87
- logger.debug(`[getFile] - instance - ${path} - ${type}`)
92
+ logger.debug(`[getFile] - instance - ${path}`)
88
93
  const pathAfterInstanceId = path.replace("/" + instanceId, "")
89
- res = await GlobalStore.store.r[instanceId].resolver(pathAfterInstanceId, type)
94
+ res = await GlobalStore.store.r[instanceId].resolver(pathAfterInstanceId)
90
95
  } else {
91
- logger.debug(`[getFile] - default - ${path} - ${type}`)
92
- res = await GlobalStore.store.r["default"].resolver(path, type)
96
+ logger.debug(`[getFile] - default - ${path}`)
97
+ res = await GlobalStore.store.r["default"].resolver(path)
93
98
  }
94
99
 
95
100
  return {
96
- // type: type,
97
101
  getContentData: asBinary => {
98
102
  if (asBinary) {
99
103
  return res.arrayBuffer();
100
104
  } else {
101
105
  return res.text().then(text => {
106
+ if(path.endsWith(".vue")) {
107
+ validateVueSFC(text)
108
+ }
102
109
  cacheSourceCode(path, text);
103
110
  return text;
104
111
  });
@@ -114,7 +121,10 @@ const options = {
114
121
  document.head.insertBefore(style, ref);
115
122
  },
116
123
 
124
+ // Step 2. Handle the module request
125
+ // built-in handling for .vue, .js, .mjs, .css (return undefined)
117
126
  handleModule: async function (type, getContentData, path, options) {
127
+ // type=.vue - path=/core/PageMain.vue
118
128
  logger.debug(`[handleModule] - type=${type} - path=${path}`)
119
129
 
120
130
  // Handle esm.sh external modules (used by code-mirror.vue)
@@ -58,7 +58,7 @@
58
58
  cy="129.01283"
59
59
  cx="97.967125"
60
60
  id="head"
61
- style="fill:#ffdf11;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583;stroke-opacity:1" />
61
+ style="fill:#c4a900;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583;stroke-opacity:1" />
62
62
  <path
63
63
  id="lefEye2"
64
64
  d="M 62.802996,126.14677 C 83.82199,101.23898 83.964978,101.06953 83.964978,101.06953"
@@ -86,9 +86,9 @@
86
86
  height="8.6218405"
87
87
  width="19.292933"
88
88
  id="neck1"
89
- style="fill:#ffdf11;fill-opacity:1;stroke:#000000;stroke-width:0.264951;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
89
+ style="fill:#c4a900;fill-opacity:1;stroke:#000000;stroke-width:0.264951;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
90
90
  <rect
91
- style="fill:#ffdf11;fill-opacity:1;stroke:#000000;stroke-width:0.222;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
91
+ style="fill:#c4a900;fill-opacity:1;stroke:#000000;stroke-width:0.222;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
92
92
  id="neck2"
93
93
  width="12.705888"
94
94
  height="6.1260414"
@@ -136,7 +136,7 @@ onMounted(async () => { await init() })
136
136
 
137
137
  <style scoped>
138
138
  .toast {
139
- background-color: rgba(255,255,255,.95);
139
+
140
140
  }
141
141
 
142
142
  /** NOTIFY */
@@ -13,8 +13,6 @@ import {reactive, computed, ref, onMounted, onUnmounted, defineAsyncComponent, w
13
13
  import {getLogger} from "Logging";
14
14
  // !# C0CKP1T_START imports
15
15
  import ComponentView from "./component-view.vue";
16
- import XTerminal from "/components/xterminal.vue";
17
- import CodeMirror from "/components/code-mirror.vue";
18
16
  // !# C0CKP1T_END imports
19
17
 
20
18
  // ________________________________________________________________________________
@@ -215,6 +215,10 @@ onMounted(async () => {
215
215
  <x-dropdown k="Route Type: " :items="local.myDropDownItems" v-model="local.myDropDown"></x-dropdown>
216
216
  </ComponentView>
217
217
 
218
+ <ComponentView name="x-dropdown2" url="/components/xdropdown2.vue">
219
+ <x-dropdown2 k="Route Type: " :items="local.myDropDownItems" v-model="local.myDropDown"></x-dropdown2>
220
+ </ComponentView>
221
+
218
222
  <ComponentView name="x-json" url="/components/xjson.vue">
219
223
  <x-json :obj="local.myTableData"></x-json>
220
224
  <div class="mt-2">
package/index-cdn.html CHANGED
@@ -47,9 +47,9 @@
47
47
  </head>
48
48
 
49
49
  <body class="main-body">
50
- <div id="app-default">
51
- <app-main></app-main>
52
- </div>
50
+ <div id="app-default">
51
+ <app-main></app-main>
52
+ </div>
53
53
  </body>
54
54
 
55
55
  <!-- =================== SCRIPTS =================== -->
@@ -57,12 +57,22 @@
57
57
  <script src="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/loglevel-plugin-prefix.min.js"></script>
58
58
 
59
59
  <script type="module">
60
- import {init as initLogger} from 'Logging';
61
- import {api as apiMain} from 'GlobalStore'
62
- import DefaultConfig from 'https://cdn.jsdelivr.net/npm/c0ckp1t@latest/CdnConfig.mjs'
60
+ import {init as initLogger} from 'Logging';
61
+ import {api as apiMain} from 'GlobalStore'
62
+ import { createConfig } from 'https://cdn.jsdelivr.net/npm/c0ckp1t@latest/Config.mjs'
63
63
 
64
- initLogger(DefaultConfig)
65
- await apiMain.init("app-default", DefaultConfig)
64
+ const config = createConfig({
65
+ appEndpoint: "https://cdn.jsdelivr.net/npm/c0ckp1t@latest",
66
+ routePrefix: "https://cdn.jsdelivr.net/npm/c0ckp1t@latest",
67
+ componentPrefix: "https://cdn.jsdelivr.net/npm/c0ckp1t@latest",
68
+ appMainComponent: "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/core/PageMain.vue",
69
+ defaultLoggerLevels: {
70
+ "VueUtils.mjs": "INFO"
71
+ }
72
+ })
73
+ initLogger(config)
74
+ console.log(config)
75
+ await apiMain.init("app-default", config)
66
76
 
67
77
  </script>
68
78
 
package/index.html CHANGED
@@ -57,15 +57,18 @@
57
57
 
58
58
  <script type="module">
59
59
  import {init as initLogger} from 'Logging';
60
- import {api as apiMain} from 'GlobalStore'
61
- import DefaultConfig from './DefaultConfig.mjs'
60
+ import {api as apiMain} from 'GlobalStore';
61
+ // Application Configuration
62
+ import { createConfig } from './Config.mjs';
63
+ // Islands
62
64
  import ConfigAdmin from './ConfigAdmin.mjs'
63
65
  import ConfigAnonymous from './ConfigAnonymous.mjs'
64
- import ConfigDemo from './c0ckp1t-demo/C0ckp1tConfig.mjs'
65
-
66
- initLogger(DefaultConfig)
67
- await apiMain.init("app-default", DefaultConfig)
68
-
66
+ import ConfigDemo from './c0ckp1t-demo/Config.mjs'
67
+ // Create Application
68
+ const config = createConfig();
69
+ initLogger(config)
70
+ await apiMain.init("app-default", config)
71
+ // Create Islands
69
72
  await apiMain.registerIsland( ConfigAdmin)
70
73
  await apiMain.registerIsland(ConfigAnonymous)
71
74
  await apiMain.registerIsland(ConfigDemo)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c0ckp1t",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "A Vue 3 zero-build web dashboard framework with Islands architecture, WebSocket backends, and reusable UI components",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -26,8 +26,7 @@
26
26
  "index-cdn.html",
27
27
  "index.html",
28
28
  "style.css",
29
- "DefaultConfig.mjs",
30
- "CdnConfig.mjs",
29
+ "Config.mjs",
31
30
  "favicon.ico",
32
31
  "favicon-32x32.png",
33
32
  "favicon-64x64.png",
@@ -36,8 +35,7 @@
36
35
  "components/",
37
36
  "js_ext/",
38
37
  "css/",
39
- "c0ckp1t-demo/",
40
- "docs/"
38
+ "c0ckp1t-demo/"
41
39
  ],
42
40
  "scripts": {
43
41
  "lint": "eslint .",
package/CdnConfig.mjs DELETED
@@ -1,177 +0,0 @@
1
- /**
2
- * Default Configuration for a C0ckp1t Application
3
- */
4
- // ________________________________________________________________________________
5
- // Properties
6
- // ________________________________________________________________________________
7
- // XMLHttpRequest from a different domain cannot set cookie values for their own
8
- // domain unless withCredentials is set to true before making the request.
9
- // https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials
10
- const WITH_CREDENTIALS = false
11
- // Note: VueUtils requires this to be 'default'
12
- const instanceId = "default";
13
- // Used for requestion app components and files
14
- const appEndpoint = "https://cdn.jsdelivr.net/npm/c0ckp1t@latest";
15
-
16
- // ________________________________________________________________________________
17
- // GLOBAL CONSTANTS
18
- // ________________________________________________________________________________
19
- export default {
20
- isDev: true,
21
- WITH_CREDENTIALS: WITH_CREDENTIALS,
22
-
23
- // logger config
24
- defaultLogLevel: "INFO",
25
- defaultLoggerLevels: {
26
- "GlobalStore.mjs": "INFO",
27
- "VueUtils.mjs": "INFO",
28
- "Connection.mjs": "INFO",
29
- "default": "INFO",
30
- "anonymous": "INFO",
31
- "demo": "INFO"
32
- },
33
-
34
- instanceId: instanceId,
35
- type: "LOCAL",
36
- appName: "C0ckp1t App",
37
- appEndpoint: appEndpoint,
38
-
39
- // This creates the navigation tree
40
- root: {
41
- icon: "fa-house",
42
- depth: 0,
43
- endpoint: "/",
44
- isLeaf: false,
45
- isRoot: true,
46
- name: "",
47
- path: [],
48
- children: [
49
- {
50
- depth: 1,
51
- endpoint: `/${instanceId}/connections`,
52
- isLeaf: true,
53
- isRoot: false,
54
- path: ["connections"],
55
- name: "Connections",
56
- children: []
57
- },
58
- {
59
- depth: 1,
60
- endpoint: `/${instanceId}/cache`,
61
- isLeaf: true,
62
- isRoot: false,
63
- path: ["cache"],
64
- name: "Cache",
65
- children: []
66
- },
67
- {
68
- icon: "fa-network-wired",
69
- depth: 1,
70
- endpoint: `/${instanceId}/traffic`,
71
- isLeaf: true,
72
- isRoot: false,
73
- path: ["traffic"],
74
- name: "Traffic",
75
- children: []
76
- },
77
- {
78
- icon: "fa-bell",
79
- depth: 1,
80
- endpoint: `/${instanceId}/notifies`,
81
- isLeaf: true,
82
- isRoot: false,
83
- path: ["notifies"],
84
- name: "Notifies",
85
- children: []
86
- },
87
- {
88
- icon: "fa-info",
89
- depth: 1,
90
- endpoint: `/${instanceId}/docs`,
91
- isLeaf: true,
92
- isRoot: false,
93
- path: ["docs"],
94
- name: "Documentation",
95
- children: []
96
- },
97
- {
98
- icon: "fa-info",
99
- depth: 1,
100
- endpoint: `/${instanceId}/components`,
101
- isLeaf: true,
102
- isRoot: false,
103
- path: ["components"],
104
- name: "Components",
105
- children: [
106
- {
107
- icon: "fa-info",
108
- depth: 2,
109
- endpoint: `/${instanceId}/components/bootstrap`,
110
- isLeaf: true,
111
- isRoot: false,
112
- path: ["bootstrap"],
113
- name: "Bootstrap",
114
- children: []
115
- },
116
- {
117
- icon: "fa-info",
118
- depth: 2,
119
- endpoint: `/${instanceId}/components/basic`,
120
- isLeaf: true,
121
- isRoot: false,
122
- path: ["basic"],
123
- name: "Basic",
124
- children: []
125
- },
126
- {
127
- icon: "fa-info",
128
- depth: 2,
129
- endpoint: `/${instanceId}/components/advanced`,
130
- isLeaf: true,
131
- isRoot: false,
132
- path: ["advanced"],
133
- name: "Advanced",
134
- children: []
135
- },
136
- {
137
- icon: "fa-info",
138
- depth: 2,
139
- endpoint: `/${instanceId}/components/theme`,
140
- isLeaf: true,
141
- isRoot: false,
142
- path: ["theme"],
143
- name: "Theme",
144
- children: []
145
- },
146
- ]
147
- }
148
- ]
149
- },
150
-
151
- // This is used to create routes for the vue router
152
- routes: [
153
- { path: '/', name: 'root', children: [
154
- {path: '', redirect: '/default/docs/Introduction.md'},
155
- {path: `${instanceId}`, children :[
156
- {path: 'docs', redirect: `/${instanceId}/docs/Introduction.md`},
157
- {path: 'docs/:pathMatch(.*)*', location: `${appEndpoint}/core/pages/Documentation.vue`},
158
- {path: 'connections', location: `${appEndpoint}/core/pages/Connections.vue`},
159
- {path: 'connections/:id', location: `${appEndpoint}/core/pages/Connection.vue`},
160
- {path: 'cache', location: `${appEndpoint}/core/pages/Cache.vue`},
161
- {path: 'traffic', location: `${appEndpoint}/core/pages/Traffic.vue`},
162
- {path: 'notifies', location: `${appEndpoint}/core/pages/Notifies.vue`},
163
- {path: 'components', location: `${appEndpoint}/core/pages/frontend/Components.vue`, children: [
164
- {path: 'basic', location: `${appEndpoint}/core/pages/frontend/ComponentsBasic.vue`},
165
- {path: 'advanced', location: `${appEndpoint}/core/pages/frontend/ComponentsAdv.vue`},
166
- {path: 'theme', location: `${appEndpoint}/core/pages/frontend/Theme.vue`},
167
- {path: 'bootstrap', location: `${appEndpoint}/core/pages/frontend/Bootstrap.vue`},
168
- ]},
169
- ]}
170
- ] },
171
- { path: '/:pathMatch(.*)*', name: '404', location: `${appEndpoint}/core/Page404.vue` }
172
-
173
- ]
174
-
175
-
176
- } // end of Constants
177
-