mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-08-27 11:10:12 +08:00
fix: simplify plugin market repo display
This commit is contained in:
@@ -89,6 +89,24 @@ function cancelEdit() {
|
|||||||
editingUrl.value = ''
|
editingUrl.value = ''
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function formatRepoDisplay(url: string) {
|
||||||
|
try {
|
||||||
|
const parsedUrl = new URL(url)
|
||||||
|
const pathSegments = parsedUrl.pathname.split('/').filter(Boolean)
|
||||||
|
|
||||||
|
if (
|
||||||
|
['github.com', 'www.github.com', 'raw.githubusercontent.com'].includes(parsedUrl.hostname)
|
||||||
|
&& pathSegments.length >= 2
|
||||||
|
) {
|
||||||
|
return `${pathSegments[0]}/${pathSegments[1].replace(/\.git$/, '')}`
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// Ignore malformed URLs and fall back to the original value.
|
||||||
|
}
|
||||||
|
|
||||||
|
return url
|
||||||
|
}
|
||||||
|
|
||||||
function moveUp(index: number) {
|
function moveUp(index: number) {
|
||||||
if (index === 0) return
|
if (index === 0) return
|
||||||
const temp = repoList.value[index]
|
const temp = repoList.value[index]
|
||||||
@@ -159,7 +177,7 @@ onMounted(() => {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<VListItemTitle v-if="editingIndex !== index">
|
<VListItemTitle v-if="editingIndex !== index">
|
||||||
<span class="text-truncate">{{ repo }}</span>
|
<span class="text-truncate" :title="repo">{{ formatRepoDisplay(repo) }}</span>
|
||||||
</VListItemTitle>
|
</VListItemTitle>
|
||||||
|
|
||||||
<VTextField
|
<VTextField
|
||||||
|
|||||||
Reference in New Issue
Block a user