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.
627 lines
20 KiB
627 lines
20 KiB
4 years ago
|
<template>
|
||
3 years ago
|
<v-container fluid class="ph-no-capture project-container ma-0 pa-0" style="position: relative">
|
||
4 years ago
|
<v-tabs
|
||
3 years ago
|
ref="projectTabs"
|
||
|
v-model="activeTab"
|
||
4 years ago
|
dark
|
||
|
background-color="primary"
|
||
|
height="40"
|
||
3 years ago
|
class="project-tabs nc-project-tabs"
|
||
4 years ago
|
color=""
|
||
|
next-icon="mdi-arrow-right-bold-box-outline"
|
||
|
prev-icon="mdi-arrow-left-bold-box-outline"
|
||
|
show-arrows
|
||
3 years ago
|
:class="{ 'dark-them': $store.state.settings.darkTheme }"
|
||
4 years ago
|
>
|
||
3 years ago
|
<v-tabs-slider color="" />
|
||
|
|
||
|
<v-tab
|
||
3 years ago
|
v-for="(tab, index) in tabs"
|
||
3 years ago
|
:key="`${pid}||${(tab._nodes && tab._nodes).type || ''}||${(tab._nodes && tab._nodes.dbAlias) || ''}||${
|
||
|
tab.name
|
||
|
}`"
|
||
3 years ago
|
class="divider project-tab xc-border-right"
|
||
|
:title="tab.name"
|
||
3 years ago
|
:href="`#${(tab._nodes && tab._nodes).type || ''}||${(tab._nodes && tab._nodes.dbAlias) || ''}||${tab.name}`"
|
||
3 years ago
|
@change="tabActivated(tab)"
|
||
4 years ago
|
>
|
||
3 years ago
|
<v-icon v-if="treeViewIcons[tab._nodes.type]" icon :small="true">
|
||
|
{{ treeViewIcons[tab._nodes.type].openIcon }}
|
||
4 years ago
|
</v-icon>
|
||
3 years ago
|
<span
|
||
|
class="flex-grow-1 caption font-weight-bold text-capitalize mx-2"
|
||
3 years ago
|
style="white-space: nowrap; overflow: hidden; max-width: 140px; text-overflow: ellipsis"
|
||
|
>{{ tab.name }}</span
|
||
|
>
|
||
|
<v-icon icon :small="true" @click="removeTab(index)"> mdi-close </v-icon>
|
||
4 years ago
|
</v-tab>
|
||
|
|
||
|
<v-tabs-items :value="activeTab">
|
||
3 years ago
|
<v-tab-item
|
||
|
v-for="(tab, index) in tabs"
|
||
3 years ago
|
:key="`${pid}||${(tab._nodes && tab._nodes).type || ''}||${(tab._nodes && tab._nodes.dbAlias) || ''}||${
|
||
|
tab.name
|
||
|
}`"
|
||
3 years ago
|
class="nc-main-tab-item"
|
||
3 years ago
|
:value="`${(tab._nodes && tab._nodes.type) || ''}||${(tab._nodes && tab._nodes.dbAlias) || ''}||${tab.name}`"
|
||
3 years ago
|
:transition="false"
|
||
3 years ago
|
style="height: 100%"
|
||
3 years ago
|
:reverse-transition="false"
|
||
|
>
|
||
3 years ago
|
<div v-if="tab._nodes.type === 'table'" style="height: 100%">
|
||
3 years ago
|
<TableView
|
||
3 years ago
|
:ref="'tabs' + index"
|
||
|
:is-active="
|
||
|
activeTab ===
|
||
3 years ago
|
`${(tab._nodes && tab._nodes).type || ''}||${(tab._nodes && tab._nodes.dbAlias) || ''}||${tab.name}`
|
||
3 years ago
|
"
|
||
|
:tab-id="`${pid}||${(tab._nodes && tab._nodes).type || ''}||${
|
||
|
(tab._nodes && tab._nodes.dbAlias) || ''
|
||
|
}||${tab.name}`"
|
||
3 years ago
|
:hide-log-windows.sync="hideLogWindows"
|
||
|
:nodes="tab._nodes"
|
||
|
/>
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'view'" style="height: 100%">
|
||
3 years ago
|
<TableView
|
||
3 years ago
|
:ref="'tabs' + index"
|
||
|
:is-active="
|
||
|
activeTab ===
|
||
3 years ago
|
`${(tab._nodes && tab._nodes).type || ''}||${(tab._nodes && tab._nodes.dbAlias) || ''}||${tab.name}`
|
||
3 years ago
|
"
|
||
|
:tab-id="`${pid}||${(tab._nodes && tab._nodes).type || ''}||${
|
||
|
(tab._nodes && tab._nodes.dbAlias) || ''
|
||
|
}||${tab.name}`"
|
||
3 years ago
|
:hide-log-windows.sync="hideLogWindows"
|
||
|
:nodes="tab._nodes"
|
||
|
is-view
|
||
|
/>
|
||
4 years ago
|
<!-- </sqlLogAndOutput>-->
|
||
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'function'" style="height: 100%">
|
||
4 years ago
|
<sqlLogAndOutput>
|
||
3 years ago
|
<FunctionTab :ref="'tabs' + index" :nodes="tab._nodes" />
|
||
4 years ago
|
</sqlLogAndOutput>
|
||
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'procedure'" style="height: 100%">
|
||
4 years ago
|
<sqlLogAndOutput>
|
||
3 years ago
|
<ProcedureTab :ref="'tabs' + index" :nodes="tab._nodes" />
|
||
4 years ago
|
</sqlLogAndOutput>
|
||
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'sequence'" style="height: 100%">
|
||
4 years ago
|
<sqlLogAndOutput>
|
||
3 years ago
|
<SequenceTab :ref="'tabs' + index" :nodes="tab._nodes" />
|
||
4 years ago
|
</sqlLogAndOutput>
|
||
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'db'" style="height: 100%">
|
||
3 years ago
|
<audit-tab :ref="'tabs' + index" class="backgroundColor" :nodes="tab._nodes" />
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'seedParserDir'" style="height: 100%">
|
||
4 years ago
|
<sqlLogAndOutput>
|
||
3 years ago
|
<SeedTab :ref="'tabs' + index" :nodes="tab._nodes" />
|
||
4 years ago
|
</sqlLogAndOutput>
|
||
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'migrationsDir'" style="height: 100%">
|
||
|
<audit-tab :ref="'tabs' + index" class="backgroundColor" :nodes="tab._nodes" />
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'apisDir'" style="height: 100%">
|
||
3 years ago
|
<ApisTab :ref="'tabs' + index" class="backgroundColor" :nodes="tab._nodes" />
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'apiClientDir'" style="height: 100%">
|
||
3 years ago
|
<ApiClientTab :ref="'tabs' + index" :nodes="tab._nodes" />
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'apiClientSwaggerDir'" style="height: 100%">
|
||
3 years ago
|
<ApiClientSwaggerTab :ref="'tabs' + index" :nodes="tab._nodes" />
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'sqlClientDir'" style="height: 100%">
|
||
4 years ago
|
<sqlLogAndOutput>
|
||
3 years ago
|
<SqlClientTab :ref="'tabs' + index" :nodes="tab._nodes" />
|
||
4 years ago
|
</sqlLogAndOutput>
|
||
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'terminal'" style="height: 100%">
|
||
|
<x-term :ref="'tabs' + index" style="height: 100%" />
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'graphqlClientDir'" style="height: 100%">
|
||
3 years ago
|
<graphql-client class="backgroundColor" style="height: 100%" />
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'swaggerClientDir'" style="height: 100%">
|
||
3 years ago
|
<swagger-client style="height: 100%" />
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'grpcClient'" style="height: 100%">
|
||
3 years ago
|
<grpc-client style="height: 100%" />
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'meta'" style="height: 100%">
|
||
|
<xc-meta class="backgroundColor" style="height: 100%" />
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'roles'" style="height: 100%">
|
||
3 years ago
|
<auth-tab
|
||
|
v-if="_isUIAllowed('team-auth')"
|
||
|
class="backgroundColor"
|
||
|
:nodes="tab._nodes"
|
||
|
style="height: 100%"
|
||
|
/>
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'acl'" style="height: 100%">
|
||
3 years ago
|
<global-acl class="backgroundColor" :nodes="tab._nodes" style="height: 100%" />
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'projectSettings'" style="height: 100%">
|
||
3 years ago
|
<project-settings
|
||
3 years ago
|
v-if="_isUIAllowed('projectSettings')"
|
||
3 years ago
|
class="backgroundColor"
|
||
3 years ago
|
:nodes="tab._nodes"
|
||
|
style="height: 100%"
|
||
|
/>
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'disableOrEnableModel'" style="height: 100%">
|
||
3 years ago
|
<disable-or-enable-models
|
||
|
v-if="_isUIAllowed('project-metadata')"
|
||
3 years ago
|
class="backgroundColor"
|
||
3 years ago
|
:nodes="tab._nodes"
|
||
|
style="height: 100%"
|
||
|
/>
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'cronJobs'" style="height: 100%">
|
||
3 years ago
|
<cron-jobs :nodes="tab._nodes" style="height: 100%" />
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'projectInfo'" style="height: 100%">
|
||
3 years ago
|
<xc-info :nodes="tab._nodes" class="h-100" />
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else-if="tab._nodes.type === 'appStore'" style="height: 100%">
|
||
|
<app-store :nodes="tab._nodes" class="backgroundColor h-100" />
|
||
4 years ago
|
</div>
|
||
3 years ago
|
<div v-else style="height: 100%">
|
||
4 years ago
|
<h1>{{ tab.name }}</h1>
|
||
|
<h1>{{ tab._nodes }}</h1>
|
||
|
</div>
|
||
|
</v-tab-item>
|
||
|
</v-tabs-items>
|
||
|
|
||
3 years ago
|
<!-- Add / Import -->
|
||
3 years ago
|
<v-menu v-if="_isUIAllowed('addOrImport')" offset-y>
|
||
3 years ago
|
<template #activator="{ on }">
|
||
3 years ago
|
<v-btn color="primary" style="height: 100%; padding: 5px" v-on="on">
|
||
|
<x-icon icon-class="add-btn" :color="['white', 'grey lighten-2']"> mdi-plus-box </x-icon>
|
||
3 years ago
|
<span class="flex-grow-1 caption font-weight-bold text-capitalize mx-2">
|
||
|
<!-- TODO: i18n -->
|
||
|
Add / Import
|
||
|
</span>
|
||
|
<v-spacer />
|
||
|
</v-btn>
|
||
|
</template>
|
||
|
<v-list class="addOrImport">
|
||
|
<v-list-item
|
||
|
v-if="_isUIAllowed('addTable')"
|
||
|
v-t="['a:table:import-from-excel']"
|
||
|
@click="dialogCreateTableShowMethod"
|
||
|
>
|
||
|
<v-list-item-title>
|
||
3 years ago
|
<v-icon small> mdi-table </v-icon>
|
||
3 years ago
|
<span class="caption">
|
||
|
<!-- Add new table -->
|
||
|
{{ $t('tooltip.addTable') }}
|
||
|
</span>
|
||
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
3 years ago
|
<v-divider class="my-1" />
|
||
3 years ago
|
<v-subheader class="caption" style="height: 35px"> QUICK IMPORT FROM </v-subheader>
|
||
3 years ago
|
|
||
|
<v-list-item
|
||
|
v-if="_isUIAllowed('airtableImport')"
|
||
|
v-t="['a:actions:import-airtable']"
|
||
|
@click="airtableImportModal = true"
|
||
|
>
|
||
|
<v-list-item-title>
|
||
3 years ago
|
<v-icon small> mdi-table-large </v-icon>
|
||
3 years ago
|
<span class="caption">
|
||
|
<!-- TODO: i18n -->
|
||
|
Airtable
|
||
|
</span>
|
||
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
3 years ago
|
<v-list-item
|
||
|
v-if="_isUIAllowed('csvQuickImport')"
|
||
|
v-t="['a:actions:import-csv']"
|
||
|
@click="onImportFromExcelOrCSV('csv')"
|
||
|
>
|
||
|
<v-list-item-title>
|
||
3 years ago
|
<v-icon small> mdi-file-document-outline </v-icon>
|
||
3 years ago
|
<span class="caption">
|
||
|
<!-- TODO: i18n -->
|
||
|
CSV file
|
||
|
</span>
|
||
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
3 years ago
|
<v-list-item
|
||
|
v-if="_isUIAllowed('jsonImport')"
|
||
|
v-t="['a:actions:import-json']"
|
||
|
@click="jsonImportModal = true"
|
||
|
>
|
||
|
<v-list-item-title>
|
||
3 years ago
|
<v-icon small> mdi-code-json </v-icon>
|
||
3 years ago
|
<span class="caption">
|
||
|
<!-- TODO: i18n -->
|
||
|
JSON file
|
||
|
</span>
|
||
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
3 years ago
|
<v-list-item
|
||
|
v-if="_isUIAllowed('excelQuickImport')"
|
||
|
v-t="['a:actions:import-excel']"
|
||
|
@click="onImportFromExcelOrCSV('excel')"
|
||
|
>
|
||
|
<v-list-item-title>
|
||
3 years ago
|
<v-icon small> mdi-file-excel </v-icon>
|
||
3 years ago
|
<span class="caption">
|
||
|
<!-- TODO: i18n -->
|
||
|
Microsoft Excel
|
||
|
</span>
|
||
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
3 years ago
|
|
||
|
<v-divider class="my-1" />
|
||
|
|
||
3 years ago
|
<v-list-item
|
||
3 years ago
|
v-if="_isUIAllowed('importRequest')"
|
||
|
v-t="['e:datasource:import-request']"
|
||
|
href="https://github.com/nocodb/nocodb/issues/2052"
|
||
|
target="_blank"
|
||
3 years ago
|
>
|
||
|
<v-list-item-title>
|
||
3 years ago
|
<v-icon small> mdi-open-in-new </v-icon>
|
||
3 years ago
|
<span class="caption">
|
||
|
<!-- TODO: i18n -->
|
||
3 years ago
|
Request a data source you need ?
|
||
3 years ago
|
</span>
|
||
|
</v-list-item-title>
|
||
|
</v-list-item>
|
||
3 years ago
|
</v-list>
|
||
|
</v-menu>
|
||
4 years ago
|
</v-tabs>
|
||
3 years ago
|
<!-- Create Empty Table -->
|
||
4 years ago
|
<dlg-table-create
|
||
|
v-if="dialogCreateTableShow"
|
||
|
v-model="dialogCreateTableShow"
|
||
3 years ago
|
@create="
|
||
|
$emit('tableCreate', $event);
|
||
|
dialogCreateTableShow = false;
|
||
|
"
|
||
3 years ago
|
/>
|
||
3 years ago
|
<!-- Import From Excel / CSV -->
|
||
|
<quick-import
|
||
|
ref="quickImport"
|
||
|
v-model="quickImportModal"
|
||
|
:quick-import-type="quickImportType"
|
||
|
hide-label
|
||
|
@closeModal="quickImportModal = false"
|
||
|
/>
|
||
3 years ago
|
|
||
3 years ago
|
<!-- Import From JSON string / file -->
|
||
3 years ago
|
<json-import v-model="jsonImportModal" hide-label @closeModal="jsonImportModal = false" />
|
||
3 years ago
|
|
||
3 years ago
|
<import-from-airtable v-if="airtableImportModal" v-model="airtableImportModal" />
|
||
4 years ago
|
</v-container>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
3 years ago
|
import { mapGetters, mapMutations } from 'vuex';
|
||
|
import treeViewIcons from '../helpers/treeViewIcons';
|
||
|
import TableView from './project/Table';
|
||
|
import FunctionTab from './project/Function';
|
||
|
import ProcedureTab from './project/Procedure';
|
||
|
import SequenceTab from './project/Sequence';
|
||
|
import SeedTab from './project/Seed';
|
||
|
import SqlClientTab from './project/SqlClient';
|
||
|
import ApisTab from './project/Apis';
|
||
|
import ApiClientTab from './project/ApiClientOld';
|
||
|
import sqlLogAndOutput from './project/SqlLogAndOutput';
|
||
|
import graphqlClient from './project/GraphqlClient';
|
||
|
import xTerm from './XTerm';
|
||
|
|
||
|
import ApiClientSwaggerTab from './project/ApiClientSwagger';
|
||
|
import XcMeta from './project/settings/XcMeta';
|
||
|
import XcInfo from './project/XcInfo';
|
||
|
import SwaggerClient from '~/components/project/SwaggerClient';
|
||
|
import DlgTableCreate from '~/components/utils/DlgTableCreate';
|
||
|
import AppStore from '~/components/project/AppStore';
|
||
|
import AuthTab from '~/components/AuthTab';
|
||
|
import CronJobs from '~/components/project/CronJobs';
|
||
|
import DisableOrEnableModels from '~/components/project/projectMetadata/DisableOrEnableModels';
|
||
|
import ProjectSettings from '~/components/project/ProjectSettings';
|
||
|
import GrpcClient from '~/components/project/GrpcClient';
|
||
|
import GlobalAcl from '~/components/GlobalAcl';
|
||
|
import AuditTab from '~/components/project/AuditTab';
|
||
|
import QuickImport from '~/components/import/QuickImport';
|
||
|
import ImportFromAirtable from '~/components/import/ImportFromAirtable';
|
||
|
import JsonImport from '~/components/import/JSONImport';
|
||
4 years ago
|
|
||
|
export default {
|
||
|
components: {
|
||
3 years ago
|
JsonImport,
|
||
3 years ago
|
ImportFromAirtable,
|
||
4 years ago
|
SwaggerClient,
|
||
3 years ago
|
// Screensaver,
|
||
4 years ago
|
DlgTableCreate,
|
||
|
AuditTab,
|
||
|
AppStore,
|
||
|
XcInfo,
|
||
|
AuthTab,
|
||
|
CronJobs,
|
||
|
DisableOrEnableModels,
|
||
3 years ago
|
// CreateOrEditProject,
|
||
4 years ago
|
ProjectSettings,
|
||
|
GrpcClient,
|
||
|
GlobalAcl,
|
||
3 years ago
|
// Roles,
|
||
4 years ago
|
XcMeta,
|
||
|
ApiClientSwaggerTab,
|
||
|
TableView,
|
||
|
FunctionTab,
|
||
|
ProcedureTab,
|
||
|
ApisTab,
|
||
|
SqlClientTab,
|
||
|
ApiClientTab,
|
||
|
SeedTab,
|
||
|
SequenceTab,
|
||
|
sqlLogAndOutput,
|
||
|
xTerm,
|
||
3 years ago
|
graphqlClient,
|
||
3 years ago
|
QuickImport,
|
||
4 years ago
|
},
|
||
3 years ago
|
data() {
|
||
4 years ago
|
return {
|
||
3 years ago
|
dragOver: false,
|
||
4 years ago
|
dialogCreateTableShow: false,
|
||
3 years ago
|
test: '',
|
||
4 years ago
|
treeViewIcons,
|
||
|
hideLogWindows: false,
|
||
3 years ago
|
showScreensaver: false,
|
||
3 years ago
|
quickImportModal: false,
|
||
3 years ago
|
quickImportType: '',
|
||
3 years ago
|
airtableImportModal: false,
|
||
3 years ago
|
jsonImportModal: false,
|
||
|
};
|
||
4 years ago
|
},
|
||
|
methods: {
|
||
3 years ago
|
dialogCreateTableShowMethod() {
|
||
3 years ago
|
this.dialogCreateTableShow = true;
|
||
|
this.$e('c:table:create:navbar');
|
||
3 years ago
|
},
|
||
3 years ago
|
checkInactiveState() {
|
||
3 years ago
|
let position = 0;
|
||
|
let idleTime = 0;
|
||
3 years ago
|
// Increment the idle time counter every minute.
|
||
3 years ago
|
let idleInterval = setInterval(timerIncrement, 1000);
|
||
3 years ago
|
|
||
3 years ago
|
const self = this;
|
||
3 years ago
|
// Zero the idle timer on mouse movement.
|
||
3 years ago
|
document.addEventListener('mousemove', e => {
|
||
|
self.showScreensaver = false;
|
||
|
idleTime = 0;
|
||
|
clearInterval(idleInterval);
|
||
|
idleInterval = setInterval(timerIncrement, 1000);
|
||
|
});
|
||
|
document.addEventListener('keypress', e => {
|
||
|
self.showScreensaver = false;
|
||
|
idleTime = 0;
|
||
|
clearInterval(idleInterval);
|
||
|
idleInterval = setInterval(timerIncrement, 1000);
|
||
|
});
|
||
3 years ago
|
|
||
3 years ago
|
function timerIncrement() {
|
||
3 years ago
|
idleTime = idleTime + 1;
|
||
4 years ago
|
if (idleTime > 120) {
|
||
3 years ago
|
const title = document.title;
|
||
4 years ago
|
|
||
3 years ago
|
function scrolltitle() {
|
||
3 years ago
|
document.title = title + Array(position).fill(' .').join('');
|
||
|
position = ++position % 3;
|
||
4 years ago
|
if (self.showScreensaver) {
|
||
3 years ago
|
window.setTimeout(scrolltitle, 400);
|
||
4 years ago
|
} else {
|
||
3 years ago
|
document.title = title;
|
||
4 years ago
|
}
|
||
|
}
|
||
|
|
||
3 years ago
|
self.showScreensaver = self.$store.state.settings.screensaver;
|
||
|
scrolltitle();
|
||
|
clearInterval(idleInterval);
|
||
4 years ago
|
}
|
||
|
}
|
||
|
},
|
||
3 years ago
|
async handleKeyDown(event) {
|
||
3 years ago
|
const activeTabEleKey = `tabs${this.activeTab}`;
|
||
|
let isHandled = false;
|
||
4 years ago
|
|
||
3 years ago
|
if (
|
||
|
this.$refs[activeTabEleKey] &&
|
||
3 years ago
|
this.$refs[activeTabEleKey][0] &&
|
||
3 years ago
|
this.$refs[activeTabEleKey][0].handleKeyDown
|
||
|
) {
|
||
3 years ago
|
isHandled = await this.$refs[activeTabEleKey][0].handleKeyDown(event);
|
||
4 years ago
|
}
|
||
3 years ago
|
if (!isHandled) {
|
||
3 years ago
|
switch ([this._isMac ? event.metaKey : event.ctrlKey, event.key].join('_')) {
|
||
3 years ago
|
case 'true_w':
|
||
3 years ago
|
this.removeTab(this.activeTab);
|
||
|
event.preventDefault();
|
||
|
event.stopPropagation();
|
||
|
break;
|
||
4 years ago
|
}
|
||
3 years ago
|
}
|
||
4 years ago
|
},
|
||
|
...mapMutations({
|
||
3 years ago
|
setActiveTab: 'tabs/active',
|
||
|
removeTab: 'tabs/remove',
|
||
3 years ago
|
updateActiveTabx: 'tabs/activeTabCtx',
|
||
4 years ago
|
}),
|
||
3 years ago
|
tabActivated(tab) {},
|
||
3 years ago
|
onImportFromExcelOrCSV(quickImportType) {
|
||
3 years ago
|
this.quickImportModal = true;
|
||
|
this.quickImportType = quickImportType;
|
||
3 years ago
|
},
|
||
|
onAirtableImport() {
|
||
3 years ago
|
this.airtableImportModal = true;
|
||
|
},
|
||
4 years ago
|
},
|
||
|
computed: {
|
||
3 years ago
|
...mapGetters({ tabs: 'tabs/list', activeTabCtx: 'tabs/activeTabCtx' }),
|
||
3 years ago
|
pid() {
|
||
3 years ago
|
return this.$route.params.project_id;
|
||
4 years ago
|
},
|
||
|
activeTab: {
|
||
3 years ago
|
set(tab) {
|
||
4 years ago
|
if (!tab) {
|
||
|
return this.$router.push({
|
||
3 years ago
|
query: {},
|
||
|
});
|
||
4 years ago
|
}
|
||
3 years ago
|
const [type, dbalias, name] = tab.split('||');
|
||
4 years ago
|
this.$router.push({
|
||
|
query: {
|
||
|
...this.$route.query,
|
||
3 years ago
|
type,
|
||
|
dbalias,
|
||
3 years ago
|
name,
|
||
|
},
|
||
|
});
|
||
4 years ago
|
},
|
||
3 years ago
|
get() {
|
||
3 years ago
|
return [this.$route.query.type, this.$route.query.dbalias, this.$route.query.name].join('||');
|
||
|
},
|
||
|
},
|
||
4 years ago
|
},
|
||
|
|
||
3 years ago
|
beforeCreated() {},
|
||
|
watch: {},
|
||
3 years ago
|
created() {
|
||
3 years ago
|
document.addEventListener('keydown', this.handleKeyDown);
|
||
4 years ago
|
/**
|
||
|
* Listening for tab change so that we can hide/show projectlogs based on tab
|
||
|
*/
|
||
|
},
|
||
3 years ago
|
mounted() {
|
||
|
if (this.$route && this.$route.query && this.$route.query.excelUrl) {
|
||
3 years ago
|
this.quickImportModal = true;
|
||
3 years ago
|
}
|
||
|
},
|
||
3 years ago
|
beforeDestroy() {},
|
||
3 years ago
|
destroyed() {
|
||
3 years ago
|
document.removeEventListener('keydown', this.handleKeyDown);
|
||
4 years ago
|
},
|
||
3 years ago
|
directives: {},
|
||
3 years ago
|
validate({ params }) {
|
||
3 years ago
|
return true;
|
||
4 years ago
|
},
|
||
3 years ago
|
head() {
|
||
3 years ago
|
return {};
|
||
4 years ago
|
},
|
||
3 years ago
|
props: {},
|
||
|
};
|
||
4 years ago
|
</script>
|
||
|
|
||
|
<style scoped>
|
||
|
/deep/ .project-tabs .v-tabs-bar {
|
||
|
max-height: 30px;
|
||
|
}
|
||
|
|
||
|
/deep/ .project-tabs > .v-tabs-bar {
|
||
3 years ago
|
max-height: 30px;
|
||
4 years ago
|
}
|
||
3 years ago
|
/deep/ .v-window__container .v-window-item {
|
||
|
height: 100%;
|
||
|
}
|
||
4 years ago
|
|
||
|
/deep/ .project-tabs .v-tab.project-tab {
|
||
|
text-transform: capitalize;
|
||
3 years ago
|
border-top-left-radius: 3px;
|
||
|
border-top-right-radius: 3px;
|
||
|
background: #0002;
|
||
4 years ago
|
margin: 0px 1px 0 1px;
|
||
|
color: white !important;
|
||
|
}
|
||
|
|
||
|
/deep/ .project-tabs .v-tab.v-tab--active.project-tab {
|
||
|
background-color: white !important;
|
||
|
color: rgba(51, 51, 51, 1) !important;
|
||
|
}
|
||
|
|
||
|
/deep/ .project-tabs.dark-them .v-tab.v-tab--active.project-tab {
|
||
|
background-color: #272727 !important;
|
||
|
color: white !important;
|
||
|
}
|
||
|
|
||
|
/deep/ .project-tabs > div > div > div > div > .v-tabs-slider {
|
||
|
color: transparent !important;
|
||
|
}
|
||
|
|
||
|
/deep/ .project-tabs .v-btn {
|
||
|
text-transform: capitalize;
|
||
|
}
|
||
|
|
||
|
.powered-by .powered-by-close {
|
||
|
opacity: 0;
|
||
3 years ago
|
transition: 0.4s opacity;
|
||
4 years ago
|
}
|
||
|
|
||
|
.powered-by a {
|
||
3 years ago
|
transition: 0.1s font-weight;
|
||
4 years ago
|
}
|
||
|
|
||
|
.powered-by:hover .powered-by-close {
|
||
|
opacity: 1;
|
||
|
}
|
||
|
|
||
|
.powered-by:hover a {
|
||
|
font-weight: bold;
|
||
|
}
|
||
|
|
||
3 years ago
|
.addOrImport {
|
||
|
min-width: 200px;
|
||
|
}
|
||
|
|
||
|
.addOrImport .v-list-item {
|
||
|
min-height: 35px;
|
||
|
}
|
||
|
|
||
4 years ago
|
/deep/ .add-btn {
|
||
|
margin-left: 5px;
|
||
|
}
|
||
|
|
||
|
/deep/ .screensaver.body {
|
||
|
position: absolute;
|
||
|
}
|
||
|
|
||
3 years ago
|
/deep/ .project-tab:first-of-type {
|
||
3 years ago
|
margin-left: 0 !important;
|
||
|
}
|
||
3 years ago
|
|
||
3 years ago
|
/deep/ .nc-main-tab-item:not(.v-window-item--active) {
|
||
|
display: none;
|
||
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/>.
|
||
|
*
|
||
|
*/
|
||
|
-->
|