mirror of https://github.com/nocodb/nocodb
137 lines
3.7 KiB
137 lines
3.7 KiB
4 years ago
|
<template>
|
||
|
<div class="">
|
||
|
<v-toolbar flat height="42" class="toolbar-border-bottom">
|
||
|
<v-toolbar-title>
|
||
3 years ago
|
<v-breadcrumbs
|
||
3 years ago
|
:items="[
|
||
|
{
|
||
|
text: nodes.env,
|
||
|
disabled: true,
|
||
|
href: '#',
|
||
|
},
|
||
|
{
|
||
|
text: nodes.dbAlias,
|
||
|
disabled: true,
|
||
|
href: '#',
|
||
|
},
|
||
|
{
|
||
|
text: nodes.table_name + ' (table)',
|
||
|
disabled: true,
|
||
|
href: '#',
|
||
|
},
|
||
|
]"
|
||
3 years ago
|
divider=">"
|
||
|
small
|
||
|
>
|
||
|
<template #divider>
|
||
3 years ago
|
<v-icon small color="grey lighten-2"> forward </v-icon>
|
||
4 years ago
|
</template>
|
||
|
</v-breadcrumbs>
|
||
|
</v-toolbar-title>
|
||
3 years ago
|
<v-spacer />
|
||
3 years ago
|
<v-btn small color="primary" class="primary" @click="loadConstraintList">
|
||
|
<v-icon left> refresh </v-icon>
|
||
4 years ago
|
Refresh
|
||
3 years ago
|
</v-btn>
|
||
3 years ago
|
<v-btn small color="error " class="error text-right" @click="deleteTable('showDialog')">
|
||
3 years ago
|
{{ $t('activity.deleteTable') }}
|
||
3 years ago
|
</v-btn>
|
||
3 years ago
|
<v-btn icon class="text-right">
|
||
4 years ago
|
<v-icon>mdi-help-circle-outline</v-icon>
|
||
|
</v-btn>
|
||
|
</v-toolbar>
|
||
|
|
||
3 years ago
|
<v-data-table dense :headers="headers" :items="constraints" footer-props.items-per-page-options="30">
|
||
3 years ago
|
<template #item="props">
|
||
4 years ago
|
<td>{{ props.item.cstn }}</td>
|
||
|
<td>{{ props.item.cst }}</td>
|
||
3 years ago
|
<td>{{ props.item.column_name }}</td>
|
||
4 years ago
|
<td>{{ props.item.op }}</td>
|
||
|
</template>
|
||
|
</v-data-table>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
3 years ago
|
import { mapGetters } from 'vuex';
|
||
4 years ago
|
|
||
3 years ago
|
export default {
|
||
3 years ago
|
data() {
|
||
3 years ago
|
return {
|
||
|
constraints: [],
|
||
|
headers: [
|
||
|
{
|
||
|
text: 'Constraint',
|
||
3 years ago
|
sortable: false,
|
||
3 years ago
|
},
|
||
|
{ text: 'Constraint Type', sortable: false },
|
||
|
{ text: 'Column Name', sortable: false },
|
||
3 years ago
|
{ text: 'Constraint Ordinal Position', sortable: false },
|
||
|
],
|
||
|
};
|
||
3 years ago
|
},
|
||
|
methods: {
|
||
3 years ago
|
async loadConstraintList() {
|
||
3 years ago
|
if (this.newTable) {
|
||
|
return;
|
||
|
}
|
||
3 years ago
|
// console.log("env: this.nodes.env", this.nodes.env, this.nodes.dbAlias);
|
||
|
const client = await this.sqlMgr.projectGetSqlClient({
|
||
|
env: this.nodes.env,
|
||
3 years ago
|
dbAlias: this.nodes.dbAlias,
|
||
|
});
|
||
3 years ago
|
const result = await client.constraintList({
|
||
3 years ago
|
tn: this.nodes.table_name,
|
||
|
});
|
||
3 years ago
|
// console.log("cons", result.data.list);
|
||
3 years ago
|
this.constraints = result.data.list;
|
||
|
},
|
||
3 years ago
|
},
|
||
|
computed: { ...mapGetters({ sqlMgr: 'sqlMgr/sqlMgr' }) },
|
||
4 years ago
|
|
||
3 years ago
|
beforeCreated() {},
|
||
3 years ago
|
watch: {},
|
||
3 years ago
|
created() {
|
||
3 years ago
|
this.loadConstraintList();
|
||
3 years ago
|
},
|
||
3 years ago
|
mounted() {},
|
||
|
beforeDestroy() {},
|
||
|
destroy() {},
|
||
3 years ago
|
directives: {},
|
||
|
components: {},
|
||
3 years ago
|
validate({ params }) {
|
||
3 years ago
|
return true;
|
||
3 years ago
|
},
|
||
3 years ago
|
head() {
|
||
3 years ago
|
return {};
|
||
3 years ago
|
},
|
||
3 years ago
|
props: ['nodes', 'newTable', 'deleteTable'],
|
||
|
};
|
||
4 years ago
|
</script>
|
||
|
|
||
3 years ago
|
<style scoped></style>
|
||
4 years ago
|
<!--
|
||
|
/**
|
||
|
* @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/>.
|
||
|
*
|
||
|
*/
|
||
|
-->
|