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.
190 lines
5.4 KiB
190 lines
5.4 KiB
4 years ago
|
<template>
|
||
|
<div>
|
||
3 years ago
|
<v-tabs v-model="dbsTab" color="x-active" height="30">
|
||
3 years ago
|
<!-- <v-tab href="#xc-project-meta">-->
|
||
|
<!-- <v-icon icon x-small class="mr-2">-->
|
||
|
<!-- mdi-file-table-box-multiple-outline-->
|
||
|
<!-- </v-icon>-->
|
||
|
<!-- <span class="caption text-capitalize nc-exp-imp-metadata">-->
|
||
|
<!-- <!– Export/Import Metadata –>-->
|
||
|
<!-- {{ $t('title.exportImportMeta') }}-->
|
||
|
<!-- </span>-->
|
||
|
<!-- </v-tab>-->
|
||
4 years ago
|
<v-tab-item value="xc-project-meta">
|
||
|
<div class="d-flex justify-center d-100">
|
||
3 years ago
|
<xc-meta />
|
||
4 years ago
|
</div>
|
||
|
</v-tab-item>
|
||
|
|
||
2 years ago
|
<template v-for="(db, i) in bases">
|
||
3 years ago
|
<v-tab :key="db.id + i" :href="'#' + db.id + 'meta'" class="text-capitalize caption nc-meta-mgmt-metadata-tab">
|
||
|
<!-- {{ db.connection.database | extractDbName }} {{ db.id }} -->
|
||
3 years ago
|
<!-- Metadata -->
|
||
|
{{ $t('title.metadata') }}
|
||
4 years ago
|
</v-tab>
|
||
3 years ago
|
<v-tab-item :key="db.id + 't' + i" :value="db.id + 'meta'">
|
||
2 years ago
|
<metaDiffSync :nodes="nodes" :db="db" :db-id="db.id" />
|
||
4 years ago
|
</v-tab-item>
|
||
3 years ago
|
<template v-if="uiacl">
|
||
3 years ago
|
<v-tab :key="db.id + 'acl'" :href="'#' + db.id + 'acl'" class="text-capitalize caption nc-ui-acl-tab">
|
||
3 years ago
|
<!--UI Access Control-->
|
||
|
{{ $t('title.uiACL') }}
|
||
3 years ago
|
</v-tab>
|
||
2 years ago
|
<v-tab-item :key="db.id + 'aclt'" :value="db.id + 'acl'">
|
||
3 years ago
|
<v-tabs color="x-active" height="28">
|
||
|
<v-tab class="text-capitalize caption">
|
||
3 years ago
|
<!-- Tables -->
|
||
|
{{ $t('objects.tables') }}
|
||
3 years ago
|
</v-tab>
|
||
|
<v-tab-item>
|
||
2 years ago
|
<toggle-table-ui-acl :nodes="nodes" :db="db" :db-alias="db.id" />
|
||
3 years ago
|
</v-tab-item>
|
||
|
</v-tabs>
|
||
|
</v-tab-item>
|
||
|
</template>
|
||
4 years ago
|
</template>
|
||
|
</v-tabs>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
2 years ago
|
import { mapGetters } from 'vuex';
|
||
|
import XcMeta from '../settings/XcMeta';
|
||
|
import { isMetaTable } from '@/helpers/xutils';
|
||
|
import metaDiffSync from '~/components/project/projectMetadata/sync/MetaDiffSync';
|
||
|
import ToggleTableUiAcl from '~/components/project/projectMetadata/uiAcl/ToggleTableUIAcl';
|
||
4 years ago
|
|
||
|
export default {
|
||
3 years ago
|
name: 'DisableOrEnableModels',
|
||
4 years ago
|
components: {
|
||
|
ToggleTableUiAcl,
|
||
3 years ago
|
metaDiffSync,
|
||
2 years ago
|
XcMeta,
|
||
4 years ago
|
},
|
||
3 years ago
|
props: ['nodes'],
|
||
4 years ago
|
data: () => ({
|
||
3 years ago
|
uiacl: true,
|
||
4 years ago
|
edited: false,
|
||
|
models: null,
|
||
|
updating: false,
|
||
|
// dbsTab: 0,
|
||
|
filter: '',
|
||
2 years ago
|
tables: null,
|
||
4 years ago
|
}),
|
||
2 years ago
|
async mounted() {},
|
||
4 years ago
|
methods: {},
|
||
|
computed: {
|
||
3 years ago
|
bases() {
|
||
2 years ago
|
return this.$store.state.project.project && this.$store.state.project.project.bases;
|
||
3 years ago
|
},
|
||
4 years ago
|
dbsTab: {
|
||
3 years ago
|
set(tab) {
|
||
4 years ago
|
if (!tab) {
|
||
|
// return this.$router.push({
|
||
|
// query: {}
|
||
|
// })
|
||
2 years ago
|
return;
|
||
4 years ago
|
}
|
||
3 years ago
|
// eslint-disable-next-line camelcase
|
||
2 years ago
|
const nested_1 = tab;
|
||
4 years ago
|
this.$router.push({
|
||
|
query: {
|
||
|
...this.$route.query,
|
||
2 years ago
|
nested_1,
|
||
|
},
|
||
|
});
|
||
4 years ago
|
},
|
||
3 years ago
|
get() {
|
||
2 years ago
|
return this.$route.query.nested_1;
|
||
|
},
|
||
4 years ago
|
},
|
||
|
|
||
|
...mapGetters({
|
||
2 years ago
|
dbAliasList: 'project/GtrDbAliasList',
|
||
4 years ago
|
}),
|
||
3 years ago
|
enableCountText() {
|
||
2 years ago
|
return this.models ? `${this.models.filter(m => m.enabled).length}/${this.models.length} enabled` : '';
|
||
4 years ago
|
},
|
||
|
|
||
3 years ago
|
isNewOrDeletedModelFound() {
|
||
2 years ago
|
return this.comparedModelList.some(m => m.new || m.deleted);
|
||
4 years ago
|
},
|
||
3 years ago
|
comparedModelList() {
|
||
2 years ago
|
const res = [];
|
||
|
const getPriority = item => {
|
||
|
if (item.new) {
|
||
|
return 2;
|
||
|
}
|
||
|
if (item.deleted) {
|
||
|
return 1;
|
||
|
}
|
||
|
return 0;
|
||
|
};
|
||
4 years ago
|
if (this.tables && this.models) {
|
||
2 years ago
|
const tables = this.tables.filter(t => !isMetaTable(t.table_name)).map(t => t.table_name);
|
||
|
res.push(
|
||
|
...this.models.map(m => {
|
||
|
const i = tables.indexOf(m.title);
|
||
|
if (i === -1) {
|
||
|
m.deleted = true;
|
||
|
} else {
|
||
|
tables.splice(i, 1);
|
||
|
}
|
||
|
return m;
|
||
|
})
|
||
|
);
|
||
|
res.push(
|
||
|
...tables.map(t => ({
|
||
|
title: t,
|
||
|
new: true,
|
||
|
}))
|
||
|
);
|
||
4 years ago
|
}
|
||
2 years ago
|
res.sort((a, b) => getPriority(b) - getPriority(a));
|
||
|
return res;
|
||
|
},
|
||
3 years ago
|
},
|
||
|
filters: {
|
||
|
extractDbName(name) {
|
||
2 years ago
|
return (name || '').split('/').pop();
|
||
|
},
|
||
|
},
|
||
|
};
|
||
4 years ago
|
</script>
|
||
|
|
||
|
<style scoped lang="scss">
|
||
|
::v-deep {
|
||
|
.v-tabs-bar {
|
||
|
border-bottom: solid 1px #7f828b33;
|
||
|
}
|
||
|
|
||
|
.v-tab {
|
||
|
border-right: 1px solid #7f828b33;
|
||
|
}
|
||
|
}
|
||
|
</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/>.
|
||
|
*
|
||
|
*/
|
||
|
-->
|