update document detail page

This commit is contained in:
AceDataCloud committed 2023-01-22 16:36:46 +08:00
1 parent 798de13a35
commit 1bc2068e7b
7 files changed
+71 -9

No files matched your search

+9 -1
View File
@@ -7,6 +7,9 @@
<div class="title">{{ $t('api.entity.response') }}</div>
<code-snippet :code="responseData" />
</div>
<div v-if="loading">
<el-skeleton />
</div>
</div>
</template>
@@ -35,11 +38,14 @@ export default defineComponent({
data() {
return {
apiKeyValue: this.apiKey,
responseData: ''
responseData: '',
loading: false
};
},
methods: {
onTry() {
this.loading = true;
this.responseData = '';
const config = {
method: this.api?.request?.method as Method,
url: urlJoin(this.api?.endpoint, this.api?.path),
@@ -49,9 +55,11 @@ export default defineComponent({
console.debug('config of testing', config);
axios(config)
.then((response) => {
this.loading = false;
this.responseData = JSON.stringify(response?.data, null, ' ');
})
.catch((error) => {
this.loading = false;
this.responseData = JSON.stringify(error?.response?.data, null, ' ');
});
}
+11 -1
View File
@@ -1,5 +1,10 @@
<template>
<vue-markdown :source="content" class="markdown-body" />
<div v-if="loading">
<el-skeleton />
<el-divider />
<el-skeleton />
</div>
<vue-markdown v-else :source="content" class="markdown-body" />
</template>
<script lang="ts">
@@ -15,6 +20,11 @@ export default defineComponent({
content: {
type: String,
required: true
},
loading: {
type: Boolean,
required: false,
default: false
}
},
data() {},
+2 -1
View File
@@ -41,7 +41,8 @@ export default defineComponent({
documentOperator
.getAll({
offset,
limit
limit,
ordering: 'rank'
})
.then(({ data: data }: { data: IDocumentListResponse }) => {
this.documents = data.items;
-1
View File
@@ -16,7 +16,6 @@
<script lang="ts">
import { defineComponent } from 'vue';
import { IApi } from '@/operators/api/models';
import { IDocument } from '@/operators/document/models';
export default defineComponent({