koel/resources/assets/js/components/meta/AboutKoelModal.vue

187 lines
4.4 KiB
Vue
Raw Normal View History

2022-04-15 14:24:30 +00:00
<template>
<div v-koel-focus class="about text-secondary" data-testid="about-koel" tabindex="0" @keydown.esc="close">
2022-04-15 14:24:30 +00:00
<main>
<div class="logo">
2022-04-21 22:58:32 +00:00
<img alt="Koel's logo" src="@/../img/logo.svg" width="128">
2022-04-15 14:24:30 +00:00
</div>
2024-01-08 16:59:05 +00:00
<div class="current-version">
Koel {{ currentVersion }}
<span v-if="isPlus" class="badge">Plus</span>
<span v-else>Community</span>
Edition
<p v-if="isPlus" class="plus-badge">
Licensed to {{ license.customerName }} &lt;{{ license.customerEmail }}&gt;
<br>
License key: <span class="key">{{ license.shortKey }}</span>
2024-01-08 16:59:05 +00:00
</p>
2024-01-11 17:06:32 +00:00
<template v-else>
2024-03-19 22:48:12 +00:00
<p v-if="isAdmin" class="upgrade">
<!-- close the modal first to prevent it from overlapping Lemonsqueezy's overlay -->
<BtnUpgradeToPlus @click.prevent="showPlusModal" />
2024-01-11 17:06:32 +00:00
</p>
</template>
2024-01-08 16:59:05 +00:00
</div>
2022-04-15 14:24:30 +00:00
<p v-if="shouldNotifyNewVersion" data-testid="new-version-about">
<a :href="latestVersionReleaseUrl" target="_blank">
A new version of Koel is available ({{ latestVersion }})!
2022-04-15 14:24:30 +00:00
</a>
</p>
<p class="author">
2022-04-21 22:58:32 +00:00
Made with by
<a href="https://github.com/phanan" rel="noopener" target="_blank">Phan An</a>
2022-04-15 14:24:30 +00:00
and quite a few
<a href="https://github.com/koel/core/graphs/contributors" rel="noopener" target="_blank">awesome</a>&nbsp;<a
2022-12-02 16:17:37 +00:00
href="https://github.com/koel/koel/graphs/contributors" rel="noopener" target="_blank"
>contributors</a>.
2022-04-15 14:24:30 +00:00
</p>
<div v-if="credits" class="credit-wrapper" data-testid="demo-credits">
2022-08-04 08:34:13 +00:00
Music by
<ul class="credits">
<li v-for="credit in credits" :key="credit.name">
<a :href="credit.url" target="_blank">{{ credit.name }}</a>
</li>
</ul>
</div>
2022-04-15 14:24:30 +00:00
2022-12-02 16:17:37 +00:00
<SponsorList />
2024-01-08 16:59:05 +00:00
<p v-if="!isPlus">
2022-04-15 14:24:30 +00:00
Loving Koel? Please consider supporting its development via
2022-04-21 22:58:32 +00:00
<a href="https://github.com/users/phanan/sponsorship" rel="noopener" target="_blank">GitHub Sponsors</a>
2022-04-15 14:24:30 +00:00
and/or
2022-04-21 22:58:32 +00:00
<a href="https://opencollective.com/koel" rel="noopener" target="_blank">OpenCollective</a>.
2022-04-15 14:24:30 +00:00
</p>
</main>
<footer>
2022-05-03 16:51:59 +00:00
<Btn data-testid="close-modal-btn" red rounded @click.prevent="close">Close</Btn>
2022-04-15 14:24:30 +00:00
</footer>
</div>
</template>
2022-04-15 17:00:08 +00:00
<script lang="ts" setup>
2022-08-04 08:34:13 +00:00
import { orderBy } from 'lodash'
import { onMounted, ref } from 'vue'
2024-01-11 17:06:32 +00:00
import { useAuthorization, useKoelPlus, useNewVersionNotification } from '@/composables'
import { http } from '@/services'
import { eventBus } from '@/utils'
2022-04-15 14:24:30 +00:00
import SponsorList from '@/components/meta/SponsorList.vue'
import Btn from '@/components/ui/Btn.vue'
import BtnUpgradeToPlus from '@/components/koel-plus/BtnUpgradeToPlus.vue'
2022-04-15 14:24:30 +00:00
2022-08-04 08:34:13 +00:00
type DemoCredits = {
name: string
url: string
}
const credits = ref<DemoCredits[] | null>(null)
2022-08-04 08:34:13 +00:00
const {
shouldNotifyNewVersion,
currentVersion,
latestVersion,
latestVersionReleaseUrl
} = useNewVersionNotification()
2022-04-15 17:00:08 +00:00
2024-01-11 17:06:32 +00:00
const { isPlus, license } = useKoelPlus()
const { isAdmin } = useAuthorization()
2024-01-08 16:59:05 +00:00
const emit = defineEmits<{ (e: 'close'): void }>()
2022-04-15 17:00:08 +00:00
const close = () => emit('close')
2022-08-04 08:34:13 +00:00
const showPlusModal = () => {
close()
eventBus.emit('MODAL_SHOW_KOEL_PLUS')
}
2022-08-04 08:34:13 +00:00
onMounted(async () => {
credits.value = window.IS_DEMO ? orderBy(await http.get<DemoCredits[]>('demo/credits'), 'name') : null
2022-08-04 08:34:13 +00:00
})
2022-04-15 14:24:30 +00:00
</script>
<style lang="scss" scoped>
.about {
text-align: center;
max-width: 480px;
overflow: hidden;
position: relative;
2022-04-15 14:24:30 +00:00
main {
padding: 1.8rem;
2022-04-15 14:24:30 +00:00
p {
margin: 1rem 0;
}
}
footer {
2022-04-15 14:24:30 +00:00
padding: 1rem;
background: rgba(255, 255, 255, .02);
2022-04-15 14:24:30 +00:00
}
a {
color: var(--color-text-primary);
&:hover {
color: var(--color-accent);
2022-04-15 14:24:30 +00:00
}
}
}
2022-08-04 08:34:13 +00:00
.credit-wrapper {
max-height: 9rem;
overflow: auto;
}
.credits, .credits li {
display: inline;
}
.credits {
display: inline;
li {
display: inline;
&:last-child {
&::before {
content: ', and '
}
&::after {
content: '.';
}
}
}
li + li {
&::before {
content: ', ';
}
}
}
.sponsors {
margin-top: 1rem;
}
2024-01-08 16:59:05 +00:00
.plus-badge {
.key {
font-family: monospace;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-image: linear-gradient(97.78deg, #c62be8 17.5%, #671ce4 113.39%);
2024-01-08 16:59:05 +00:00
}
}
.upgrade {
padding: .5rem 0;
}
2022-04-15 14:24:30 +00:00
</style>