|
@@ -9,14 +9,14 @@
|
|
|
<p>{{ email }}</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <el-menu :default-active="path" active-text-color="#1460F3" text-color="#666" router>
|
|
|
+ <el-menu :default-openeds="['1','4']" :default-active="path" active-text-color="#1460F3" text-color="#666" router>
|
|
|
<el-submenu index="1">
|
|
|
<template slot="title">
|
|
|
<Project />
|
|
|
<span>{{ $t('aside.project') }}</span>
|
|
|
</template>
|
|
|
- <el-menu-item index="/dashboard">{{ $t('aside.dashboard') }}</el-menu-item>
|
|
|
- <el-menu-item :index="'/api/keys'||'/api/keys/new-project'||'api/keys/edit-project'">{{ $t('aside.apiKeys') }}</el-menu-item>
|
|
|
+ <el-menu-item index="/dashboard" class="dashboard">{{ $t('aside.dashboard') }}</el-menu-item>
|
|
|
+ <el-menu-item class="apiKey" :index="'/api/keys'||'/api/keys/new-project'||'api/keys/edit-project'">{{ $t('aside.apiKeys') }}</el-menu-item>
|
|
|
<el-menu-item index="/user/webhooks">{{ $t('aside.webhook') }}</el-menu-item>
|
|
|
</el-submenu>
|
|
|
<el-submenu index="2">
|
|
@@ -40,11 +40,21 @@
|
|
|
<Support />
|
|
|
<span>{{ $t('aside.support') }}</span>
|
|
|
</template>
|
|
|
- <el-menu-item index="">
|
|
|
- <a :href="apiDomain + '/api/docs/introduction'" class="downloadDoc">
|
|
|
+ <el-menu-item index="" class="introduction">
|
|
|
+ <a :href="apiDomain + '/contact-us'" target="_blank" class="downloadDoc">
|
|
|
+ {{ $t('aside.contact') }}
|
|
|
+ </a>
|
|
|
+ </el-menu-item>
|
|
|
+ <el-menu-item index="" class="introduction">
|
|
|
+ <a :href="apiDomain + '/api/docs/introduction'" target="_blank" class="downloadDoc">
|
|
|
{{ $t('aside.document') }}
|
|
|
</a>
|
|
|
</el-menu-item>
|
|
|
+ <el-menu-item index="" class="introduction">
|
|
|
+ <a :href="apiDomain + '/api-libraries/overview'" target="_blank" class="downloadDoc">
|
|
|
+ {{ $t('aside.libraries') }}
|
|
|
+ </a>
|
|
|
+ </el-menu-item>
|
|
|
</el-submenu>
|
|
|
</el-menu>
|
|
|
</div>
|
|
@@ -81,10 +91,20 @@
|
|
|
<el-submenu index="4">
|
|
|
<template slot="title"><span>{{ $t('aside.support') }}</span></template>
|
|
|
<el-menu-item index="">
|
|
|
- <a :href="apiDomain + '/api/docs/introduction'" class="downloadDoc">
|
|
|
+ <a :href="apiDomain + '/contact-us'" target="_blank" class="downloadDoc">
|
|
|
+ {{ $t('aside.contact') }}
|
|
|
+ </a>
|
|
|
+ </el-menu-item>
|
|
|
+ <el-menu-item index="">
|
|
|
+ <a :href="apiDomain + '/api/docs/introduction'" target="_blank" class="downloadDoc">
|
|
|
{{ $t('aside.document') }}
|
|
|
</a>
|
|
|
</el-menu-item>
|
|
|
+ <el-menu-item index="">
|
|
|
+ <a :href="apiDomain + '/api-libraries/overview'" target="_blank" class="downloadDoc">
|
|
|
+ {{ $t('aside.libraries') }}
|
|
|
+ </a>
|
|
|
+ </el-menu-item>
|
|
|
</el-submenu>
|
|
|
<el-submenu index="5">
|
|
|
<template slot="title"><span>{{ $i18n.locale === 'en' ? 'English' : '简体中文' }}</span></template>
|
|
@@ -103,6 +123,10 @@
|
|
|
import { Component, Vue } from 'vue-property-decorator'
|
|
|
import { loginStore } from '@/store/loginStore'
|
|
|
import i18n from '@/i18n'
|
|
|
+import { driver } from 'driver.js'
|
|
|
+import { neverPrompt } from '@/request/api'
|
|
|
+import 'driver.js/dist/driver.css'
|
|
|
+import Cookie from 'js-cookie'
|
|
|
import Project from '@/components/icon/menu_project.vue'
|
|
|
import Settings from '@/components/icon/menu_setting.vue'
|
|
|
import Billing from '@/components/icon/menu_billing.vue'
|
|
@@ -122,11 +146,140 @@ export default class Aside extends Vue {
|
|
|
// data
|
|
|
apiDomain = process.env.VUE_APP_API_DOMAIN
|
|
|
languageActive = false
|
|
|
+ isDisable = false
|
|
|
+
|
|
|
+ handleOpen (key:any, keyPath:any) {
|
|
|
+ console.log(key, keyPath)
|
|
|
+ }
|
|
|
|
|
|
created () {
|
|
|
window.addEventListener('click', this.handleGlobalClick)
|
|
|
}
|
|
|
|
|
|
+ mounted () {
|
|
|
+ const base = this.$t('guide.twoDesc[0]') as string + '<a target="_blank" href=' + this.apiDomain + '/api-libraries/authentication' + '>' + this.$t('guide.twoDesc[1]') + '</a>'
|
|
|
+ const step = i18n.locale === 'zh-cn' ? base + this.$t('guide.twoDesc[2]') as string : base
|
|
|
+ this.$nextTick(() => {
|
|
|
+ const driverObj = driver({
|
|
|
+ allowClose: false,
|
|
|
+ showProgress: true,
|
|
|
+ popoverClass: 'noviceGuide',
|
|
|
+ disableActiveInteraction: true,
|
|
|
+ nextBtnText: this.$t('guide.next') as string,
|
|
|
+ showButtons: [
|
|
|
+ 'next'
|
|
|
+ ],
|
|
|
+ progressText: '{{current}} / {{total}}',
|
|
|
+ steps: [
|
|
|
+ {
|
|
|
+ element: '.apiKey',
|
|
|
+ popover: {
|
|
|
+ title: this.$t('guide.one') as string,
|
|
|
+ description: this.$t('guide.oneDesc') as string,
|
|
|
+ onNextClick: () => {
|
|
|
+ this.$router.push('/api/keys')
|
|
|
+ this.$nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ driverObj.moveNext()
|
|
|
+ }, 250)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ side: 'left',
|
|
|
+ align: 'start'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ element: '.el-table__row',
|
|
|
+ popover: {
|
|
|
+ title: this.$t('guide.two') as string,
|
|
|
+ description: step,
|
|
|
+ side: 'bottom',
|
|
|
+ align: 'center',
|
|
|
+ onNextClick: () => {
|
|
|
+ this.$router.push('/dashboard')
|
|
|
+ this.$nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ driverObj.moveNext()
|
|
|
+ }, 250)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ element: '.dashboard',
|
|
|
+ popover:
|
|
|
+ {
|
|
|
+ title: this.$t('guide.three') as string,
|
|
|
+ description: this.$t('guide.threeDesc') as string,
|
|
|
+ side: 'bottom',
|
|
|
+ align: 'start'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ element: '.introduction',
|
|
|
+ popover: {
|
|
|
+ title: this.$t('guide.four') as string,
|
|
|
+ description: this.$t('guide.fourDesc') as string,
|
|
|
+ side: 'left',
|
|
|
+ align: 'start',
|
|
|
+ onPopoverRender: (popover, { config, state }) => {
|
|
|
+ const footer = document.querySelector('.driver-popover-footer') as HTMLElement | null
|
|
|
+ const step = document.querySelector('.driver-popover-progress-text') as HTMLElement | null
|
|
|
+ const next = document.querySelector('.driver-popover-next-btn') as HTMLElement | null
|
|
|
+ if (step && next) {
|
|
|
+ next.innerText = this.$t('guide.done') as string
|
|
|
+ step.style.display = 'none'
|
|
|
+ }
|
|
|
+ const firstCheck = document.createElement('input')
|
|
|
+ const text = document.createElement('p')
|
|
|
+ const div = document.createElement('div')
|
|
|
+ const span = document.createElement('span')
|
|
|
+ text.innerText = this.$t('guide.disable') as string
|
|
|
+ firstCheck.type = 'checkbox'
|
|
|
+ if (footer) {
|
|
|
+ footer.style.justifyContent = 'space-between'
|
|
|
+ const referenceNode = footer.firstChild
|
|
|
+ footer.insertBefore(div, referenceNode)
|
|
|
+ div.appendChild(span)
|
|
|
+ div.appendChild(firstCheck)
|
|
|
+ div.appendChild(text)
|
|
|
+ }
|
|
|
+ span.addEventListener('click', () => {
|
|
|
+ if (footer && span) {
|
|
|
+ span.style.display = 'none'
|
|
|
+ firstCheck.style.display = 'inline'
|
|
|
+ this.isDisable = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ firstCheck.addEventListener('click', () => {
|
|
|
+ if (footer && span) {
|
|
|
+ span.className = 'img'
|
|
|
+ span.style.display = 'flex'
|
|
|
+ span.innerHTML = '<svg data-v-1e0db733="" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class=""><rect data-v-1e0db733="" x="1" y="1" width="22" height="22" rx="4" fill="#396FFA"></rect><path data-v-1e0db733="" d="M18 9L11.333 15.667L7.09035 11.4244" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>'
|
|
|
+ firstCheck.style.display = 'none'
|
|
|
+ this.isDisable = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onNextClick: async () => {
|
|
|
+ if (this.isDisable) {
|
|
|
+ await neverPrompt({}, {})
|
|
|
+ }
|
|
|
+ Cookie.set('isDisable', true, { expires: 14, domain: process.env.VUE_APP_SaaS_DOMAIN })
|
|
|
+ driverObj.moveNext()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ const screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
|
|
|
+ const isDisable = Cookie.get('isDisable')
|
|
|
+ if (screenWidth > 930 && isDisable === 'false') {
|
|
|
+ driverObj.drive()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
beforeDestroy () {
|
|
|
window.removeEventListener('click', this.handleGlobalClick)
|
|
|
}
|