"Fossies" - the Fresh Open Source Software Archive

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