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.
188 lines
5.1 KiB
188 lines
5.1 KiB
3 years ago
|
<!-- eslint-disable -->
|
||
|
<template>
|
||
4 years ago
|
<div>
|
||
|
<v-card style="">
|
||
|
<v-toolbar flat height="42" class="toolbar-border-bottom">
|
||
|
<v-toolbar-title>
|
||
4 years ago
|
<v-breadcrumbs
|
||
3 years ago
|
:items="[
|
||
|
{
|
||
|
text: nodes.env,
|
||
|
disabled: true,
|
||
|
href: '#',
|
||
|
},
|
||
|
{
|
||
|
text: nodes.dbAlias,
|
||
|
disabled: true,
|
||
|
href: '#',
|
||
|
},
|
||
|
{
|
||
|
text: nodes.table_name + ' (ACL)',
|
||
|
disabled: true,
|
||
|
href: '#',
|
||
|
},
|
||
|
]"
|
||
4 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>
|
||
4 years ago
|
<v-spacer />
|
||
3 years ago
|
<x-btn v-ge="['acl', 'reload']" outlined tooltip="Reload ACL" color="primary" small @click="reload">
|
||
|
<v-icon small left> refresh </v-icon>
|
||
3 years ago
|
<!-- Reload -->
|
||
|
{{ $t('general.reload') }}
|
||
4 years ago
|
</x-btn>
|
||
4 years ago
|
<x-btn
|
||
3 years ago
|
v-ge="['acl', 'open-folder']"
|
||
4 years ago
|
tooltip="Open Corresponding Folder"
|
||
|
icon="mdi-folder-open"
|
||
|
outlined
|
||
|
small
|
||
|
:disabled="!policies || !policies.length"
|
||
|
color="primary"
|
||
|
@click="openFolder"
|
||
|
>
|
||
4 years ago
|
Open Folder
|
||
|
</x-btn>
|
||
4 years ago
|
<x-btn
|
||
3 years ago
|
v-ge="['acl', 'save']"
|
||
4 years ago
|
outlined
|
||
3 years ago
|
:tooltip="$t('tooltip.saveChanges')"
|
||
4 years ago
|
color="primary"
|
||
|
class="primary"
|
||
|
small
|
||
|
:disabled="disableSaveButton"
|
||
|
@click="save"
|
||
|
>
|
||
3 years ago
|
<v-icon small left> save </v-icon>
|
||
3 years ago
|
<!-- Save -->
|
||
|
{{ $t('general.save') }}
|
||
4 years ago
|
</x-btn>
|
||
|
</v-toolbar>
|
||
|
|
||
|
<template v-if="loading">
|
||
3 years ago
|
<v-skeleton-loader type="table" width="100%" />
|
||
4 years ago
|
</template>
|
||
|
|
||
|
<template v-else>
|
||
4 years ago
|
<v-text-field
|
||
|
v-model="search"
|
||
|
dense
|
||
|
hide-details
|
||
|
class="ma-2"
|
||
3 years ago
|
:placeholder="`Search ${nodes.table_name} routes`"
|
||
4 years ago
|
prepend-inner-icon="search"
|
||
|
outlined
|
||
|
/>
|
||
4 years ago
|
<acl-typeorm-db-child
|
||
|
v-if="policies && policies.length"
|
||
|
ref="acl"
|
||
4 years ago
|
:nodes="nodes"
|
||
|
:search="search"
|
||
|
:policies="policies"
|
||
|
/>
|
||
4 years ago
|
</template>
|
||
|
<!-- <acl-ts-file-child-->
|
||
|
<!-- style="border-bottom: 1px solid grey"-->
|
||
|
<!-- v-for="policyPath in policyPaths" ref="acl" :nodes="nodes" :search="search" :policyPath="policyPath"></acl-ts-file-child>-->
|
||
|
|
||
|
<!-- <v-alert v-if="policyPaths && !policyPaths.length" outlined type="info">Permission file not found</v-alert>-->
|
||
|
</v-card>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
3 years ago
|
import { mapGetters } from 'vuex';
|
||
|
import AclTypeormDbChild from './AclTsFileDbChild';
|
||
4 years ago
|
|
||
|
// const {shell, path} = require("electron").remote.require('./libs');
|
||
|
|
||
|
export default {
|
||
4 years ago
|
name: 'AclTypeormDb',
|
||
|
components: { AclTypeormDbChild },
|
||
|
props: ['nodes'],
|
||
4 years ago
|
data() {
|
||
4 years ago
|
return {
|
||
|
disableSaveButton: false,
|
||
|
policies: [],
|
||
|
search: '',
|
||
3 years ago
|
loading: false,
|
||
|
};
|
||
4 years ago
|
},
|
||
4 years ago
|
methods: {
|
||
4 years ago
|
async aclInit() {
|
||
4 years ago
|
// // this.disableSaveButton = true;
|
||
|
// this.policies = (await this.sqlMgr.xcRoutesPolicyGet({
|
||
|
// env: this.nodes.env,
|
||
|
// dbAlias: this.nodes.dbAlias,
|
||
3 years ago
|
// tn: this.nodes.table_name
|
||
4 years ago
|
// })).data.list;
|
||
|
// this.disableSaveButton = true;
|
||
3 years ago
|
this.policies = (
|
||
|
await this.$store.dispatch('sqlMgr/ActSqlOp', [
|
||
|
null,
|
||
|
'xcRoutesPolicyGet',
|
||
|
{
|
||
|
env: this.nodes.env,
|
||
|
dbAlias: this.nodes.dbAlias,
|
||
|
tn: this.nodes.table_name,
|
||
|
},
|
||
|
])
|
||
|
).data.list;
|
||
4 years ago
|
},
|
||
4 years ago
|
reload() {
|
||
3 years ago
|
this.$refs.acl.aclInit();
|
||
4 years ago
|
},
|
||
4 years ago
|
save() {
|
||
3 years ago
|
this.$refs.acl.save();
|
||
4 years ago
|
},
|
||
3 years ago
|
openFolder() {},
|
||
4 years ago
|
},
|
||
|
computed: {
|
||
3 years ago
|
...mapGetters({ sqlMgr: 'sqlMgr/sqlMgr' }),
|
||
4 years ago
|
},
|
||
4 years ago
|
watch: {},
|
||
4 years ago
|
mounted() {
|
||
3 years ago
|
this.$nuxt.$loading.start();
|
||
|
setTimeout(async () => {
|
||
|
await this.aclInit();
|
||
|
this.$nuxt.$loading.finish();
|
||
|
this.loading = false;
|
||
|
}, 500);
|
||
4 years ago
|
},
|
||
4 years ago
|
created() {
|
||
3 years ago
|
this.loading = true;
|
||
|
},
|
||
|
};
|
||
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/>.
|
||
|
*
|
||
|
*/
|
||
|
-->
|