add doc of proxy
This commit is contained in:
1 parent
4a0428f1b2
commit
3ea9f786dc
5 files changed
+35
-17
No files matched your search
@@ -1,7 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<api-info v-if="api" :api="api" />
|
|
||||||
<el-divider />
|
|
||||||
<div class="queries">
|
<div class="queries">
|
||||||
<h2 class="title">{{ $t('api.entity.requestQueries') }}</h2>
|
<h2 class="title">{{ $t('api.entity.requestQueries') }}</h2>
|
||||||
<api-form
|
<api-form
|
||||||
@@ -40,8 +38,6 @@ import ApiForm from './Form.vue';
|
|||||||
import ApiResult from './Result.vue';
|
import ApiResult from './Result.vue';
|
||||||
import { applicationOperator } from '@/operators/application/operator';
|
import { applicationOperator } from '@/operators/application/operator';
|
||||||
import { IApplication, IApplicationListResponse } from '@/operators/application/models';
|
import { IApplication, IApplicationListResponse } from '@/operators/application/models';
|
||||||
import { ElDivider } from 'element-plus';
|
|
||||||
import ApiInfo from './Info.vue';
|
|
||||||
|
|
||||||
export interface IData {
|
export interface IData {
|
||||||
formValue: IForm;
|
formValue: IForm;
|
||||||
@@ -53,9 +49,7 @@ export default defineComponent({
|
|||||||
name: 'ApiUsage',
|
name: 'ApiUsage',
|
||||||
components: {
|
components: {
|
||||||
ApiForm,
|
ApiForm,
|
||||||
ApiResult,
|
ApiResult
|
||||||
ElDivider,
|
|
||||||
ApiInfo
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
api: {
|
api: {
|
||||||
|
|||||||
@@ -16,6 +16,18 @@
|
|||||||
{{ document?.api?.request?.method }}
|
{{ document?.api?.request?.method }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</div>
|
</div>
|
||||||
|
<div
|
||||||
|
v-else-if="document.type === documentType.PROXY"
|
||||||
|
:class="{ item: true, active: id === document?.id }"
|
||||||
|
@click="onClick"
|
||||||
|
>
|
||||||
|
<el-link type="primary" class="link" :underline="false">
|
||||||
|
<span class="name">{{ document?.title || document?.proxy?.title }}</span>
|
||||||
|
</el-link>
|
||||||
|
<el-tag v-if="document?.api?.request?.method" type="" class="method" effect="dark">
|
||||||
|
{{ document?.api?.request?.method }}
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
{{ proxy?.title }}
|
{{ proxy?.title }}
|
||||||
</div>
|
</div>
|
||||||
<div class="url">
|
<div class="url">
|
||||||
<!-- <el-tag class="method" effect="dark">{{ proxy? }}</el-tag> -->
|
<span v-if="proxy?.endpoint" class="endpoint">{{ proxy?.endpoint }}</span>
|
||||||
<span v-if="proxy?.endpoint && proxy?.path" class="endpoint">{{ urlJoin(proxy?.endpoint, proxy?.path) }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="introduction">
|
<div class="introduction">
|
||||||
<p>{{ proxy?.introduction }}</p>
|
<p>{{ proxy?.introduction }}</p>
|
||||||
@@ -15,12 +14,10 @@
|
|||||||
import { IProxy } from '@/operators';
|
import { IProxy } from '@/operators';
|
||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import urlJoin from 'url-join';
|
import urlJoin from 'url-join';
|
||||||
import { ElTag } from 'element-plus';
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'ProxyInfo',
|
name: 'ProxyInfo',
|
||||||
components: {
|
components: {},
|
||||||
// ElTag
|
|
||||||
},
|
|
||||||
props: {
|
props: {
|
||||||
proxy: {
|
proxy: {
|
||||||
type: Object as () => IProxy,
|
type: Object as () => IProxy,
|
||||||
@@ -44,7 +41,7 @@ export default defineComponent({
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
.method {
|
.method {
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
padding: 1px 8px;
|
padding: 1px 0px;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
transform: scale(0.8);
|
transform: scale(0.8);
|
||||||
transform-origin: left;
|
transform-origin: left;
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
import { IApi } from '../api/models';
|
import { IApi } from '../api/models';
|
||||||
|
import { IProxy } from '../proxy';
|
||||||
|
|
||||||
export enum IDocumentType {
|
export enum IDocumentType {
|
||||||
API = 'Api',
|
API = 'Api',
|
||||||
TEXT = 'Text'
|
TEXT = 'Text',
|
||||||
|
PROXY = 'Proxy'
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IDocument {
|
export interface IDocument {
|
||||||
@@ -13,7 +15,9 @@ export interface IDocument {
|
|||||||
content?: string;
|
content?: string;
|
||||||
rank?: number;
|
rank?: number;
|
||||||
api?: IApi;
|
api?: IApi;
|
||||||
|
proxy?: IProxy;
|
||||||
api_id?: string;
|
api_id?: string;
|
||||||
|
proxy_id?: string;
|
||||||
created_at?: string;
|
created_at?: string;
|
||||||
updated_at?: string;
|
updated_at?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,15 @@
|
|||||||
<markdown-renderer :content="document?.content" />
|
<markdown-renderer :content="document?.content" />
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="document.type === documentType.API">
|
<div v-else-if="document.type === documentType.API">
|
||||||
|
<api-info v-if="document.api" :api="document.api" />
|
||||||
|
<el-divider />
|
||||||
<api-usage v-if="document.api" v-model:form="form" :api="document.api" />
|
<api-usage v-if="document.api" v-model:form="form" :api="document.api" />
|
||||||
</div>
|
</div>
|
||||||
|
<div v-else-if="document.type === documentType.PROXY">
|
||||||
|
<proxy-info v-if="document.proxy" :proxy="document.proxy" />
|
||||||
|
<el-divider />
|
||||||
|
<markdown-renderer :content="document?.content" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- end center part -->
|
<!-- end center part -->
|
||||||
@@ -26,7 +33,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- end right part -->
|
<!-- end right part -->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -34,11 +40,13 @@
|
|||||||
import { defineComponent } from 'vue';
|
import { defineComponent } from 'vue';
|
||||||
import ApiUsage from '@/components/api/Usage.vue';
|
import ApiUsage from '@/components/api/Usage.vue';
|
||||||
import ApiTry from '@/components/api/Try.vue';
|
import ApiTry from '@/components/api/Try.vue';
|
||||||
|
import ApiInfo from '@/components/api/Info.vue';
|
||||||
|
import ProxyInfo from '@/components/proxy/Info.vue';
|
||||||
import ApiCode from '@/components/api/Code.vue';
|
import ApiCode from '@/components/api/Code.vue';
|
||||||
import { documentOperator, IDocument, IDocumentDetailResponse, IDocumentType } from '@/operators';
|
import { documentOperator, IDocument, IDocumentDetailResponse, IDocumentType } from '@/operators';
|
||||||
import { IForm } from '@/operators/api/models';
|
import { IForm } from '@/operators/api/models';
|
||||||
import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
|
import MarkdownRenderer from '@/components/common/MarkdownRenderer.vue';
|
||||||
import { ElSkeleton } from 'element-plus';
|
import { ElSkeleton, ElDivider } from 'element-plus';
|
||||||
|
|
||||||
export interface IData {
|
export interface IData {
|
||||||
document: IDocument | undefined;
|
document: IDocument | undefined;
|
||||||
@@ -53,7 +61,10 @@ export default defineComponent({
|
|||||||
ApiUsage,
|
ApiUsage,
|
||||||
ApiTry,
|
ApiTry,
|
||||||
ApiCode,
|
ApiCode,
|
||||||
|
ApiInfo,
|
||||||
|
ProxyInfo,
|
||||||
ElSkeleton,
|
ElSkeleton,
|
||||||
|
ElDivider,
|
||||||
MarkdownRenderer
|
MarkdownRenderer
|
||||||
},
|
},
|
||||||
data(): IData {
|
data(): IData {
|
||||||
|
|||||||
Reference in new issue
Block a user