cob-cli 2.12.0 → 2.12.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/customizations/backend.js +1 -0
- package/customizations/backend.vuepress.js +35 -0
- package/customizations/frontend.js +1 -0
- 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
package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLinks.vue
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ul
|
|
3
|
+
v-if="items.length"
|
|
4
|
+
class="sidebar-links"
|
|
5
|
+
>
|
|
6
|
+
<li
|
|
7
|
+
v-for="(item, i) in items"
|
|
8
|
+
:key="i"
|
|
9
|
+
>
|
|
10
|
+
<SidebarGroup
|
|
11
|
+
v-if="item.type === 'group'"
|
|
12
|
+
:item="item"
|
|
13
|
+
:open="isActivePath(item.path)"
|
|
14
|
+
:collapsable="item.collapsable || item.collapsible"
|
|
15
|
+
:depth="depth"
|
|
16
|
+
@toggle="toggleGroup(i)"
|
|
17
|
+
/>
|
|
18
|
+
<SidebarLink
|
|
19
|
+
v-else
|
|
20
|
+
:sidebar-depth="sidebarDepth"
|
|
21
|
+
:item="item"
|
|
22
|
+
:hide="i==0"
|
|
23
|
+
/>
|
|
24
|
+
</li>
|
|
25
|
+
</ul>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script>
|
|
29
|
+
import SidebarGroup from '@theme/components/SidebarGroup.vue'
|
|
30
|
+
import SidebarLink from '@theme/components/SidebarLink.vue'
|
|
31
|
+
import { isActive, normalize } from '../util'
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
name: 'SidebarLinks',
|
|
35
|
+
|
|
36
|
+
components: { SidebarGroup, SidebarLink },
|
|
37
|
+
|
|
38
|
+
props: [
|
|
39
|
+
'items',
|
|
40
|
+
'depth', // depth of current sidebar links
|
|
41
|
+
'sidebarDepth', // depth of headers to be extracted
|
|
42
|
+
'initialOpenGroupIndex'
|
|
43
|
+
],
|
|
44
|
+
|
|
45
|
+
data () {
|
|
46
|
+
return {
|
|
47
|
+
openGroupIndex: this.initialOpenGroupIndex || 0
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
watch: {
|
|
52
|
+
'$route' () {
|
|
53
|
+
this.refreshIndex()
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
created () {
|
|
58
|
+
this.refreshIndex()
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
methods: {
|
|
62
|
+
isActivePath(path) {
|
|
63
|
+
// basead on isActive() from theme-default/util/index.js
|
|
64
|
+
const route = this.$route
|
|
65
|
+
const routePath = normalize(route.path)
|
|
66
|
+
const pagePath = normalize(path)
|
|
67
|
+
return routePath.indexOf(pagePath) == 0
|
|
68
|
+
},
|
|
69
|
+
refreshIndex () {
|
|
70
|
+
const index = resolveOpenGroupIndex(
|
|
71
|
+
this.$route,
|
|
72
|
+
this.items
|
|
73
|
+
)
|
|
74
|
+
if (index > -1) {
|
|
75
|
+
this.openGroupIndex = index
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
toggleGroup (index) {
|
|
80
|
+
this.openGroupIndex = index === this.openGroupIndex ? -1 : index
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
isActive (page) {
|
|
84
|
+
return isActive(this.$route, page.regularPath)
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function resolveOpenGroupIndex (route, items) {
|
|
90
|
+
for (let i = 0; i < items.length; i++) {
|
|
91
|
+
const item = items[i]
|
|
92
|
+
if (descendantIsActive(route, item)) {
|
|
93
|
+
return i
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return -1
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function descendantIsActive (route, item) {
|
|
100
|
+
if (item.type === 'group') {
|
|
101
|
+
const childIsActive = item.path && isActive(route, item.path)
|
|
102
|
+
const grandChildIsActive = item.children.some(child => {
|
|
103
|
+
if (child.type === 'group') {
|
|
104
|
+
return descendantIsActive(route, child)
|
|
105
|
+
} else {
|
|
106
|
+
return child.type === 'page' && isActive(route, child.path)
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
return childIsActive || grandChildIsActive
|
|
111
|
+
}
|
|
112
|
+
return false
|
|
113
|
+
}
|
|
114
|
+
</script>
|
package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/Badge.vue
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
functional: true,
|
|
4
|
+
props: {
|
|
5
|
+
type: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: 'tip'
|
|
8
|
+
},
|
|
9
|
+
text: String,
|
|
10
|
+
vertical: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: 'top'
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
render (h, { props, slots }) {
|
|
16
|
+
return h('span', {
|
|
17
|
+
class: ['badge', props.type],
|
|
18
|
+
style: {
|
|
19
|
+
verticalAlign: props.vertical
|
|
20
|
+
}
|
|
21
|
+
}, props.text || slots().default)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<style lang="stylus" scoped>
|
|
27
|
+
.badge
|
|
28
|
+
display inline-block
|
|
29
|
+
font-size 14px
|
|
30
|
+
height 18px
|
|
31
|
+
line-height 18px
|
|
32
|
+
border-radius 3px
|
|
33
|
+
padding 0 6px
|
|
34
|
+
color white
|
|
35
|
+
background-color #42b983
|
|
36
|
+
&.tip, &.green
|
|
37
|
+
background-color $badgeTipColor
|
|
38
|
+
&.error
|
|
39
|
+
background-color $badgeErrorColor
|
|
40
|
+
&.warning, &.warn, &.yellow
|
|
41
|
+
background-color $badgeWarningColor
|
|
42
|
+
& + &
|
|
43
|
+
margin-left 5px
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="theme-code-block"
|
|
4
|
+
:class="{ 'theme-code-block__active': active }"
|
|
5
|
+
>
|
|
6
|
+
<slot />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
name: 'CodeBlock',
|
|
13
|
+
props: {
|
|
14
|
+
title: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
active: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
mounted () {
|
|
24
|
+
if (this.$parent && this.$parent.loadTabs) {
|
|
25
|
+
this.$parent.loadTabs()
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style scoped>
|
|
32
|
+
.theme-code-block {
|
|
33
|
+
display: none;
|
|
34
|
+
}
|
|
35
|
+
.theme-code-block__active {
|
|
36
|
+
display: block;
|
|
37
|
+
}
|
|
38
|
+
.theme-code-block > pre {
|
|
39
|
+
background-color: orange;
|
|
40
|
+
}
|
|
41
|
+
</style>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ClientOnly>
|
|
3
|
+
<div class="theme-code-group">
|
|
4
|
+
<div class="theme-code-group__nav">
|
|
5
|
+
<ul class="theme-code-group__ul">
|
|
6
|
+
<li
|
|
7
|
+
v-for="(tab, i) in codeTabs"
|
|
8
|
+
:key="tab.title"
|
|
9
|
+
class="theme-code-group__li"
|
|
10
|
+
>
|
|
11
|
+
<button
|
|
12
|
+
class="theme-code-group__nav-tab"
|
|
13
|
+
:class="{
|
|
14
|
+
'theme-code-group__nav-tab-active': i === activeCodeTabIndex,
|
|
15
|
+
}"
|
|
16
|
+
@click="changeCodeTab(i)"
|
|
17
|
+
>
|
|
18
|
+
{{ tab.title }}
|
|
19
|
+
</button>
|
|
20
|
+
</li>
|
|
21
|
+
</ul>
|
|
22
|
+
</div>
|
|
23
|
+
<slot />
|
|
24
|
+
<pre
|
|
25
|
+
v-if="codeTabs.length < 1"
|
|
26
|
+
class="pre-blank"
|
|
27
|
+
>// Make sure to add code blocks to your code group</pre>
|
|
28
|
+
</div>
|
|
29
|
+
</ClientOnly>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
export default {
|
|
34
|
+
name: 'CodeGroup',
|
|
35
|
+
data () {
|
|
36
|
+
return {
|
|
37
|
+
codeTabs: [],
|
|
38
|
+
activeCodeTabIndex: -1
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
watch: {
|
|
42
|
+
activeCodeTabIndex (index) {
|
|
43
|
+
this.activateCodeTab(index)
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
mounted () {
|
|
47
|
+
this.loadTabs()
|
|
48
|
+
},
|
|
49
|
+
methods: {
|
|
50
|
+
changeCodeTab (index) {
|
|
51
|
+
this.activeCodeTabIndex = index
|
|
52
|
+
},
|
|
53
|
+
loadTabs () {
|
|
54
|
+
this.codeTabs = (this.$slots.default || []).filter(slot => Boolean(slot.componentOptions)).map((slot, index) => {
|
|
55
|
+
if (slot.componentOptions.propsData.active === '') {
|
|
56
|
+
this.activeCodeTabIndex = index
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return {
|
|
60
|
+
title: slot.componentOptions.propsData.title,
|
|
61
|
+
elm: slot.elm
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
if (this.activeCodeTabIndex === -1 && this.codeTabs.length > 0) {
|
|
66
|
+
this.activeCodeTabIndex = 0
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
this.activateCodeTab(0)
|
|
70
|
+
},
|
|
71
|
+
activateCodeTab (index) {
|
|
72
|
+
this.codeTabs.forEach(tab => {
|
|
73
|
+
if (tab.elm) {
|
|
74
|
+
tab.elm.classList.remove('theme-code-block__active')
|
|
75
|
+
}
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
if (this.codeTabs[index].elm) {
|
|
79
|
+
this.codeTabs[index].elm.classList.add('theme-code-block__active')
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<style lang="stylus" scoped>
|
|
87
|
+
.theme-code-group {}
|
|
88
|
+
.theme-code-group__nav {
|
|
89
|
+
margin-bottom: -35px;
|
|
90
|
+
background-color: $codeBgColor;
|
|
91
|
+
padding-bottom: 22px;
|
|
92
|
+
border-top-left-radius: 6px;
|
|
93
|
+
border-top-right-radius: 6px;
|
|
94
|
+
padding-left: 10px;
|
|
95
|
+
padding-top: 10px;
|
|
96
|
+
}
|
|
97
|
+
.theme-code-group__ul {
|
|
98
|
+
margin: auto 0;
|
|
99
|
+
padding-left: 0;
|
|
100
|
+
display: inline-flex;
|
|
101
|
+
list-style: none;
|
|
102
|
+
}
|
|
103
|
+
.theme-code-group__li {}
|
|
104
|
+
.theme-code-group__nav-tab {
|
|
105
|
+
border: 0;
|
|
106
|
+
padding: 5px;
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
background-color: transparent;
|
|
109
|
+
font-size: 0.85em;
|
|
110
|
+
line-height: 1.4;
|
|
111
|
+
color: rgba(255, 255, 255, 0.9);
|
|
112
|
+
font-weight: 600;
|
|
113
|
+
}
|
|
114
|
+
.theme-code-group__nav-tab-active {
|
|
115
|
+
border-bottom: #42b983 1px solid;
|
|
116
|
+
}
|
|
117
|
+
.pre-blank {
|
|
118
|
+
color: #42b983;
|
|
119
|
+
}
|
|
120
|
+
</style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const path = require('path')
|
|
2
|
+
|
|
3
|
+
// Theme API.
|
|
4
|
+
module.exports = (options, ctx) => {
|
|
5
|
+
const { themeConfig, siteConfig } = ctx
|
|
6
|
+
|
|
7
|
+
// resolve algolia
|
|
8
|
+
const isAlgoliaSearch = (
|
|
9
|
+
themeConfig.algolia
|
|
10
|
+
|| Object
|
|
11
|
+
.keys(siteConfig.locales && themeConfig.locales || {})
|
|
12
|
+
.some(base => themeConfig.locales[base].algolia)
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
const enableSmoothScroll = themeConfig.smoothScroll === true
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
alias () {
|
|
19
|
+
return {
|
|
20
|
+
'@AlgoliaSearchBox': isAlgoliaSearch
|
|
21
|
+
? path.resolve(__dirname, 'components/AlgoliaSearchBox.vue')
|
|
22
|
+
: path.resolve(__dirname, 'noopModule.js')
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
plugins: [
|
|
27
|
+
['@vuepress/active-header-links', options.activeHeaderLinks],
|
|
28
|
+
'@vuepress/search',
|
|
29
|
+
'@vuepress/plugin-nprogress',
|
|
30
|
+
['container', {
|
|
31
|
+
type: 'tip',
|
|
32
|
+
defaultTitle: {
|
|
33
|
+
'/': 'TIP',
|
|
34
|
+
'/zh/': '提示'
|
|
35
|
+
}
|
|
36
|
+
}],
|
|
37
|
+
['container', {
|
|
38
|
+
type: 'warning',
|
|
39
|
+
defaultTitle: {
|
|
40
|
+
'/': 'WARNING',
|
|
41
|
+
'/zh/': '注意'
|
|
42
|
+
}
|
|
43
|
+
}],
|
|
44
|
+
['container', {
|
|
45
|
+
type: 'danger',
|
|
46
|
+
defaultTitle: {
|
|
47
|
+
'/': 'WARNING',
|
|
48
|
+
'/zh/': '警告'
|
|
49
|
+
}
|
|
50
|
+
}],
|
|
51
|
+
['container', {
|
|
52
|
+
type: 'details',
|
|
53
|
+
before: info => `<details class="custom-block details">${info ? `<summary>${info}</summary>` : ''}\n`,
|
|
54
|
+
after: () => '</details>\n'
|
|
55
|
+
}],
|
|
56
|
+
['smooth-scroll', enableSmoothScroll]
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="theme-container">
|
|
3
|
+
<div class="theme-default-content">
|
|
4
|
+
<h1>404</h1>
|
|
5
|
+
|
|
6
|
+
<blockquote>{{ getMsg() }}</blockquote>
|
|
7
|
+
|
|
8
|
+
<RouterLink to="/">
|
|
9
|
+
Take me home.
|
|
10
|
+
</RouterLink>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
const msgs = [
|
|
17
|
+
`There's nothing here.`,
|
|
18
|
+
`How did we get here?`,
|
|
19
|
+
`That's a Four-Oh-Four.`,
|
|
20
|
+
`Looks like we've got some broken links.`
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
methods: {
|
|
25
|
+
getMsg () {
|
|
26
|
+
return msgs[Math.floor(Math.random() * msgs.length)]
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="theme-container"
|
|
4
|
+
:class="pageClasses"
|
|
5
|
+
@touchstart="onTouchStart"
|
|
6
|
+
@touchend="onTouchEnd"
|
|
7
|
+
>
|
|
8
|
+
<Navbar
|
|
9
|
+
v-if="shouldShowNavbar"
|
|
10
|
+
@toggle-sidebar="toggleSidebar"
|
|
11
|
+
/>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
class="sidebar-mask"
|
|
15
|
+
@click="toggleSidebar(false)"
|
|
16
|
+
/>
|
|
17
|
+
|
|
18
|
+
<Sidebar
|
|
19
|
+
:items="sidebarItems"
|
|
20
|
+
@toggle-sidebar="toggleSidebar"
|
|
21
|
+
>
|
|
22
|
+
<template #top>
|
|
23
|
+
<slot name="sidebar-top" />
|
|
24
|
+
</template>
|
|
25
|
+
<template #bottom>
|
|
26
|
+
<slot name="sidebar-bottom" />
|
|
27
|
+
</template>
|
|
28
|
+
</Sidebar>
|
|
29
|
+
|
|
30
|
+
<Home v-if="$page.frontmatter.home" />
|
|
31
|
+
|
|
32
|
+
<Page
|
|
33
|
+
v-else
|
|
34
|
+
:sidebar-items="sidebarItems"
|
|
35
|
+
>
|
|
36
|
+
<template #top>
|
|
37
|
+
<slot name="page-top" />
|
|
38
|
+
</template>
|
|
39
|
+
<template #bottom>
|
|
40
|
+
<slot name="page-bottom" />
|
|
41
|
+
</template>
|
|
42
|
+
</Page>
|
|
43
|
+
</div>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script>
|
|
47
|
+
import Home from '@theme/components/Home.vue'
|
|
48
|
+
import Navbar from '@theme/components/Navbar.vue'
|
|
49
|
+
import Page from '@theme/components/Page.vue'
|
|
50
|
+
import Sidebar from '@theme/components/Sidebar.vue'
|
|
51
|
+
import { resolveSidebarItems } from '../util'
|
|
52
|
+
|
|
53
|
+
export default {
|
|
54
|
+
name: 'Layout',
|
|
55
|
+
|
|
56
|
+
components: {
|
|
57
|
+
Home,
|
|
58
|
+
Page,
|
|
59
|
+
Sidebar,
|
|
60
|
+
Navbar
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
data () {
|
|
64
|
+
return {
|
|
65
|
+
isSidebarOpen: false
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
computed: {
|
|
70
|
+
shouldShowNavbar () {
|
|
71
|
+
const { themeConfig } = this.$site
|
|
72
|
+
const { frontmatter } = this.$page
|
|
73
|
+
if (
|
|
74
|
+
frontmatter.navbar === false
|
|
75
|
+
|| themeConfig.navbar === false) {
|
|
76
|
+
return false
|
|
77
|
+
}
|
|
78
|
+
return (
|
|
79
|
+
this.$title
|
|
80
|
+
|| themeConfig.logo
|
|
81
|
+
|| themeConfig.repo
|
|
82
|
+
|| themeConfig.nav
|
|
83
|
+
|| this.$themeLocaleConfig.nav
|
|
84
|
+
)
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
shouldShowSidebar () {
|
|
88
|
+
const { frontmatter } = this.$page
|
|
89
|
+
return (
|
|
90
|
+
!frontmatter.home
|
|
91
|
+
&& frontmatter.sidebar !== false
|
|
92
|
+
&& this.sidebarItems.length
|
|
93
|
+
)
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
sidebarItems () {
|
|
97
|
+
return resolveSidebarItems(
|
|
98
|
+
this.$page,
|
|
99
|
+
this.$page.regularPath,
|
|
100
|
+
this.$site,
|
|
101
|
+
this.$localePath
|
|
102
|
+
)
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
pageClasses () {
|
|
106
|
+
const userPageClass = this.$page.frontmatter.pageClass
|
|
107
|
+
return [
|
|
108
|
+
{
|
|
109
|
+
'no-navbar': !this.shouldShowNavbar,
|
|
110
|
+
'sidebar-open': this.isSidebarOpen,
|
|
111
|
+
'no-sidebar': !this.shouldShowSidebar
|
|
112
|
+
},
|
|
113
|
+
userPageClass
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
mounted () {
|
|
119
|
+
this.$router.afterEach(() => {
|
|
120
|
+
this.isSidebarOpen = false
|
|
121
|
+
})
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
methods: {
|
|
125
|
+
toggleSidebar (to) {
|
|
126
|
+
this.isSidebarOpen = typeof to === 'boolean' ? to : !this.isSidebarOpen
|
|
127
|
+
this.$emit('toggle-sidebar', this.isSidebarOpen)
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
// side swipe
|
|
131
|
+
onTouchStart (e) {
|
|
132
|
+
this.touchStart = {
|
|
133
|
+
x: e.changedTouches[0].clientX,
|
|
134
|
+
y: e.changedTouches[0].clientY
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
onTouchEnd (e) {
|
|
139
|
+
const dx = e.changedTouches[0].clientX - this.touchStart.x
|
|
140
|
+
const dy = e.changedTouches[0].clientY - this.touchStart.y
|
|
141
|
+
if (Math.abs(dx) > Math.abs(dy) && Math.abs(dx) > 40) {
|
|
142
|
+
if (dx > 0 && this.touchStart.x <= 80) {
|
|
143
|
+
this.toggleSidebar(true)
|
|
144
|
+
} else {
|
|
145
|
+
this.toggleSidebar(false)
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
</script>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vuepress/theme-default",
|
|
3
|
+
"version": "1.8.2",
|
|
4
|
+
"description": "Default theme for VuePress",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"documentation",
|
|
7
|
+
"generator",
|
|
8
|
+
"vue",
|
|
9
|
+
"vuepress"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://github.com/vuejs/vuepress/blob/master/packages/@vuepress/theme-default#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/vuejs/vuepress/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/vuejs/vuepress.git",
|
|
18
|
+
"directory": "packages/@vuepress/theme-default"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"author": "Evan You",
|
|
22
|
+
"main": "index.js",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@vuepress/plugin-active-header-links": "1.8.2",
|
|
25
|
+
"@vuepress/plugin-nprogress": "1.8.2",
|
|
26
|
+
"@vuepress/plugin-search": "1.8.2",
|
|
27
|
+
"docsearch.js": "^2.5.2",
|
|
28
|
+
"lodash": "^4.17.15",
|
|
29
|
+
"stylus": "^0.54.8",
|
|
30
|
+
"stylus-loader": "^3.0.2",
|
|
31
|
+
"vuepress-plugin-container": "^2.0.2",
|
|
32
|
+
"vuepress-plugin-smooth-scroll": "^0.0.3"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public"
|
|
36
|
+
},
|
|
37
|
+
"maintainers": [
|
|
38
|
+
{
|
|
39
|
+
"name": "ULIVZ",
|
|
40
|
+
"email": "chl814@foxmail.com"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"gitHead": "11eed0f0f105b97a7324cfa8e59d7d27bb966842"
|
|
44
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
@require './config'
|
|
2
|
+
|
|
3
|
+
.arrow
|
|
4
|
+
display inline-block
|
|
5
|
+
width 0
|
|
6
|
+
height 0
|
|
7
|
+
&.up
|
|
8
|
+
border-left 4px solid transparent
|
|
9
|
+
border-right 4px solid transparent
|
|
10
|
+
border-bottom 6px solid $arrowBgColor
|
|
11
|
+
&.down
|
|
12
|
+
border-left 4px solid transparent
|
|
13
|
+
border-right 4px solid transparent
|
|
14
|
+
border-top 6px solid $arrowBgColor
|
|
15
|
+
&.right
|
|
16
|
+
border-top 4px solid transparent
|
|
17
|
+
border-bottom 4px solid transparent
|
|
18
|
+
border-left 6px solid $arrowBgColor
|
|
19
|
+
&.left
|
|
20
|
+
border-top 4px solid transparent
|
|
21
|
+
border-bottom 4px solid transparent
|
|
22
|
+
border-right 6px solid $arrowBgColor
|