Skip to content

Commit

Permalink
fix: 手机版样式 (Close Chanzhaoyu#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerwin committed Jun 11, 2023
1 parent 43f553c commit 89552f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/components/common/Setting/Keys.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ import { KeyConfig, Status, UserRole, apiModelOptions, userRoleOptions } from '.
import { fetchGetKeys, fetchUpdateApiKeyStatus, fetchUpsertApiKey } from '@/api'
import { t } from '@/locales'
import { useAuthStore } from '@/store'
import { useBasicLayout } from '@/hooks/useBasicLayout'
const ms = useMessage()
const dialog = useDialog()
const authStore = useAuthStore()
const { isMobile } = useBasicLayout()
const loading = ref(false)
const show = ref(false)
const handleSaving = ref(false)
Expand Down Expand Up @@ -227,20 +230,20 @@ onMounted(async () => {
</div>
</div>

<NModal v-model:show="show" :auto-focus="false" preset="card" style="width:50%;">
<NModal v-model:show="show" :auto-focus="false" preset="card" :style="{ width: !isMobile ? '50%' : '100%' }">
<div class="p-4 space-y-5 min-h-[200px]">
<div class="space-y-6">
<div class="flex items-center space-x-4">
<span class="flex-shrink-0 w-[100px]">{{ $t('setting.apiModel') }}</span>
<div>
<div class="flex-1">
<NSelect
style="width: 240px"
style="width: 100%"
:value="keyConfig.keyModel"
:options="apiModelOptions"
@update-value="value => keyConfig.keyModel = value"
/>
</div>
<p>
<p v-if="!isMobile">
<a v-if="keyConfig.keyModel === 'ChatGPTAPI'" target="_blank" href="https://platform.openai.com/account/api-keys">Get Api Key</a>
<a v-else target="_blank" href="https://chat.openai.com/api/auth/session">Get Access Token</a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/Setting/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const show = computed({
</script>

<template>
<NModal v-model:show="show" :auto-focus="false" preset="card" :style="{ 'width': '80%', 'min-height': !isMobile ? '800px' : 'auto' }">
<NModal v-model:show="show" :auto-focus="false" preset="card" :style="{ 'width': !isMobile ? '80%' : '100%', 'min-height': !isMobile ? '800px' : 'auto' }">
<div>
<NTabs v-model:value="active" type="line" animated>
<NTabPane name="General" tab="General">
Expand Down

0 comments on commit 89552f8

Please sign in to comment.