mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-07 08:46:40 +08:00
fix: improve plugin market editor layout
This commit is contained in:
@@ -199,13 +199,13 @@ function startEdit(index: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 保存当前行内编辑的仓库地址。 */
|
/** 保存当前行内编辑的仓库地址。 */
|
||||||
function saveEdit() {
|
function saveEdit(index = editingIndex.value) {
|
||||||
if (editingIndex.value === null) return
|
if (index === null) return
|
||||||
|
|
||||||
const url = editingUrl.value.trim()
|
const url = editingUrl.value.trim()
|
||||||
if (!validateRepoUrl(url, editingIndex.value)) return
|
if (!validateRepoUrl(url, index)) return
|
||||||
|
|
||||||
repoList.value[editingIndex.value] = url
|
repoList.value[index] = url
|
||||||
syncTextFromList()
|
syncTextFromList()
|
||||||
editingIndex.value = null
|
editingIndex.value = null
|
||||||
editingUrl.value = ''
|
editingUrl.value = ''
|
||||||
@@ -330,10 +330,10 @@ onMounted(() => {
|
|||||||
<VListItemTitle>
|
<VListItemTitle>
|
||||||
<div class="plugin-market-repo-title">
|
<div class="plugin-market-repo-title">
|
||||||
<span class="plugin-market-repo-index">{{ index + 1 }}</span>
|
<span class="plugin-market-repo-index">{{ index + 1 }}</span>
|
||||||
<span class="text-truncate" :title="repo">{{ formatRepoDisplay(repo) }}</span>
|
<span class="plugin-market-repo-name" :title="repo">{{ formatRepoDisplay(repo) }}</span>
|
||||||
</div>
|
</div>
|
||||||
</VListItemTitle>
|
</VListItemTitle>
|
||||||
<VListItemSubtitle class="text-truncate mt-1" :title="repo">
|
<VListItemSubtitle class="plugin-market-repo-url mt-1" :title="repo">
|
||||||
{{ repo }}
|
{{ repo }}
|
||||||
</VListItemSubtitle>
|
</VListItemSubtitle>
|
||||||
</template>
|
</template>
|
||||||
@@ -345,7 +345,7 @@ onMounted(() => {
|
|||||||
variant="outlined"
|
variant="outlined"
|
||||||
hide-details
|
hide-details
|
||||||
autofocus
|
autofocus
|
||||||
@keyup.enter="saveEdit"
|
@keyup.enter="saveEdit(index)"
|
||||||
@keyup.escape="cancelEdit"
|
@keyup.escape="cancelEdit"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -364,8 +364,13 @@ onMounted(() => {
|
|||||||
|
|
||||||
<template #append v-else>
|
<template #append v-else>
|
||||||
<div class="d-flex align-center">
|
<div class="d-flex align-center">
|
||||||
<IconBtn icon="mdi-check" size="small" variant="text" color="success" @click="saveEdit" />
|
<VBtn
|
||||||
<IconBtn icon="mdi-close" size="small" variant="text" @click="cancelEdit" />
|
icon="mdi-check"
|
||||||
|
size="small"
|
||||||
|
variant="text"
|
||||||
|
color="success"
|
||||||
|
@click.stop="saveEdit(index)"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</VListItem>
|
</VListItem>
|
||||||
@@ -383,16 +388,17 @@ onMounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-else class="plugin-market-text-panel">
|
<div v-else class="plugin-market-text-panel">
|
||||||
<VTextarea
|
<div class="plugin-market-textarea-field">
|
||||||
|
<VIcon icon="mdi-text-box-edit-outline" class="plugin-market-textarea-icon" />
|
||||||
|
<textarea
|
||||||
v-model="repoText"
|
v-model="repoText"
|
||||||
class="plugin-market-textarea"
|
class="plugin-market-textarea"
|
||||||
rows="8"
|
|
||||||
variant="outlined"
|
|
||||||
prepend-inner-icon="mdi-text-box-edit-outline"
|
|
||||||
:placeholder="t('dialog.pluginMarketSetting.textPlaceholder')"
|
:placeholder="t('dialog.pluginMarketSetting.textPlaceholder')"
|
||||||
:hint="t('dialog.pluginMarketSetting.textHint')"
|
|
||||||
persistent-hint
|
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="plugin-market-text-hint">
|
||||||
|
{{ t('dialog.pluginMarketSetting.textHint') }}
|
||||||
|
</div>
|
||||||
|
|
||||||
<VAlert
|
<VAlert
|
||||||
v-if="parsedTextRepos.invalidRepos.length > 0"
|
v-if="parsedTextRepos.invalidRepos.length > 0"
|
||||||
@@ -488,7 +494,7 @@ onMounted(() => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0.75rem;
|
gap: 0.5rem;
|
||||||
min-block-size: 0;
|
min-block-size: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -520,6 +526,22 @@ onMounted(() => {
|
|||||||
min-inline-size: 0;
|
min-inline-size: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.plugin-market-repo-name,
|
||||||
|
.plugin-market-repo-url {
|
||||||
|
display: -webkit-box;
|
||||||
|
overflow: hidden;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
line-break: anywhere;
|
||||||
|
overflow-wrap: anywhere;
|
||||||
|
white-space: normal;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.plugin-market-repo-url {
|
||||||
|
line-height: 1.4;
|
||||||
|
}
|
||||||
|
|
||||||
.plugin-market-repo-index {
|
.plugin-market-repo-index {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
color: rgba(var(--v-theme-on-surface), 0.48);
|
color: rgba(var(--v-theme-on-surface), 0.48);
|
||||||
@@ -536,29 +558,56 @@ onMounted(() => {
|
|||||||
min-block-size: 14rem;
|
min-block-size: 14rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.plugin-market-textarea-field {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
|
border: 1px solid rgba(var(--v-border-color), var(--v-border-opacity));
|
||||||
|
border-radius: 8px;
|
||||||
|
background: rgba(var(--v-theme-surface), 0.72);
|
||||||
|
min-block-size: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
transition: border-color 0.2s ease, box-shadow 0.2s ease;
|
||||||
|
|
||||||
|
&:focus-within {
|
||||||
|
border-color: rgb(var(--v-theme-primary));
|
||||||
|
box-shadow: 0 0 0 1px rgb(var(--v-theme-primary));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.plugin-market-textarea-icon {
|
||||||
|
position: absolute;
|
||||||
|
z-index: 1;
|
||||||
|
color: rgba(var(--v-theme-on-surface), 0.62);
|
||||||
|
inset-block-start: 1.25rem;
|
||||||
|
inset-inline-start: 1rem;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
.plugin-market-textarea {
|
.plugin-market-textarea {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-block-size: 0;
|
border: 0;
|
||||||
|
background: transparent;
|
||||||
:deep(.v-input__control),
|
|
||||||
:deep(.v-field),
|
|
||||||
:deep(.v-field__field) {
|
|
||||||
block-size: 100%;
|
|
||||||
min-block-size: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.v-field__input) {
|
|
||||||
align-items: stretch;
|
|
||||||
block-size: 100%;
|
|
||||||
min-block-size: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(textarea) {
|
|
||||||
block-size: 100%;
|
block-size: 100%;
|
||||||
|
color: rgb(var(--v-theme-on-surface));
|
||||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
||||||
|
font-size: 1rem;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
|
min-block-size: 0;
|
||||||
|
outline: none;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
padding: 1rem 1rem 1rem 3.25rem;
|
||||||
|
resize: none;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.plugin-market-text-hint {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
color: rgba(var(--v-theme-on-surface), 0.62);
|
||||||
|
font-size: 0.8125rem;
|
||||||
|
line-height: 1.4;
|
||||||
|
padding-inline: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.plugin-market-invalid-alert {
|
.plugin-market-invalid-alert {
|
||||||
|
|||||||
Reference in New Issue
Block a user