cob-cli 2.12.0 → 2.13.1
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.publish.md +10 -0
- package/customizations/backend.js +1 -0
- package/customizations/backend.vuepress.js +35 -0
- package/customizations/frontend.js +1 -0
- package/lib/task_lists/rsyncFilter.txt +3 -2
- package/lib/task_lists/test_otherFilesContiousReload.js +1 -1
- package/package.json +5 -1
- package/templates/backend/vuepress/integrationm/actions/getVuePressDoc.groovy +74 -0
- package/templates/backend/vuepress/integrationm/actions/getVuePressSidebarConfig.groovy +42 -0
- package/templates/backend/vuepress/integrationm/actions/getVuePressSidebarRootElements.groovy +17 -0
- package/templates/backend/vuepress/others/vuepress/definition_contents_v234.json +619 -0
- package/templates/backend/vuepress/others/vuepress/nginx/README.md +28 -0
- package/templates/backend/vuepress/others/vuepress/package-lock.json +29656 -0
- package/templates/backend/vuepress/others/vuepress/package.json +24 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/DescriptVideo.vue +22 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/Graph.vue +124 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/ReadingTime.vue +26 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/References.vue +228 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/RestrictedContent.vue +77 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/config.js +101 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/config.json +31 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/enhanceApp.js +14 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/nav/getNavTranslated.js +52 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/plugins/References.js +96 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/Logo-Cult-of-Bits-400x400-1.png +0 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/favicon-cob.png +0 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/logo.png +0 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/styles/index.styl +39 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/styles/palette.styl +17 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/LICENSE +21 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/README.md +11 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/AlgoliaSearchBox.vue +172 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/DropdownLink.vue +252 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/DropdownTransition.vue +33 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Home.vue +134 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLink.vue +98 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLinks.vue +165 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Navbar.vue +140 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Page.vue +31 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageEdit.vue +119 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageNav.vue +163 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Sidebar.vue +64 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarButton.vue +40 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarGroup.vue +144 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLink.vue +140 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLinks.vue +114 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/Badge.vue +44 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/CodeBlock.vue +41 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/CodeGroup.vue +120 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/index.js +59 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/layouts/404.vue +30 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/layouts/Layout.vue +151 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/noopModule.js +1 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/package.json +44 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/arrow.styl +22 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/code.styl +137 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/config.styl +1 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/custom-blocks.styl +44 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/index.styl +202 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/mobile.styl +37 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/toc.styl +3 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/wrapper.styl +10 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/util/index.js +244 -0
- package/templates/dashboards/dash/definition_dashboard_v59.json +1 -0
- package/templates/dashboards/dash/dist/dashboard.html +8 -3
- package/templates/dashboards/dash/dist/js/{app.a65a4c2c.js → app.8423eff3.js} +2 -2
- package/templates/dashboards/dash/dist/js/app.8423eff3.js.map +1 -0
- package/templates/dashboards/dash/dist/js/app.f9c19b80.js +188 -0
- package/templates/dashboards/dash/dist/js/app.f9c19b80.js.map +1 -0
- package/templates/dashboards/dash/src/App.vue +32 -212
- package/templates/dashboards/dash/src/Dashboard.vue +31 -11
- package/templates/dashboards/dash/src/collector.js +35 -3694
- package/templates/dashboards/dash/src/components/Menu.vue +15 -4
- package/templates/dashboards/dash/src/components/Title.vue +10 -2
- package/templates/dashboards/dash/src/components/Totals.vue +19 -9
- package/templates/dashboards/dash/src/components/{TotalsBadge.vue → TotalsValue.vue} +12 -12
- package/templates/dashboards/dash/src/dashboard.html +6 -1
- package/templates/dashboards/dash/src/test_collector.js +3732 -0
- package/templates/dashboards/dash/dist/js/app.a65a4c2c.js.map +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "docs",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "vuepress dev src",
|
|
7
|
+
"build": "vuepress build src"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@vuepress/plugin-back-to-top": "^1.8.2",
|
|
12
|
+
"@vuepress/plugin-medium-zoom": "^1.8.2",
|
|
13
|
+
"vuepress": "^1.8.2",
|
|
14
|
+
"vuepress-plugin-reading-time": "^0.1.1"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@cob/rest-api-wrapper": "^2.1.6",
|
|
18
|
+
"axios": "^0.21.4",
|
|
19
|
+
"markdown-it-prism": "^2.2.3",
|
|
20
|
+
"tinycolor2": "^1.4.2",
|
|
21
|
+
"vue-mermaid-string": "^2.2.6",
|
|
22
|
+
"vuepress-bar": "^0.4.2"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div style="text-align:center;">
|
|
3
|
+
<iframe
|
|
4
|
+
:src="'https://share.descript.com/embed/' + id"
|
|
5
|
+
width="100%"
|
|
6
|
+
height="360"
|
|
7
|
+
frameborder="0"
|
|
8
|
+
allowfullscreen
|
|
9
|
+
style="max-width:640px"
|
|
10
|
+
></iframe>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
props: {
|
|
17
|
+
id: String,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<style></style>
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="cob-graph">
|
|
3
|
+
<vue-mermaid-string v-if="ready" :value="diagram" />
|
|
4
|
+
<div v-else>
|
|
5
|
+
Loading ...
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import VueMermaidString from "vue-mermaid-string";
|
|
12
|
+
import tinycolor from "tinycolor2";
|
|
13
|
+
import axios from 'axios'
|
|
14
|
+
|
|
15
|
+
// https://www.paletton.com/#uid=73+1p0k2O++00++00++7n++be+Z
|
|
16
|
+
let colorDefs = [
|
|
17
|
+
{ color: "#FFF" },
|
|
18
|
+
{ color: "#FFE9F0", darkenStroke: 20, saturateStroke: 0 },
|
|
19
|
+
{ color: "#F3FFE9", darkenStroke: 60, saturateStroke: -5 },
|
|
20
|
+
{ color: "#FFF9E9" },
|
|
21
|
+
{ color: "#D0FFA6", darkenStroke: 60, saturateStroke: -5 },
|
|
22
|
+
{ color: "#FF66E9", font: "#FFF" },
|
|
23
|
+
{ color: "#FF3399", font: "#FFF" },
|
|
24
|
+
];
|
|
25
|
+
//Default variations:
|
|
26
|
+
colorDefs = colorDefs.map((colorDef) => ({
|
|
27
|
+
darkenStroke: 50,
|
|
28
|
+
saturateStroke: 10,
|
|
29
|
+
font: "#333",
|
|
30
|
+
...colorDef,
|
|
31
|
+
}));
|
|
32
|
+
|
|
33
|
+
const typeSequence = ["Tutorial","Howto","Reference","Explanation","Solution","SiteItem"]
|
|
34
|
+
|
|
35
|
+
const style = (node, colorIndex) => {
|
|
36
|
+
const colorDef = colorDefs[colorIndex];
|
|
37
|
+
const fill = colorDef.color;
|
|
38
|
+
const font = colorDef.font;
|
|
39
|
+
const stroke = tinycolor(colorDef.color)
|
|
40
|
+
.darken(colorDef.darkenStroke)
|
|
41
|
+
.saturate(colorDef.saturateStroke)
|
|
42
|
+
.toString();
|
|
43
|
+
return `style ${node} color:${font}, fill:${fill}, stroke:${stroke}`;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export default {
|
|
47
|
+
components: {
|
|
48
|
+
VueMermaidString,
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
data () {
|
|
52
|
+
return {
|
|
53
|
+
nodes: [],
|
|
54
|
+
ready: false
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
created() {
|
|
58
|
+
let lang = this.$localePath.match(/^\/([^\/]*)(\/)?$/)[1]
|
|
59
|
+
let preferredLangPostfix = lang ? "-"+lang : ""
|
|
60
|
+
axios.get('/recordm/recordm/definitions/search/66?q=-chapter -.wip.*',{params: {sort:"sortablefield", size: 310}})
|
|
61
|
+
.then( answer => {
|
|
62
|
+
for(let content of answer.data.hits.hits.reverse()) {
|
|
63
|
+
for(let langPostfix of [preferredLangPostfix,"","-pt","-es"] ) {
|
|
64
|
+
try {
|
|
65
|
+
let path = this.$site.base + this.$localePath.substring(1) + content._source["path"][0].substring(1)
|
|
66
|
+
let id = content._id
|
|
67
|
+
let title
|
|
68
|
+
let type = content._source["type"] ? content._source["type"][0] : ""
|
|
69
|
+
if( !content._source["type"] || content._source["siteitemtype"] && content._source["siteitemtype"][0] == "directory") {
|
|
70
|
+
title = content._source["descriptor"][0]
|
|
71
|
+
type="dir"
|
|
72
|
+
} else {
|
|
73
|
+
title = content._source["name" + langPostfix][0] // Fails if it doesn't have this lang content (and will try another)
|
|
74
|
+
}
|
|
75
|
+
let styleIndex = typeSequence.indexOf(type)
|
|
76
|
+
|
|
77
|
+
this.nodes.push( id + "[\"" + title + "\"]" )
|
|
78
|
+
this.nodes.push( style(id,styleIndex+1) ) //If styleIndex is -1 => 0, 0 => 1, etc, etc
|
|
79
|
+
if(type == "dir") {
|
|
80
|
+
this.nodes.push( 'click ' + id + ' href "/recordm/#/instance/' + id + '" "' + title + '"' )
|
|
81
|
+
} else {
|
|
82
|
+
this.nodes.push( 'click ' + id + ' href "' + path + '" "' + title + '"' )
|
|
83
|
+
}
|
|
84
|
+
if(content._source["parent"]) {
|
|
85
|
+
this.nodes.push( content._source["parent"][0] + "-->" + id )
|
|
86
|
+
}
|
|
87
|
+
break;
|
|
88
|
+
} catch {}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
this.ready = true
|
|
92
|
+
})
|
|
93
|
+
},
|
|
94
|
+
computed: {
|
|
95
|
+
diagram: function() {
|
|
96
|
+
let result = []
|
|
97
|
+
result.push("flowchart LR ")
|
|
98
|
+
result.push("subgraph Contents")
|
|
99
|
+
result.push("direction LR")
|
|
100
|
+
result.push("style Contents fill:#FFF, stroke:#ccc")
|
|
101
|
+
result.push(...this.nodes)
|
|
102
|
+
result.push("end")
|
|
103
|
+
result.push("subgraph Legends")
|
|
104
|
+
result.push("direction TB")
|
|
105
|
+
result.push("style Legends fill:#FFF, stroke:#ccc")
|
|
106
|
+
for( let typeIndex in typeSequence ) {
|
|
107
|
+
result.push(typeSequence[typeIndex]+"s")
|
|
108
|
+
result.push( style(typeSequence[typeIndex]+"s",+typeIndex+1) )
|
|
109
|
+
}
|
|
110
|
+
result.push("end")
|
|
111
|
+
return result.join("\n")
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
</script>
|
|
116
|
+
|
|
117
|
+
<style>
|
|
118
|
+
#cob-graph {
|
|
119
|
+
text-align: center;
|
|
120
|
+
}
|
|
121
|
+
#cob-graph svg {
|
|
122
|
+
height:100%
|
|
123
|
+
}
|
|
124
|
+
</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="read-time">
|
|
3
|
+
<p>
|
|
4
|
+
<strong>Reading time:</strong> {{ readingTime }} minute{{readingTime > 1 ? 's': ''}}<br />
|
|
5
|
+
</p>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
name: 'ReadingTime',
|
|
12
|
+
computed: {
|
|
13
|
+
// Full object list: //github.com/darrenjennings/vuepress-plugin-reading-time#usage
|
|
14
|
+
readingTime() {
|
|
15
|
+
let minutes = this.$page.readingTime.minutes
|
|
16
|
+
|
|
17
|
+
if (minutes < 1) {
|
|
18
|
+
minutes = 1
|
|
19
|
+
} else {
|
|
20
|
+
minutes = (minutes - Math.floor(minutes) < .5) ? Math.floor(minutes) : Math.ceil(minutes)
|
|
21
|
+
}
|
|
22
|
+
return minutes
|
|
23
|
+
},
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="outside-container">
|
|
3
|
+
<div class="inside-container">
|
|
4
|
+
<template v-for="(card, i) of cards">
|
|
5
|
+
<div v-if="card.items.length" class="card-wraper" :key="card.title">
|
|
6
|
+
<h3>
|
|
7
|
+
<span v-if="$attrs.mainNumber">
|
|
8
|
+
{{ i + 1 }}.
|
|
9
|
+
</span>
|
|
10
|
+
{{ card.title }}
|
|
11
|
+
</h3>
|
|
12
|
+
<div v-if="Object.keys(card.intro).length" class="meta">
|
|
13
|
+
<div v-for="(value, name) in card.intro" :key="name">
|
|
14
|
+
<strong>{{ name }}:</strong>
|
|
15
|
+
<wbr>
|
|
16
|
+
<span> {{ value }} </span>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="flexible"></div>
|
|
20
|
+
<div v-for="(item, i) in card.items" :key="item.title" class="item" :class="{multiple:i!=0}">
|
|
21
|
+
<!-- TODO: adicionar marcas de lido, marca de conteúdo em construção, marca de certificado, tempo de leitura -->
|
|
22
|
+
<!-- TODO: links para edição -->
|
|
23
|
+
<span v-if="item.isRestricted" class="icon">🔓</span>
|
|
24
|
+
<span v-if="card.numbering" class="numbering">
|
|
25
|
+
{{ i + 1 }}.
|
|
26
|
+
</span>
|
|
27
|
+
<span v-else class="no-numbering"/>
|
|
28
|
+
<a :href="item.path">
|
|
29
|
+
{{ item.title }}
|
|
30
|
+
</a>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
import axios from 'axios'
|
|
40
|
+
|
|
41
|
+
export default {
|
|
42
|
+
name: "References",
|
|
43
|
+
|
|
44
|
+
data: () => ({
|
|
45
|
+
cards: []
|
|
46
|
+
}),
|
|
47
|
+
|
|
48
|
+
created() {
|
|
49
|
+
let listProp = this.$attrs.list ? this.$attrs.list : "References";
|
|
50
|
+
this.cards = this.$page[listProp];
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
beforeMount() {
|
|
54
|
+
let lang = this.$localePath.match(/^\/([^\/]*)(\/)?$/)[1]
|
|
55
|
+
let preferredLangPostfix = lang ? "-"+lang : ""
|
|
56
|
+
|
|
57
|
+
this.cards.forEach( card => {
|
|
58
|
+
if(card.queries.length) {
|
|
59
|
+
let initialItems = card.items
|
|
60
|
+
this.$set(card, 'items', [])
|
|
61
|
+
this.cardsLoaded = true
|
|
62
|
+
card.queries.forEach( queryItem => {
|
|
63
|
+
axios.get('/recordm/recordm/definitions/search/7?q=' + queryItem.query ,{params: {sort:"sortablefield"}})
|
|
64
|
+
.then( answer => {
|
|
65
|
+
for(let content of answer.data.hits.hits.reverse()) {
|
|
66
|
+
for(let langPostfix of [preferredLangPostfix,"","-pt","-es"] ) {
|
|
67
|
+
try {
|
|
68
|
+
let title = content._source["name" + langPostfix][0] // Fails if it doesn't have this lang content (and will try another)
|
|
69
|
+
let id = content._id
|
|
70
|
+
let path = this.$site.base + this.$localePath.substring(1) + content._source["path"][0].substring(1)
|
|
71
|
+
let type = content._source["type"][0]
|
|
72
|
+
let target = content._source["target"] ? content._source["target"][0] : ""
|
|
73
|
+
let format = content._source["format"] ? content._source["format"][0] : ""
|
|
74
|
+
let isRestricted = initialItems.filter(i => i.id == id).length == 0;
|
|
75
|
+
card.items.push( { id: id, title: title, path: path, type: type, target: target, format: format, isRestricted: isRestricted} )
|
|
76
|
+
break;
|
|
77
|
+
} catch {}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
card.queries = [] // clean queries to prevent getting them multiple times (with page back and forth)
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<style lang="stylus">
|
|
90
|
+
.inside-container
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-wrap: wrap;
|
|
93
|
+
align-content: stretch;
|
|
94
|
+
align-items: stretch;
|
|
95
|
+
justify-content: start;
|
|
96
|
+
gap: 20px;
|
|
97
|
+
@media (max-width: 768px)
|
|
98
|
+
flex-direction column
|
|
99
|
+
.card-wraper
|
|
100
|
+
flex-grow: 1;
|
|
101
|
+
flex-basis: 10%;
|
|
102
|
+
min-width: 300px;
|
|
103
|
+
border: solid 1px lighten($accentColor,45);
|
|
104
|
+
border-radius: 7px;
|
|
105
|
+
padding: 20px;
|
|
106
|
+
@media (max-width: 768px)
|
|
107
|
+
background-color: lighten($accentColor,55);
|
|
108
|
+
max-width 100%
|
|
109
|
+
h3
|
|
110
|
+
margin-block-start: 0;
|
|
111
|
+
margin-bottom: 0px;
|
|
112
|
+
font-size: 1.35em;
|
|
113
|
+
.meta
|
|
114
|
+
padding: 4px;
|
|
115
|
+
margin-top:5px
|
|
116
|
+
margin-bottom:5px
|
|
117
|
+
background-color: #fffaf0;
|
|
118
|
+
border: solid 0.9px #ddd;
|
|
119
|
+
border-radius: 7px;
|
|
120
|
+
div
|
|
121
|
+
font-size: 14px;
|
|
122
|
+
.item
|
|
123
|
+
display: flex
|
|
124
|
+
align-items: flex-end
|
|
125
|
+
.numbering
|
|
126
|
+
font-size: 15px
|
|
127
|
+
align-self: center
|
|
128
|
+
min-width:19px
|
|
129
|
+
text-align: right
|
|
130
|
+
padding-right: 2px
|
|
131
|
+
font-weight: 600;
|
|
132
|
+
.no-numbering
|
|
133
|
+
min-width: 4px
|
|
134
|
+
a
|
|
135
|
+
flex-grow: 1
|
|
136
|
+
span.icon
|
|
137
|
+
order: 1
|
|
138
|
+
font-size: 13px
|
|
139
|
+
min-width: 13px
|
|
140
|
+
align-self: center
|
|
141
|
+
|
|
142
|
+
.buttonCards
|
|
143
|
+
.inside-container
|
|
144
|
+
text-align: center
|
|
145
|
+
font-size: 1.2em
|
|
146
|
+
justify-content: space-around;
|
|
147
|
+
gap: 32px;
|
|
148
|
+
margin-left: auto
|
|
149
|
+
margin-right: auto
|
|
150
|
+
flex-direction inherit
|
|
151
|
+
.card-wraper
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-flow: column-reverse;
|
|
154
|
+
border:none
|
|
155
|
+
max-width: 255px;
|
|
156
|
+
min-width: 255px;
|
|
157
|
+
background-color: none
|
|
158
|
+
@media (max-width: 1018px)
|
|
159
|
+
max-width: 355px;
|
|
160
|
+
h3
|
|
161
|
+
display:none
|
|
162
|
+
.flexible
|
|
163
|
+
flex-grow: 1;
|
|
164
|
+
.meta
|
|
165
|
+
div
|
|
166
|
+
strong
|
|
167
|
+
font-weight: normal
|
|
168
|
+
color: #888
|
|
169
|
+
span
|
|
170
|
+
font-size: 17px
|
|
171
|
+
font-weight: 600
|
|
172
|
+
color: #666
|
|
173
|
+
&:before
|
|
174
|
+
content: "\a";
|
|
175
|
+
white-space: pre;
|
|
176
|
+
a
|
|
177
|
+
a:hover
|
|
178
|
+
background-color: $accentColor;
|
|
179
|
+
color: #fff;
|
|
180
|
+
font-weight: bold;
|
|
181
|
+
margin: 10px auto;
|
|
182
|
+
border-radius: 8px;
|
|
183
|
+
padding: 5px;
|
|
184
|
+
a:hover
|
|
185
|
+
background-color: lighten($accentColor,5);
|
|
186
|
+
transition-duration: .2s;
|
|
187
|
+
|
|
188
|
+
.justContent
|
|
189
|
+
.inside-container
|
|
190
|
+
.card-wraper
|
|
191
|
+
border:none
|
|
192
|
+
background-color: none
|
|
193
|
+
h3
|
|
194
|
+
display:none
|
|
195
|
+
.flexible
|
|
196
|
+
flex-grow: 1;
|
|
197
|
+
.meta
|
|
198
|
+
display:none
|
|
199
|
+
.item
|
|
200
|
+
margin-top: 10px
|
|
201
|
+
.icon
|
|
202
|
+
display:none
|
|
203
|
+
|
|
204
|
+
.inlineContent
|
|
205
|
+
display: inline
|
|
206
|
+
margin-right: 3px;
|
|
207
|
+
.inside-container
|
|
208
|
+
display: inline
|
|
209
|
+
.card-wraper
|
|
210
|
+
border:none
|
|
211
|
+
background-color: none
|
|
212
|
+
display: inline
|
|
213
|
+
padding: 0
|
|
214
|
+
h3
|
|
215
|
+
display:none
|
|
216
|
+
.flexible
|
|
217
|
+
display: none
|
|
218
|
+
.meta
|
|
219
|
+
display:none
|
|
220
|
+
.item
|
|
221
|
+
display: inline
|
|
222
|
+
margin-right: -3px;
|
|
223
|
+
.item.multiple
|
|
224
|
+
span::after
|
|
225
|
+
content: ", "
|
|
226
|
+
.icon
|
|
227
|
+
display:none
|
|
228
|
+
</style>
|
package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/RestrictedContent.vue
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<clientOnly>
|
|
3
|
+
<div>
|
|
4
|
+
<div v-if="loading">
|
|
5
|
+
Loading ...
|
|
6
|
+
</div>
|
|
7
|
+
<div v-else>
|
|
8
|
+
<div v-if="hasAccess" v-html="renderedMarkdown"></div>
|
|
9
|
+
|
|
10
|
+
<div v-else class="warning custom-block">
|
|
11
|
+
<p class="custom-block-title">WARNING</p>
|
|
12
|
+
<p>Restricted Content</p>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</clientOnly>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
import axios from 'axios'
|
|
21
|
+
import markdownIt from 'markdown-it';
|
|
22
|
+
import emojiPlugin from 'markdown-it-emoji';
|
|
23
|
+
import prism from 'markdown-it-prism';
|
|
24
|
+
|
|
25
|
+
import "prismjs/components/prism-java"
|
|
26
|
+
import "prismjs/components/prism-sql"
|
|
27
|
+
import "prismjs/components/prism-groovy"
|
|
28
|
+
import "prismjs/components/prism-jsx"
|
|
29
|
+
import "prismjs/components/prism-json"
|
|
30
|
+
import "prismjs/components/prism-bash"
|
|
31
|
+
import "prismjs/components/prism-nix"
|
|
32
|
+
import "prismjs/components/prism-nginx"
|
|
33
|
+
|
|
34
|
+
export default {
|
|
35
|
+
name: 'ConditionalContent',
|
|
36
|
+
data: () => ({
|
|
37
|
+
renderedMarkdown: "",
|
|
38
|
+
hasAccess: false,
|
|
39
|
+
loading: true,
|
|
40
|
+
}),
|
|
41
|
+
mounted() {
|
|
42
|
+
let lang = this.$localePath.match(/^\/([^\/]*)(\/)?$/)[1]
|
|
43
|
+
let preferredLangPostfix = lang ? "-"+lang : ""
|
|
44
|
+
|
|
45
|
+
axios.get('/recordm/recordm/definitions/search/7?q=id:' + this.$page.frontmatter.id ,{})
|
|
46
|
+
.then((answer) => {
|
|
47
|
+
let md = new markdownIt({ html: true });
|
|
48
|
+
md.use(emojiPlugin)
|
|
49
|
+
md.use(prism)
|
|
50
|
+
let content
|
|
51
|
+
for(let langPostfix of [preferredLangPostfix,"","-pt","-es"] ) {
|
|
52
|
+
try {
|
|
53
|
+
content = answer.data.hits.hits[0]._source["content" + langPostfix][0]
|
|
54
|
+
break;
|
|
55
|
+
} catch {}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if(content) {
|
|
59
|
+
this.hasAccess = true;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// if there is some frontmatter data on the content remove it before rendering it
|
|
63
|
+
if(content && content.indexOf("---\n") == 0) {
|
|
64
|
+
let frontmatterEval = content.split("---\n")
|
|
65
|
+
if(frontmatterEval.length>2) {
|
|
66
|
+
frontmatterEval.shift() // Before first ---\n (should be "")
|
|
67
|
+
frontmatterEval.shift() // frontmattercontent
|
|
68
|
+
content = frontmatterEval.join() //Just content
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
this.renderedMarkdown = md.render(content)
|
|
72
|
+
})
|
|
73
|
+
.catch()
|
|
74
|
+
.finally(() => this.loading = false)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
const axios = require('axios').default
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const CONF = require('./config.json')
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
async function getSidebar(lang) {
|
|
7
|
+
const rootElementsResponse = await axios.post('https://' + CONF.server + '/integrationm/action/getVuePressSidebarRootElements',{})
|
|
8
|
+
const rootElements = rootElementsResponse.data
|
|
9
|
+
let sidebar = {}
|
|
10
|
+
let langPrefix = (lang == "en") ? "" : "/" + lang
|
|
11
|
+
for(rootElement of rootElements) {
|
|
12
|
+
sidebar[langPrefix + rootElement] = (await axios.post('https://' + CONF.server + '/integrationm/action/getVuePressSidebarConfig',{path:rootElement,lang:lang})).data;
|
|
13
|
+
}
|
|
14
|
+
return sidebar
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async function getAllPages() {
|
|
18
|
+
const content = await axios.post('https://' + CONF.server + '/integrationm/action/getVuePressDoc',{})
|
|
19
|
+
return content.data;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async function createFilesFromServerInfo() {
|
|
23
|
+
fs.mkdirSync("./debug/.vuepress", { recursive: true }, (err) => {
|
|
24
|
+
if (err) throw err;
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
fs.writeFile('./debug/.vuepress/sidebarEN.json', JSON.stringify(await getSidebar("en")), () => {})
|
|
28
|
+
fs.writeFile('./debug/.vuepress/sidebarPT.json', JSON.stringify(await getSidebar("pt")), () => {})
|
|
29
|
+
fs.writeFile('./debug/.vuepress/sidebarES.json', JSON.stringify(await getSidebar("es")), () => {})
|
|
30
|
+
|
|
31
|
+
const pages = await getAllPages()
|
|
32
|
+
pages.forEach(page => {
|
|
33
|
+
fs.mkdirSync("./debug" + page.path, { recursive: true }, (err) => {
|
|
34
|
+
if (err) throw err;
|
|
35
|
+
});
|
|
36
|
+
fs.writeFile("./debug" + page.path + '/README.md', page.content, (err) => {
|
|
37
|
+
if (err) throw err;
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
module.exports = async function() {
|
|
43
|
+
const DEBUG = false;
|
|
44
|
+
if(DEBUG) await createFilesFromServerInfo();
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
base: "/docs/",
|
|
48
|
+
dest: "nginx/dist",
|
|
49
|
+
additionalPages: await getAllPages(),
|
|
50
|
+
locales: {
|
|
51
|
+
'/': { lang: 'en-US', title:CONF.title },
|
|
52
|
+
'/pt/': { lang: 'pt-PT', title:CONF.titlePT },
|
|
53
|
+
'/es/': { lang: 'es-ES', title:CONF.titleES }
|
|
54
|
+
},
|
|
55
|
+
themeConfig: {
|
|
56
|
+
displayAllHeaders: false,
|
|
57
|
+
editLinks: true,
|
|
58
|
+
locales: {
|
|
59
|
+
'/': {
|
|
60
|
+
lang: 'en-US',
|
|
61
|
+
selectText: '🇬🇧',
|
|
62
|
+
label: 'English',
|
|
63
|
+
selectLanguageName: 'English',
|
|
64
|
+
nav: CONF.nav,
|
|
65
|
+
sidebar: await getSidebar("en")
|
|
66
|
+
},
|
|
67
|
+
'/pt/': {
|
|
68
|
+
lang: 'pt-PT',
|
|
69
|
+
selectText: '🇵🇹',
|
|
70
|
+
label: 'Português',
|
|
71
|
+
selectLanguageName: 'Português',
|
|
72
|
+
nav: CONF.navPT,
|
|
73
|
+
sidebar: await getSidebar("pt")
|
|
74
|
+
},
|
|
75
|
+
'/es/': {
|
|
76
|
+
lang: 'es-ES',
|
|
77
|
+
selectText: '🇪🇸',
|
|
78
|
+
label: 'Espanol',
|
|
79
|
+
selectLanguageName: 'Español',
|
|
80
|
+
nav: CONF.navES,
|
|
81
|
+
sidebar: await getSidebar("es")
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
logo: '/logo.png'
|
|
85
|
+
},
|
|
86
|
+
head: [
|
|
87
|
+
['link', { href: 'https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700;900&display=swap', rel: 'stylesheet' } ],
|
|
88
|
+
['meta', { name: 'viewport', content: 'width=device-width, initial-scale=1.0' }],
|
|
89
|
+
['link', { rel: 'icon', type: 'image/png', href: '/favicon.png' }],
|
|
90
|
+
['meta', { name: 'theme-color', content: '#d5184b' }],
|
|
91
|
+
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
|
|
92
|
+
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black' }]
|
|
93
|
+
],
|
|
94
|
+
plugins: [
|
|
95
|
+
require('./plugins/References.js'),
|
|
96
|
+
'vuepress-plugin-reading-time',
|
|
97
|
+
'@vuepress/back-to-top',
|
|
98
|
+
'@vuepress/medium-zoom'
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"server": "learning.cultofbits.com",
|
|
3
|
+
"contentDefinition": 66,
|
|
4
|
+
"title": "CoB",
|
|
5
|
+
"nav": [
|
|
6
|
+
{ "text": "Users", "link": "/site/users/" },
|
|
7
|
+
{ "text": "Admins", "link": "/site/managers/" },
|
|
8
|
+
{ "text": "Developers", "link": "/site/developers/" },
|
|
9
|
+
{ "text": "Solutions", "link": "/site/solutions/" },
|
|
10
|
+
{ "text": "Login", "link": "/recordm/index.html#/login", "ifLoggedIn": false, "target": "_self" },
|
|
11
|
+
{ "text": "Backend", "link": "/recordm/#/domain/1", "ifLoggedIn": true }
|
|
12
|
+
],
|
|
13
|
+
"titlePT": "CoB",
|
|
14
|
+
"navPT": [
|
|
15
|
+
{ "text": "Utilizadores", "link": "/site/users/" },
|
|
16
|
+
{ "text": "Administradores", "link": "/site/managers/" },
|
|
17
|
+
{ "text": "Programadores", "link": "/site/developers/" },
|
|
18
|
+
{ "text": "Soluções", "link": "/site/solutions/" },
|
|
19
|
+
{ "text": "Login", "link": "/recordm/index.html#/login", "ifLoggedIn": false, "target": "_self" },
|
|
20
|
+
{ "text": "Backend", "link": "/recordm/#/domain/1", "ifLoggedIn": true }
|
|
21
|
+
],
|
|
22
|
+
"titleES": "CoB",
|
|
23
|
+
"navES": [
|
|
24
|
+
{ "text": "Usuários", "link": "/site/users/" },
|
|
25
|
+
{ "text": "Administradores", "link": "/site/managers/" },
|
|
26
|
+
{ "text": "Desarrolladores", "link": "/site/developers/" },
|
|
27
|
+
{ "text": "Soluciones", "link": "/site/solutions/" },
|
|
28
|
+
{ "text": "Acceso", "link": "/recordm/index.html#/login", "ifLoggedIn": false, "target": "_self" },
|
|
29
|
+
{ "text": "Backend", "link": "/recordm/#/domain/1", "ifLoggedIn": true }
|
|
30
|
+
]
|
|
31
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client app enhancement file.
|
|
3
|
+
*
|
|
4
|
+
* https://v1.vuepress.vuejs.org/guide/basic-config.html#app-level-enhancements
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export default ({
|
|
8
|
+
Vue, // the version of Vue being used in the VuePress app
|
|
9
|
+
options, // the options for the root Vue instance
|
|
10
|
+
router, // the router instance for the app
|
|
11
|
+
siteData // site metadata
|
|
12
|
+
}) => {
|
|
13
|
+
// ...apply enhancements for the site.
|
|
14
|
+
}
|