mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-11 19:59:50 +08:00
fix(models): allow manual entry during catalog load
This commit is contained in:
@@ -31,9 +31,22 @@
|
|||||||
<div class="flex-1 min-h-0 overflow-hidden border rounded-lg flex flex-col">
|
<div class="flex-1 min-h-0 overflow-hidden border rounded-lg flex flex-col">
|
||||||
<div
|
<div
|
||||||
v-if="loading"
|
v-if="loading"
|
||||||
class="flex items-center justify-center flex-1"
|
class="flex flex-col items-center justify-center gap-3 flex-1"
|
||||||
>
|
>
|
||||||
<Loader2 class="w-5 h-5 animate-spin text-muted-foreground" />
|
<Loader2 class="w-5 h-5 animate-spin text-muted-foreground" />
|
||||||
|
<p class="text-xs text-muted-foreground">
|
||||||
|
正在加载在线目录;也可以先手动填写模型
|
||||||
|
</p>
|
||||||
|
<Button
|
||||||
|
type="button"
|
||||||
|
variant="ghost"
|
||||||
|
size="sm"
|
||||||
|
class="h-8"
|
||||||
|
data-testid="models-catalog-manual-entry-loading"
|
||||||
|
@click="enterManualEntryMode"
|
||||||
|
>
|
||||||
|
手动填写
|
||||||
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-else-if="catalogLoadError"
|
v-else-if="catalogLoadError"
|
||||||
|
|||||||
+19
@@ -302,6 +302,25 @@ describe('GlobalModelFormDialog preset replacement', () => {
|
|||||||
expect(document.body.querySelector('#model-name')).not.toBeNull()
|
expect(document.body.querySelector('#model-name')).not.toBeNull()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('allows manual model creation while the external catalog request is still pending', async () => {
|
||||||
|
modelsDevMocks.getModelsDevList.mockReturnValueOnce(
|
||||||
|
new Promise<ModelsDevModelItem[]>(() => {}),
|
||||||
|
)
|
||||||
|
|
||||||
|
mountDialog()
|
||||||
|
await settle()
|
||||||
|
|
||||||
|
const manualEntryButton = document.body.querySelector<HTMLButtonElement>(
|
||||||
|
'[data-testid="models-catalog-manual-entry-loading"]',
|
||||||
|
)
|
||||||
|
if (!manualEntryButton) throw new Error('Missing loading-state manual-entry button')
|
||||||
|
manualEntryButton.click()
|
||||||
|
await settle()
|
||||||
|
|
||||||
|
expect(document.body.textContent).toContain('手动填写模式')
|
||||||
|
expect(document.body.querySelector('#model-name')).not.toBeNull()
|
||||||
|
})
|
||||||
|
|
||||||
it('drops the previous draft and submits only the newly selected model preset', async () => {
|
it('drops the previous draft and submits only the newly selected model preset', async () => {
|
||||||
mountDialog()
|
mountDialog()
|
||||||
await settle()
|
await settle()
|
||||||
|
|||||||
Reference in New Issue
Block a user