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.
127 lines
3.5 KiB
127 lines
3.5 KiB
3 years ago
|
<template>
|
||
|
<v-menu v-if="connectToExternalDB" offset-y bottom open-on-hover>
|
||
|
<template #activator="{ on }">
|
||
|
<slot :on="on">
|
||
|
<div>
|
||
|
<v-btn
|
||
3 years ago
|
v-if="_isUIAllowed('projectCreate', true)"
|
||
3 years ago
|
v-ge="['home', 'project-new']"
|
||
|
:x-large="$vuetify.breakpoint.lgAndUp"
|
||
|
:large="$vuetify.breakpoint.mdAndDown"
|
||
|
data-v-step="1"
|
||
|
outlined
|
||
|
rounded
|
||
|
color="primary"
|
||
|
class="nc-new-project-menu elevation-3"
|
||
|
v-on="on"
|
||
|
>
|
||
3 years ago
|
<v-icon class="mr-2">
|
||
|
mdi-plus
|
||
|
</v-icon>
|
||
3 years ago
|
|
||
|
<!-- New Project -->
|
||
3 years ago
|
{{ $t("title.newProj") }}
|
||
3 years ago
|
<v-icon class="mr-1" small>
|
||
|
mdi-menu-down
|
||
|
</v-icon>
|
||
3 years ago
|
</v-btn>
|
||
|
</div>
|
||
|
</slot>
|
||
|
</template>
|
||
|
<v-list dense>
|
||
|
<v-list-item
|
||
|
class="create-xc-db-project nc-create-xc-db-project"
|
||
|
@click="onCreateProject('xcdb')"
|
||
|
>
|
||
|
<v-list-item-icon class="mr-2">
|
||
3 years ago
|
<v-icon small color="blue">
|
||
|
mdi-plus
|
||
|
</v-icon>
|
||
3 years ago
|
</v-list-item-icon>
|
||
|
<v-list-item-title>
|
||
|
<!-- Create -->
|
||
3 years ago
|
<span>{{ $t("general.create") }}</span>
|
||
3 years ago
|
</v-list-item-title>
|
||
|
<v-spacer />
|
||
|
<v-tooltip right>
|
||
|
<template #activator="{ on }">
|
||
3 years ago
|
<v-icon x-small color="grey" class="ml-4" v-on="on">
|
||
3 years ago
|
mdi-information-outline
|
||
|
</v-icon>
|
||
|
</template>
|
||
|
<!-- Create a new project -->
|
||
3 years ago
|
<span class="caption">{{ $t("tooltip.xcDB") }}</span>
|
||
3 years ago
|
</v-tooltip>
|
||
|
</v-list-item>
|
||
|
<v-list-item
|
||
|
title
|
||
|
class="pt-2 create-external-db-project nc-create-external-db-project"
|
||
|
@click="onCreateProject()"
|
||
|
>
|
||
|
<v-list-item-icon class="mr-2">
|
||
3 years ago
|
<v-icon small color="green">
|
||
|
mdi-database-outline
|
||
|
</v-icon>
|
||
3 years ago
|
</v-list-item-icon>
|
||
|
<v-list-item-title>
|
||
|
<!-- Create By Connecting <br>To An External Database -->
|
||
|
<span
|
||
|
style="line-height: 1.5em"
|
||
3 years ago
|
v-html="$t('activity.createProjectExtended.extDB')"
|
||
3 years ago
|
/>
|
||
|
</v-list-item-title>
|
||
|
<v-spacer />
|
||
|
<v-tooltip right>
|
||
|
<template #activator="{ on }">
|
||
3 years ago
|
<v-icon x-small color="grey" class="ml-4" v-on="on">
|
||
3 years ago
|
mdi-information-outline
|
||
|
</v-icon>
|
||
|
</template>
|
||
|
<!-- Supports MySQL, PostgreSQL, SQL Server & SQLite -->
|
||
3 years ago
|
<span class="caption">{{ $t("tooltip.extDB") }}</span>
|
||
3 years ago
|
</v-tooltip>
|
||
|
</v-list-item>
|
||
|
</v-list>
|
||
|
</v-menu>
|
||
|
<x-btn
|
||
3 years ago
|
v-else-if="_isUIAllowed('projectCreate', true)"
|
||
3 years ago
|
v-ge="['home', 'project-new']"
|
||
|
outlined
|
||
|
data-v-step="1"
|
||
|
color="primary"
|
||
|
@click="onCreateProject('xcdb')"
|
||
|
>
|
||
|
<!-- New Project -->
|
||
3 years ago
|
{{ $t("title.newProj") }}
|
||
3 years ago
|
</x-btn>
|
||
|
<span v-else />
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
3 years ago
|
name: 'CreateNewProjectBtn',
|
||
3 years ago
|
computed: {
|
||
|
connectToExternalDB() {
|
||
3 years ago
|
return (
|
||
|
this.$store.state.project &&
|
||
3 years ago
|
this.$store.state.project.appInfo &&
|
||
|
this.$store.state.project.appInfo.connectToExternalDB
|
||
|
)
|
||
|
}
|
||
3 years ago
|
},
|
||
|
methods: {
|
||
|
onCreateProject(xcdb) {
|
||
3 years ago
|
if (xcdb === 'xcdb') {
|
||
|
this.$router.push('/project/xcdb')
|
||
|
this.$e('c:project:create:xcdb')
|
||
3 years ago
|
} else {
|
||
3 years ago
|
this.$router.push('/project/0')
|
||
|
this.$e('c:project:create:extdb')
|
||
3 years ago
|
}
|
||
3 years ago
|
}
|
||
|
}
|
||
|
}
|
||
3 years ago
|
</script>
|
||
|
|
||
3 years ago
|
<style scoped></style>
|