c0ckp1t 1.0.5 → 1.0.10
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/CdnConfig.mjs +177 -0
- package/DefaultConfig.mjs +177 -0
- package/README.md +2 -1
- package/c0ckp1t-demo/C0ckp1tConfig.mjs +68 -0
- package/c0ckp1t-demo/CdnConfig.mjs +68 -0
- package/c0ckp1t-demo/store.mjs +4 -4
- package/components/xjson.vue +1 -2
- package/components/xsound.vue +1 -1
- package/core/Content.mjs +1 -1
- package/core/CoreUtils.mjs +77 -0
- package/core/GlobalStore.mjs +93 -84
- package/core/Island.mjs +0 -3
- package/core/IslandDefault.mjs +4 -23
- package/core/JsUtils.mjs +1 -0
- package/core/Logging.mjs +14 -3
- package/core/Page404.vue +64 -34
- package/core/PageFallback.vue +7 -7
- package/core/VueUtils.mjs +25 -4
- package/core/pages/Cache.vue +9 -9
- package/core/pages/Connection.vue +2 -2
- package/core/pages/connections/connection-header-details.vue +1 -1
- package/core/pages/connections/page-connection.vue +3 -2
- package/core/pages/frontend/Components.vue +1 -1
- package/core/pages/frontend/ComponentsBasic.vue +1 -1
- package/core/pages/frontend/Theme.vue +1 -1
- package/index-cdn.html +17 -11
- package/index.html +25 -15
- package/package.json +3 -2
- package/style.css +1 -0
- package/c0ckp1t-demo/Constants.mjs +0 -125
package/CdnConfig.mjs
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
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
|
+
|
|
@@ -0,0 +1,177 @@
|
|
|
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 = "";
|
|
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
|
+
|
package/README.md
CHANGED
|
@@ -50,7 +50,8 @@ tar -zxvf c0ckp1t-1.0.2.tgz
|
|
|
50
50
|
|
|
51
51
|
## Releases
|
|
52
52
|
|
|
53
|
-
* 1.0.
|
|
53
|
+
* 1.0.10 - Beta: fixing cdn index-cdn.html making sure it works with jsfiddle.net
|
|
54
|
+
* Had to publish many times to get CDN working with different configurations
|
|
54
55
|
* 1.0.2 - Beta: fixing cdn index-cdn.html example
|
|
55
56
|
* 1.0.1 - Beta: removing `Constants.mjs` dependencies
|
|
56
57
|
* 1.0.0 - Beta: initial release
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// ________________________________________________________________________________
|
|
2
|
+
// Properties
|
|
3
|
+
// ________________________________________________________________________________
|
|
4
|
+
// XMLHttpRequest from a different domain cannot set cookie values for their own
|
|
5
|
+
// domain unless withCredentials is set to true before making the request.
|
|
6
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials
|
|
7
|
+
const WITH_CREDENTIALS = false
|
|
8
|
+
// Note: VueUtils requires this to be 'default'
|
|
9
|
+
const instanceId = "demo";
|
|
10
|
+
// Used for requestion app components and files
|
|
11
|
+
const appEndpoint = "";
|
|
12
|
+
|
|
13
|
+
// ________________________________________________________________________________
|
|
14
|
+
// GLOBAL CONSTANTS
|
|
15
|
+
// ________________________________________________________________________________
|
|
16
|
+
export default {
|
|
17
|
+
isDev: true,
|
|
18
|
+
WITH_CREDENTIALS: WITH_CREDENTIALS,
|
|
19
|
+
|
|
20
|
+
instanceId: instanceId,
|
|
21
|
+
type: "LOCAL",
|
|
22
|
+
appName: "C0ckp1t Demo",
|
|
23
|
+
appEndpoint: appEndpoint,
|
|
24
|
+
|
|
25
|
+
// This creates the navigation tree
|
|
26
|
+
root: {
|
|
27
|
+
icon: "fa-house",
|
|
28
|
+
depth: 0,
|
|
29
|
+
endpoint: "/",
|
|
30
|
+
isLeaf: false,
|
|
31
|
+
isRoot: true,
|
|
32
|
+
name: "",
|
|
33
|
+
path: [],
|
|
34
|
+
children: [
|
|
35
|
+
{
|
|
36
|
+
depth: 1,
|
|
37
|
+
endpoint: `/${instanceId}/homepage`,
|
|
38
|
+
isLeaf: true,
|
|
39
|
+
isRoot: false,
|
|
40
|
+
path: ["homepage"],
|
|
41
|
+
name: "homepage",
|
|
42
|
+
children: []
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
depth: 1,
|
|
46
|
+
endpoint: `/${instanceId}/docs`,
|
|
47
|
+
isLeaf: true,
|
|
48
|
+
isRoot: false,
|
|
49
|
+
path: ["docs"],
|
|
50
|
+
name: "docs",
|
|
51
|
+
children: []
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
// This is used to create routes for the vue router
|
|
57
|
+
routes: [
|
|
58
|
+
{path: instanceId, location: `${appEndpoint}/c0ckp1t-demo/main.vue`, children: [
|
|
59
|
+
{path: '', redirect: `/${instanceId}/homepage`},
|
|
60
|
+
{path: 'homepage', location: `${appEndpoint}/c0ckp1t-demo/pages/homepage.vue`},
|
|
61
|
+
{path: 'docs', redirect: `/${instanceId}/docs/Introduction.md`},
|
|
62
|
+
{path: 'docs/:pathMatch(.*)*', location: `${appEndpoint}/core/pages/Documentation.vue`},
|
|
63
|
+
] },
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
} // end of Constants
|
|
68
|
+
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// ________________________________________________________________________________
|
|
2
|
+
// Properties
|
|
3
|
+
// ________________________________________________________________________________
|
|
4
|
+
// XMLHttpRequest from a different domain cannot set cookie values for their own
|
|
5
|
+
// domain unless withCredentials is set to true before making the request.
|
|
6
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials
|
|
7
|
+
const WITH_CREDENTIALS = false
|
|
8
|
+
// Note: VueUtils requires this to be 'default'
|
|
9
|
+
const instanceId = "demo";
|
|
10
|
+
// Used for requestion app components and files
|
|
11
|
+
const appEndpoint = "https://cdn.jsdelivr.net/npm/c0ckp1t@latest";
|
|
12
|
+
|
|
13
|
+
// ________________________________________________________________________________
|
|
14
|
+
// GLOBAL CONSTANTS
|
|
15
|
+
// ________________________________________________________________________________
|
|
16
|
+
export default {
|
|
17
|
+
isDev: true,
|
|
18
|
+
WITH_CREDENTIALS: WITH_CREDENTIALS,
|
|
19
|
+
|
|
20
|
+
instanceId: instanceId,
|
|
21
|
+
type: "LOCAL",
|
|
22
|
+
appName: "C0ckp1t Demo",
|
|
23
|
+
appEndpoint: appEndpoint,
|
|
24
|
+
|
|
25
|
+
// This creates the navigation tree
|
|
26
|
+
root: {
|
|
27
|
+
icon: "fa-house",
|
|
28
|
+
depth: 0,
|
|
29
|
+
endpoint: "/",
|
|
30
|
+
isLeaf: false,
|
|
31
|
+
isRoot: true,
|
|
32
|
+
name: "",
|
|
33
|
+
path: [],
|
|
34
|
+
children: [
|
|
35
|
+
{
|
|
36
|
+
depth: 1,
|
|
37
|
+
endpoint: `/${instanceId}/homepage`,
|
|
38
|
+
isLeaf: true,
|
|
39
|
+
isRoot: false,
|
|
40
|
+
path: ["homepage"],
|
|
41
|
+
name: "homepage",
|
|
42
|
+
children: []
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
depth: 1,
|
|
46
|
+
endpoint: `/${instanceId}/docs`,
|
|
47
|
+
isLeaf: true,
|
|
48
|
+
isRoot: false,
|
|
49
|
+
path: ["docs"],
|
|
50
|
+
name: "docs",
|
|
51
|
+
children: []
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
// This is used to create routes for the vue router
|
|
57
|
+
routes: [
|
|
58
|
+
{path: instanceId, location: `${appEndpoint}/c0ckp1t-demo/main.vue`, children: [
|
|
59
|
+
{path: '', redirect: `/${instanceId}/homepage`},
|
|
60
|
+
{path: 'homepage', location: `${appEndpoint}/c0ckp1t-demo/pages/homepage.vue`},
|
|
61
|
+
{path: 'docs', redirect: `/${instanceId}/docs/Introduction.md`},
|
|
62
|
+
{path: 'docs/:pathMatch(.*)*', location: `${appEndpoint}/core/pages/Documentation.vue`},
|
|
63
|
+
] },
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
} // end of Constants
|
|
68
|
+
|
package/c0ckp1t-demo/store.mjs
CHANGED
|
@@ -12,12 +12,12 @@ import {getLogger} from "Logging";
|
|
|
12
12
|
import {store as storeMain, api as apiMain} from 'GlobalStore'
|
|
13
13
|
|
|
14
14
|
// !# C0CKP1T_START import
|
|
15
|
-
|
|
15
|
+
import C0ckp1tConfig from "./C0ckp1tConfig.mjs";
|
|
16
16
|
// !# C0CKP1T_END import
|
|
17
17
|
|
|
18
|
-
export const instanceId =
|
|
18
|
+
export const instanceId = C0ckp1tConfig.instanceId
|
|
19
19
|
export const registry = storeMain.r[instanceId]
|
|
20
|
-
export const routerEndpoint = `/${instanceId}
|
|
20
|
+
export const routerEndpoint = `/${instanceId}`
|
|
21
21
|
|
|
22
22
|
// ________________________________________________________________________________
|
|
23
23
|
// LOGGING
|
|
@@ -35,7 +35,7 @@ export const store = reactive({
|
|
|
35
35
|
id: LOG_HEADER,
|
|
36
36
|
isLoading: false,
|
|
37
37
|
isReady: true,
|
|
38
|
-
endpoint:
|
|
38
|
+
endpoint: routerEndpoint,
|
|
39
39
|
|
|
40
40
|
// !# C0CKP1T_START store
|
|
41
41
|
|
package/components/xjson.vue
CHANGED
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
https://www.webcomponents.org/element/@alenaksu/json-viewer
|
|
7
7
|
*/
|
|
8
|
-
import {computed, reactive, watch, onMounted, markRaw} from 'vue'
|
|
8
|
+
import {computed, reactive, watch, onMounted, markRaw, defineAsyncComponent} from 'vue'
|
|
9
9
|
|
|
10
10
|
import 'json-viewer';
|
|
11
11
|
|
|
12
|
-
|
|
13
12
|
const props = defineProps({
|
|
14
13
|
obj: Object,
|
|
15
14
|
expanded: {
|
package/components/xsound.vue
CHANGED
package/core/Content.mjs
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import {reactive, ref, markRaw, onMounted, watch, computed, onErrorCaptured} from 'vue'
|
|
6
6
|
// import { get, set, del } from 'idb-keyval'
|
|
7
|
-
import {get, set, del} from '
|
|
7
|
+
import {get, set, del} from 'idb-keyval'
|
|
8
8
|
|
|
9
9
|
export const articlesFiltered = computed(() => {
|
|
10
10
|
return Content.articles.filter(article => {
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use window to extract the hostname, port, protocol, and whether the connection is secure.
|
|
3
|
+
* @returns {{hostname: string, port: string, protocol: string, isSecure: boolean}}
|
|
4
|
+
*/
|
|
5
|
+
export function findHostnamePortProtocol() {
|
|
6
|
+
const hostname = window.location.hostname
|
|
7
|
+
const protocol = window.location.protocol.toLowerCase()
|
|
8
|
+
const isSecure = protocol.toLowerCase() === 'https:'
|
|
9
|
+
const port = window.location.port || (isSecure ? "443" : "80")
|
|
10
|
+
const serverUrl = `${protocol}//${hostname}:${port}`
|
|
11
|
+
return {hostname, port, protocol, isSecure, serverUrl}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Validate and set defaults for the island config object.
|
|
16
|
+
* @param config
|
|
17
|
+
* @returns {*}
|
|
18
|
+
*/
|
|
19
|
+
export function validateIslandConfig(config) {
|
|
20
|
+
if (!config) {
|
|
21
|
+
throw new Error("Island config is required")
|
|
22
|
+
}
|
|
23
|
+
if (typeof config !== 'object') {
|
|
24
|
+
throw new Error("Island config must be an object must was `" + typeof config + "`")
|
|
25
|
+
}
|
|
26
|
+
if (typeof config.instanceId !== `string` || config.instanceId.trim() === ``) {
|
|
27
|
+
throw new Error(`Island config requires non-empty instanceId property`)
|
|
28
|
+
}
|
|
29
|
+
config.type ??= "LOCAL"
|
|
30
|
+
|
|
31
|
+
if (!Array.isArray(config?.routes) || config.routes.length === 0) {
|
|
32
|
+
config.routes = []
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return config
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Return the default Vue components
|
|
40
|
+
* @returns {Object}
|
|
41
|
+
*/
|
|
42
|
+
export function defaultVueComponents() {
|
|
43
|
+
return {
|
|
44
|
+
ExecButton: `/components/ExecButton.vue`,
|
|
45
|
+
XInput: `/components/xinput.vue`,
|
|
46
|
+
XLabel: `/components/xlabel.vue`,
|
|
47
|
+
XDropdown: `/components/xdropdown.vue`,
|
|
48
|
+
XDropdown2: `/components/xdropdown2.vue`,
|
|
49
|
+
XSection: `/components/xsection.vue`,
|
|
50
|
+
XTableOpen: `/components/xtable-open.vue`,
|
|
51
|
+
XCollapse: `/components/xcollapse.vue`,
|
|
52
|
+
XToggle: `/components/xtoggle.vue`,
|
|
53
|
+
XToggle3: `/components/xtoggle3.vue`,
|
|
54
|
+
XCheck: `/components/xcheck.vue`,
|
|
55
|
+
XCheckbox: `/components/xcheckbox.vue`,
|
|
56
|
+
XTextarea: `/components/xtextarea.vue`,
|
|
57
|
+
XHidden: `/components/xhidden.vue`,
|
|
58
|
+
|
|
59
|
+
XTabs: `/components/xtabs.vue`,
|
|
60
|
+
XKv: `/components/xkv.vue`,
|
|
61
|
+
XNav: `/components/xnav.vue`,
|
|
62
|
+
XMap: `/components/xmap.vue`,
|
|
63
|
+
XList: `/components/xlist.vue`,
|
|
64
|
+
XJson: `/components/xjson.vue`,
|
|
65
|
+
XCard: `/components/xcard.vue`,
|
|
66
|
+
XCardH: `/components/xcard-h.vue`,
|
|
67
|
+
XColor: `/components/xcolor.vue`,
|
|
68
|
+
|
|
69
|
+
"v-ace-editor": `/components/vue3-ace-editor.vue`,
|
|
70
|
+
XMarkdown: `/components/xmarkdown.vue`,
|
|
71
|
+
XSound: `/components/xsound.vue`,
|
|
72
|
+
XUpload: `/components/xupload.vue`,
|
|
73
|
+
XTree: `/components/xtree.vue`,
|
|
74
|
+
CodeMirror: `/components/CodeMirror.vue`,
|
|
75
|
+
XTerminal: `/components/XTerminal.vue`,
|
|
76
|
+
}
|
|
77
|
+
}
|