Skip to content

Commit 8580af3

Browse files
committed
fix: compact plugin market settings dialog
1 parent 95ca092 commit 8580af3

4 files changed

Lines changed: 75 additions & 136 deletions

File tree

src/components/dialog/PluginMarketSettingDialog.vue

Lines changed: 75 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -236,15 +236,6 @@ function formatRepoDisplay(url: string) {
236236
return url
237237
}
238238
239-
/** 获取仓库地址的主机名用于辅助显示。 */
240-
function formatRepoHost(url: string) {
241-
try {
242-
return new URL(url).hostname
243-
} catch {
244-
return ''
245-
}
246-
}
247-
248239
/** 返回拖拽列表项的稳定键。 */
249240
function repoItemKey(repo: string) {
250241
return repo
@@ -256,26 +247,17 @@ onMounted(() => {
256247
</script>
257248

258249
<template>
259-
<VDialog width="56rem" scrollable :fullscreen="!display.mdAndUp.value">
250+
<VDialog width="56rem" :fullscreen="!display.mdAndUp.value">
260251
<VCard class="plugin-market-dialog-card">
261-
<VCardItem>
252+
<VCardItem class="plugin-market-card-item">
262253
<div class="plugin-market-header">
263-
<div class="plugin-market-title-block">
264-
<VCardTitle class="d-flex align-center pa-0">
265-
<VIcon icon="mdi-store-cog" class="me-2" />
266-
{{ t('dialog.pluginMarketSetting.title') }}
267-
</VCardTitle>
268-
<div class="plugin-market-subtitle">
269-
{{ t('dialog.pluginMarketSetting.description') }}
270-
</div>
271-
</div>
272-
<VChip color="primary" variant="tonal" prepend-icon="mdi-source-repository">
273-
{{ t('dialog.pluginMarketSetting.repoCount', { count: activeRepoCount }) }}
274-
</VChip>
254+
<VCardTitle class="plugin-market-title d-flex align-center pa-0">
255+
<VIcon icon="mdi-store-cog" class="me-2" />
256+
{{ t('dialog.pluginMarketSetting.title') }}
257+
</VCardTitle>
275258
</div>
276259
<VDialogCloseBtn @click="emit('close')" />
277260
</VCardItem>
278-
<VDivider />
279261

280262
<VCardText class="plugin-market-dialog-body pt-4">
281263
<div class="plugin-market-toolbar">
@@ -295,10 +277,6 @@ onMounted(() => {
295277
{{ t('dialog.pluginMarketSetting.textMode') }}
296278
</VBtn>
297279
</VBtnToggle>
298-
299-
<div class="plugin-market-toolbar-info">
300-
{{ editorMode === 'list' ? t('dialog.pluginMarketSetting.listHint') : t('dialog.pluginMarketSetting.textHint') }}
301-
</div>
302280
</div>
303281

304282
<div v-if="editorMode === 'list'" class="plugin-market-list-panel">
@@ -353,15 +331,6 @@ onMounted(() => {
353331
<div class="plugin-market-repo-title">
354332
<span class="plugin-market-repo-index">{{ index + 1 }}</span>
355333
<span class="text-truncate" :title="repo">{{ formatRepoDisplay(repo) }}</span>
356-
<VChip
357-
v-if="formatRepoHost(repo)"
358-
size="x-small"
359-
variant="tonal"
360-
color="secondary"
361-
class="plugin-market-host-chip"
362-
>
363-
{{ formatRepoHost(repo) }}
364-
</VChip>
365334
</div>
366335
</VListItemTitle>
367336
<VListItemSubtitle class="text-truncate mt-1" :title="repo">
@@ -417,38 +386,14 @@ onMounted(() => {
417386
<VTextarea
418387
v-model="repoText"
419388
class="plugin-market-textarea"
420-
rows="11"
421-
auto-grow
422-
max-rows="18"
389+
rows="8"
423390
variant="outlined"
424391
prepend-inner-icon="mdi-text-box-edit-outline"
425392
:placeholder="t('dialog.pluginMarketSetting.textPlaceholder')"
426393
:hint="t('dialog.pluginMarketSetting.textHint')"
427394
persistent-hint
428395
/>
429396

430-
<div class="plugin-market-text-summary">
431-
<VChip color="primary" variant="tonal" prepend-icon="mdi-check-circle-outline">
432-
{{ t('dialog.pluginMarketSetting.repoCount', { count: parsedTextRepos.repos.length }) }}
433-
</VChip>
434-
<VChip
435-
v-if="parsedTextRepos.duplicateRepos.length > 0"
436-
color="warning"
437-
variant="tonal"
438-
prepend-icon="mdi-content-duplicate"
439-
>
440-
{{ t('dialog.pluginMarketSetting.duplicateCount', { count: parsedTextRepos.duplicateRepos.length }) }}
441-
</VChip>
442-
<VChip
443-
v-if="parsedTextRepos.invalidRepos.length > 0"
444-
color="error"
445-
variant="tonal"
446-
prepend-icon="mdi-alert-circle-outline"
447-
>
448-
{{ t('dialog.pluginMarketSetting.invalidCount', { count: parsedTextRepos.invalidRepos.length }) }}
449-
</VChip>
450-
</div>
451-
452397
<VAlert
453398
v-if="parsedTextRepos.invalidRepos.length > 0"
454399
type="error"
@@ -473,15 +418,8 @@ onMounted(() => {
473418
</div>
474419
</VCardText>
475420

476-
<VDivider />
477421
<VCardActions class="plugin-market-actions">
478-
<div class="plugin-market-footer-summary">
479-
{{ t('dialog.pluginMarketSetting.repoCount', { count: activeRepoCount }) }}
480-
</div>
481422
<VSpacer />
482-
<VBtn variant="text" @click="emit('close')">
483-
{{ t('dialog.pluginMarketSetting.close') }}
484-
</VBtn>
485423
<VBtn
486424
color="primary"
487425
variant="flat"
@@ -501,67 +439,56 @@ onMounted(() => {
501439
.plugin-market-dialog-card {
502440
display: flex;
503441
flex-direction: column;
504-
max-block-size: min(82vh, 50rem);
442+
block-size: min(82vh, 50rem);
443+
}
444+
445+
.plugin-market-card-item {
446+
flex: 0 0 auto;
447+
padding-block: 0.875rem;
505448
}
506449
507450
.plugin-market-header {
508451
display: flex;
509-
align-items: flex-start;
452+
align-items: center;
510453
justify-content: space-between;
511454
gap: 1rem;
512455
padding-inline-end: 2rem;
513456
}
514457
515-
.plugin-market-title-block {
458+
.plugin-market-title {
516459
min-inline-size: 0;
517460
}
518461
519-
.plugin-market-subtitle {
520-
color: rgba(var(--v-theme-on-surface), 0.68);
521-
font-size: 0.875rem;
522-
margin-block-start: 0.25rem;
523-
}
524-
525462
.plugin-market-dialog-body {
526463
display: flex;
527464
overflow: hidden;
528465
flex: 1;
529466
flex-direction: column;
530-
gap: 1rem;
467+
gap: 0.875rem;
531468
min-block-size: 0;
469+
padding-block: 0.875rem !important;
532470
}
533471
534472
.plugin-market-toolbar {
535473
display: flex;
536-
align-items: center;
537-
justify-content: space-between;
538-
gap: 1rem;
539-
border: 1px solid rgba(var(--v-border-color), var(--v-border-opacity));
540-
border-radius: 8px;
541-
background: rgba(var(--v-theme-surface-variant), 0.18);
542-
padding: 0.75rem;
474+
flex-shrink: 0;
543475
}
544476
545477
.plugin-market-mode-toggle {
546-
flex-shrink: 0;
478+
inline-size: 100%;
547479
548480
:deep(.v-btn) {
549-
min-inline-size: 7rem;
481+
flex: 1;
482+
min-inline-size: 0;
550483
}
551484
}
552485
553-
.plugin-market-toolbar-info {
554-
color: rgba(var(--v-theme-on-surface), 0.68);
555-
font-size: 0.875rem;
556-
text-align: end;
557-
}
558-
559486
.plugin-market-list-panel,
560487
.plugin-market-text-panel {
561488
display: flex;
562489
flex: 1;
563490
flex-direction: column;
564-
gap: 1rem;
491+
gap: 0.75rem;
565492
min-block-size: 0;
566493
}
567494
@@ -574,7 +501,7 @@ onMounted(() => {
574501
border: 1px solid rgba(var(--v-border-color), var(--v-border-opacity));
575502
border-radius: 8px;
576503
background: rgba(var(--v-theme-surface), 0.72);
577-
min-block-size: 14rem;
504+
min-block-size: 0;
578505
overflow-y: auto;
579506
}
580507
@@ -601,10 +528,6 @@ onMounted(() => {
601528
inline-size: 1.75rem;
602529
}
603530
604-
.plugin-market-host-chip {
605-
flex: 0 0 auto;
606-
}
607-
608531
.plugin-market-empty {
609532
display: flex;
610533
align-items: center;
@@ -614,47 +537,65 @@ onMounted(() => {
614537
}
615538
616539
.plugin-market-textarea {
540+
flex: 1;
541+
min-block-size: 0;
542+
543+
:deep(.v-input__control),
544+
:deep(.v-field),
545+
:deep(.v-field__field) {
546+
block-size: 100%;
547+
min-block-size: 0;
548+
}
549+
550+
:deep(.v-field__input) {
551+
align-items: stretch;
552+
block-size: 100%;
553+
min-block-size: 0;
554+
}
555+
617556
:deep(textarea) {
557+
block-size: 100%;
618558
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
619559
line-height: 1.6;
560+
overflow-y: auto;
620561
}
621562
}
622563
623-
.plugin-market-text-summary {
624-
display: flex;
625-
flex-wrap: wrap;
626-
gap: 0.5rem;
627-
}
628-
629564
.plugin-market-invalid-alert {
630565
:deep(.v-alert__content) {
631566
min-inline-size: 0;
632567
}
633568
}
634569
635570
.plugin-market-actions {
571+
flex: 0 0 auto;
636572
gap: 0.5rem;
637-
}
638-
639-
.plugin-market-footer-summary {
640-
color: rgba(var(--v-theme-on-surface), 0.62);
641-
font-size: 0.875rem;
642-
margin-inline-start: 0.5rem;
573+
padding: 0.75rem 1.5rem 1rem;
643574
}
644575
645576
@media (max-width: 600px) {
646577
.plugin-market-dialog-card {
647-
max-block-size: 100vh;
578+
block-size: 100dvh;
648579
}
649580
650-
.plugin-market-header,
651-
.plugin-market-toolbar {
652-
align-items: stretch;
653-
flex-direction: column;
581+
.plugin-market-card-item {
582+
padding: 0.75rem 1rem 0.625rem;
583+
}
584+
585+
.plugin-market-header {
586+
align-items: center;
587+
gap: 0.5rem;
588+
padding-inline-end: 2.25rem;
654589
}
655590
656-
.plugin-market-toolbar-info {
657-
text-align: start;
591+
.plugin-market-header :deep(.v-card-title) {
592+
font-size: 1.125rem;
593+
line-height: 1.35;
594+
}
595+
596+
.plugin-market-dialog-body {
597+
gap: 0.625rem;
598+
padding: 0.75rem 1rem !important;
658599
}
659600
660601
.plugin-market-mode-toggle {
@@ -666,8 +607,21 @@ onMounted(() => {
666607
}
667608
}
668609
669-
.plugin-market-footer-summary {
670-
display: none;
610+
.plugin-market-list-panel,
611+
.plugin-market-text-panel {
612+
gap: 0.625rem;
613+
}
614+
615+
.plugin-market-list-wrap {
616+
min-block-size: 0;
617+
}
618+
619+
.plugin-market-empty {
620+
min-block-size: 10rem;
621+
}
622+
623+
.plugin-market-actions {
624+
padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
671625
}
672626
}
673627
</style>

src/locales/en-US.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2485,21 +2485,16 @@ export default {
24852485
},
24862486
pluginMarketSetting: {
24872487
title: 'Plugin Market Settings',
2488-
description: 'Maintain plugin market repositories as an ordered list or by pasting bulk text.',
24892488
repoUrl: 'Plugin Repository URL',
24902489
repoPlaceholder: 'Format: https://github.com/jxxghp/MoviePilot-Plugins/,https://github.com/xxxx/xxxxxx/',
24912490
repoHint: 'Separate multiple URLs with new lines or commas',
24922491
urlPlaceholder: 'Enter plugin repository URL',
24932492
textPlaceholder: 'https://github.com/jxxghp/MoviePilot-Plugins/\nhttps://github.com/xxxx/xxxxxx/',
24942493
listMode: 'List',
24952494
textMode: 'Text',
2496-
listHint: 'Add, edit, delete, or drag repositories to adjust their order.',
24972495
textHint: 'Paste repository URLs one per line or separated by commas.',
24982496
addRepo: 'Add repository',
24992497
noRepos: 'No plugin repository URLs',
2500-
repoCount: '{count} repositories',
2501-
duplicateCount: '{count} duplicates',
2502-
invalidCount: '{count} invalid',
25032498
invalidUrl: 'Please enter a valid URL',
25042499
duplicateUrl: 'This URL already exists',
25052500
invalidText: 'There are {count} invalid URLs in the text. Fix them before saving.',

src/locales/zh-CN.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,21 +2440,16 @@ export default {
24402440
},
24412441
pluginMarketSetting: {
24422442
title: '插件市场设置',
2443-
description: '维护插件市场仓库来源,可按列表逐条调整,也可直接粘贴批量文本。',
24442443
repoUrl: '插件仓库地址',
24452444
repoPlaceholder: '格式:https://github.com/jxxghp/MoviePilot-Plugins/,https://github.com/xxxx/xxxxxx/',
24462445
repoHint: '多个地址可使用换行或英文逗号分隔',
24472446
urlPlaceholder: '输入插件仓库地址',
24482447
textPlaceholder: 'https://github.com/jxxghp/MoviePilot-Plugins/\nhttps://github.com/xxxx/xxxxxx/',
24492448
listMode: '列表维护',
24502449
textMode: '文本维护',
2451-
listHint: '逐条添加、编辑、删除或拖拽调整仓库顺序。',
24522450
textHint: '直接粘贴仓库地址串,一行一个或使用英文逗号分隔。',
24532451
addRepo: '添加仓库',
24542452
noRepos: '暂无插件仓库地址',
2455-
repoCount: '{count} 个仓库',
2456-
duplicateCount: '{count} 个重复',
2457-
invalidCount: '{count} 个无效',
24582453
invalidUrl: '请输入有效的URL地址',
24592454
duplicateUrl: '该地址已存在',
24602455
invalidText: '文本中有 {count} 个无效地址,请修正后保存。',

0 commit comments

Comments
 (0)