"Fossies" - the Fresh Open Source Software Archive

Member "nocodb-0.83.5/packages/nc-gui/components/project/tableTabs/aclTsFileDb.vue" (27 Nov 2021, 5176 Bytes) of package /linux/misc/nocodb-0.83.5.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) vue.js (beta) source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <!-- eslint-disable --><template>
    2   <div>
    3     <v-card style="">
    4       <v-toolbar flat height="42" class="toolbar-border-bottom">
    5         <v-toolbar-title>
    6           <v-breadcrumbs
    7             :items="[{
    8                        text: nodes.env,
    9                        disabled: true,
   10                        href: '#'
   11                      },{
   12                        text: nodes.dbAlias,
   13                        disabled: true,
   14                        href: '#'
   15                      },
   16                      {
   17                        text: nodes.tn + ' (ACL)',
   18                        disabled: true,
   19                        href: '#'
   20                      }]"
   21             divider=">"
   22             small
   23           >
   24             <template #divider>
   25               <v-icon small color="grey lighten-2">
   26                 forward
   27               </v-icon>
   28             </template>
   29           </v-breadcrumbs>
   30         </v-toolbar-title>
   31         <v-spacer />
   32         <x-btn
   33           v-ge="['acl','reload']"
   34           outlined
   35           tooltip="Reload ACL"
   36           color="primary"
   37           small
   38           @click="reload"
   39         >
   40           <v-icon small left>
   41             refresh
   42           </v-icon>
   43           Reload
   44         </x-btn>
   45         <x-btn
   46           v-ge="['acl','open-folder']"
   47           tooltip="Open Corresponding Folder"
   48           icon="mdi-folder-open"
   49           outlined
   50           small
   51           :disabled="!policies || !policies.length"
   52           color="primary"
   53           @click="openFolder"
   54         >
   55           Open Folder
   56         </x-btn>
   57         <x-btn
   58           v-ge="['acl','save']"
   59           outlined
   60           tooltip="Save Changes"
   61           color="primary"
   62           class="primary"
   63           small
   64           :disabled="disableSaveButton"
   65           @click="save"
   66         >
   67           <v-icon small left>
   68             save
   69           </v-icon>
   70           Save
   71         </x-btn>
   72       </v-toolbar>
   73 
   74       <template v-if="loading">
   75         <v-skeleton-loader
   76           type="table"
   77           width="100%"
   78         />
   79       </template>
   80 
   81       <template v-else>
   82         <v-text-field
   83           v-model="search"
   84           dense
   85           hide-details
   86           class="ma-2"
   87           :placeholder="`Search ${nodes.tn} routes`"
   88           prepend-inner-icon="search"
   89           outlined
   90         />
   91         <acl-typeorm-db-child
   92           v-if="policies && policies.length"
   93           ref="acl"
   94           :nodes="nodes"
   95           :search="search"
   96           :policies="policies"
   97         />
   98       </template>
   99       <!--      <acl-ts-file-child-->
  100       <!--        style="border-bottom: 1px solid grey"-->
  101       <!--        v-for="policyPath in policyPaths" ref="acl" :nodes="nodes" :search="search" :policyPath="policyPath"></acl-ts-file-child>-->
  102 
  103       <!--      <v-alert v-if="policyPaths && !policyPaths.length" outlined type="info">Permission file not found</v-alert>-->
  104     </v-card>
  105   </div>
  106 </template>
  107 
  108 <script>
  109 import { mapGetters } from 'vuex'
  110 import AclTypeormDbChild from './aclTsFileDbChild'
  111 
  112 // const {shell, path} = require("electron").remote.require('./libs');
  113 
  114 export default {
  115   name: 'AclTypeormDb',
  116   components: { AclTypeormDbChild },
  117   props: ['nodes'],
  118   data() {
  119     return {
  120       disableSaveButton: false,
  121       policies: [],
  122       search: '',
  123       loading: false
  124     }
  125   },
  126   methods: {
  127 
  128     async aclInit() {
  129       // // this.disableSaveButton = true;
  130       // this.policies = (await this.sqlMgr.xcRoutesPolicyGet({
  131       //   env: this.nodes.env,
  132       //   dbAlias: this.nodes.dbAlias,
  133       //   tn: this.nodes.tn
  134       // })).data.list;
  135       // this.disableSaveButton = true;
  136       this.policies = (await this.$store.dispatch('sqlMgr/ActSqlOp', [null, 'xcRoutesPolicyGet', {
  137         env: this.nodes.env,
  138         dbAlias: this.nodes.dbAlias,
  139         tn: this.nodes.tn
  140       }])).data.list
  141     },
  142     reload() {
  143       this.$refs.acl.aclInit()
  144     },
  145     save() {
  146       this.$refs.acl.save()
  147     },
  148     openFolder() {
  149     }
  150   },
  151   computed: {
  152     ...mapGetters({ sqlMgr: 'sqlMgr/sqlMgr' })
  153   },
  154   watch: {},
  155   mounted() {
  156     this.$nuxt.$loading.start()
  157     setTimeout(async() => {
  158       await this.aclInit()
  159       this.$nuxt.$loading.finish()
  160       this.loading = false
  161     }, 500)
  162   },
  163   created() {
  164     this.loading = true
  165   }
  166 }
  167 </script>
  168 
  169 <style scoped>
  170 
  171 </style>
  172 <!--
  173 /**
  174  * @copyright Copyright (c) 2021, Xgene Cloud Ltd
  175  *
  176  * @author Naveen MR <oof1lab@gmail.com>
  177  * @author Pranav C Balan <pranavxc@gmail.com>
  178  *
  179  * @license GNU AGPL version 3 or any later version
  180  *
  181  * This program is free software: you can redistribute it and/or modify
  182  * it under the terms of the GNU Affero General Public License as
  183  * published by the Free Software Foundation, either version 3 of the
  184  * License, or (at your option) any later version.
  185  *
  186  * This program is distributed in the hope that it will be useful,
  187  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  188  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  189  * GNU Affero General Public License for more details.
  190  *
  191  * You should have received a copy of the GNU Affero General Public License
  192  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  193  *
  194  */
  195 -->