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.
708 lines
25 KiB
708 lines
25 KiB
4 years ago
|
<template>
|
||
2 years ago
|
<v-container fluid class="text-center px-10 pt-10 nc-container">
|
||
4 years ago
|
<v-row>
|
||
3 years ago
|
<v-col v-if="loaded" class="col-lg-6 offset-lg-3 col-12 col-md-12">
|
||
3 years ago
|
<v-row v-show="projects" class="justify-center">
|
||
2 years ago
|
<v-card row class="pa-4 elevation-20 text-center overflow-x-hidden flex-shrink-1" min-width="600">
|
||
3 years ago
|
<v-overlay v-if="projectStatusUpdating" />
|
||
4 years ago
|
<v-row justify="center">
|
||
3 years ago
|
<h1 class="text-center display-1 pa-2 nc-project-page-title">
|
||
3 years ago
|
<!-- My Projects -->
|
||
2 years ago
|
<b>{{ $t('title.myProject') }}</b>
|
||
|
<x-icon small color="primary grey" :tooltip="$t('activity.refreshProject')" @click="projectsRefresh">
|
||
|
mdi-refresh </x-icon
|
||
|
>
|
||
4 years ago
|
<!-- </x-btn>-->
|
||
|
</h1>
|
||
|
</v-row>
|
||
3 years ago
|
<v-row class="pa-4">
|
||
|
<!-- Search Project -->
|
||
4 years ago
|
<v-text-field
|
||
|
ref="search1"
|
||
|
v-model="search"
|
||
3 years ago
|
v-ge="['home', 'project-search']"
|
||
|
data-v-step="3"
|
||
3 years ago
|
class="caption pt-0 mt-0 nc-project-page-search"
|
||
3 years ago
|
:placeholder="$t('activity.searchProject')"
|
||
4 years ago
|
single-line
|
||
|
hide-details
|
||
3 years ago
|
style="max-width: 200px"
|
||
|
>
|
||
3 years ago
|
<template #prepend-inner>
|
||
2 years ago
|
<v-icon color="grey" class="mt-1" small> search </v-icon>
|
||
4 years ago
|
</template>
|
||
|
</v-text-field>
|
||
3 years ago
|
<v-spacer />
|
||
4 years ago
|
|
||
|
<template v-if="connectToExternalDB">
|
||
|
<v-menu offset-y bottom open-on-hover>
|
||
3 years ago
|
<template #activator="{ on }">
|
||
4 years ago
|
<div>
|
||
|
<x-btn
|
||
3 years ago
|
v-if="_isUIAllowed('projectCreate')"
|
||
3 years ago
|
v-ge="['home', 'project-new']"
|
||
4 years ago
|
data-v-step="1"
|
||
3 years ago
|
outlined
|
||
4 years ago
|
color="primary"
|
||
3 years ago
|
class="nc-new-project-menu"
|
||
4 years ago
|
v-on="on"
|
||
|
>
|
||
3 years ago
|
<!-- New Project -->
|
||
2 years ago
|
{{ $t('title.newProj') }}
|
||
|
<v-icon class="mr-1" small> mdi-menu-down </v-icon>
|
||
4 years ago
|
</x-btn>
|
||
|
</div>
|
||
|
</template>
|
||
|
<v-list dense>
|
||
2 years ago
|
<v-list-item class="create-xc-db-project nc-create-xc-db-project" @click="onCreateProject('xcdb')">
|
||
3 years ago
|
<v-list-item-icon class="mr-2">
|
||
2 years ago
|
<v-icon small> mdi-plus </v-icon>
|
||
4 years ago
|
</v-list-item-icon>
|
||
|
<v-list-item-title>
|
||
3 years ago
|
<!-- Create -->
|
||
2 years ago
|
<span class="caption font-weight-regular">{{ $t('general.create') }}</span>
|
||
4 years ago
|
</v-list-item-title>
|
||
3 years ago
|
<v-spacer />
|
||
4 years ago
|
<v-tooltip right>
|
||
3 years ago
|
<template #activator="{ on }">
|
||
2 years ago
|
<v-icon x-small color="grey" class="ml-4" v-on="on"> mdi-information-outline </v-icon>
|
||
4 years ago
|
</template>
|
||
3 years ago
|
<!-- Create a new project -->
|
||
2 years ago
|
<span class="caption">{{ $t('tooltip.xcDB') }}</span>
|
||
4 years ago
|
</v-tooltip>
|
||
|
</v-list-item>
|
||
3 years ago
|
<v-divider />
|
||
3 years ago
|
<v-list-item
|
||
|
title
|
||
3 years ago
|
class="pt-2 create-external-db-project nc-create-external-db-project"
|
||
3 years ago
|
@click="onCreateProject()"
|
||
3 years ago
|
>
|
||
4 years ago
|
<v-list-item-icon class="mr-2">
|
||
2 years ago
|
<v-icon small class=""> mdi-power-plug-outline </v-icon>
|
||
4 years ago
|
</v-list-item-icon>
|
||
3 years ago
|
<v-list-item-title>
|
||
|
<!-- Create By Connecting <br>To An External Database -->
|
||
2 years ago
|
<span class="caption font-weight-regular" v-html="$t('activity.createProjectExtended.extDB')" />
|
||
4 years ago
|
</v-list-item-title>
|
||
3 years ago
|
<v-spacer />
|
||
4 years ago
|
<v-tooltip right>
|
||
3 years ago
|
<template #activator="{ on }">
|
||
2 years ago
|
<v-icon x-small color="grey" class="ml-4" v-on="on"> mdi-information-outline </v-icon>
|
||
4 years ago
|
</template>
|
||
3 years ago
|
<!-- Supports MySQL, PostgreSQL, SQL Server & SQLite -->
|
||
2 years ago
|
<span class="caption">{{ $t('tooltip.extDB') }}</span>
|
||
4 years ago
|
</v-tooltip>
|
||
|
</v-list-item>
|
||
|
</v-list>
|
||
|
</v-menu>
|
||
|
</template>
|
||
|
<x-btn
|
||
3 years ago
|
v-else-if="_isUIAllowed('projectCreate', true)"
|
||
3 years ago
|
v-ge="['home', 'project-new']"
|
||
4 years ago
|
outlined
|
||
|
data-v-step="1"
|
||
|
color="primary"
|
||
3 years ago
|
@click="onCreateProject('xcdb')"
|
||
4 years ago
|
>
|
||
3 years ago
|
<!-- New Project -->
|
||
2 years ago
|
{{ $t('title.newProj') }}
|
||
4 years ago
|
</x-btn>
|
||
|
</v-row>
|
||
|
|
||
|
<v-row>
|
||
|
<v-data-table
|
||
3 years ago
|
v-if="!loadingProjects && projects && projects.length"
|
||
4 years ago
|
fixed-header
|
||
|
hide-default-header
|
||
|
:height="500"
|
||
|
dense
|
||
|
:headers="headers"
|
||
|
:items="projects"
|
||
|
:search="search"
|
||
|
:footer-props="{
|
||
3 years ago
|
'items-per-page-options': [20, -1],
|
||
2 years ago
|
'items-per-page-text': $t('msg.info.footerInfo'),
|
||
4 years ago
|
}"
|
||
3 years ago
|
class="pa-4 text-left mx-auto"
|
||
3 years ago
|
style="cursor: pointer; max-width: 100%"
|
||
4 years ago
|
>
|
||
3 years ago
|
<template #item="props">
|
||
3 years ago
|
<tr
|
||
|
class="project-row"
|
||
3 years ago
|
:class="[
|
||
|
`nc-${props.item.projectType}-project-row`,
|
||
|
{
|
||
|
'nc-meta-project-row': props.item.prefix,
|
||
|
},
|
||
|
]"
|
||
3 years ago
|
@click="projectRouteHandler(props.item, projects.length)"
|
||
3 years ago
|
>
|
||
4 years ago
|
<td data-v-step="2">
|
||
3 years ago
|
<div class="d-flex align-center">
|
||
2 years ago
|
<v-progress-circular v-if="props.item.loading" class="mr-2" size="15" indeterminate />
|
||
3 years ago
|
<template v-else>
|
||
2 years ago
|
<v-icon x-small class="mr-2" color="green"> mdi-moon-full </v-icon>
|
||
3 years ago
|
<!-- Accessible via GraphQL APIs / Accessible via REST APIs -->
|
||
|
</template>
|
||
3 years ago
|
<div
|
||
|
class="d-inline-block title font-weight-regular"
|
||
3 years ago
|
style="
|
||
|
min-width: 0;
|
||
|
max-width: 390px;
|
||
|
white-space: nowrap;
|
||
|
text-overflow: ellipsis;
|
||
|
overflow: hidden;
|
||
|
"
|
||
3 years ago
|
>
|
||
3 years ago
|
{{ props.item.title }}
|
||
3 years ago
|
</div>
|
||
3 years ago
|
</div>
|
||
4 years ago
|
</td>
|
||
2 years ago
|
<td style="width: 150px; min-width: 150px; max-width: 150px">
|
||
2 years ago
|
<!-- Delete Project -->
|
||
|
<!-- TODO: only show it for creators -->
|
||
3 years ago
|
<x-icon
|
||
3 years ago
|
:tooltip="$t('activity.deleteProject')"
|
||
3 years ago
|
class="pointer mr-2"
|
||
2 years ago
|
icon.class="icon"
|
||
3 years ago
|
small
|
||
|
color="red grey"
|
||
|
@click.stop="deleteProject(props.item)"
|
||
|
>
|
||
|
mdi-delete-outline
|
||
|
</x-icon>
|
||
2 years ago
|
<!-- Edit Project -->
|
||
|
<!-- TODO: only show it for creators -->
|
||
|
<x-icon
|
||
|
:tooltip="$t('activity.editProject')"
|
||
|
class="pointer mr-2"
|
||
|
icon.class="icon"
|
||
|
small
|
||
|
color="blue grey"
|
||
|
@click.stop="onEditProject(props.item)"
|
||
3 years ago
|
>
|
||
2 years ago
|
mdi-circle-edit-outline
|
||
|
</x-icon>
|
||
4 years ago
|
</td>
|
||
|
</tr>
|
||
|
</template>
|
||
3 years ago
|
<!-- Your search for "{{ search }}" found no results. -->
|
||
3 years ago
|
<template #no-results>
|
||
|
<v-alert :value="true" color="error" icon="warning">
|
||
2 years ago
|
{{ $t('msg.error.searchProject', { search }) }}
|
||
3 years ago
|
</v-alert>
|
||
|
</template>
|
||
4 years ago
|
</v-data-table>
|
||
2 years ago
|
<v-col v-else-if="!loadingProjects" style="height: 500px" class="d-flex align-center justify-center">
|
||
|
<v-alert border="left" dense text :value="true" outlined color="success" icon="mdi-information-outline">
|
||
3 years ago
|
<!-- Get started by creating a new project -->
|
||
2 years ago
|
{{ $t('msg.info.projectEmptyMessage') }}
|
||
4 years ago
|
</v-alert>
|
||
|
</v-col>
|
||
|
</v-row>
|
||
|
</v-card>
|
||
|
</v-row>
|
||
|
|
||
|
<v-row v-cloak v-show="!projects.length && false">
|
||
|
<!-- <howItWorks class="text-left"></howItWorks>-->
|
||
|
|
||
|
<v-col cols="" class="d-flex justify-center">
|
||
2 years ago
|
<v-card height="500px" width="500px" class="elevation-20 pt-4 mt-4 d-flex flex-column">
|
||
|
<p class="display-1 flex-grow-1 pt-5 d-flex align-center justify-center">
|
||
3 years ago
|
<!-- Create By Connecting <br>To An External Database -->
|
||
3 years ago
|
<span v-html="$t('activity.createProjectExtended.extDB')" />
|
||
4 years ago
|
</p>
|
||
|
<v-card-actions class="justify-center pb-10">
|
||
3 years ago
|
<x-btn
|
||
|
tooltip="Create New Project"
|
||
|
btn.class=" ma-4 primary"
|
||
|
color="primary"
|
||
|
large
|
||
|
@click="onCreateProject"
|
||
|
>
|
||
2 years ago
|
<v-icon color="white" class="blink_me"> mdi-lightbulb-on </v-icon>
|
||
3 years ago
|
<!-- New Project -->
|
||
2 years ago
|
{{ $t('title.newProj') }}
|
||
4 years ago
|
</x-btn>
|
||
|
</v-card-actions>
|
||
|
</v-card>
|
||
|
</v-col>
|
||
|
</v-row>
|
||
|
</v-col>
|
||
2 years ago
|
<v-col v-if="loaded" class="col-sm-12 col-lg-3 d-sm-none d-md-flex justify-center justify-lg-end align-start">
|
||
3 years ago
|
<sponsor-mini />
|
||
4 years ago
|
</v-col>
|
||
|
</v-row>
|
||
|
|
||
3 years ago
|
<div v-if="projects && projects.length" class="d-flex justify-end">
|
||
3 years ago
|
<v-list
|
||
3 years ago
|
class="flex-shrink-1 text-left elevation-4 rounded-xl community-card mr-10"
|
||
3 years ago
|
width="300"
|
||
|
:class="{ active: showCommunity }"
|
||
|
dense
|
||
|
>
|
||
2 years ago
|
<v-list-item dense href="https://github.com/nocodb/nocodb" target="_blank">
|
||
4 years ago
|
<v-list-item-icon>
|
||
2 years ago
|
<v-icon class="ml-2 mt-n2"> mdi-github </v-icon>
|
||
4 years ago
|
</v-list-item-icon>
|
||
3 years ago
|
<v-list-item-title v-if="_isRtl">
|
||
|
<!-- us on Github -->
|
||
2 years ago
|
{{ $t('labels.community.starUs2') }}
|
||
3 years ago
|
<!-- Star -->
|
||
2 years ago
|
{{ $t('labels.community.starUs1') }}
|
||
|
<v-icon small> mdi-star-outline </v-icon>
|
||
3 years ago
|
</v-list-item-title>
|
||
|
<v-list-item-title v-else>
|
||
3 years ago
|
<!-- Star -->
|
||
2 years ago
|
{{ $t('labels.community.starUs1') }}
|
||
|
<v-icon small> mdi-star-outline </v-icon>
|
||
3 years ago
|
<!-- us on Github -->
|
||
2 years ago
|
{{ $t('labels.community.starUs2') }}
|
||
4 years ago
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
3 years ago
|
<v-divider v-if="!_isZh" />
|
||
2 years ago
|
<v-list-item v-if="!_isZh" dense target="_blank" href="https://calendly.com/nocodb-meeting">
|
||
4 years ago
|
<v-list-item-icon>
|
||
2 years ago
|
<v-icon class="ml-2" :color="textColors[3]"> mdi-calendar-month </v-icon>
|
||
4 years ago
|
</v-list-item-icon>
|
||
3 years ago
|
<!-- Book a Free DEMO -->
|
||
3 years ago
|
<v-list-item-title>
|
||
2 years ago
|
{{ $t('labels.community.bookDemo') }}
|
||
3 years ago
|
</v-list-item-title>
|
||
4 years ago
|
</v-list-item>
|
||
3 years ago
|
<v-divider />
|
||
4 years ago
|
<v-list-item dense href="https://discord.gg/5RgZmkW" target="_blank">
|
||
|
<v-list-item-icon>
|
||
2 years ago
|
<v-icon class="ml-2" :color="textColors[0]"> mdi-discord </v-icon>
|
||
4 years ago
|
</v-list-item-icon>
|
||
3 years ago
|
<!-- Get your questions answered -->
|
||
3 years ago
|
<v-list-item-title>
|
||
2 years ago
|
{{ $t('labels.community.getAnswered') }}
|
||
3 years ago
|
</v-list-item-title>
|
||
4 years ago
|
</v-list-item>
|
||
3 years ago
|
<v-divider />
|
||
2 years ago
|
<v-list-item v-if="!_isZh" dense href="https://twitter.com/NocoDB" target="_blank">
|
||
4 years ago
|
<v-list-item-icon>
|
||
2 years ago
|
<v-icon class="ml-2" :color="textColors[1]"> mdi-twitter </v-icon>
|
||
4 years ago
|
</v-list-item-icon>
|
||
3 years ago
|
<!-- Follow NocoDB -->
|
||
3 years ago
|
<v-list-item-title>
|
||
2 years ago
|
{{ $t('labels.community.followNocodb') }}
|
||
3 years ago
|
</v-list-item-title>
|
||
4 years ago
|
</v-list-item>
|
||
3 years ago
|
<template v-else>
|
||
2 years ago
|
<v-list-item dense class="" @click="$refs.wechat.$el.firstElementChild.click()">
|
||
3 years ago
|
<v-list-item-icon>
|
||
|
<share-icons
|
||
|
ref="wechat"
|
||
3 years ago
|
class="small mr-n2"
|
||
3 years ago
|
url="https://github.com/nocodb/nocodb"
|
||
|
:social-medias="['wechat']"
|
||
|
/>
|
||
|
</v-list-item-icon>
|
||
3 years ago
|
<v-list-item-title> Please share it in Wechat </v-list-item-title>
|
||
3 years ago
|
</v-list-item>
|
||
|
<v-divider />
|
||
2 years ago
|
<v-list-item dense class="" @click="$refs.weibo.$el.firstElementChild.click()">
|
||
3 years ago
|
<v-list-item-icon>
|
||
|
<share-icons
|
||
|
ref="weibo"
|
||
|
class="small mr-n2"
|
||
|
url="https://github.com/nocodb/nocodb"
|
||
|
:social-medias="['weibo']"
|
||
|
/>
|
||
|
</v-list-item-icon>
|
||
3 years ago
|
<v-list-item-title> Please share it in Weibo </v-list-item-title>
|
||
3 years ago
|
</v-list-item>
|
||
|
<v-divider />
|
||
3 years ago
|
<v-list-item dense target="_blank">
|
||
3 years ago
|
<v-list-item-icon>
|
||
2 years ago
|
<img class="ml-2" src="vue.svg" width="25" />
|
||
3 years ago
|
</v-list-item-icon>
|
||
|
<!-- Follow NocoDB -->
|
||
|
<v-list-item-title>
|
||
|
Built with Vue JS
|
||
|
<!-- {{-->
|
||
3 years ago
|
<!-- $t('labels.community.followNocodb')-->
|
||
3 years ago
|
<!-- }}-->
|
||
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
|
</template>
|
||
3 years ago
|
|
||
|
<v-divider />
|
||
2 years ago
|
<v-list-item v-t="['e:hiring']" dense target="_blank" href="http://careers.nocodb.com">
|
||
3 years ago
|
<v-list-item-icon>
|
||
2 years ago
|
<span class="ml-2" style="font-size: 20px">🚀</span>
|
||
3 years ago
|
</v-list-item-icon>
|
||
2 years ago
|
<v-list-item-title> We are Hiring!!! </v-list-item-title>
|
||
3 years ago
|
</v-list-item>
|
||
4 years ago
|
</v-list>
|
||
|
</div>
|
||
|
|
||
|
<dlg-label-submit-cancel
|
||
|
v-if="dialogShow"
|
||
3 years ago
|
type="primary"
|
||
|
:actions-mtd="confirmAction"
|
||
|
:dialog-show="dialogShow"
|
||
4 years ago
|
:heading="confirmMessage"
|
||
3 years ago
|
/>
|
||
3 years ago
|
<templates-modal v-model="templatesModal" hide-label create-project />
|
||
4 years ago
|
</v-container>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
2 years ago
|
import dlgLabelSubmitCancel from '../../components/utils/DlgLabelSubmitCancel.vue';
|
||
|
import ShareIcons from '../../components/ShareIcons';
|
||
|
import SponsorMini from '~/components/SponsorMini';
|
||
|
import colors from '~/mixins/colors';
|
||
|
import TemplatesModal from '~/components/templates/TemplatesModal';
|
||
3 years ago
|
|
||
3 years ago
|
export default {
|
||
|
components: {
|
||
3 years ago
|
TemplatesModal,
|
||
3 years ago
|
ShareIcons,
|
||
3 years ago
|
SponsorMini,
|
||
2 years ago
|
dlgLabelSubmitCancel,
|
||
3 years ago
|
// howItWorks,
|
||
|
},
|
||
|
mixins: [colors],
|
||
|
$_veeValidate: {
|
||
2 years ago
|
validator: 'new',
|
||
3 years ago
|
},
|
||
3 years ago
|
data() {
|
||
3 years ago
|
return {
|
||
3 years ago
|
templatesModal: false,
|
||
3 years ago
|
overlayVisible: true,
|
||
|
showCommunity: false,
|
||
|
project_id: null,
|
||
|
loading: null,
|
||
|
dialogShow: false,
|
||
|
confirmAction: null,
|
||
3 years ago
|
confirmMessage: '',
|
||
3 years ago
|
|
||
3 years ago
|
createProjectDialog: false,
|
||
|
projectStatusUpdating: false,
|
||
|
statusUpdatingProjectId: null,
|
||
|
screenSize: null,
|
||
|
trialAlert: true,
|
||
|
dialog1: true,
|
||
|
steps: [
|
||
|
{
|
||
|
target: '[data-v-step="1"]',
|
||
3 years ago
|
content: 'Click here to create new Project.',
|
||
3 years ago
|
params: {
|
||
2 years ago
|
placement: 'top',
|
||
|
},
|
||
4 years ago
|
},
|
||
3 years ago
|
{
|
||
|
target: '[data-v-step="2"]',
|
||
2 years ago
|
content: 'Click here to open existing project.',
|
||
4 years ago
|
},
|
||
3 years ago
|
{
|
||
|
target: '[data-v-step="3"]',
|
||
2 years ago
|
content: 'Click here to filter projects.',
|
||
3 years ago
|
},
|
||
|
{
|
||
|
target: '[data-v-step="4"]',
|
||
2 years ago
|
content: 'Click here to open project folder.',
|
||
3 years ago
|
},
|
||
|
{
|
||
|
target: '[data-v-step="5"]',
|
||
2 years ago
|
content: 'Click here to edit project.',
|
||
3 years ago
|
},
|
||
|
{
|
||
|
target: '[data-v-step="6"]',
|
||
2 years ago
|
content: 'Click here to delete project.',
|
||
|
},
|
||
3 years ago
|
],
|
||
|
loaded: false,
|
||
|
dialog: {
|
||
|
show: false,
|
||
3 years ago
|
title: 'Confirm Deleting project',
|
||
|
heading: '',
|
||
3 years ago
|
// mtdOk: this.projectRemove,
|
||
2 years ago
|
type: 'error',
|
||
4 years ago
|
},
|
||
3 years ago
|
loadingProjects: true,
|
||
|
newProjectDialog: false,
|
||
3 years ago
|
name: '',
|
||
|
type: 'MySQL',
|
||
3 years ago
|
userSelectedDir: false,
|
||
3 years ago
|
dialogTitle: 'New',
|
||
3 years ago
|
databases: {
|
||
3 years ago
|
Oracle: 'oracledb',
|
||
|
Postgres: 'pg',
|
||
|
MySQL: 'mysql',
|
||
|
MSSQL: 'mssql',
|
||
2 years ago
|
Sqlite: 'sqlite',
|
||
4 years ago
|
},
|
||
3 years ago
|
headers: [
|
||
|
{
|
||
3 years ago
|
text: 'Title',
|
||
|
value: 'title',
|
||
2 years ago
|
class: 'caption',
|
||
3 years ago
|
},
|
||
|
{
|
||
3 years ago
|
text: '',
|
||
|
value: 'name',
|
||
3 years ago
|
sortable: false,
|
||
2 years ago
|
class: 'caption',
|
||
|
},
|
||
3 years ago
|
],
|
||
|
projects: [],
|
||
3 years ago
|
search: '',
|
||
2 years ago
|
deleteBtnClicked: false,
|
||
|
};
|
||
3 years ago
|
},
|
||
|
computed: {
|
||
3 years ago
|
connectToExternalDB() {
|
||
3 years ago
|
return (
|
||
|
this.$store.state.project &&
|
||
3 years ago
|
this.$store.state.project.appInfo &&
|
||
|
this.$store.state.project.appInfo.connectToExternalDB
|
||
2 years ago
|
);
|
||
|
},
|
||
3 years ago
|
},
|
||
|
watch: {
|
||
3 years ago
|
name() {
|
||
3 years ago
|
if (!this.userSelectedDir) {
|
||
2 years ago
|
this.folder = `${this.baseFolder}/${this.name}`;
|
||
3 years ago
|
}
|
||
2 years ago
|
},
|
||
3 years ago
|
},
|
||
3 years ago
|
async created() {
|
||
2 years ago
|
this.$store.commit('settings/MutToggleGaEnabled', true);
|
||
|
this.$store.commit('settings/MutToggleTelemetryEnabled', true);
|
||
|
await this.$store.dispatch('users/ActGetUserDetails');
|
||
3 years ago
|
},
|
||
3 years ago
|
async mounted() {
|
||
2 years ago
|
setTimeout(() => (this.showCommunity = true), 2000);
|
||
3 years ago
|
|
||
2 years ago
|
await this.projectsLoad();
|
||
3 years ago
|
},
|
||
|
methods: {
|
||
3 years ago
|
async stopProject(project) {
|
||
2 years ago
|
this.dialogShow = true;
|
||
|
this.confirmMessage = 'Do you want to stop the project?';
|
||
|
this.confirmAction = async act => {
|
||
3 years ago
|
if (act === 'hideDialog') {
|
||
2 years ago
|
this.dialogShow = false;
|
||
3 years ago
|
} else {
|
||
2 years ago
|
this.$set(project, 'status', 'stopping');
|
||
|
const projectId = project.id;
|
||
|
this.statusUpdatingProjectId = projectId;
|
||
|
this.projectStatusUpdating = true;
|
||
3 years ago
|
try {
|
||
2 years ago
|
await this.$store.dispatch('sqlMgr/ActSqlOp', [{ project_id: projectId }, 'projectStop']);
|
||
|
this.$toast.success(`Project '${project.title}' stopped successfully`).goAway(3000);
|
||
3 years ago
|
} catch (e) {
|
||
2 years ago
|
this.$toast.error(`Project '${project.title}' stopping failed`).goAway(3000);
|
||
3 years ago
|
}
|
||
2 years ago
|
await this.projectsLoad();
|
||
|
this.projectStatusUpdating = false;
|
||
|
this.dialogShow = false;
|
||
4 years ago
|
}
|
||
2 years ago
|
};
|
||
3 years ago
|
},
|
||
3 years ago
|
async startProject(project) {
|
||
2 years ago
|
this.dialogShow = true;
|
||
|
this.confirmMessage = 'Do you want to start the project?';
|
||
|
this.confirmAction = async act => {
|
||
3 years ago
|
if (act === 'hideDialog') {
|
||
2 years ago
|
this.dialogShow = false;
|
||
3 years ago
|
} else {
|
||
2 years ago
|
this.$set(project, 'status', 'starting');
|
||
|
const projectId = project.id;
|
||
|
this.statusUpdatingProjectId = projectId;
|
||
|
this.projectStatusUpdating = true;
|
||
3 years ago
|
try {
|
||
2 years ago
|
await this.$store.dispatch('sqlMgr/ActSqlOp', [{ project_id: projectId }, 'projectStart']);
|
||
|
this.$toast.success(`Project '${project.title}' started successfully`).goAway(3000);
|
||
3 years ago
|
} catch (e) {
|
||
2 years ago
|
this.$toast.error(`Project '${project.title}' starting failed`).goAway(3000);
|
||
3 years ago
|
}
|
||
2 years ago
|
await this.projectsLoad();
|
||
|
this.projectStatusUpdating = false;
|
||
|
this.dialogShow = false;
|
||
3 years ago
|
}
|
||
2 years ago
|
};
|
||
3 years ago
|
},
|
||
3 years ago
|
async restartProject(project) {
|
||
2 years ago
|
this.dialogShow = true;
|
||
|
this.confirmMessage = 'Do you want to restart the project?';
|
||
|
this.confirmAction = async act => {
|
||
3 years ago
|
if (act === 'hideDialog') {
|
||
2 years ago
|
this.dialogShow = false;
|
||
3 years ago
|
} else {
|
||
2 years ago
|
this.$set(project, 'status', 'restarting');
|
||
|
const projectId = project.id;
|
||
|
this.statusUpdatingProjectId = projectId;
|
||
|
this.projectStatusUpdating = true;
|
||
3 years ago
|
try {
|
||
2 years ago
|
await this.$store.dispatch('sqlMgr/ActSqlOp', [{ project_id: projectId }, 'projectRestart']);
|
||
|
this.$toast.success(`Project '${project.title}' restarted successfully`).goAway(3000);
|
||
3 years ago
|
} catch (e) {
|
||
2 years ago
|
this.$toast.error(`Project '${project.title}' restarting failed`).goAway(3000);
|
||
3 years ago
|
}
|
||
2 years ago
|
await this.projectsLoad();
|
||
|
this.projectStatusUpdating = false;
|
||
|
this.dialogShow = false;
|
||
3 years ago
|
}
|
||
2 years ago
|
};
|
||
3 years ago
|
},
|
||
3 years ago
|
async deleteProject(project) {
|
||
2 years ago
|
this.dialogShow = true;
|
||
|
this.confirmMessage = 'Do you want to delete the project?';
|
||
|
this.$e('c:project:delete');
|
||
|
this.confirmAction = async act => {
|
||
3 years ago
|
if (act === 'hideDialog') {
|
||
2 years ago
|
this.dialogShow = false;
|
||
3 years ago
|
} else {
|
||
2 years ago
|
this.$set(project, 'status', 'deleting');
|
||
|
const projectId = project.id;
|
||
|
this.statusUpdatingProjectId = projectId;
|
||
|
this.projectStatusUpdating = true;
|
||
3 years ago
|
try {
|
||
2 years ago
|
await this.$api.project.delete(projectId);
|
||
|
this.$toast.success(`Project '${project.title}' deleted successfully`).goAway(3000);
|
||
3 years ago
|
} catch (e) {
|
||
2 years ago
|
this.$toast.error(`Project '${project.title}' deleting failed`).goAway(3000);
|
||
3 years ago
|
}
|
||
2 years ago
|
await this.projectsLoad();
|
||
|
this.projectStatusUpdating = false;
|
||
3 years ago
|
|
||
2 years ago
|
this.dialogShow = false;
|
||
|
this.$e('a:project:delete');
|
||
3 years ago
|
}
|
||
2 years ago
|
};
|
||
3 years ago
|
},
|
||
3 years ago
|
onCreateProject(xcdb) {
|
||
3 years ago
|
if (xcdb === 'xcdb') {
|
||
2 years ago
|
this.$router.push('/project/xcdb');
|
||
|
this.$e('c:project:create:xcdb');
|
||
3 years ago
|
} else {
|
||
2 years ago
|
this.$router.push('/project/0');
|
||
|
this.$e('c:project:create:extdb');
|
||
3 years ago
|
}
|
||
|
},
|
||
2 years ago
|
onEditProject(project) {
|
||
2 years ago
|
this.$router.push(`/project/edit?projectId=${project.id}`);
|
||
|
this.$e('c:project:edit:rename');
|
||
2 years ago
|
},
|
||
3 years ago
|
onCreateProjectFromTemplate() {
|
||
2 years ago
|
this.templatesModal = true;
|
||
|
this.$e('c:project:create:template');
|
||
3 years ago
|
},
|
||
3 years ago
|
async importProjectFromJSON() {},
|
||
3 years ago
|
onTourCompletion() {
|
||
3 years ago
|
// this.$store.commit('settings/MutShowTour', {page: 'home'})
|
||
3 years ago
|
},
|
||
3 years ago
|
getDir(filePath) {
|
||
3 years ago
|
// return path.dirname(filePath);
|
||
|
},
|
||
3 years ago
|
async projectsRefresh() {
|
||
2 years ago
|
await this.projectsLoad();
|
||
|
this.$e('a:project:refresh');
|
||
3 years ago
|
},
|
||
3 years ago
|
async projectsLoad() {
|
||
3 years ago
|
try {
|
||
2 years ago
|
this.loadingProjects = true;
|
||
|
this.projects = (await this.$api.project.list({})).list;
|
||
3 years ago
|
|
||
3 years ago
|
// todo: multiplex
|
||
2 years ago
|
const user = this.$store.state.users.user;
|
||
|
if (!(this.projects && this.projects.length) && user && user.roles && user.roles.owner) {
|
||
|
if (this.$store.state.project.appInfo && this.$store.state.project.appInfo.oneClick) {
|
||
3 years ago
|
//
|
||
4 years ago
|
}
|
||
3 years ago
|
}
|
||
4 years ago
|
|
||
2 years ago
|
this.loadingProjects = false;
|
||
3 years ago
|
} catch (error) {
|
||
2 years ago
|
console.log('Project fetch err', error);
|
||
3 years ago
|
}
|
||
2 years ago
|
this.loaded = true;
|
||
3 years ago
|
},
|
||
3 years ago
|
async projectRouteHandler(project, count) {
|
||
3 years ago
|
if (!this.deleteBtnClicked) {
|
||
3 years ago
|
await this.$router.push({
|
||
2 years ago
|
path: `/nc/${project.id}`,
|
||
|
});
|
||
3 years ago
|
}
|
||
2 years ago
|
this.$e('a:project:open', { count });
|
||
3 years ago
|
},
|
||
3 years ago
|
async projectEdit(project) {
|
||
3 years ago
|
this.$router.push({
|
||
2 years ago
|
path: `project/0?edit=true&projectId=${project.id}`,
|
||
|
});
|
||
3 years ago
|
},
|
||
2 years ago
|
},
|
||
|
};
|
||
4 years ago
|
</script>
|
||
|
<style scoped>
|
||
3 years ago
|
.action-icons {
|
||
|
opacity: 0;
|
||
|
transition: 0.2s opacity;
|
||
|
}
|
||
4 years ago
|
|
||
3 years ago
|
tr:hover .action-icons {
|
||
|
opacity: 1;
|
||
|
}
|
||
4 years ago
|
|
||
3 years ago
|
@media screen and (max-width: 1240px) {
|
||
4 years ago
|
.community-card {
|
||
3 years ago
|
display: none;
|
||
4 years ago
|
}
|
||
3 years ago
|
}
|
||
4 years ago
|
|
||
3 years ago
|
.community-card {
|
||
|
position: absolute;
|
||
|
right: -300px;
|
||
|
bottom: 60px;
|
||
|
opacity: 0;
|
||
|
transition: 2s right, 2s opacity;
|
||
|
}
|
||
4 years ago
|
|
||
3 years ago
|
.community-card.active {
|
||
|
right: 0px;
|
||
|
opacity: 1;
|
||
|
}
|
||
|
|
||
|
.nc-container {
|
||
|
position: relative;
|
||
|
}
|
||
2 years ago
|
/deep/ .project-row .icon {
|
||
3 years ago
|
opacity: 0;
|
||
|
transition: 0.2s opacity;
|
||
3 years ago
|
}
|
||
2 years ago
|
/deep/ .project-row:hover .icon {
|
||
3 years ago
|
opacity: 1;
|
||
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>
|
||
3 years ago
|
* @author Wing-Kam Wong <wingkwong.code@gmail.com>
|
||
4 years ago
|
*
|
||
|
* @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/>.
|
||
|
*
|
||
|
*/
|
||
3 years ago
|
-->
|