webui: add default value in select component.

unhide search bar.

backend: fix type error.
This commit is contained in:
EstrellaXD
2023-09-02 11:44:53 +08:00
parent 9460cf211d
commit 820f69f40f
4 changed files with 19 additions and 15 deletions

View File

@@ -9,7 +9,7 @@ from module.models import Bangumi
router = APIRouter(prefix="/search", tags=["search"])
@router.get("/", response_model=EventSourceResponse[Bangumi])
@router.get("/", response_model=list[Bangumi])
async def search_torrents(
site: str = "mikan",
keywords: str = Query(None),

View File

@@ -10,7 +10,7 @@ withDefaults(
group?: string;
}>(),
{
type: 'search',
type: 'primary',
}
);

View File

@@ -14,7 +14,9 @@ const props = withDefaults(
modelValue?: SelectItem | string;
items: Array<SelectItem | string>;
}>(),
{}
{
items: ['test1', 'test2'],
}
);
const emit = defineEmits(['update:modelValue']);

View File

@@ -8,14 +8,14 @@ import {
Refresh,
} from '@icon-park/vue-next';
const { t, changeLocale } = useMyI18n();
const { running, onUpdate, offUpdate } = useAppInfo();
const {t, changeLocale} = useMyI18n();
const {running, onUpdate, offUpdate} = useAppInfo();
const search = ref('');
const show = ref(false);
const showAdd = ref(false);
const { start, pause, shutdown, restart, resetRule } = useProgramStore();
const {start, pause, shutdown, restart, resetRule} = useProgramStore();
const items = [
{
@@ -69,19 +69,21 @@ onUnmounted(() => {
<template>
<div h-60px bg-theme-row text-white rounded-12px fx-cer px-24px>
<div fx-cer space-x-16px>
<img src="/images/logo-light.svg" alt="favicon" wh-24px />
<img src="/images/AutoBangumi.svg" alt="AutoBangumi" h-24px rel top-2px />
</div>
<div flex space-x-16px>
<div fx-cer space-x-16px>
<img src="/images/logo-light.svg" alt="favicon" wh-24px/>
<img src="/images/AutoBangumi.svg" alt="AutoBangumi" h-24px rel top-2px/>
</div>
<ab-search v-model:value="search" hidden />
<ab-search v-model:value="search"/>
</div>
<div ml-auto>
<ab-status-bar
:items="items"
:running="running"
@click-add="() => (showAdd = true)"
@change-lang="() => changeLocale()"
:items="items"
:running="running"
@click-add="() => (showAdd = true)"
@change-lang="() => changeLocale()"
></ab-status-bar>
</div>