mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
715 lines
23 KiB
715 lines
23 KiB
4 years ago
|
<template>
|
||
|
<v-app v-if="isProjectInfoLoaded">
|
||
2 years ago
|
<v-app-bar class="elevation-0" color="primary" app clipped-left dense dark height="48">
|
||
3 years ago
|
<div class="d-flex align-center pt-1" style="flex: 1">
|
||
|
<v-toolbar-title>
|
||
3 years ago
|
<v-tooltip bottom>
|
||
3 years ago
|
<template #activator="{ on }">
|
||
|
<v-btn
|
||
3 years ago
|
v-t="['c:navbar:home']"
|
||
3 years ago
|
to="/projects"
|
||
|
icon
|
||
|
class="pa-1 pr-0 brand-icon nc-noco-brand-icon"
|
||
|
v-on="on"
|
||
|
>
|
||
|
<v-img :src="logo" max-height="32px" max-width="32px" />
|
||
|
</v-btn>
|
||
3 years ago
|
</template>
|
||
3 years ago
|
<!-- Home -->
|
||
2 years ago
|
{{ $t('general.home') }}
|
||
|
<span class="caption font-weight-light pointer"
|
||
|
>(v{{ $store.state.project.appInfo && $store.state.project.appInfo.version }})</span
|
||
|
>
|
||
3 years ago
|
</v-tooltip>
|
||
3 years ago
|
|
||
2 years ago
|
<span class="body-1 ml-n1" @click="$router.push('/projects')"> {{ brandName }}</span>
|
||
3 years ago
|
</v-toolbar-title>
|
||
3 years ago
|
|
||
3 years ago
|
<!-- <v-toolbar-items />-->
|
||
|
<!-- loading -->
|
||
2 years ago
|
<span v-show="$nuxt.$loading.show" class="caption grey--text ml-3"
|
||
|
>{{ $t('general.loading') }} <v-icon small color="grey">mdi-spin mdi-loading</v-icon></span
|
||
|
>
|
||
3 years ago
|
|
||
3 years ago
|
<span v-shortkey="['ctrl', 'shift', 'd']" @shortkey="openDiscord" />
|
||
3 years ago
|
</div>
|
||
|
|
||
2 years ago
|
<div v-if="isDashboard" class="text-capitalize text-center title" style="flex: 1">
|
||
|
{{ $store.getters['project/GtrProjectName'] }}
|
||
3 years ago
|
</div>
|
||
|
|
||
|
<div style="flex: 1" class="d-flex justify-end">
|
||
|
<v-toolbar-items class="hidden-sm-and-down nc-topright-menu">
|
||
|
<release-info />
|
||
|
|
||
|
<language class="mr-3" />
|
||
|
<template v-if="isDashboard">
|
||
|
<div>
|
||
|
<x-btn
|
||
|
v-if="_isUIAllowed('add-user')"
|
||
|
small
|
||
|
btn-class="primary--text nc-menu-share white"
|
||
|
@click="shareModal = true"
|
||
|
>
|
||
2 years ago
|
<v-icon small class="mr-1"> mdi-account-supervisor-outline </v-icon>
|
||
3 years ago
|
<!-- Share -->
|
||
2 years ago
|
{{ $t('activity.share') }}
|
||
3 years ago
|
</x-btn>
|
||
|
|
||
|
<share-or-invite-modal v-model="shareModal" />
|
||
|
</div>
|
||
2 years ago
|
<span v-shortkey="['ctrl', 'shift', 'd']" @shortkey="$router.push('/')" />
|
||
3 years ago
|
<x-btn
|
||
3 years ago
|
v-if="!$store.state.settings.nc"
|
||
3 years ago
|
text
|
||
|
btn.class="caption font-weight-bold px-2 text-capitalize"
|
||
|
tooltip="Enable/Disable Models"
|
||
|
@click="cronTabAdd()"
|
||
3 years ago
|
>
|
||
2 years ago
|
<v-icon size="20"> mdi-timetable </v-icon> Crons
|
||
3 years ago
|
</x-btn>
|
||
3 years ago
|
</template>
|
||
|
<template v-else>
|
||
2 years ago
|
<span v-shortkey="['ctrl', 'shift', 'c']" @shortkey="settingsTabAdd" />
|
||
3 years ago
|
|
||
3 years ago
|
<span v-shortkey="['ctrl', 'shift', 'b']" @shortkey="changeTheme" />
|
||
3 years ago
|
</template>
|
||
4 years ago
|
|
||
3 years ago
|
<preview-as class="mx-1" />
|
||
4 years ago
|
|
||
3 years ago
|
<v-menu v-if="isAuthenticated" offset-y>
|
||
3 years ago
|
<template #activator="{ on }">
|
||
2 years ago
|
<v-icon v-ge="['Profile', '']" text class="font-weight-bold nc-menu-account icon" v-on="on">
|
||
3 years ago
|
<!-- <v-icon></v-icon>-->
|
||
|
mdi-dots-vertical
|
||
3 years ago
|
</v-icon>
|
||
|
</template>
|
||
3 years ago
|
<v-list dense class="nc-user-menu">
|
||
|
<template>
|
||
2 years ago
|
<v-list-item v-t="['c:navbar:user:email']" v-ge="['Settings', '']" dense to="/user/settings">
|
||
3 years ago
|
<v-list-item-title>
|
||
2 years ago
|
<v-icon small> mdi-at </v-icon>
|
||
|
<span class="font-weight-bold caption">{{ userEmail }}</span>
|
||
3 years ago
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
|
|
||
|
<v-divider />
|
||
|
|
||
|
<!-- Copy Auth Token -->
|
||
|
<!-- "Auth token copied to clipboard" -->
|
||
|
<v-list-item
|
||
|
v-if="isDashboard"
|
||
3 years ago
|
v-t="['a:navbar:user:copy-auth-token']"
|
||
3 years ago
|
v-clipboard="$store.state.users.token"
|
||
|
dense
|
||
2 years ago
|
@click.stop="$toast.success($t('msg.toast.authToken')).goAway(3000)"
|
||
3 years ago
|
>
|
||
|
<v-list-item-title>
|
||
2 years ago
|
<v-icon key="terminal-dash" small> mdi-content-copy </v-icon>
|
||
|
<span class="font-weight-regular caption">{{ $t('activity.account.authToken') }}</span>
|
||
3 years ago
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
|
<v-list-item
|
||
3 years ago
|
v-if="isDashboard"
|
||
3 years ago
|
v-t="['a:navbar:user:swagger']"
|
||
3 years ago
|
dense
|
||
2 years ago
|
@click.stop="openUrl(swaggerLink)"
|
||
3 years ago
|
>
|
||
|
<v-list-item-title>
|
||
2 years ago
|
<v-icon key="terminal-dash" small> mdi-code-json </v-icon>
|
||
|
<span class="font-weight-regular caption"> {{ 'Swagger API Doc' }}</span>
|
||
3 years ago
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
3 years ago
|
<!-- <v-list-item
|
||
|
v-t="['a:navbar:user:redoc']"
|
||
|
dense
|
||
|
@click.stop="
|
||
|
openUrl(redocLink)
|
||
|
"
|
||
|
>
|
||
|
<v-list-item-title>
|
||
|
<v-icon key="terminal-dash" small>
|
||
|
mdi-code-json
|
||
|
</v-icon>
|
||
|
<span class="font-weight-regular caption">
|
||
|
{{ "Redoc API Doc" }}</span>
|
||
|
</v-list-item-title>
|
||
|
</v-list-item>-->
|
||
3 years ago
|
<v-divider />
|
||
|
<v-list-item
|
||
|
v-if="isDashboard"
|
||
3 years ago
|
v-t="['c:navbar:user:copy-proj-info']"
|
||
|
v-ge="['Sign Out', '']"
|
||
3 years ago
|
dense
|
||
|
@click="copyProjectInfo"
|
||
|
>
|
||
|
<v-list-item-title>
|
||
2 years ago
|
<v-icon small> mdi-content-copy </v-icon>
|
||
|
<span class="font-weight-regular caption">{{ $t('activity.account.projInfo') }}</span>
|
||
3 years ago
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
|
<v-divider v-if="isDashboard" />
|
||
2 years ago
|
<v-list-item v-if="isDashboard" v-t="['c:navbar:user:themes']" dense @click.stop="settingsTabAdd">
|
||
3 years ago
|
<v-list-item-title>
|
||
2 years ago
|
<v-icon key="terminal-dash" small> mdi-palette </v-icon>
|
||
|
<span class="font-weight-regular caption">{{ $t('activity.account.themes') }}</span>
|
||
3 years ago
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
|
|
||
|
<v-divider v-if="isDashboard" />
|
||
|
|
||
2 years ago
|
<v-list-item v-t="['a:navbar:user:sign-out']" v-ge="['Sign Out', '']" dense @click="MtdSignOut">
|
||
3 years ago
|
<v-list-item-title>
|
||
2 years ago
|
<v-icon small> mdi-logout </v-icon>
|
||
|
<span class="font-weight-regular caption">{{ $t('general.signOut') }}</span>
|
||
3 years ago
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
|
</template>
|
||
|
</v-list>
|
||
|
</v-menu>
|
||
|
<v-menu v-else offset-y open-on-hover>
|
||
3 years ago
|
<template #activator="{ on }">
|
||
2 years ago
|
<v-btn v-ge="['Profile', '']" text class="font-weight-bold nc-menu-account" v-on="on">
|
||
3 years ago
|
<!-- Menu-->
|
||
|
<v-icon>mdi-account</v-icon>
|
||
|
<v-icon>arrow_drop_down</v-icon>
|
||
|
</v-btn>
|
||
3 years ago
|
</template>
|
||
3 years ago
|
<v-list dense>
|
||
2 years ago
|
<v-list-item v-if="!user && !isThisMobile" dense to="/user/authentication/signup">
|
||
3 years ago
|
<v-list-item-title>
|
||
2 years ago
|
<v-icon small> mdi-account-plus-outline </v-icon>
|
||
|
<span class="font-weight-regular caption">{{ $t('general.signUp') }}</span>
|
||
3 years ago
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
2 years ago
|
<v-list-item v-if="!user && !isThisMobile" dense to="/user/authentication/signin">
|
||
3 years ago
|
<v-list-item-title>
|
||
2 years ago
|
<v-icon small> mdi-login </v-icon>
|
||
|
<span class="font-weight-regular caption">{{ $t('general.signIn') }}</span>
|
||
3 years ago
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
3 years ago
|
</v-list>
|
||
|
</v-menu>
|
||
|
</v-toolbar-items>
|
||
|
</div>
|
||
4 years ago
|
</v-app-bar>
|
||
|
|
||
|
<v-main class="pb-0 mb-0">
|
||
|
<v-container class="ma-0 pa-0" fluid style="">
|
||
2 years ago
|
<v-progress-linear v-show="GetPendingStatus" top absolute color="success" indeterminate height="2" />
|
||
4 years ago
|
|
||
3 years ago
|
<nuxt />
|
||
4 years ago
|
</v-container>
|
||
|
</v-main>
|
||
|
<dlgUnexpectedError
|
||
|
v-if="dialogErrorShow"
|
||
|
heading="Unexpected Error"
|
||
|
:error="error"
|
||
3 years ago
|
:dialog-error-show="dialogErrorShow"
|
||
|
:error-dialog-cancel="errorDialogCancel"
|
||
|
:error-dialog-report="errorDialogReport"
|
||
4 years ago
|
/>
|
||
2 years ago
|
<dlgDebug v-if="dialogDebug" :dialog-show="dialogDebug" :mtd-dialog-cancel="dialogDebugCancel" />
|
||
3 years ago
|
<settings v-model="settingsDialog" />
|
||
3 years ago
|
<loader />
|
||
4 years ago
|
</v-app>
|
||
|
<v-app v-else>
|
||
|
<v-overlay>
|
||
3 years ago
|
<v-progress-circular indeterminate size="64" />
|
||
4 years ago
|
</v-overlay>
|
||
|
</v-app>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
2 years ago
|
import { mapGetters, mapActions, mapMutations } from 'vuex';
|
||
|
import ReleaseInfo from '~/components/ReleaseInfo';
|
||
|
import 'splitpanes/dist/splitpanes.css';
|
||
|
import XBtn from '../components/global/XBtn';
|
||
|
import dlgUnexpectedError from '../components/utils/DlgUnexpectedError';
|
||
|
import settings from '../components/Settings';
|
||
|
import { copyTextToClipboard } from '@/helpers/xutils';
|
||
|
import Language from '~/components/utils/Language';
|
||
|
import Loader from '~/components/Loader';
|
||
|
import PreviewAs from '~/components/PreviewAs';
|
||
|
import ShareOrInviteModal from '~/components/auth/ShareOrInviteModal';
|
||
|
import weAreHiring from '~/helpers/weAreHiring';
|
||
4 years ago
|
|
||
|
export default {
|
||
|
components: {
|
||
3 years ago
|
ShareOrInviteModal,
|
||
|
PreviewAs,
|
||
3 years ago
|
Loader,
|
||
3 years ago
|
ReleaseInfo,
|
||
3 years ago
|
Language,
|
||
4 years ago
|
XBtn,
|
||
|
dlgUnexpectedError,
|
||
2 years ago
|
settings,
|
||
4 years ago
|
},
|
||
|
data: () => ({
|
||
3 years ago
|
clickCount: true,
|
||
3 years ago
|
templateModal: false,
|
||
4 years ago
|
swaggerOrGraphiqlUrl: null,
|
||
|
showScreensaver: false,
|
||
|
roleIcon: {
|
||
3 years ago
|
owner: 'mdi-account-star',
|
||
|
creator: 'mdi-account-hard-hat',
|
||
|
editor: 'mdi-account-edit',
|
||
2 years ago
|
viewer: 'mdi-eye-outline',
|
||
4 years ago
|
},
|
||
|
showAppStore: false,
|
||
|
showChangeEnv: false,
|
||
|
feedDialog: false,
|
||
|
releaseDownloadedSnackbar: false,
|
||
|
downloadAvailSnackbar: false,
|
||
|
settingsDialog: false,
|
||
|
environmentDialog: false,
|
||
|
darkTheme: true,
|
||
|
error: null,
|
||
|
dialogErrorShow: false,
|
||
|
dialogDebug: false,
|
||
|
clipped: false,
|
||
|
drawer: null,
|
||
|
fixed: false,
|
||
|
right: true,
|
||
3 years ago
|
title: 'Xgene',
|
||
4 years ago
|
isHydrated: false,
|
||
|
snackbar: false,
|
||
|
timeout: 10000,
|
||
3 years ago
|
rolesList: null,
|
||
2 years ago
|
shareModal: false,
|
||
4 years ago
|
}),
|
||
|
computed: {
|
||
3 years ago
|
swaggerLink() {
|
||
2 years ago
|
return new URL(
|
||
|
`/api/v1/db/meta/projects/${this.projectId}/swagger`,
|
||
|
this.$store.state.project.appInfo && this.$store.state.project.appInfo.ncSiteUrl
|
||
|
);
|
||
3 years ago
|
},
|
||
|
redocLink() {
|
||
2 years ago
|
return new URL(
|
||
|
`/api/v1/db/meta/projects/${this.projectId}/redoc`,
|
||
|
this.$store.state.project.appInfo && this.$store.state.project.appInfo.ncSiteUrl
|
||
|
);
|
||
3 years ago
|
},
|
||
4 years ago
|
...mapGetters({
|
||
3 years ago
|
logo: 'plugins/brandLogo',
|
||
|
brandName: 'plugins/brandName',
|
||
|
projects: 'project/list',
|
||
|
tabs: 'tabs/list',
|
||
|
sqldMgr: 'sqlMgr/sqlMgr',
|
||
|
GetPendingStatus: 'notification/GetPendingStatus',
|
||
|
isAuthenticated: 'users/GtrIsAuthenticated',
|
||
|
isAdmin: 'users/GtrIsAdmin',
|
||
|
isDocker: 'project/GtrIsDocker',
|
||
|
isFirstLoad: 'project/GtrIsFirstLoad',
|
||
|
isGql: 'project/GtrProjectIsGraphql',
|
||
|
isRest: 'project/GtrProjectIsRest',
|
||
|
isGrpc: 'project/GtrProjectIsGrpc',
|
||
|
role: 'users/GtrRole',
|
||
2 years ago
|
userEmail: 'users/GtrUserEmail',
|
||
4 years ago
|
}),
|
||
3 years ago
|
user() {
|
||
2 years ago
|
return this.$store.getters['users/GtrUser'];
|
||
3 years ago
|
},
|
||
|
isThisMobile() {
|
||
|
// just an example, could be one specific value if that's all you need
|
||
2 years ago
|
return this.isHydrated ? this.$vuetify.breakpoint.smAndDown : false;
|
||
|
},
|
||
4 years ago
|
},
|
||
|
watch: {
|
||
3 years ago
|
'$route.path'(path, oldPath) {
|
||
4 years ago
|
try {
|
||
3 years ago
|
if (oldPath === path) {
|
||
2 years ago
|
return;
|
||
3 years ago
|
}
|
||
2 years ago
|
const recaptcha = this.$recaptchaInstance;
|
||
3 years ago
|
if (path.startsWith('/user/')) {
|
||
2 years ago
|
recaptcha.showBadge();
|
||
4 years ago
|
} else {
|
||
2 years ago
|
recaptcha.hideBadge();
|
||
4 years ago
|
}
|
||
3 years ago
|
} catch (e) {}
|
||
4 years ago
|
},
|
||
3 years ago
|
'$route.params.project_id'(newId, oldId) {
|
||
4 years ago
|
if (newId && newId !== oldId) {
|
||
2 years ago
|
this.loadProjectInfo();
|
||
4 years ago
|
}
|
||
|
if (!newId) {
|
||
2 years ago
|
this.swaggerOrGraphiqlUrl = null;
|
||
4 years ago
|
}
|
||
2 years ago
|
},
|
||
4 years ago
|
},
|
||
3 years ago
|
mounted() {
|
||
2 years ago
|
this.selectedEnv = this.$store.getters['project/GtrActiveEnv'];
|
||
|
this.loadProjectInfo();
|
||
3 years ago
|
},
|
||
3 years ago
|
created() {
|
||
2 years ago
|
weAreHiring();
|
||
3 years ago
|
},
|
||
4 years ago
|
methods: {
|
||
3 years ago
|
...mapActions({ changeActiveTab: 'tabs/changeActiveTab' }),
|
||
4 years ago
|
...mapMutations({
|
||
3 years ago
|
toggleLogWindow: 'settings/MutToggleLogWindow',
|
||
|
toggleOutputWindow: 'settings/MutToggleOutputWindow',
|
||
2 years ago
|
toggleTreeviewWindow: 'settings/MutToggleTreeviewWindow',
|
||
4 years ago
|
}),
|
||
3 years ago
|
async loadProjectInfo() {
|
||
3 years ago
|
// if (this.$route.params.project_id) {
|
||
|
// try {
|
||
|
// const { info } = (await this.$axios.get(`/nc/${this.$route.params.project_id}/projectApiInfo`, {
|
||
|
// headers: {
|
||
|
// 'xc-auth': this.$store.state.users.token
|
||
|
// }
|
||
|
// })).data
|
||
|
// const obj = Object.values(info).find(v => v.apiType === 'rest' ? v.swaggerUrl : v.gqlApiUrl)
|
||
|
// this.swaggerOrGraphiqlUrl = obj.apiType === 'rest' ? obj.swaggerUrl : obj.gqlApiUrl
|
||
|
// } catch (e) {
|
||
|
// }
|
||
|
// }
|
||
4 years ago
|
},
|
||
3 years ago
|
setPreviewUSer(previewAs) {
|
||
2 years ago
|
this.previewAs = previewAs;
|
||
|
window.location.reload();
|
||
4 years ago
|
},
|
||
3 years ago
|
showAppStoreIcon() {
|
||
2 years ago
|
this.showAppStore = true;
|
||
|
this.$toast.info('Apps unlocked').goAway(5000);
|
||
4 years ago
|
},
|
||
|
|
||
3 years ago
|
isProjectInfoLoaded() {
|
||
2 years ago
|
return this.$store.state.project.appInfo !== null;
|
||
4 years ago
|
},
|
||
3 years ago
|
githubClickHandler(e) {
|
||
4 years ago
|
// e.preventDefault();
|
||
|
// shell.openExternal(e.path.find(e => e.href).href);
|
||
|
},
|
||
3 years ago
|
openUrl(url) {
|
||
2 years ago
|
window.open(url, '_blank');
|
||
4 years ago
|
},
|
||
3 years ago
|
openPricingPage() {
|
||
4 years ago
|
// shell.openExternal(process.env.serverUrl + '/pricing')
|
||
|
},
|
||
3 years ago
|
openHowItWorks() {
|
||
4 years ago
|
// shell.openExternal(process.env.serverUrl + '/how-it-works')
|
||
|
},
|
||
3 years ago
|
openDiscord() {
|
||
4 years ago
|
// shell.openExternal('https://discord.gg/5RgZmkW')
|
||
|
},
|
||
3 years ago
|
openGithub() {
|
||
4 years ago
|
// shell.openExternal('https://github.com/NocoDB/NocoDB')
|
||
|
},
|
||
3 years ago
|
dialogDebugCancel() {
|
||
2 years ago
|
this.dialogDebug = false;
|
||
4 years ago
|
},
|
||
3 years ago
|
dialogDebugShow() {
|
||
2 years ago
|
this.dialogDebug = true;
|
||
4 years ago
|
},
|
||
|
|
||
3 years ago
|
errorDialogCancel() {
|
||
2 years ago
|
this.dialogErrorShow = false;
|
||
4 years ago
|
},
|
||
3 years ago
|
errorDialogReport() {
|
||
2 years ago
|
this.dialogErrorShow = false;
|
||
4 years ago
|
},
|
||
3 years ago
|
loadChat() {
|
||
4 years ago
|
if (!window.Tawk_API) {
|
||
2 years ago
|
const s1 = document.createElement('script');
|
||
|
const s0 = document.getElementsByTagName('script')[0];
|
||
|
s1.async = true;
|
||
|
s1.src = 'https://embed.tawk.to/5d81b8de9f6b7a4457e23ba7/default';
|
||
|
s1.charset = 'UTF-8';
|
||
|
s1.setAttribute('crossorigin', '*');
|
||
|
s0.parentNode.insertBefore(s1, s0);
|
||
|
setTimeout(() => window.Tawk_API && window.Tawk_API.maximize(), 2000);
|
||
4 years ago
|
} else {
|
||
2 years ago
|
window.Tawk_API.maximize();
|
||
4 years ago
|
}
|
||
|
},
|
||
3 years ago
|
handleMigrationsMenuClick(item, closeMenu = true, sqlEditor = false) {},
|
||
3 years ago
|
apiClientTabAdd() {
|
||
4 years ago
|
// if (this.$route.path.indexOf('dashboard') > -1) {
|
||
2 years ago
|
const tabIndex = this.tabs.findIndex(el => el.key === 'apiClientDir');
|
||
4 years ago
|
if (tabIndex !== -1) {
|
||
2 years ago
|
this.changeActiveTab(tabIndex);
|
||
4 years ago
|
} else {
|
||
2 years ago
|
const item = { name: 'API Client', key: 'apiClientDir' };
|
||
|
item._nodes = { env: '_noco' };
|
||
|
item._nodes.type = 'apiClientDir';
|
||
|
this.$store.dispatch('tabs/ActAddTab', item);
|
||
4 years ago
|
}
|
||
|
},
|
||
3 years ago
|
apiClientSwaggerTabAdd() {
|
||
4 years ago
|
// if (this.$route.path.indexOf('dashboard') > -1) {
|
||
2 years ago
|
const tabIndex = this.tabs.findIndex(el => el.key === 'apiClientSwaggerDir');
|
||
4 years ago
|
if (tabIndex !== -1) {
|
||
2 years ago
|
this.changeActiveTab(tabIndex);
|
||
4 years ago
|
} else {
|
||
2 years ago
|
const item = { name: 'API Client', key: 'apiClientSwaggerDir' };
|
||
|
item._nodes = { env: '_noco' };
|
||
|
item._nodes.type = 'apiClientSwaggerDir';
|
||
|
this.$store.dispatch('tabs/ActAddTab', item);
|
||
4 years ago
|
}
|
||
|
},
|
||
3 years ago
|
projectInfoTabAdd() {
|
||
2 years ago
|
const tabIndex = this.tabs.findIndex(el => el.key === 'projectInfo');
|
||
4 years ago
|
if (tabIndex !== -1) {
|
||
2 years ago
|
this.changeActiveTab(tabIndex);
|
||
4 years ago
|
} else {
|
||
2 years ago
|
const item = { name: 'Info', key: 'projectInfo' };
|
||
|
item._nodes = { env: '_noco' };
|
||
|
item._nodes.type = 'projectInfo';
|
||
|
this.$store.dispatch('tabs/ActAddTab', item);
|
||
4 years ago
|
}
|
||
|
},
|
||
3 years ago
|
xcMetaTabAdd() {
|
||
4 years ago
|
// if (this.$route.path.indexOf('dashboard') > -1) {
|
||
2 years ago
|
const tabIndex = this.tabs.findIndex(el => el.key === 'meta');
|
||
4 years ago
|
if (tabIndex !== -1) {
|
||
2 years ago
|
this.changeActiveTab(tabIndex);
|
||
4 years ago
|
} else {
|
||
2 years ago
|
const item = { name: 'Meta', key: 'meta' };
|
||
|
item._nodes = { env: '_noco' };
|
||
|
item._nodes.type = 'meta';
|
||
|
this.$store.dispatch('tabs/ActAddTab', item);
|
||
4 years ago
|
}
|
||
|
},
|
||
3 years ago
|
apiClientSwaggerOpen() {
|
||
2 years ago
|
this.$router.push('/apiClient');
|
||
4 years ago
|
},
|
||
3 years ago
|
graphqlClientTabAdd() {
|
||
2 years ago
|
window.open(this.swaggerOrGraphiqlUrl, '_blank');
|
||
4 years ago
|
},
|
||
3 years ago
|
swaggerClientTabAdd() {
|
||
2 years ago
|
window.open(this.swaggerOrGraphiqlUrl, '_blank');
|
||
4 years ago
|
},
|
||
3 years ago
|
grpcTabAdd() {
|
||
2 years ago
|
const tabIndex = this.tabs.findIndex(el => el.key === 'grpcClient');
|
||
4 years ago
|
if (tabIndex !== -1) {
|
||
2 years ago
|
this.changeActiveTab(tabIndex);
|
||
4 years ago
|
} else {
|
||
2 years ago
|
const item = { name: 'gRPC Client', key: 'grpcClient' };
|
||
|
item._nodes = { env: '_noco' };
|
||
|
item._nodes.type = 'grpcClient';
|
||
|
this.$store.dispatch('tabs/ActAddTab', item);
|
||
4 years ago
|
}
|
||
|
},
|
||
3 years ago
|
rolesTabAdd() {
|
||
2 years ago
|
const tabIndex = this.tabs.findIndex(el => el.key === 'roles');
|
||
4 years ago
|
if (tabIndex !== -1) {
|
||
2 years ago
|
this.changeActiveTab(tabIndex);
|
||
4 years ago
|
} else {
|
||
2 years ago
|
const item = { name: 'Team & Auth ', key: 'roles' };
|
||
|
item._nodes = { env: '_noco' };
|
||
|
item._nodes.type = 'roles';
|
||
|
this.$store.dispatch('tabs/ActAddTab', item);
|
||
4 years ago
|
}
|
||
3 years ago
|
setTimeout(() => {
|
||
2 years ago
|
this.$eventBus.$emit('show-add-user');
|
||
|
}, 200);
|
||
4 years ago
|
},
|
||
3 years ago
|
settingsTabAdd() {
|
||
2 years ago
|
const tabIndex = this.tabs.findIndex(el => el.key === 'projectSettings');
|
||
4 years ago
|
if (tabIndex !== -1) {
|
||
2 years ago
|
this.changeActiveTab(tabIndex);
|
||
4 years ago
|
} else {
|
||
2 years ago
|
const item = { name: 'Themes', key: 'projectSettings' };
|
||
|
item._nodes = { env: '_noco' };
|
||
|
item._nodes.type = 'projectSettings';
|
||
|
this.$store.dispatch('tabs/ActAddTab', item);
|
||
4 years ago
|
}
|
||
|
},
|
||
3 years ago
|
aclTabAdd() {
|
||
2 years ago
|
const tabIndex = this.tabs.findIndex(el => el.key === 'acl');
|
||
4 years ago
|
if (tabIndex !== -1) {
|
||
2 years ago
|
this.changeActiveTab(tabIndex);
|
||
4 years ago
|
} else {
|
||
2 years ago
|
const item = { name: 'ACL', key: 'acl' };
|
||
|
item._nodes = { env: '_noco' };
|
||
|
item._nodes.type = 'acl';
|
||
|
this.$store.dispatch('tabs/ActAddTab', item);
|
||
4 years ago
|
}
|
||
3 years ago
|
},
|
||
3 years ago
|
disableOrEnableModelTabAdd() {
|
||
2 years ago
|
const tabIndex = this.tabs.findIndex(el => el.key === 'disableOrEnableModel');
|
||
4 years ago
|
if (tabIndex !== -1) {
|
||
2 years ago
|
this.changeActiveTab(tabIndex);
|
||
4 years ago
|
} else {
|
||
2 years ago
|
const item = { name: 'Meta Management', key: 'disableOrEnableModel' };
|
||
|
item._nodes = { env: '_noco' };
|
||
|
item._nodes.type = 'disableOrEnableModel';
|
||
|
this.$store.dispatch('tabs/ActAddTab', item);
|
||
4 years ago
|
}
|
||
3 years ago
|
},
|
||
3 years ago
|
cronTabAdd() {
|
||
2 years ago
|
const tabIndex = this.tabs.findIndex(el => el.key === 'cronJobs');
|
||
4 years ago
|
if (tabIndex !== -1) {
|
||
2 years ago
|
this.changeActiveTab(tabIndex);
|
||
4 years ago
|
} else {
|
||
2 years ago
|
const item = { name: 'Cron Jobs', key: 'cronJobs' };
|
||
|
item._nodes = { env: '_noco' };
|
||
|
item._nodes.type = 'cronJobs';
|
||
|
this.$store.dispatch('tabs/ActAddTab', item);
|
||
4 years ago
|
}
|
||
3 years ago
|
},
|
||
3 years ago
|
appsTabAdd() {
|
||
2 years ago
|
const tabIndex = this.tabs.findIndex(el => el.key === 'appStore');
|
||
4 years ago
|
if (tabIndex !== -1) {
|
||
2 years ago
|
this.changeActiveTab(tabIndex);
|
||
4 years ago
|
} else {
|
||
2 years ago
|
const item = { name: 'App Store', key: 'appStore' };
|
||
|
item._nodes = { env: '_noco' };
|
||
|
item._nodes.type = 'appStore';
|
||
|
this.$store.dispatch('tabs/ActAddTab', item);
|
||
4 years ago
|
}
|
||
|
},
|
||
3 years ago
|
async codeGenerateMvc() {
|
||
4 years ago
|
try {
|
||
|
await this.sqlMgr.projectGenerateBackend({
|
||
2 years ago
|
env: '_noco',
|
||
|
});
|
||
|
this.$toast.success('Yay, REST APIs with MVC generated').goAway(4000);
|
||
4 years ago
|
} catch (e) {
|
||
2 years ago
|
this.$toast.error('Error generating REST APIs code :' + e).goAway(4000);
|
||
|
throw e;
|
||
4 years ago
|
}
|
||
|
},
|
||
3 years ago
|
cookieStatus(status) {
|
||
2 years ago
|
this.status = status;
|
||
4 years ago
|
},
|
||
3 years ago
|
cookieClickedAccept() {
|
||
2 years ago
|
this.status = 'accept';
|
||
4 years ago
|
},
|
||
3 years ago
|
cookieClickedDecline() {
|
||
2 years ago
|
this.status = 'decline';
|
||
3 years ago
|
// localStorage.removeItem('vue-cookie-accept-decline')
|
||
4 years ago
|
},
|
||
3 years ago
|
removeCookie() {
|
||
3 years ago
|
// console.log('Cookie removed')
|
||
2 years ago
|
localStorage.removeItem('vue-cookie-accept-decline');
|
||
|
this.status = 'Cookie removed, refresh the page.';
|
||
4 years ago
|
},
|
||
|
|
||
3 years ago
|
MtdContactUs() {
|
||
2 years ago
|
this.snackbar = true;
|
||
4 years ago
|
},
|
||
|
|
||
3 years ago
|
MtdHiring() {
|
||
2 years ago
|
this.$router.push('/info/hiring');
|
||
4 years ago
|
},
|
||
|
|
||
3 years ago
|
MtdFaq() {
|
||
2 years ago
|
this.$router.push('/info/faq');
|
||
4 years ago
|
},
|
||
3 years ago
|
MtdTos() {
|
||
2 years ago
|
this.$router.push('/info/tos');
|
||
4 years ago
|
},
|
||
3 years ago
|
async MtdSignOut() {
|
||
2 years ago
|
await this.$store.dispatch('users/ActSignOut');
|
||
|
this.$router.push('/user/authentication/signin');
|
||
4 years ago
|
},
|
||
3 years ago
|
MtdToggleDrawer() {
|
||
3 years ago
|
if (!this.$store.getters['users/GtrUser']) {
|
||
2 years ago
|
this.drawer = false;
|
||
4 years ago
|
} else {
|
||
2 years ago
|
this.drawer = !this.drawer;
|
||
4 years ago
|
}
|
||
3 years ago
|
// console.log('Toggling drawer', this.drawer);
|
||
4 years ago
|
},
|
||
3 years ago
|
changeTheme() {
|
||
2 years ago
|
this.$store.dispatch('settings/ActToggleDarkMode', !this.$store.state.settings.darkTheme);
|
||
|
this.$e('c:navbar:theme');
|
||
3 years ago
|
},
|
||
3 years ago
|
async copyProjectInfo() {
|
||
3 years ago
|
try {
|
||
2 years ago
|
const data = await this.$api.project.metaGet(this.$store.state.project.projectId);
|
||
3 years ago
|
copyTextToClipboard(
|
||
|
Object.entries(data)
|
||
|
.map(([k, v]) => `${k}: **${v}**`)
|
||
3 years ago
|
.join('\n')
|
||
2 years ago
|
);
|
||
|
this.$toast.info('Copied project info to clipboard').goAway(3000);
|
||
3 years ago
|
} catch (e) {
|
||
2 years ago
|
console.log(e);
|
||
|
this.$toast.error(e.message).goAway(3000);
|
||
3 years ago
|
}
|
||
2 years ago
|
},
|
||
|
},
|
||
|
};
|
||
4 years ago
|
</script>
|
||
|
<style scoped>
|
||
|
a {
|
||
|
text-decoration: none;
|
||
|
}
|
||
|
|
||
|
.brand-icon::before {
|
||
|
background: none !important;
|
||
|
}
|
||
|
|
||
|
@keyframes pulse {
|
||
|
0% {
|
||
|
transform: scale(1);
|
||
|
}
|
||
|
60% {
|
||
|
transform: scale(1);
|
||
|
}
|
||
|
70% {
|
||
|
/*opacity: 0;*/
|
||
|
transform: scale(1.35);
|
||
|
}
|
||
|
80% {
|
||
|
transform: scale(1);
|
||
|
}
|
||
|
90% {
|
||
|
/*opacity: 0;*/
|
||
|
transform: scale(1.35);
|
||
|
}
|
||
|
100% {
|
||
|
transform: scale(1);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.heart-anim {
|
||
|
animation-name: pulse;
|
||
|
animation-duration: 4.5s;
|
||
|
animation-iteration-count: infinite;
|
||
|
}
|
||
|
|
||
3 years ago
|
/deep/ .v-toolbar__items {
|
||
4 years ago
|
align-items: center;
|
||
|
}
|
||
|
|
||
3 years ago
|
/deep/ .nc-ripple {
|
||
3 years ago
|
border-radius: 50%;
|
||
|
}
|
||
3 years ago
|
|
||
3 years ago
|
/deep/ .nc-user-menu .v-list-item--dense,
|
||
|
/deep/ .nc-user-menu .v-list--dense .v-list-item {
|
||
|
min-height: 35px;
|
||
3 years ago
|
}
|
||
4 years ago
|
</style>
|
||
|
|
||
|
<!--
|
||
|
/**
|
||
|
* @copyright Copyright (c) 2021, Xgene Cloud Ltd
|
||
|
*
|
||
|
* @author Naveen MR <oof1lab@gmail.com>
|
||
|
* @author Pranav C Balan <pranavxc@gmail.com>
|
||
|
*
|
||
|
* @license GNU AGPL version 3 or any later version
|
||
|
*
|
||
|
* This program is free software: you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU Affero General Public License as
|
||
|
* published by the Free Software Foundation, either version 3 of the
|
||
|
* License, or (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU Affero General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU Affero General Public License
|
||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
|
*
|
||
|
*/
|
||
|
-->
|