-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b18ce12
commit f4a8a49
Showing
7 changed files
with
129 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
app/frontend/components/application/settings-modal/api-document-settings.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<script setup lang="ts"> | ||
import { ApiDocument } from '~/api/backend/components/schemas' | ||
const props = defineProps<{ | ||
apiDocument: ApiDocument | ||
}>() | ||
const code = toRef(() => props.apiDocument.code) | ||
const title = ref('') | ||
syncRef(title, toRef(() => props.apiDocument.title), { direction: 'rtl' }) | ||
const cronSyncUrl = ref('') | ||
syncRef( | ||
cronSyncUrl, | ||
toRef(() => props.apiDocument.cronSyncUrl), | ||
{ | ||
direction: 'rtl', | ||
transform: { rtl: r => r || '' }, | ||
}, | ||
) | ||
const type = ref<ApiDocument['type']>('openapi') | ||
syncRef(type, toRef(() => props.apiDocument.type), { direction: 'rtl' }) | ||
const typeDescription: Record<ApiDocument['type'], string> = { | ||
openapi: 'OpenAPI', | ||
asyncapi: 'AsyncAPI', | ||
markdown: 'Markdown', | ||
} | ||
watch( | ||
() => props.apiDocument.id, | ||
() => { | ||
title.value = props.apiDocument.title | ||
}, | ||
) | ||
</script> | ||
|
||
<template> | ||
<div class="flex flex-col space-y-4"> | ||
<div class="form-control w-full max-w-md"> | ||
<div class="d-label"> | ||
<span class="d-label-text">类型/Type</span> | ||
</div> | ||
|
||
<SelectBox v-model="type"> | ||
<SelectButton | ||
class="d-join-item d-select-bordered" | ||
> | ||
{{ typeDescription[type] }} | ||
</SelectButton> | ||
|
||
<template #options> | ||
<SelectOption value="openapi"> | ||
OpenAPI | ||
</SelectOption> | ||
<SelectOption value="asyncapi"> | ||
AsyncAPI | ||
</SelectOption> | ||
<SelectOption value="markdown"> | ||
Markdown | ||
</SelectOption> | ||
</template> | ||
</SelectBox> | ||
</div> | ||
|
||
<div class="form-control w-full max-w-md"> | ||
<div class="d-label"> | ||
<span class="d-label-text">文档名/Title</span> | ||
</div> | ||
|
||
<input | ||
v-model="title" | ||
class="d-input d-input-bordered w-full" | ||
> | ||
</div> | ||
|
||
<div class="form-control w-full max-w-md"> | ||
<div class="d-label"> | ||
<span class="d-label-text">文档编码/Code</span> | ||
</div> | ||
|
||
<input | ||
:value="code" | ||
disabled | ||
class="d-input d-input-bordered w-full" | ||
placeholder="大小写字母、下划线或中线" | ||
> | ||
</div> | ||
|
||
<div class="form-control w-full max-w-md"> | ||
<div class="d-label"> | ||
<span class="d-label-text">同步地址</span> | ||
</div> | ||
|
||
<input | ||
:value="cronSyncUrl" | ||
class="d-input d-input-bordered w-full" | ||
placeholder="大小写字母、下划线或中线" | ||
> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<style scoped lang="postcss"> | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters