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.
93 lines
2.4 KiB
93 lines
2.4 KiB
4 years ago
|
<template>
|
||
3 years ago
|
<v-dialog v-model="dialogShow" width="60%">
|
||
4 years ago
|
<v-card>
|
||
3 years ago
|
<h5 class="body-1 pa-1 text-center">Paste JSON/JSON5 String</h5>
|
||
4 years ago
|
|
||
3 years ago
|
<div class="d-flex" style="height: 100%; width: 100%">
|
||
4 years ago
|
<div style="" class="text-center flex-shrink-1 d-flex flex-column">
|
||
3 years ago
|
<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>
|
||
3 years ago
|
<div class="flex-grow-1" style="overflow: auto; height: 100%">
|
||
4 years ago
|
<monaco-json-editor
|
||
|
v-model="jsonContent"
|
||
3 years ago
|
:validate="false"
|
||
|
lang="json"
|
||
3 years ago
|
style="height: 500px; width: 100%; min-width: 250px"
|
||
3 years ago
|
/>
|
||
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;
|
||
3 years ago
|
},
|
||
|
props: {
|
||
|
value: Boolean,
|
||
3 years ago
|
show: Boolean,
|
||
3 years ago
|
},
|
||
3 years ago
|
data() {
|
||
3 years ago
|
return {
|
||
|
jsonContent: JSON.stringify({ first_name: 'James', last_name: 'Bond' }, 0, 2),
|
||
3 years ago
|
activeTab: 0,
|
||
|
};
|
||
3 years ago
|
},
|
||
3 years ago
|
head() {
|
||
3 years ago
|
return {};
|
||
3 years ago
|
},
|
||
|
computed: {
|
||
|
dialogShow: {
|
||
3 years ago
|
get() {
|
||
3 years ago
|
return this.show;
|
||
3 years ago
|
},
|
||
3 years ago
|
set(val) {
|
||
3 years ago
|
this.$emit('update:show', val);
|
||
|
},
|
||
|
},
|
||
3 years ago
|
},
|
||
|
watch: {},
|
||
3 years ago
|
created() {},
|
||
|
mounted() {},
|
||
|
beforeDestroy() {},
|
||
3 years ago
|
methods: {},
|
||
3 years ago
|
beforeCreated() {},
|
||
|
destroy() {},
|
||
|
};
|
||
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/>.
|
||
|
*
|
||
|
*/
|
||
|
-->
|