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.
116 lines
3.0 KiB
116 lines
3.0 KiB
3 years ago
|
<template>
|
||
|
<v-container fluid style="height: 100%" class="py-0">
|
||
|
<v-row style="height: 100%">
|
||
|
<v-col cols="12" class="py-1">
|
||
|
<div>
|
||
|
<v-text-field
|
||
3 years ago
|
v-model="url"
|
||
3 years ago
|
class=""
|
||
|
outlined
|
||
|
solo-inverted
|
||
|
single-line
|
||
|
dense
|
||
|
rounded
|
||
|
hide-details
|
||
|
label="Graphql Url"
|
||
|
@keypress.enter="loadUrl"
|
||
|
>
|
||
3 years ago
|
<template #append-outer>
|
||
|
<x-btn
|
||
|
icon="mdi-graphql"
|
||
|
btn.class="mt-n1"
|
||
|
tooltip="Load graphql schema"
|
||
|
color="primary"
|
||
|
@click="loadUrl"
|
||
|
>
|
||
|
Load
|
||
3 years ago
|
</x-btn>
|
||
|
</template>
|
||
|
</v-text-field>
|
||
|
</div>
|
||
|
</v-col>
|
||
|
<v-col cols="12" class="py-0 px-5" style="width: 100%;height: calc(100% - 52px)">
|
||
3 years ago
|
<iframe
|
||
|
id="foo"
|
||
|
ref="webview"
|
||
|
v-shortkey="['ctrl','shift','w']"
|
||
|
class="white"
|
||
|
:src="webViewUrl"
|
||
|
style="width: 100%;height: 100%"
|
||
|
@shortkey="test"
|
||
|
/>
|
||
3 years ago
|
</v-col>
|
||
|
</v-row>
|
||
|
</v-container>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
export default {
|
||
3 years ago
|
name: 'SwaggerClient',
|
||
3 years ago
|
data() {
|
||
3 years ago
|
return {
|
||
|
url: '',
|
||
|
webViewUrl: ''
|
||
|
}
|
||
|
},
|
||
3 years ago
|
async created() {
|
||
3 years ago
|
// if (this.$store.state.graphqlClient.list && this.$store.state.graphqlClient.list[0])
|
||
|
// this.webViewUrl = this.url = this.$store.state.graphqlClient.list[0].url;
|
||
|
try {
|
||
3 years ago
|
const { info } = (await this.$axios.get(`/nc/${this.$route.params.project_id}/projectApiInfo`, {
|
||
3 years ago
|
headers: {
|
||
|
'xc-auth': this.$store.state.users.token
|
||
|
}
|
||
3 years ago
|
})).data
|
||
|
const swagger = Object.values(info).find(v => v.swaggerUrl)
|
||
3 years ago
|
if (swagger) {
|
||
|
this.webViewUrl = this.url = swagger.swaggerUrl
|
||
|
}
|
||
|
} catch (e) {
|
||
|
}
|
||
|
},
|
||
3 years ago
|
mounted() {
|
||
3 years ago
|
|
||
3 years ago
|
},
|
||
|
methods: {
|
||
3 years ago
|
test() {
|
||
3 years ago
|
console.log('triggerd')
|
||
|
},
|
||
3 years ago
|
loadUrl() {
|
||
3 years ago
|
this.webViewUrl = this.url
|
||
|
// if (this.url)
|
||
|
// this.$store.commit('graphqlClient/MutListAdd', {url: this.url});
|
||
|
}
|
||
3 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/>.
|
||
|
*
|
||
|
*/
|
||
|
-->
|