Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions dashboard/src/components/shared/ExtensionCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,22 @@ const viewChangelog = () => {
emit("view-changelog", props.extension);
};

const safeSocialLink = computed(() => {
const socialLink = props.extension?.social_link;
if (typeof socialLink !== "string" || !socialLink.trim().length) {
return "";
}

try {
const parsed = new URL(socialLink);
return parsed.protocol === "http:" || parsed.protocol === "https:"
? parsed.href
: "";
} catch {
return "";
}
});

</script>

<template>
Expand Down Expand Up @@ -325,6 +341,33 @@ const viewChangelog = () => {
</v-chip>
</div>

<div
v-if="!marketMode && extension.author"
class="extension-author-row"
>
<v-icon
icon="mdi-account"
size="x-small"
class="extension-author-row__icon"
></v-icon>
<a
v-if="safeSocialLink"
:href="safeSocialLink"
target="_blank"
rel="noopener noreferrer"
class="extension-author-row__link text-subtitle-2 font-weight-medium"
@click.stop
>
{{ extension.author }}
</a>
<span
v-else
class="extension-author-row__text text-subtitle-2 font-weight-medium"
>
{{ extension.author }}
</span>
</div>

<div
class="extension-desc"
:class="{ 'text-caption': $vuetify.display.xs }"
Expand Down Expand Up @@ -408,6 +451,14 @@ const viewChangelog = () => {
<v-list-item-title>{{ tm("buttons.viewInfo") }}</v-list-item-title>
</v-list-item>

<v-list-item
class="styled-menu-item"
prepend-icon="mdi-text-box-search-outline"
@click="viewChangelog"
>
<v-list-item-title>{{ tm("pluginChangelog.menuTitle") }}</v-list-item-title>
</v-list-item>

<v-list-item class="styled-menu-item" prepend-icon="mdi-update" @click="updateExtension">
<v-list-item-title>{{
extension.has_update
Expand Down Expand Up @@ -465,6 +516,41 @@ const viewChangelog = () => {
gap: 8px;
}

.extension-author-row {
display: flex;
align-items: center;
gap: 4px;
margin-top: 8px;
color: rgb(var(--v-theme-primary));
min-width: 0;
}

.extension-author-row__icon {
color: rgba(var(--v-theme-on-surface), 0.5);
flex-shrink: 0;
}

.extension-author-row__link,
.extension-author-row__text {
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

.extension-author-row__link,
.extension-author-row__text {
color: rgb(var(--v-theme-primary));
}

.extension-author-row__link {
text-decoration: none;
}

.extension-author-row__link:hover {
text-decoration: underline;
}

.extension-desc {
margin-top: 8px;
font-size: 90%;
Expand Down
Loading