Files
nocodb/packages/nc-gui/components/project/settings/ImportTemplate.vue
Pranav C 9540ca672e GUI code refactoring (#2051)
* refactor: update vue component filenames

Signed-off-by: Pranav C <pranavxc@gmail.com>

* refactor: update store and state variable names

Signed-off-by: Pranav C <pranavxc@gmail.com>

* fix: variable name correction

Signed-off-by: Pranav C <pranavxc@gmail.com>

* fix: store module name correction

Signed-off-by: Pranav C <pranavxc@gmail.com>

* fix: variable name correction

Signed-off-by: Pranav C <pranavxc@gmail.com>
2022-05-15 16:43:39 +05:30

45 lines
757 B
Vue

<template>
<!-- <v-dialog :value="true">-->
<v-card>
<v-textarea v-model="template" />
<v-btn @click="ImportTemplate">
import
</v-btn>
</v-card>
<!-- </v-dialog>-->
</template>
<script>
export default {
name: 'ImportTemplate',
props: {
nodes: Object
},
data() {
return {
template: ''
}
},
methods: {
importTemplate() {
try {
const template = JSON.parse(this.template)
this.$store.dispatch('sqlMgr/ActSqlOp', [{
dbAlias: this.nodes.dbAlias,
env: '_noco'
}, 'xcModelsCreateFromTemplate', {
template
}])
} catch (e) {
this.$toast.error(e.message).goAway(3000)
}
}
}
}
</script>
<style scoped>
</style>