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.
110 lines
2.4 KiB
110 lines
2.4 KiB
4 years ago
|
<template>
|
||
|
<v-dialog
|
||
3 years ago
|
v-model="dialogShow"
|
||
4 years ago
|
width="60%"
|
||
3 years ago
|
>
|
||
4 years ago
|
<v-card>
|
||
3 years ago
|
<h5 class="body-1 pa-1 text-center">
|
||
|
Paste JSON/JSON5 String
|
||
|
</h5>
|
||
4 years ago
|
|
||
|
<div class="d-flex" style="height: 100%; width:100%">
|
||
|
<div style="" class="text-center flex-shrink-1 d-flex flex-column">
|
||
|
<x-icon
|
||
|
icon-class="mx-2 mt-3 elevation-1"
|
||
|
color="success success"
|
||
|
@click="$emit('load',jsonContent)"
|
||
3 years ago
|
>
|
||
|
mdi-send
|
||
4 years ago
|
</x-icon>
|
||
|
</div>
|
||
|
<div class="flex-grow-1" style="overflow:auto;height:100%">
|
||
|
<monaco-json-editor
|
||
|
v-model="jsonContent"
|
||
3 years ago
|
:validate="false"
|
||
|
lang="json"
|
||
|
style="height: 500px;width: 100%;min-width: 250px"
|
||
|
/>
|
||
4 years ago
|
</div>
|
||
|
</div>
|
||
|
</v-card>
|
||
|
</v-dialog>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
|
||
3 years ago
|
import { MonacoJsonEditor } from '../../../monaco/index'
|
||
4 years ago
|
|
||
3 years ago
|
export default {
|
||
|
name: 'JsonToColumn',
|
||
|
directives: {},
|
||
|
components: { MonacoJsonEditor },
|
||
3 years ago
|
validate({ params }) {
|
||
3 years ago
|
return true
|
||
|
},
|
||
|
props: {
|
||
|
value: Boolean,
|
||
|
show: Boolean
|
||
|
},
|
||
3 years ago
|
data() {
|
||
3 years ago
|
return {
|
||
|
jsonContent: JSON.stringify({ first_name: 'James', last_name: 'Bond' }, 0, 2),
|
||
|
activeTab: 0
|
||
|
}
|
||
|
},
|
||
3 years ago
|
head() {
|
||
3 years ago
|
return {}
|
||
|
},
|
||
|
computed: {
|
||
|
dialogShow: {
|
||
3 years ago
|
get() {
|
||
3 years ago
|
return this.show
|
||
|
},
|
||
3 years ago
|
set(val) {
|
||
3 years ago
|
this.$emit('update:show', val)
|
||
4 years ago
|
}
|
||
3 years ago
|
}
|
||
|
},
|
||
|
watch: {},
|
||
3 years ago
|
created() {
|
||
3 years ago
|
},
|
||
3 years ago
|
mounted() {
|
||
3 years ago
|
},
|
||
3 years ago
|
beforeDestroy() {
|
||
3 years ago
|
},
|
||
|
methods: {},
|
||
3 years ago
|
beforeCreated() {
|
||
3 years ago
|
},
|
||
3 years ago
|
destroy() {
|
||
4 years ago
|
}
|
||
3 years ago
|
}
|
||
4 years ago
|
</script>
|
||
|
|
||
|
<style scoped>
|
||
|
|
||
|
</style>
|
||
|
<!--
|
||
|
/**
|
||
|
* @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/>.
|
||
|
*
|
||
|
*/
|
||
|
-->
|