v1.0.3-beta.2

This commit is contained in:
huanqing.shao
2019-09-15 22:49:35 +08:00
parent a23e1fb75f
commit a2ea384338
13 changed files with 165 additions and 60 deletions

View File

@@ -19,7 +19,7 @@
<div style="margin-bottom: 10px;">github star 本窗口将不再弹出</div> -->
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="waitAMoment">一会儿再说</el-button>
<el-button @click="reset">一会儿再说</el-button>
<el-button type="primary" @click="gotoStar">够义气现在就去</el-button>
</span>
</el-dialog>
@@ -28,8 +28,9 @@
<script>
import Vue from 'vue'
import 'element-ui/lib/theme-chalk/index.css';
import { Dialog, Button } from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'
import { Dialog, Button } from 'element-ui'
import { differenceInMinutes } from 'date-fns'
Vue.component(Dialog.name, Dialog)
Vue.component(Button.name, Button)
@@ -41,24 +42,63 @@ export default {
};
},
mounted () {
this.waitAMoment()
if (localStorage.getItem('stared') === 'true') {
console.log('已经去过 GITHUB')
return
}
setInterval(this.checkDuration, 10000)
},
methods: {
waitAMoment() {
this.dialogVisible = false
checkDuration() {
let firstAccess = localStorage.getItem('FIRST_ACCESS')
// console.log(new Date(), new Date(firstAccess))
if (!firstAccess) {
console.log('FIRST_ACCESS', new Date())
localStorage.setItem('FIRST_ACCESS', new Date())
} else {
// console.log('differenceInMinutes', differenceInMinutes(new Date(), new Date(firstAccess)))
if (differenceInMinutes(new Date(), new Date(firstAccess)) >= 10 && !this.dialogVisible) {
this.show()
}
}
},
show () {
this.dialogVisible = true
if (localStorage.getItem('stared') === 'true') {
console.log('已经去过 GITHUB')
return
}
let _this = this
setTimeout(_ => {
_this.dialogVisible = true
// }, 10000)
}, 60000 * 2)
if (window.ga) {
window.ga('send', {
hitType: 'event',
eventCategory: 'StarGazer',
eventAction: 'Show',
eventLabel: '显示 StarGazer'
});
console.log('发送成功 ga event')
} else {
console.log('开发环境,不发送 ga event')
}
},
reset () {
localStorage.removeItem('FIRST_ACCESS')
this.dialogVisible = false
},
gotoStar() {
this.dialogVisible = false
window.open('https://github.com/eip-work/kuboard-press')
localStorage.setItem('stared', 'true')
if (window.ga) {
window.ga('send', {
hitType: 'event',
eventCategory: 'StarGazer',
eventAction: 'Click',
eventLabel: '前往 github'
});
console.log('发送成功 ga event')
} else {
console.log('开发环境,不发送 ga event')
}
}
}
}

View File

@@ -1,10 +1,10 @@
let dateFns = require('date-fns')
module.exports = {
title: 'Kuboard - Kubernetes k8s 安装/部署/入门/免费教程/实践/微服务管理界面',
description: '一个非常 cool 的 Kubernetes Dashboard简化 Kubernetes 的学习和使用,帮助您快速落地 Kubernetes同时提供 Spring Cloud 微服务部署教程DevOps教程',
title: 'Kuboard - Kubernetes k8s 国内安装/部署/入门/免费中文教程/实践/微服务管理界面',
description: '一个非常 cool 的 Kubernetes Dashboard简化 Kubernetes 的学习和使用,帮助您快速落地 Kubernetes提供 Kubernetes 免费中文教程、国内安装文档',
head: [
['meta', {name: 'keywords', content: 'Kubernetes, Docker, Dashboard, Kuboard, Spring Cloud, micro service, DevOps, 微服务, 持续构建集成, 容器, Kubernetes 教程, Kubernetes 入门, K8S 教程, K8S 入门, 微服务实践, Kubernetes 安装, K8S 安装, Kubernetes 安装, Kubernetes 部署'}],
['meta', {name: 'keywords', content: 'Kubernetes, Docker, Dashboard, Kuboard, Spring Cloud, micro service, DevOps, 微服务, 持续构建集成, Kubernetes 中文教程, Kubernetes 入门, K8S 教程, K8S 入门, 微服务实践, Kubernetes 国内安装, K8S 安装, Kubernetes 安装, Kubernetes 部署'}],
['script', {}, `
var _hmt = _hmt || [];
(function() {

View File

@@ -1,2 +0,0 @@
User-agent: *
Allow: /

View File

@@ -2,23 +2,34 @@
<header class="navbar">
<SidebarButton @toggle-sidebar="$emit('toggle-sidebar')"/>
<router-link
:to="$localePath"
class="home-link"
>
<img
class="logo"
v-if="$site.themeConfig.logo"
:src="$withBase($site.themeConfig.logo)"
:alt="$siteTitle"
<div style="white-space: nowrap; text-overflow: ellipsis; overflow: hidden; max-width: calc(100vw - 120px);">
<router-link
:to="$localePath"
class="home-link noselect"
>
<span
ref="siteName"
class="site-name"
v-if="$siteTitle"
:class="{ 'can-hide': $site.themeConfig.logo }"
>Kuboard</span>
</router-link>
<img
class="logo"
v-if="$site.themeConfig.logo"
:src="$withBase($site.themeConfig.logo)"
:alt="$siteTitle"
>
<span
ref="siteName"
class="site-name"
v-if="$siteTitle"
:class="{ 'can-hide': $site.themeConfig.logo }"
>Kuboard - </span>
</router-link>
<span class="home-link noselect" style="line-height: 2.2em; font-size: 1em; font-weight: 400;">
<a href="/learning/">
<span style="color: #42b983;">提供K8S免费教程</span>
</a>
<span style="color: #2c3e50;">|</span>
<a href="/support/#%E5%BE%AE%E6%9C%8D%E5%8A%A1%E8%90%BD%E5%9C%B0%E5%92%A8%E8%AF%A2">
<span style="color: #007af5;">微服务落地咨询</span>
</a>
</span>
</div>
<div
class="links"