c0ckp1t 1.0.1 → 1.0.4
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.
- package/README.md +48 -8
- package/c0ckp1t-demo/Constants.mjs +40 -37
- package/c0ckp1t-demo/components/sidebar.vue +1 -2
- package/c0ckp1t-demo/docs/Introduction.md +3 -0
- package/c0ckp1t-demo/pages/homepage.vue +29 -10
- package/c0ckp1t-demo/store.mjs +3 -42
- package/components/xjson.vue +1 -1
- package/components/xsection.vue +1 -0
- package/components/xtable-open.vue +1 -1
- package/core/Content.mjs +2 -1
- package/core/GlobalStore.mjs +53 -44
- package/core/PageMain.vue +7 -8
- package/core/VueUtils.mjs +23 -6
- package/core/WsUtils.mjs +2 -3
- package/core/main-offcanvas.vue +2 -2
- package/core/pages/Cache.vue +9 -13
- package/core/pages/Documentation.vue +0 -1
- package/core/pages/frontend/ComponentsAdv.vue +1 -2
- package/core/sfc/info-api.vue +0 -1
- package/core/sfc/scroll-to-top.vue +1 -1
- package/core/ws-client/Connection.mjs +1 -1
- package/core/ws-client/ws-connection.vue +1 -5
- package/index-cdn.html +40 -32
- package/index.html +74 -0
- package/package.json +3 -2
- package/c0ckp1t-demo/pages/devices.vue +0 -63
- package/c0ckp1t-demo/pages/report.vue +0 -63
package/README.md
CHANGED
|
@@ -1,16 +1,56 @@
|
|
|
1
|
-
#
|
|
1
|
+
# C0ckp1t Frontend
|
|
2
2
|
|
|
3
|
+
This project is a Vue.js 3 zero-build web framework using an Islands architecture. HTTP and WebSocket backends are supported. It can compile .vue SFC files at runtime via **vue3-sfc-loader**, this means no Webpack/Vite build step required. There are many reusable components and bootstrap 5.3 theming.
|
|
3
4
|
|
|
4
|
-
A Vue 3 zero-build web dashboard framework with Islands architecture, WebSocket backends, and reusable UI components
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
## References
|
|
7
|
+
|
|
8
|
+
* npm
|
|
9
|
+
* https://www.npmjs.com/package/c0ckp1t
|
|
8
10
|
* cdn
|
|
9
|
-
|
|
11
|
+
* https://www.jsdelivr.com/package/npm/c0ckp1t
|
|
12
|
+
* https://cdn.jsdelivr.net/npm/c0ckp1t@latest/
|
|
13
|
+
|
|
14
|
+
## Overview
|
|
15
|
+
|
|
16
|
+
The main entry point is `GlobalStore.mjs`. You initialize it with a configuration object, and name of where the C0ckp1t Vue Application should be mounted.
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
import Constants from 'C0ckp1tAppConfig'
|
|
20
|
+
|
|
21
|
+
import {api as apiMain} from 'GlobalStore'
|
|
22
|
+
apiMain.init("app-default", Constants)
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## jsfiddle.net example
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## Use Remotely (jsdelivr CDN)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
## Use Locally
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
wget https://registry.npmjs.org/c0ckp1t/-/c0ckp1t-1.0.2.tgz
|
|
39
|
+
tar -zxvf c0ckp1t-1.0.2.tgz
|
|
10
40
|
|
|
41
|
+
# Note expands to package/ folder i.e:
|
|
42
|
+
tar -zxvf c0ckp1t-1.0.2.tgz
|
|
43
|
+
# package/LICENSE
|
|
44
|
+
# package/css/Makefile
|
|
45
|
+
# package/js_ext/Makefile
|
|
46
|
+
# package/css/bootstrap-c0ckp1t.css
|
|
47
|
+
# ...
|
|
48
|
+
```
|
|
11
49
|
|
|
12
|
-
# Releases
|
|
13
50
|
|
|
51
|
+
## Releases
|
|
14
52
|
|
|
15
|
-
* 1.0.
|
|
16
|
-
* 1.0.
|
|
53
|
+
* 1.0.4 - Beta: fixing cdn index-cdn.html making sure it works with jsfiddle.net
|
|
54
|
+
* 1.0.2 - Beta: fixing cdn index-cdn.html example
|
|
55
|
+
* 1.0.1 - Beta: removing `Constants.mjs` dependencies
|
|
56
|
+
* 1.0.0 - Beta: initial release
|
|
@@ -44,24 +44,29 @@ function findHostNamePortProtocol() {
|
|
|
44
44
|
let WITH_CREDENTIALS = false
|
|
45
45
|
const {hostname, port, protocol, isSecure, apiBaseUrl} = findHostNamePortProtocol()
|
|
46
46
|
|
|
47
|
+
const defaultInstanceId = "default";
|
|
48
|
+
const appEndpoint = "https://cdn.jsdelivr.net/npm/c0ckp1t@latest"
|
|
47
49
|
|
|
48
50
|
// ________________________________________________________________________________
|
|
49
51
|
// GLOBAL CONSTANTS
|
|
50
52
|
// ________________________________________________________________________________
|
|
51
53
|
let Constants = {
|
|
52
|
-
|
|
54
|
+
vueRouterModeIsHash: false, // if true, vue router will use hash mode, otherwise history mode
|
|
55
|
+
appEndpoint: appEndpoint,
|
|
56
|
+
apiBaseUrl: apiBaseUrl,
|
|
53
57
|
SERVER_API_URL: `${protocol}//${hostname}:${port}`,
|
|
58
|
+
|
|
54
59
|
WITH_CREDENTIALS: WITH_CREDENTIALS,
|
|
55
60
|
HOSTNAME: hostname,
|
|
56
61
|
PORT: port,
|
|
57
62
|
PROTOCOL: protocol,
|
|
58
63
|
IS_SECURE: isSecure,
|
|
59
64
|
|
|
60
|
-
appName: "C0ckp1t",
|
|
65
|
+
appName: "C0ckp1t Demo App",
|
|
61
66
|
|
|
62
67
|
defaultLogLevel: "INFO",
|
|
63
68
|
defaultLoggerLevels: {
|
|
64
|
-
"VueUtils.
|
|
69
|
+
"VueUtils.mjs": "DEBUG",
|
|
65
70
|
"Connection.mjs": "INFO",
|
|
66
71
|
"default": "INFO",
|
|
67
72
|
"anonymous": "INFO"
|
|
@@ -73,46 +78,44 @@ let Constants = {
|
|
|
73
78
|
{ path: '/', name: 'root', children: [
|
|
74
79
|
{path: '', redirect: '/default/demo/homepage'},
|
|
75
80
|
{path: 'default', children :[
|
|
76
|
-
{path: 'connections', location:
|
|
77
|
-
{path: 'connections/:id', location:
|
|
78
|
-
{path: 'demo', location:
|
|
81
|
+
{path: 'connections', location: `${appEndpoint}/core/pages/Connections.vue`},
|
|
82
|
+
{path: 'connections/:id', location: `${appEndpoint}/core/pages/Connection.vue`},
|
|
83
|
+
{path: 'demo', location: `${appEndpoint}/c0ckp1t-demo/main.vue`, children: [
|
|
79
84
|
{path: '', redirect: "/default/demo/homepage"},
|
|
80
|
-
{path: 'homepage', location:
|
|
81
|
-
{path: 'report', location: "/c0ckp1t-demo/pages/report.vue"},
|
|
82
|
-
{path: 'devices', location: "/c0ckp1t-demo/pages/devices.vue"},
|
|
85
|
+
{path: 'homepage', location: `${appEndpoint}/c0ckp1t-demo/pages/homepage.vue`},
|
|
83
86
|
] },
|
|
84
87
|
]}
|
|
85
88
|
] },
|
|
86
|
-
{ path: '/:pathMatch(.*)*', name: '404', location:
|
|
89
|
+
{ path: '/:pathMatch(.*)*', name: '404', location: `${appEndpoint}/core/Page404.vue` }
|
|
87
90
|
|
|
88
91
|
],
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
}
|
|
92
|
+
defaultInstanceId: defaultInstanceId,
|
|
93
|
+
islands: {
|
|
94
|
+
[defaultInstanceId]: {
|
|
95
|
+
type: "LOCAL",
|
|
96
|
+
instanceId: defaultInstanceId,
|
|
97
|
+
root: {
|
|
98
|
+
icon: "fa-house",
|
|
99
|
+
depth: 0,
|
|
100
|
+
endpoint: "/",
|
|
101
|
+
isLeaf: false,
|
|
102
|
+
isRoot: true,
|
|
103
|
+
name: "",
|
|
104
|
+
path: [],
|
|
105
|
+
children: [
|
|
106
|
+
{
|
|
107
|
+
depth: 1,
|
|
108
|
+
endpoint: `/default/demo`,
|
|
109
|
+
isLeaf: true,
|
|
110
|
+
isRoot: false,
|
|
111
|
+
path: ["demo"],
|
|
112
|
+
name: "demo",
|
|
113
|
+
children: []
|
|
114
|
+
}
|
|
115
|
+
]
|
|
116
|
+
}
|
|
117
|
+
} // end of default island
|
|
118
|
+
}
|
|
116
119
|
|
|
117
120
|
} // end of Constants
|
|
118
121
|
|
|
@@ -47,9 +47,8 @@ logger.debug("[INIT]")
|
|
|
47
47
|
|
|
48
48
|
<!-- !# C0CKP1T_START content -->
|
|
49
49
|
|
|
50
|
+
<span class="ms-2 text-secondary fw-bold">PAGES</span>
|
|
50
51
|
<ul class="nav flex-column">
|
|
51
|
-
<RouterLink class="nav-link d-flex align-items-center gap-2" :to="`${routerEndpoint}/devices`">Devices</RouterLink>
|
|
52
|
-
<RouterLink class="nav-link d-flex align-items-center gap-2" :to="`${routerEndpoint}/report`">Report</RouterLink>
|
|
53
52
|
</ul>
|
|
54
53
|
|
|
55
54
|
<!-- !# C0CKP1T_END content -->
|
|
@@ -13,7 +13,8 @@ import {reactive, computed, ref, onMounted, onUnmounted, defineAsyncComponent, w
|
|
|
13
13
|
import {getLogger} from "Logging";
|
|
14
14
|
import {api as notify} from "NotifyUtils"
|
|
15
15
|
import {store as storeLocal, api as apiLocal, registry} from '../store.mjs'
|
|
16
|
-
import {
|
|
16
|
+
import {store as storeMain, api as apiMain} from 'GlobalStore'
|
|
17
|
+
|
|
17
18
|
// !# C0CKP1T_START imports
|
|
18
19
|
|
|
19
20
|
// !# C0CKP1T_END imports
|
|
@@ -26,6 +27,16 @@ const logger = getLogger(LOG_HEADER)
|
|
|
26
27
|
logger.debug("[INIT]")
|
|
27
28
|
|
|
28
29
|
// !# C0CKP1T_START script
|
|
30
|
+
// ________________________________________________________________________________
|
|
31
|
+
// LOCAL
|
|
32
|
+
// ________________________________________________________________________________
|
|
33
|
+
const local = reactive({
|
|
34
|
+
id: LOG_HEADER,
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
|
|
29
40
|
|
|
30
41
|
// !# C0CKP1T_END script
|
|
31
42
|
|
|
@@ -33,24 +44,32 @@ logger.debug("[INIT]")
|
|
|
33
44
|
// INIT
|
|
34
45
|
// ________________________________________________________________________________
|
|
35
46
|
async function init() {
|
|
36
|
-
|
|
47
|
+
if (registry.state.isReady) {
|
|
37
48
|
// !# C0CKP1T_START init
|
|
38
49
|
|
|
39
50
|
// !# C0CKP1T_END init
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
51
|
+
} else {
|
|
52
|
+
setTimeout(async () => {
|
|
53
|
+
await init()
|
|
54
|
+
}, 1000)
|
|
55
|
+
}
|
|
43
56
|
}
|
|
44
|
-
|
|
57
|
+
|
|
58
|
+
onMounted(async () => {
|
|
59
|
+
init()
|
|
60
|
+
})
|
|
45
61
|
</script>
|
|
46
62
|
|
|
47
63
|
<template>
|
|
48
64
|
|
|
49
|
-
<!-- !# C0CKP1T_START template -->
|
|
50
|
-
|
|
65
|
+
<!-- !# C0CKP1T_START template -->
|
|
66
|
+
<div>
|
|
67
|
+
|
|
68
|
+
<x-section :level="3" k="Homepage" :visible="true">
|
|
51
69
|
|
|
52
|
-
|
|
53
|
-
|
|
70
|
+
</x-section>
|
|
71
|
+
</div>
|
|
72
|
+
<!-- !# C0CKP1T_END template -->
|
|
54
73
|
|
|
55
74
|
</template>
|
|
56
75
|
|
package/c0ckp1t-demo/store.mjs
CHANGED
|
@@ -6,12 +6,10 @@
|
|
|
6
6
|
// ________________________________________________________________________________
|
|
7
7
|
// IMPORT
|
|
8
8
|
// ________________________________________________________________________________
|
|
9
|
-
import {reactive, watch, computed} from 'vue'
|
|
9
|
+
import {reactive, watch, computed, markRaw} from 'vue'
|
|
10
10
|
import {api as notify} from "NotifyUtils"
|
|
11
11
|
import {getLogger} from "Logging";
|
|
12
|
-
import {fromBinary, tryCallLoading, fromByteArray, eventBus} from 'WsUtils'
|
|
13
12
|
import {store as storeMain, api as apiMain} from 'GlobalStore'
|
|
14
|
-
import {endpointToRouterName} from 'JsUtils'
|
|
15
13
|
|
|
16
14
|
// !# C0CKP1T_START import
|
|
17
15
|
|
|
@@ -24,7 +22,7 @@ export const routerEndpoint = `/${instanceId}/demo`
|
|
|
24
22
|
// ________________________________________________________________________________
|
|
25
23
|
// LOGGING
|
|
26
24
|
// ________________________________________________________________________________
|
|
27
|
-
const LOG_HEADER = "/
|
|
25
|
+
const LOG_HEADER = "c0ckp1t-demo/store.mjs"
|
|
28
26
|
const logger = getLogger(LOG_HEADER)
|
|
29
27
|
logger.debug("[INIT]")
|
|
30
28
|
|
|
@@ -37,12 +35,7 @@ export const store = reactive({
|
|
|
37
35
|
id: LOG_HEADER,
|
|
38
36
|
isLoading: false,
|
|
39
37
|
isReady: true,
|
|
40
|
-
|
|
41
|
-
homeDocs: '/v3/workflows/wf/www/docs/Introduction.md',
|
|
42
|
-
endpoint: '/wf',
|
|
43
|
-
|
|
44
|
-
theme: "dark",
|
|
45
|
-
events: [],
|
|
38
|
+
endpoint: "/demo",
|
|
46
39
|
|
|
47
40
|
// !# C0CKP1T_START store
|
|
48
41
|
|
|
@@ -72,38 +65,6 @@ function handleEvent(pkt) {
|
|
|
72
65
|
// API - PUBLIC
|
|
73
66
|
// ________________________________________________________________________________
|
|
74
67
|
export const api = {
|
|
75
|
-
// ________________________________________________________________________________
|
|
76
|
-
// DASHBOARDS
|
|
77
|
-
// ________________________________________________________________________________
|
|
78
|
-
async selectDefaultDashboard() {
|
|
79
|
-
logger.debug(`selectDefaultDashboard - endpoint=${store.endpoint}/homepage`)
|
|
80
|
-
await registry.routeByEndpoint(`${store.endpoint}/homepage`)
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
// ________________________________________________________________________________
|
|
84
|
-
// API: wf
|
|
85
|
-
// ________________________________________________________________________________
|
|
86
|
-
async shutdownById(wfId) {
|
|
87
|
-
const args = ["shutdownById", wfId]
|
|
88
|
-
const resp = await registry.exec(store.endpoint, args)
|
|
89
|
-
logger.debug(resp)
|
|
90
|
-
if (!resp.isOk) {
|
|
91
|
-
notify.badDetails(`[${store.id}] - shutdownById failed`, `${resp.result}`)
|
|
92
|
-
return
|
|
93
|
-
}
|
|
94
|
-
return resp.result // STRING
|
|
95
|
-
},
|
|
96
|
-
async startById(wfId) {
|
|
97
|
-
const args = ["startById", wfId]
|
|
98
|
-
const resp = await registry.exec(store.endpoint, args)
|
|
99
|
-
logger.debug(resp)
|
|
100
|
-
if (!resp.isOk) {
|
|
101
|
-
notify.badDetails(`[${store.id}] - startById failed`, `${resp.result}`)
|
|
102
|
-
return
|
|
103
|
-
}
|
|
104
|
-
return JSON.parse(resp.result) // JSON
|
|
105
|
-
},
|
|
106
|
-
|
|
107
68
|
// !# C0CKP1T_START extra-api
|
|
108
69
|
|
|
109
70
|
// !# C0CKP1T_END
|
package/components/xjson.vue
CHANGED
package/components/xsection.vue
CHANGED
package/core/Content.mjs
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
* This module manages the content articles for the application.
|
|
4
4
|
*/
|
|
5
5
|
import {reactive, ref, markRaw, onMounted, watch, computed, onErrorCaptured} from 'vue'
|
|
6
|
-
import { get, set, del } from '
|
|
6
|
+
// import { get, set, del } from 'idb-keyval'
|
|
7
|
+
import {get, set, del} from '/js_ext/idb-keyval-6.2.2.mjs'
|
|
7
8
|
|
|
8
9
|
export const articlesFiltered = computed(() => {
|
|
9
10
|
return Content.articles.filter(article => {
|
package/core/GlobalStore.mjs
CHANGED
|
@@ -12,7 +12,6 @@ import {markRaw, reactive, watch, defineAsyncComponent, createApp} from 'vue'
|
|
|
12
12
|
import * as VueRouter from 'vue-router'
|
|
13
13
|
import {getLogger} from 'Logging';
|
|
14
14
|
import { transformRoutes} from "./VueUtils.mjs";
|
|
15
|
-
import { Theme} from "./Theme.mjs";
|
|
16
15
|
import IslandDefault from 'IslandDefault'
|
|
17
16
|
import Island from './Island.mjs'
|
|
18
17
|
import {substrAfterFirstSlash} from "JsUtils";
|
|
@@ -230,8 +229,10 @@ export const api = {
|
|
|
230
229
|
async init(id, config) {
|
|
231
230
|
logger.info(`[INIT] - ${id}`)
|
|
232
231
|
|
|
233
|
-
|
|
232
|
+
const defaultInstanceId = config.defaultInstanceId
|
|
234
233
|
store.config = config
|
|
234
|
+
store.name = config.appName || "C0ckp1t"
|
|
235
|
+
const vueRouterModeIsHash = config.vueRouterModeIsHash || true
|
|
235
236
|
|
|
236
237
|
const selector = `#${id}`
|
|
237
238
|
const el = document.querySelector(selector)
|
|
@@ -239,6 +240,7 @@ export const api = {
|
|
|
239
240
|
logger.warn(`Mount point "${selector}" not found`)
|
|
240
241
|
return null
|
|
241
242
|
}
|
|
243
|
+
|
|
242
244
|
//________________________________________________________________________________
|
|
243
245
|
// CREATE APP
|
|
244
246
|
//________________________________________________________________________________
|
|
@@ -253,54 +255,53 @@ export const api = {
|
|
|
253
255
|
console.error('Global error handler:', err, vm, info);
|
|
254
256
|
};
|
|
255
257
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
const islandDefault = new IslandDefault(api, config.defaultConfig)
|
|
258
|
+
// Load default island first
|
|
259
|
+
config.islands[defaultInstanceId].SERVER_API_URL = config.SERVER_API_URL
|
|
260
|
+
const islandDefault = new IslandDefault(api, config.islands[defaultInstanceId])
|
|
260
261
|
store.r[islandDefault.instanceId] = islandDefault
|
|
261
262
|
await islandDefault.init()
|
|
262
263
|
|
|
263
264
|
const router = VueRouter.createRouter({
|
|
264
|
-
history: VueRouter.createWebHistory(),
|
|
265
|
+
history: vueRouterModeIsHash ? VueRouter.createWebHashHistory() : VueRouter.createWebHistory(),
|
|
265
266
|
routes: transformRoutes(islandDefault.loadModule, config.defaultRoutes)
|
|
266
267
|
})
|
|
267
268
|
store.router = markRaw(router)
|
|
268
269
|
|
|
269
270
|
|
|
270
|
-
app.component('app-main', createAsyncComponent(() => islandDefault.loadModule(
|
|
271
|
-
|
|
272
|
-
app.component("ExecButton", defineAsyncComponent(() => islandDefault.loadModule(
|
|
273
|
-
app.component("XInput", defineAsyncComponent(() => islandDefault.loadModule(
|
|
274
|
-
app.component("XLabel", defineAsyncComponent(() => islandDefault.loadModule(
|
|
275
|
-
app.component("XDropdown", defineAsyncComponent(() => islandDefault.loadModule(
|
|
276
|
-
app.component("XDropdown2", defineAsyncComponent(() => islandDefault.loadModule(
|
|
277
|
-
app.component("XSection", defineAsyncComponent(() => islandDefault.loadModule(
|
|
278
|
-
app.component("XTableOpen", defineAsyncComponent(() => islandDefault.loadModule(
|
|
279
|
-
app.component("XCollapse", defineAsyncComponent(() => islandDefault.loadModule(
|
|
280
|
-
app.component("XToggle", defineAsyncComponent(() => islandDefault.loadModule(
|
|
281
|
-
app.component("XToggle3", defineAsyncComponent(() => islandDefault.loadModule(
|
|
282
|
-
app.component("XCheck", defineAsyncComponent(() => islandDefault.loadModule(
|
|
283
|
-
app.component("XCheckbox", defineAsyncComponent(() => islandDefault.loadModule(
|
|
284
|
-
app.component("XTextarea", defineAsyncComponent(() => islandDefault.loadModule(
|
|
285
|
-
app.component("XHidden", defineAsyncComponent(() => islandDefault.loadModule(
|
|
286
|
-
|
|
287
|
-
app.component("XTabs", defineAsyncComponent(() => islandDefault.loadModule(
|
|
288
|
-
app.component("XKv", defineAsyncComponent(() => islandDefault.loadModule(
|
|
289
|
-
app.component("XNav", defineAsyncComponent(() => islandDefault.loadModule(
|
|
290
|
-
app.component("XMap", defineAsyncComponent(() => islandDefault.loadModule(
|
|
291
|
-
app.component("XList", defineAsyncComponent(() => islandDefault.loadModule(
|
|
292
|
-
app.component("XJson", defineAsyncComponent(() => islandDefault.loadModule(
|
|
293
|
-
app.component("XCard", defineAsyncComponent(() => islandDefault.loadModule(
|
|
294
|
-
app.component("XCardH", defineAsyncComponent(() => islandDefault.loadModule(
|
|
295
|
-
app.component("XColor", defineAsyncComponent(() => islandDefault.loadModule(
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
app.component(
|
|
300
|
-
app.component("
|
|
301
|
-
app.component("
|
|
302
|
-
app.component(
|
|
303
|
-
app.component(
|
|
271
|
+
app.component('app-main', createAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/core/PageMain.vue`)))
|
|
272
|
+
|
|
273
|
+
app.component("ExecButton", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/ExecButton.vue`)))
|
|
274
|
+
app.component("XInput", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xinput.vue`)))
|
|
275
|
+
app.component("XLabel", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xlabel.vue`)))
|
|
276
|
+
app.component("XDropdown", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xdropdown.vue`)))
|
|
277
|
+
app.component("XDropdown2", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xdropdown2.vue`)))
|
|
278
|
+
app.component("XSection", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xsection.vue`)))
|
|
279
|
+
app.component("XTableOpen", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xtable-open.vue`)))
|
|
280
|
+
app.component("XCollapse", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xcollapse.vue`)))
|
|
281
|
+
app.component("XToggle", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xtoggle.vue`)))
|
|
282
|
+
app.component("XToggle3", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xtoggle3.vue`)))
|
|
283
|
+
app.component("XCheck", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xcheck.vue`)))
|
|
284
|
+
app.component("XCheckbox", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xcheckbox.vue`)))
|
|
285
|
+
app.component("XTextarea", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xtextarea.vue`)))
|
|
286
|
+
app.component("XHidden", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xhidden.vue`)))
|
|
287
|
+
|
|
288
|
+
app.component("XTabs", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xtabs.vue`)))
|
|
289
|
+
app.component("XKv", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xkv.vue`)))
|
|
290
|
+
app.component("XNav", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xnav.vue`)))
|
|
291
|
+
app.component("XMap", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xmap.vue`)))
|
|
292
|
+
app.component("XList", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xlist.vue`)))
|
|
293
|
+
app.component("XJson", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xjson.vue`)))
|
|
294
|
+
app.component("XCard", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xcard.vue`)))
|
|
295
|
+
app.component("XCardH", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xcard-h.vue`)))
|
|
296
|
+
app.component("XColor", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xcolor.vue`)))
|
|
297
|
+
|
|
298
|
+
app.component('v-ace-editor', defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/vue3-ace-editor.vue`)))
|
|
299
|
+
app.component("XMarkdown", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xmarkdown.vue`)))
|
|
300
|
+
app.component("XSound", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xsound.vue`)))
|
|
301
|
+
app.component("XUpload", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xupload.vue`)))
|
|
302
|
+
app.component("XTree", defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/xtree.vue`)))
|
|
303
|
+
// app.component('CodeMirror', defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/CodeMirror.vue`)))
|
|
304
|
+
// app.component('XTerminal', defineAsyncComponent(() => islandDefault.loadModule(`${config.appEndpoint}/components/XTerminal.vue`)))
|
|
304
305
|
|
|
305
306
|
app.use(router)
|
|
306
307
|
app.mount(selector)
|
|
@@ -311,14 +312,22 @@ export const api = {
|
|
|
311
312
|
store.isReady = true
|
|
312
313
|
}
|
|
313
314
|
|
|
314
|
-
|
|
315
|
+
// Load the rest of the islands
|
|
315
316
|
for (const [key, value] of Object.entries(config.islands || {})) {
|
|
316
|
-
|
|
317
|
+
if(key === defaultInstanceId) {
|
|
318
|
+
continue
|
|
319
|
+
}
|
|
320
|
+
const islandConfig = {
|
|
317
321
|
SERVER_API_URL: config.SERVER_API_URL,
|
|
318
322
|
sfcOptions: islandDefault.sfcOptions,
|
|
319
323
|
...value
|
|
320
324
|
}
|
|
321
|
-
|
|
325
|
+
let island= null
|
|
326
|
+
if(islandConfig.type === "LOCAL") {
|
|
327
|
+
island = new IslandDefault(api, islandConfig)
|
|
328
|
+
} else {
|
|
329
|
+
island = new Island(api, islandConfig)
|
|
330
|
+
}
|
|
322
331
|
store.r[island.instanceId] = island
|
|
323
332
|
await island.init()
|
|
324
333
|
if(currentInstanceId === island.instanceId) {
|
package/core/PageMain.vue
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
// IMPORTS
|
|
8
8
|
//________________________________________________________________________________
|
|
9
9
|
import {reactive, ref, onMounted, onUnmounted, watch, computed, onErrorCaptured} from 'vue'
|
|
10
|
-
import {store as storeMain, api as apiMain
|
|
10
|
+
import {store as storeMain, api as apiMain} from 'GlobalStore'
|
|
11
11
|
import {getLogger} from "Logging";
|
|
12
12
|
|
|
13
13
|
import {api as apiTheme, store as storeTheme} from "./Theme.mjs"
|
|
14
|
-
import PageFallback from "
|
|
14
|
+
import PageFallback from "./PageFallback.vue"
|
|
15
15
|
import MainOffcanvas from "./main-offcanvas.vue";
|
|
16
16
|
|
|
17
17
|
|
|
@@ -94,9 +94,9 @@ const mainContentStyle = computed(() => ({
|
|
|
94
94
|
<div class="container">
|
|
95
95
|
|
|
96
96
|
<a class="navbar-brand" @click.prevent="apiMain.selectLogo()" >
|
|
97
|
-
<span class="me-2 text-warning" v-if="
|
|
98
|
-
<img src="
|
|
99
|
-
<img src="
|
|
97
|
+
<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>
|
|
100
100
|
<span class="text-warning fw-bold ms-2 brand-text">{{ storeMain.name }}</span>
|
|
101
101
|
</a>
|
|
102
102
|
|
|
@@ -139,11 +139,11 @@ const mainContentStyle = computed(() => ({
|
|
|
139
139
|
<footer class="container-fluid p-4 bg-body-tertiary border-top">
|
|
140
140
|
<div class="row mt-4 align-items-center justify-content-center">
|
|
141
141
|
<div class="col-6 d-flex flex-column align-items-center">
|
|
142
|
-
<img src="
|
|
142
|
+
<img src="./img/logo_v1.svg" width="24" height="24" class="d-block mb-3" alt="Product logo" role="img" />
|
|
143
143
|
<small class="d-block mb-3 text-body-secondary">© 2017–2025</small>
|
|
144
144
|
<small class="d-block mb-3 text-body-secondary">Product of <a href="https://sorsha.com">sorsha.com</a></small>
|
|
145
145
|
<small class="d-block mb-3 text-body-secondary">Made in USA</small>
|
|
146
|
-
<img src="
|
|
146
|
+
<img src="./img/Flag_of_the_United_States.svg" width="24" height="24" class="d-block mb-3" alt="Product logo" role="img" />
|
|
147
147
|
</div>
|
|
148
148
|
</div>
|
|
149
149
|
</footer>
|
|
@@ -162,7 +162,6 @@ const mainContentStyle = computed(() => ({
|
|
|
162
162
|
color: var(--bs-body-color);
|
|
163
163
|
background-color: var(--bs-body-bg); /* Explicitly set background to match body */
|
|
164
164
|
min-height: 100vh;
|
|
165
|
-
overflow-x: hidden; /* Prevent horizontal scrollbar when sidebar is open */
|
|
166
165
|
}
|
|
167
166
|
|
|
168
167
|
|
package/core/VueUtils.mjs
CHANGED
|
@@ -18,7 +18,7 @@ import * as Vue from 'vue'
|
|
|
18
18
|
import * as VueRouter from 'vue-router'
|
|
19
19
|
import {loadModule, vueVersion} from 'vue3-sfc-loader'
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
import * as jsonViewer from 'json-viewer'
|
|
22
22
|
|
|
23
23
|
import * as Logging from "Logging";
|
|
24
24
|
import * as GlobalStore from 'GlobalStore'
|
|
@@ -36,7 +36,7 @@ const katexTags = ['mn', 'mfrac', 'mrow', 'annotation', 'semantics', 'math',
|
|
|
36
36
|
// ________________________________________________________________________________
|
|
37
37
|
const LOG_HEADER = `VueUtils.mjs`
|
|
38
38
|
const logger = Logging.getLogger(LOG_HEADER)
|
|
39
|
-
logger.debug("
|
|
39
|
+
logger.debug("INIT")
|
|
40
40
|
logger.info(`vue3-sfc-loader vue version ${vueVersion}`)
|
|
41
41
|
logger.info(`vue.js version ${Vue.version}`)
|
|
42
42
|
|
|
@@ -66,6 +66,8 @@ const options = {
|
|
|
66
66
|
Logging: Logging,
|
|
67
67
|
NotifyUtils: NotifyUtils,
|
|
68
68
|
GlobalStore: GlobalStore,
|
|
69
|
+
|
|
70
|
+
'json-viewer': jsonViewer,
|
|
69
71
|
},
|
|
70
72
|
|
|
71
73
|
async getFile(path, type) {
|
|
@@ -80,6 +82,9 @@ const options = {
|
|
|
80
82
|
logger.debug(`[getFile] - cached - ${path} - type=${type}`)
|
|
81
83
|
const cached = sourceCode[path];
|
|
82
84
|
res = new Response(cached.code, {status: 200, statusText: 'OK'});
|
|
85
|
+
} else if (path.startsWith("http") || path.startsWith("HTTP")) {
|
|
86
|
+
logger.debug(`[getFile] - default - ${path} - ${type}`)
|
|
87
|
+
res = await GlobalStore.store.r["default"].resolver(path, type)
|
|
83
88
|
} else if (GlobalStore.store.r[instanceId]) {
|
|
84
89
|
logger.debug(`[getFile] - instance - ${path} - ${type}`)
|
|
85
90
|
const pathAfterInstanceId = path.replace("/" + instanceId, "")
|
|
@@ -90,7 +95,7 @@ const options = {
|
|
|
90
95
|
}
|
|
91
96
|
|
|
92
97
|
return {
|
|
93
|
-
type: type,
|
|
98
|
+
// type: type,
|
|
94
99
|
getContentData: asBinary => {
|
|
95
100
|
if (asBinary) {
|
|
96
101
|
return res.arrayBuffer();
|
|
@@ -121,11 +126,23 @@ const options = {
|
|
|
121
126
|
|
|
122
127
|
switch (type) {
|
|
123
128
|
case '.png':
|
|
124
|
-
return getContentData(true)
|
|
129
|
+
return getContentData(true).then(buffer => {
|
|
130
|
+
const bytes = new Uint8Array(buffer);
|
|
131
|
+
let binary = '';
|
|
132
|
+
for (let i = 0; i < bytes.byteLength; i++) {
|
|
133
|
+
binary += String.fromCharCode(bytes[i]);
|
|
134
|
+
}
|
|
135
|
+
return 'data:image/png;base64,' + btoa(binary);
|
|
136
|
+
});
|
|
125
137
|
case '.svg':
|
|
126
|
-
return getContentData(
|
|
138
|
+
return getContentData(true).then(arrayBuffer => {
|
|
139
|
+
const blob = new Blob([arrayBuffer], { type: 'image/svg+xml' });
|
|
140
|
+
return URL.createObjectURL(blob);
|
|
141
|
+
});
|
|
127
142
|
case '.json':
|
|
128
|
-
return
|
|
143
|
+
return getContentData(false).then(text => {
|
|
144
|
+
return JSON.parse(text)
|
|
145
|
+
});
|
|
129
146
|
}
|
|
130
147
|
},
|
|
131
148
|
|
package/core/WsUtils.mjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
import {encode, decode} from '/js_ext/msgpack.mjs'
|
|
2
|
+
import {encode, decode} from 'msgpack'
|
|
4
3
|
import {api as notify} from 'NotifyUtils'
|
|
5
4
|
|
|
6
5
|
// https://github.com/developit/mitt
|
|
7
|
-
import mitt from '
|
|
6
|
+
import mitt from 'mitt'
|
|
8
7
|
export const eventBus = mitt();
|
|
9
8
|
|
|
10
9
|
//________________________________________________________________________________
|
package/core/main-offcanvas.vue
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
import {reactive, markRaw, onMounted, ref, defineAsyncComponent, watch} from 'vue'
|
|
11
11
|
import {store as storeMain, api as apiMain } from 'GlobalStore'
|
|
12
12
|
import {getLogger} from "Logging";
|
|
13
|
-
import node from "
|
|
14
|
-
import ConnectionHeader from "
|
|
13
|
+
import node from "./nodes/node.vue"
|
|
14
|
+
import ConnectionHeader from "./sfc/connection-header.vue"
|
|
15
15
|
// ________________________________________________________________________________
|
|
16
16
|
// LOGGING
|
|
17
17
|
// ________________________________________________________________________________
|
package/core/pages/Cache.vue
CHANGED
|
@@ -39,19 +39,15 @@ const local = reactive({
|
|
|
39
39
|
async function refresh() {
|
|
40
40
|
logger.info(`refresh()`)
|
|
41
41
|
const cache = options.moduleCache
|
|
42
|
-
|
|
43
|
-
console.log(options.sourceCode)
|
|
44
|
-
// for (const key of Object.keys(cache)) {
|
|
45
|
-
// if(Reflect.has(cache[key], "promise")) {
|
|
46
|
-
// logger.info(`${key} NOT loaded - awaiting`)
|
|
47
|
-
// await cache[key].promise
|
|
48
|
-
// }
|
|
49
|
-
// }
|
|
42
|
+
|
|
50
43
|
local.moduleCache = markRaw(options.moduleCache)
|
|
51
44
|
local.sourceCode = markRaw(options.sourceCode)
|
|
52
45
|
|
|
53
46
|
local.es6Modules = Object.keys(local.moduleCache)
|
|
54
|
-
.filter(key =>
|
|
47
|
+
.filter(key => {
|
|
48
|
+
const val = local.moduleCache[key]
|
|
49
|
+
return typeof val === 'object' && val !== null && !Reflect.has(val, "__name")
|
|
50
|
+
})
|
|
55
51
|
.map(key => {
|
|
56
52
|
const isPromise = Reflect.has(cache[key], "promise")
|
|
57
53
|
let sourceCode = null
|
|
@@ -66,7 +62,10 @@ async function refresh() {
|
|
|
66
62
|
}).sort((a, b) => a.key.localeCompare(b.key))
|
|
67
63
|
|
|
68
64
|
local.vueComponents = Object.keys(local.moduleCache)
|
|
69
|
-
.filter(key =>
|
|
65
|
+
.filter(key => {
|
|
66
|
+
const val = local.moduleCache[key]
|
|
67
|
+
return typeof val === 'object' && val !== null && Reflect.has(val, "__name")
|
|
68
|
+
})
|
|
70
69
|
.map(key => {
|
|
71
70
|
let sourceCode = null
|
|
72
71
|
if (local.sourceCode[key] !== undefined && local.sourceCode[key].hasOwnProperty("code")) {
|
|
@@ -85,11 +84,8 @@ async function loadComponent(key) {
|
|
|
85
84
|
}
|
|
86
85
|
|
|
87
86
|
async function loadRoutes() {
|
|
88
|
-
console.log("loadroutes")
|
|
89
|
-
console.log("loadroutes")
|
|
90
87
|
const routes = apiMain.getRoutes()
|
|
91
88
|
local.routes = JSON.parse(JSON.stringify(routes)).sort((a, b) => a.path.localeCompare(b.path))
|
|
92
|
-
console.log(router.getRoutes().sort((a, b) => a.path.localeCompare(b.path)))
|
|
93
89
|
}
|
|
94
90
|
|
|
95
91
|
//________________________________________________________________________________
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
Note: This depends on vue-router being configured with
|
|
6
6
|
{ path: 'documentation', redirect: '/default/documentation/Introduction.md'},
|
|
7
7
|
{ path: 'documentation/:pathMatch(.*)*', location:'core/pages/page-documentation.vue'}
|
|
8
|
-
See Constants.mjs
|
|
9
8
|
|
|
10
9
|
*/
|
|
11
10
|
//________________________________________________________________________________
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
import {reactive, computed, ref, onMounted, onUnmounted, defineAsyncComponent, watch} from 'vue'
|
|
13
13
|
import {getLogger} from "Logging";
|
|
14
14
|
// !# C0CKP1T_START imports
|
|
15
|
-
import Constants from "Constants";
|
|
16
15
|
import ComponentView from "./component-view.vue";
|
|
17
16
|
import XTerminal from "/components/xterminal.vue";
|
|
18
17
|
import CodeMirror from "/components/code-mirror.vue";
|
|
@@ -184,7 +183,7 @@ async function delay() {
|
|
|
184
183
|
|
|
185
184
|
<ComponentView name="x-sound" url="/components/xsound.vue">
|
|
186
185
|
<XSound
|
|
187
|
-
|
|
186
|
+
url="https://cdn.jsdelivr.net/npm/c0ckp1t@1.0.2/core/img/state-uniqueId-8k.wav"
|
|
188
187
|
id="stateId" :autoLoad="true"/>
|
|
189
188
|
</ComponentView>
|
|
190
189
|
|
package/core/sfc/info-api.vue
CHANGED
|
@@ -7,7 +7,6 @@ import {reactive, onMounted, onUnmounted, defineAsyncComponent, watch, computed}
|
|
|
7
7
|
import {store as storeMain} from 'GlobalStore'
|
|
8
8
|
import {getLogger} from "Logging";
|
|
9
9
|
import {groupObjectByProperty} from "JsUtils";
|
|
10
|
-
import ExecButton from "../../components/ExecButton.vue";
|
|
11
10
|
|
|
12
11
|
const props = defineProps({
|
|
13
12
|
endpoint: String,
|
|
@@ -10,7 +10,7 @@ import WsClient, {ConnectionLookUp, ConnectionStates, getCodeDescription} from '
|
|
|
10
10
|
|
|
11
11
|
// https://stately.ai/docs/xstate
|
|
12
12
|
// This is XState version 4 (specifically appears to be v4.x).
|
|
13
|
-
import {actions, interpret, createMachine} from "
|
|
13
|
+
import {actions, interpret, createMachine} from "xstate";
|
|
14
14
|
import {AuthNState} from "./AuthNState.mjs"
|
|
15
15
|
|
|
16
16
|
const {map, filter } = rxjs.operators;
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { ref, reactive, watch, onMounted, computed } from 'vue'
|
|
3
3
|
|
|
4
|
-
|
|
5
4
|
import { actions, state, connStateString, url, isAuthenticated, tryCallLoading} from "WsInterface";
|
|
6
|
-
|
|
7
|
-
// import {store, methods} from 'GlobalStore'
|
|
8
|
-
import Constants from 'Constants'
|
|
9
5
|
import {getLogger} from "Logging";
|
|
10
6
|
import {store as storeSession} from "./Session.mjs";
|
|
11
7
|
|
|
@@ -22,7 +18,7 @@ const backoffMsMax = 20000;
|
|
|
22
18
|
|
|
23
19
|
const local = reactive({
|
|
24
20
|
isLoading: false,
|
|
25
|
-
isDev:
|
|
21
|
+
isDev: false,
|
|
26
22
|
|
|
27
23
|
retries: 0,
|
|
28
24
|
retryEnable: true,
|
package/index-cdn.html
CHANGED
|
@@ -5,32 +5,37 @@
|
|
|
5
5
|
<meta charset="utf-8">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
7
|
<title>C0ckp1t</title>
|
|
8
|
-
<link rel="icon" href="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
9
|
-
<link rel="icon" href="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
10
|
-
<link rel="icon" href="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
8
|
+
<link rel="icon" href="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/favicon-32x32.png" sizes="32x32" type="image/png">
|
|
9
|
+
<link rel="icon" href="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/favicon-64x64.png" sizes="64x64" type="image/png">
|
|
10
|
+
<link rel="icon" href="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/favicon-192x192.png" sizes="192x192" type="image/png">
|
|
11
11
|
|
|
12
|
-
<link href="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
13
|
-
<link href="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
14
|
-
<link href="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
15
|
-
<link href="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
16
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
17
|
-
<link href="
|
|
12
|
+
<link href="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/css/bootstrap.min.css" type="text/css" rel="stylesheet">
|
|
13
|
+
<link href="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/css/fontawesome/solid.min.css" rel="stylesheet">
|
|
14
|
+
<link href="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/css/fontawesome/fontawesome.min.css" rel="stylesheet">
|
|
15
|
+
<link href="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/highlight/stackoverflow-dark.min.css" rel="stylesheet">
|
|
16
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/markdown/katex.min.css">
|
|
17
|
+
<link href="/style.css" type="text/css" rel="stylesheet">
|
|
18
18
|
|
|
19
19
|
<script type="importmap">
|
|
20
20
|
{
|
|
21
21
|
"imports": {
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"vue
|
|
33
|
-
"
|
|
22
|
+
"C0ckp1tDemoConfig": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/c0ckp1t-demo/Constants.mjs",
|
|
23
|
+
"C0ckp1tAppConfig": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/C0ckp1tAppConfig.mjs",
|
|
24
|
+
"Logging": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/core/Logging.mjs",
|
|
25
|
+
"JsUtils": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/core/JsUtils.mjs",
|
|
26
|
+
"GlobalStore": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/core/GlobalStore.mjs",
|
|
27
|
+
"NotifyUtils": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/core/notify/NotifyUtils.mjs",
|
|
28
|
+
"WsUtils": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/core/WsUtils.mjs",
|
|
29
|
+
"IslandDefault": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/core/IslandDefault.mjs",
|
|
30
|
+
|
|
31
|
+
"vue3-sfc-loader": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/vue3-sfc-loader.esm.js",
|
|
32
|
+
"vue": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/vue.esm-browser.prod.min.js",
|
|
33
|
+
"vue-router": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/vue-router.esm-browser.prod.js",
|
|
34
|
+
"idb-keyval": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/idb-keyval-6.2.2.mjs",
|
|
35
|
+
"mitt": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/mitt.mjs",
|
|
36
|
+
"msgpack": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/msgpack.mjs",
|
|
37
|
+
"xstate": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/xstate.web.mjs",
|
|
38
|
+
"json-viewer": "https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/json-viewer.bundle.js"
|
|
34
39
|
}
|
|
35
40
|
}
|
|
36
41
|
</script>
|
|
@@ -44,20 +49,23 @@
|
|
|
44
49
|
</body>
|
|
45
50
|
|
|
46
51
|
<script type="module">
|
|
47
|
-
import
|
|
52
|
+
import {init as initLogger} from 'Logging';
|
|
53
|
+
import Constants from 'C0ckp1tDemoConfig'
|
|
54
|
+
initLogger(Constants)
|
|
55
|
+
|
|
48
56
|
import {api as apiMain} from 'GlobalStore'
|
|
49
57
|
apiMain.init("app-default", Constants)
|
|
50
58
|
</script>
|
|
51
59
|
|
|
52
60
|
<!-- =================== SCRIPTS =================== -->
|
|
53
|
-
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
54
|
-
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
55
|
-
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
56
|
-
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
57
|
-
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
58
|
-
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
59
|
-
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
60
|
-
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
61
|
-
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
62
|
-
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@
|
|
61
|
+
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/loglevel.min.js"></script>
|
|
62
|
+
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/loglevel-plugin-prefix.min.js"></script>
|
|
63
|
+
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/bootstrap.bundle.min.js"></script>
|
|
64
|
+
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/highlight/highlight.min.js"></script>
|
|
65
|
+
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/markdown/katex.min.js"></script>
|
|
66
|
+
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/markdown/markdown-it.min.js"></script>
|
|
67
|
+
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/markdown/markdownItAnchor.umd.js"></script>
|
|
68
|
+
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/rxjs.umd.min.js"></script>
|
|
69
|
+
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/moment.min.js"></script>
|
|
70
|
+
<script src="https://cdn.jsdelivr.net/npm/c0ckp1t@latest/js_ext/ace-editor/ace.js" type="text/javascript" charset="utf-8"></script>
|
|
63
71
|
</html>
|
package/index.html
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
7
|
+
<title>C0ckp1t</title>
|
|
8
|
+
<link rel="icon" href="/favicon-32x32.png" sizes="32x32" type="image/png">
|
|
9
|
+
<link rel="icon" href="/favicon-64x64.png" sizes="64x64" type="image/png">
|
|
10
|
+
<link rel="icon" href="/favicon-192x192.png" sizes="192x192" type="image/png">
|
|
11
|
+
|
|
12
|
+
<link href="/css/bootstrap.min.css" type="text/css" rel="stylesheet">
|
|
13
|
+
<link href="/css/fontawesome/solid.min.css" rel="stylesheet">
|
|
14
|
+
<link href="/css/fontawesome/fontawesome.min.css" rel="stylesheet">
|
|
15
|
+
<link href="/js_ext/highlight/stackoverflow-dark.min.css" rel="stylesheet">
|
|
16
|
+
<link rel="stylesheet" href="/js_ext/markdown/katex.min.css">
|
|
17
|
+
<link href="/style.css" type="text/css" rel="stylesheet">
|
|
18
|
+
|
|
19
|
+
<script type="importmap">
|
|
20
|
+
{
|
|
21
|
+
"imports": {
|
|
22
|
+
"C0ckp1tAppConfig": "/C0ckp1tAppConfig.mjs",
|
|
23
|
+
"C0ckp1tDemoConfig": "/c0ckp1t-demo/Constants.mjs",
|
|
24
|
+
"Logging": "/core/Logging.mjs",
|
|
25
|
+
"JsUtils": "/core/JsUtils.mjs",
|
|
26
|
+
"GlobalStore": "/core/GlobalStore.mjs",
|
|
27
|
+
"NotifyUtils": "/core/notify/NotifyUtils.mjs",
|
|
28
|
+
"WsUtils": "/core/WsUtils.mjs",
|
|
29
|
+
"IslandDefault": "/core/IslandDefault.mjs",
|
|
30
|
+
|
|
31
|
+
"vue3-sfc-loader": "/js_ext/vue3-sfc-loader.esm.js",
|
|
32
|
+
"vue": "/js_ext/vue.esm-browser.prod.min.js",
|
|
33
|
+
"vue-router": "/js_ext/vue-router.esm-browser.prod.js",
|
|
34
|
+
"idb-keyval": "/js_ext/idb-keyval-6.2.2.mjs",
|
|
35
|
+
"mitt": "/js_ext/mitt.mjs",
|
|
36
|
+
"msgpack": "/js_ext/msgpack.mjs",
|
|
37
|
+
"xstate": "/js_ext/xstate.web.mjs",
|
|
38
|
+
"json-viewer": "/js_ext/json-viewer.bundle.js"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
</head>
|
|
44
|
+
|
|
45
|
+
<body class="main-body">
|
|
46
|
+
<div id="app-default">
|
|
47
|
+
<app-main></app-main>
|
|
48
|
+
</div>
|
|
49
|
+
</body>
|
|
50
|
+
|
|
51
|
+
<script type="module">
|
|
52
|
+
import {init as initLogger} from 'Logging';
|
|
53
|
+
import Constants from 'C0ckp1tAppConfig'
|
|
54
|
+
initLogger(Constants)
|
|
55
|
+
|
|
56
|
+
import {api as apiMain} from 'GlobalStore'
|
|
57
|
+
apiMain.init("app-default", Constants)
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<!-- =================== SCRIPTS =================== -->
|
|
61
|
+
<script src="/js_ext/loglevel.min.js"></script>
|
|
62
|
+
<script src="/js_ext/loglevel-plugin-prefix.min.js"></script>
|
|
63
|
+
|
|
64
|
+
<script src="/js_ext/bootstrap.bundle.min.js"></script>
|
|
65
|
+
|
|
66
|
+
<script src="/js_ext/highlight/highlight.min.js"></script>
|
|
67
|
+
<script src="/js_ext/markdown/katex.min.js"></script>
|
|
68
|
+
<script src="/js_ext/markdown/markdown-it.min.js"></script>
|
|
69
|
+
<script src="/js_ext/markdown/markdownItAnchor.umd.js"></script>
|
|
70
|
+
|
|
71
|
+
<script src="/js_ext/rxjs.umd.min.js"></script>
|
|
72
|
+
<script src="/js_ext/moment.min.js"></script>
|
|
73
|
+
<script src="/js_ext/ace-editor/ace.js" type="text/javascript" charset="utf-8"></script>
|
|
74
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c0ckp1t",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
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",
|
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
],
|
|
25
25
|
"files": [
|
|
26
26
|
"index-cdn.html",
|
|
27
|
-
"
|
|
27
|
+
"index.html",
|
|
28
|
+
"Constants2.mjs",
|
|
28
29
|
"style.css",
|
|
29
30
|
"favicon.ico",
|
|
30
31
|
"favicon-32x32.png",
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
/*
|
|
3
|
-
[VARS] - name, init, imports, template, script, style
|
|
4
|
-
|
|
5
|
-
Usage:
|
|
6
|
-
const PageXXXX = defineAsyncComponent(() => import("/v3/workflows/wf/www/pages/homepage.vue"))
|
|
7
|
-
<page-xxxx></page-xxxx>
|
|
8
|
-
*/
|
|
9
|
-
// ________________________________________________________________________________
|
|
10
|
-
// IMPORTS
|
|
11
|
-
// ________________________________________________________________________________
|
|
12
|
-
import {reactive, computed, ref, onMounted, onUnmounted, defineAsyncComponent, watch} from 'vue'
|
|
13
|
-
import {getLogger} from "Logging";
|
|
14
|
-
import {api as notify} from "NotifyUtils"
|
|
15
|
-
import {store as storeLocal, api as apiLocal, registry} from '../store.mjs'
|
|
16
|
-
import { store as storeMain, api as apiMain} from 'GlobalStore'
|
|
17
|
-
// !# C0CKP1T_START imports
|
|
18
|
-
|
|
19
|
-
// !# C0CKP1T_END imports
|
|
20
|
-
|
|
21
|
-
// ________________________________________________________________________________
|
|
22
|
-
// LOGGING
|
|
23
|
-
// ________________________________________________________________________________
|
|
24
|
-
const LOG_HEADER = "pages/homepage.vue"
|
|
25
|
-
const logger = getLogger(LOG_HEADER)
|
|
26
|
-
logger.debug("[INIT]")
|
|
27
|
-
|
|
28
|
-
// !# C0CKP1T_START script
|
|
29
|
-
|
|
30
|
-
// !# C0CKP1T_END script
|
|
31
|
-
|
|
32
|
-
// ________________________________________________________________________________
|
|
33
|
-
// INIT
|
|
34
|
-
// ________________________________________________________________________________
|
|
35
|
-
async function init() {
|
|
36
|
-
if (registry.state.isReady) {
|
|
37
|
-
// !# C0CKP1T_START init
|
|
38
|
-
|
|
39
|
-
// !# C0CKP1T_END init
|
|
40
|
-
} else {
|
|
41
|
-
setTimeout(async () => { await init() }, 1000)
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
onMounted(async () => { init() })
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<template>
|
|
48
|
-
|
|
49
|
-
<!-- !# C0CKP1T_START template -->
|
|
50
|
-
<x-section extra="fs-3" :k="`Devices(endpointId=${storeLocal.endpoint})`" :visible="true">
|
|
51
|
-
|
|
52
|
-
</x-section>
|
|
53
|
-
<!-- !# C0CKP1T_END template -->
|
|
54
|
-
|
|
55
|
-
</template>
|
|
56
|
-
|
|
57
|
-
<style scoped>
|
|
58
|
-
/* !# C0CKP1T_START style */
|
|
59
|
-
|
|
60
|
-
/* !# C0CKP1T_END style */
|
|
61
|
-
</style>
|
|
62
|
-
|
|
63
|
-
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
/*
|
|
3
|
-
[VARS] - name, init, imports, template, script, style
|
|
4
|
-
|
|
5
|
-
Usage:
|
|
6
|
-
const PageXXXX = defineAsyncComponent(() => import("/v3/workflows/wf/www/pages/homepage.vue"))
|
|
7
|
-
<page-xxxx></page-xxxx>
|
|
8
|
-
*/
|
|
9
|
-
// ________________________________________________________________________________
|
|
10
|
-
// IMPORTS
|
|
11
|
-
// ________________________________________________________________________________
|
|
12
|
-
import {reactive, computed, ref, onMounted, onUnmounted, defineAsyncComponent, watch} from 'vue'
|
|
13
|
-
import {getLogger} from "Logging";
|
|
14
|
-
import {api as notify} from "NotifyUtils"
|
|
15
|
-
import {store as storeLocal, api as apiLocal, registry} from '../store.mjs'
|
|
16
|
-
import { store as storeMain, api as apiMain} from 'GlobalStore'
|
|
17
|
-
// !# C0CKP1T_START imports
|
|
18
|
-
|
|
19
|
-
// !# C0CKP1T_END imports
|
|
20
|
-
|
|
21
|
-
// ________________________________________________________________________________
|
|
22
|
-
// LOGGING
|
|
23
|
-
// ________________________________________________________________________________
|
|
24
|
-
const LOG_HEADER = "pages/homepage.vue"
|
|
25
|
-
const logger = getLogger(LOG_HEADER)
|
|
26
|
-
logger.debug("[INIT]")
|
|
27
|
-
|
|
28
|
-
// !# C0CKP1T_START script
|
|
29
|
-
|
|
30
|
-
// !# C0CKP1T_END script
|
|
31
|
-
|
|
32
|
-
// ________________________________________________________________________________
|
|
33
|
-
// INIT
|
|
34
|
-
// ________________________________________________________________________________
|
|
35
|
-
async function init() {
|
|
36
|
-
if (registry.state.isReady) {
|
|
37
|
-
// !# C0CKP1T_START init
|
|
38
|
-
|
|
39
|
-
// !# C0CKP1T_END init
|
|
40
|
-
} else {
|
|
41
|
-
setTimeout(async () => { await init() }, 1000)
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
onMounted(async () => { init() })
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<template>
|
|
48
|
-
|
|
49
|
-
<!-- !# C0CKP1T_START template -->
|
|
50
|
-
<x-section extra="fs-3" :k="`Report (endpointId=${storeLocal.endpoint})`" :visible="true">
|
|
51
|
-
|
|
52
|
-
</x-section>
|
|
53
|
-
<!-- !# C0CKP1T_END template -->
|
|
54
|
-
|
|
55
|
-
</template>
|
|
56
|
-
|
|
57
|
-
<style scoped>
|
|
58
|
-
/* !# C0CKP1T_START style */
|
|
59
|
-
|
|
60
|
-
/* !# C0CKP1T_END style */
|
|
61
|
-
</style>
|
|
62
|
-
|
|
63
|
-
|