Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
d1a478d
feat: medal promotion on servers page
IMB11 Aug 4, 2025
2da2b4a
feat: medal server card
IMB11 Aug 4, 2025
6401a89
fix: styling changes
IMB11 Aug 4, 2025
ea1789e
fix: colors for dark mode only
IMB11 Aug 4, 2025
0b3cbbd
fix: light mode medal promotion
IMB11 Aug 5, 2025
e010e61
feat: finish server card layout
IMB11 Aug 5, 2025
5b46f52
feat: countdown on server panel
IMB11 Aug 5, 2025
e89ebf6
fix: lint
IMB11 Aug 5, 2025
b497c94
feat: use same gradient as promo
IMB11 Aug 5, 2025
5495849
fix: scale for medal bg
IMB11 Aug 5, 2025
42a2451
fix: border around server icon
IMB11 Aug 5, 2025
b130a48
Merge branch 'main' into cal/medal-frontend-impls
IMB11 Aug 9, 2025
33626c1
Merge branch 'main' into cal/medal-frontend-impls
IMB11 Aug 9, 2025
e18fa0f
Merge branch 'main' into cal/medal-frontend-impls
IMB11 Aug 9, 2025
8e98c17
feat: medal subscr expiry date stuff
IMB11 Aug 9, 2025
39ce608
feat: progress on plans within the modal
IMB11 Aug 9, 2025
658b0c8
feat: finalize plan modal stage
IMB11 Aug 10, 2025
043e8ed
fix: unused scss
IMB11 Aug 10, 2025
332007e
feat: remove buttons from cards
IMB11 Aug 11, 2025
ec320cd
feat: upgrade button opens modal on server panel
IMB11 Aug 11, 2025
64bd806
feat: billing endpoint
IMB11 Aug 11, 2025
4ea02e5
fix: lint issues
IMB11 Aug 11, 2025
3d138c8
fix: lint issues
IMB11 Aug 11, 2025
22a3ce5
fix: lint issues
IMB11 Aug 11, 2025
58f628a
Merge branch 'main' into cal/medal-frontend-impls
IMB11 Aug 11, 2025
911d0bf
feat: better handling of downgrades + existing plan checks
IMB11 Aug 11, 2025
6f355e4
feat: update medal url
IMB11 Aug 11, 2025
23db0bf
feat: proration visual in modal
IMB11 Aug 12, 2025
9823985
feat: standardize upgrade modal into ServersUpgradeModalWrapper
IMB11 Aug 12, 2025
421a775
feat: replace upgrade PurchaseModal with ServersUpgradeModalWrapper
IMB11 Aug 12, 2025
2047089
feat: allow server region
IMB11 Aug 12, 2025
fab1a23
fix: lint
IMB11 Aug 13, 2025
1b70a54
Merge branch 'main' into cal/medal-frontend-impls
IMB11 Aug 14, 2025
3ad51fb
fix: lint
IMB11 Aug 14, 2025
5bbbdb6
fix: medal frontend completion
IMB11 Aug 14, 2025
658d7f7
fix: lint issues
IMB11 Aug 14, 2025
03129cf
feat: ad
IMB11 Aug 14, 2025
245dd43
fix: hover tooltip + orange new server sparkle
IMB11 Aug 14, 2025
4c6d3c3
feat: ad
IMB11 Aug 14, 2025
8ce11cf
Merge remote-tracking branch 'origin' into cal/medal-frontend-impls
IMB11 Aug 14, 2025
f0196e4
fix: lint issues new eslint
IMB11 Aug 14, 2025
19725d6
feat: match ad
IMB11 Aug 14, 2025
fd266e0
feat: support for ?dry=true
IMB11 Aug 15, 2025
d043d89
fix: lint isuses
IMB11 Aug 15, 2025
ad25a24
Merge branch 'main' into cal/medal-frontend-impls
IMB11 Aug 15, 2025
e429114
Merge branch 'main' into cal/medal-frontend-impls
IMB11 Aug 17, 2025
5a0f948
Merge branch 'main' into cal/medal-frontend-impls
IMB11 Aug 17, 2025
9b13546
fix: lint issues
IMB11 Aug 17, 2025
285110d
Merge branch 'main' into cal/medal-frontend-impls
IMB11 Aug 18, 2025
9745f32
fix: TeleportDropdownMenu imports
IMB11 Aug 18, 2025
c4837d6
fix: hash nav issues
IMB11 Aug 18, 2025
442b2cd
feat: clarify confirm changes btn
IMB11 Aug 18, 2025
05d233c
Merge branch 'main' into cal/medal-frontend-impls
IMB11 Aug 18, 2025
815b41b
Merge branch 'main' into cal/medal-frontend-impls
IMB11 Aug 18, 2025
bcf7408
fix: lint issues
IMB11 Aug 18, 2025
28e5586
fix: "Using new payment method"
IMB11 Aug 18, 2025
568750a
fix: lint
IMB11 Aug 18, 2025
a925ec5
fix: re-add -mt-2
IMB11 Aug 18, 2025
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
6 changes: 3 additions & 3 deletions apps/app-frontend/src/components/ui/PromotionWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ function updateAdPosition() {
<template>
<div ref="adsWrapper" class="ad-parent relative flex w-full justify-center cursor-pointer bg-bg">
<a
href="https://modrinth.gg?from=app-placeholder"
href="https://modrinth.gg/medal?app"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will just note that since ads aren't clickable currently in Modrinth App, this change doesn't make a difference

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep it's just future-proofing for now.

target="_blank"
class="flex max-h-[250px] min-h-[250px] min-w-[300px] max-w-[300px] flex-col gap-4 rounded-[inherit]"
>
<img
src="https://cdn-raw.modrinth.com/modrinth-servers-placeholder-light.webp"
src="https://cdn-raw.modrinth.com/medal-modrinth-servers-light.webp"
alt="Host your next server with Modrinth Servers"
class="hidden light-image rounded-[inherit]"
/>
<img
src="https://cdn-raw.modrinth.com/modrinth-servers-placeholder-dark.webp"
src="https://cdn-raw.modrinth.com/medal-modrinth-servers-dark.webp"
alt="Host your next server with Modrinth Servers"
class="dark-image rounded-[inherit]"
/>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions apps/frontend/src/assets/images/servers/medal_server_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions apps/frontend/src/assets/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ html {

--landing-raw-bg: #fff;

--medal-promotion-bg: #fff;
--medal-promotion-bg-orange: #f0b051;
--medal-promotion-text-orange: #faa624;
--medal-promotion-bg-gradient: linear-gradient(90deg, rgba(255, 200, 118, 0.15) 0%, #fff 100%);

--banner-error-bg: #fee2e2;
--banner-error-text: #991b1b;
--banner-error-border: #ef4444;
Expand Down Expand Up @@ -237,6 +242,11 @@ html {

--landing-raw-bg: #000;

--medal-promotion-bg: #000;
--medal-promotion-bg-orange: #ffb84b54;
--medal-promotion-text-orange: #ffb84b;
--medal-promotion-bg-gradient: linear-gradient(90deg, #ffb74b21, transparent 50%, #000 100%);

--hover-filter: brightness(120%);
--active-filter: brightness(140%);

Expand Down
6 changes: 3 additions & 3 deletions apps/frontend/src/components/ui/AdPlaceholder.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<template>
<div class="ad-parent relative mb-3 flex w-full justify-center rounded-2xl bg-bg-raised">
<nuxt-link
to="/servers"
to="/servers?plan&ref=medal"
class="flex max-h-[250px] min-h-[250px] min-w-[300px] max-w-[300px] flex-col gap-4 rounded-[inherit]"
>
<img
src="https://cdn-raw.modrinth.com/modrinth-servers-placeholder-light.webp"
src="https://cdn-raw.modrinth.com/medal-modrinth-servers-light.webp"
alt="Host your next server with Modrinth Servers"
class="light-image hidden rounded-[inherit]"
/>
<img
src="https://cdn-raw.modrinth.com/modrinth-servers-placeholder-dark.webp"
src="https://cdn-raw.modrinth.com/medal-modrinth-servers-dark.webp"
alt="Host your next server with Modrinth Servers"
class="dark-image rounded-[inherit]"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/src/components/ui/servers/ServerIcon.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div
class="experimental-styles-within flex size-24 shrink-0 overflow-hidden rounded-xl border-[1px] border-solid border-button-border bg-button-bg shadow-sm"
class="experimental-styles-within flex size-16 shrink-0 overflow-hidden rounded-xl border-[1px] border-solid border-button-border bg-button-bg shadow-sm"
>
<client-only>
<img
Expand Down
131 changes: 82 additions & 49 deletions apps/frontend/src/components/ui/servers/ServerListing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,23 @@
:to="status === 'suspended' ? '' : `/servers/manage/${props.server_id}`"
>
<div
v-tooltip="
status === 'suspended'
? suspension_reason === 'upgrading'
? 'This server is being transferred to a new node. It will be unavailable until this process finishes.'
: 'This server has been suspended. Please visit your billing settings or contact Modrinth Support for more information.'
: ''
"
class="flex cursor-pointer flex-row items-center overflow-x-hidden rounded-3xl bg-bg-raised p-4 transition-transform duration-100"
:class="status === 'suspended' ? '!rounded-b-none opacity-75' : 'active:scale-95'"
class="-mb-2 flex flex-row items-center overflow-x-hidden rounded-2xl border-[1px] border-solid border-button-bg bg-bg-raised p-4 transition-transform duration-100"
:class="{
'!rounded-b-none border-b-0': status === 'suspended' || !!pendingChange,
'opacity-75': status === 'suspended',
'active:scale-95': status !== 'suspended' && !pendingChange,
}"
data-pyro-server-listing
:data-pyro-server-listing-id="server_id"
>
<ServerIcon v-if="status !== 'suspended'" :image="image" />
<div
v-else
class="bg-bg-secondary flex size-24 items-center justify-center rounded-xl border-[1px] border-solid border-button-border bg-button-bg shadow-sm"
class="bg-bg-secondary flex size-16 items-center justify-center rounded-xl border-[1px] border-solid border-button-border bg-button-bg shadow-sm"
>
<LockIcon class="size-20 text-secondary" />
<LockIcon class="size-12 text-secondary" />
</div>
<div class="ml-8 flex flex-col gap-2.5">
<div class="ml-4 flex flex-col gap-2.5">
<div class="flex flex-row items-center gap-2">
<h2 class="m-0 text-xl font-bold text-contrast">{{ name }}</h2>
<ChevronRightIcon />
Expand All @@ -41,7 +38,6 @@
/>
Using {{ projectData?.title || 'Unknown' }}
</div>
<div v-else class="min-h-[20px]"></div>

<div
v-if="isConfiguring"
Expand All @@ -59,50 +55,67 @@
/>
</div>
</div>
<div
v-if="status === 'suspended' && suspension_reason === 'upgrading'"
class="relative -mt-4 flex w-full flex-row items-center gap-2 rounded-b-3xl bg-bg-blue p-4 text-sm font-bold text-contrast"
>
<PanelSpinner />
Your server's hardware is currently being upgraded and will be back online shortly.
</NuxtLink>
<div
v-if="status === 'suspended' && suspension_reason === 'upgrading'"
class="relative -mt-2 flex w-full flex-row items-center gap-2 rounded-b-2xl border-[1px] border-t-0 border-solid border-bg-blue bg-bg-blue p-4 text-sm font-bold text-contrast"
>
<PanelSpinner />
Your server's hardware is currently being upgraded and will be back online shortly.
</div>
<div
v-else-if="status === 'suspended' && suspension_reason === 'cancelled'"
class="relative -mt-2 flex w-full flex-col gap-2 rounded-b-2xl border-[1px] border-t-0 border-solid border-bg-red bg-bg-red p-4 text-sm font-bold text-contrast"
>
<div class="flex flex-row gap-2">
<PanelErrorIcon class="!size-5" /> Your server has been cancelled. Please update your billing
information or contact Modrinth Support for more information.
</div>
<div
v-else-if="status === 'suspended' && suspension_reason === 'cancelled'"
class="relative -mt-4 flex w-full flex-col gap-2 rounded-b-3xl bg-bg-red p-4 text-sm font-bold text-contrast"
>
<div class="flex flex-row gap-2">
<PanelErrorIcon class="!size-5" /> Your server has been cancelled. Please update your
billing information or contact Modrinth Support for more information.
</div>
<CopyCode :text="`${props.server_id}`" class="ml-auto" />
<CopyCode :text="`${props.server_id}`" class="ml-auto" />
</div>
<div
v-else-if="status === 'suspended' && suspension_reason"
class="relative -mt-2 flex w-full flex-col gap-2 rounded-b-2xl border-[1px] border-t-0 border-solid border-bg-red bg-bg-red p-4 text-sm font-bold text-contrast"
>
<div class="flex flex-row gap-2">
<PanelErrorIcon class="!size-5" /> Your server has been suspended: {{ suspension_reason }}.
Please update your billing information or contact Modrinth Support for more information.
</div>
<div
v-else-if="status === 'suspended' && suspension_reason"
class="relative -mt-4 flex w-full flex-col gap-2 rounded-b-3xl bg-bg-red p-4 text-sm font-bold text-contrast"
>
<div class="flex flex-row gap-2">
<PanelErrorIcon class="!size-5" /> Your server has been suspended: {{ suspension_reason }}.
Please update your billing information or contact Modrinth Support for more information.
</div>
<CopyCode :text="`${props.server_id}`" class="ml-auto" />
<CopyCode :text="`${props.server_id}`" class="ml-auto" />
</div>
<div
v-else-if="status === 'suspended'"
class="-mt-2flex relative w-full flex-col gap-2 rounded-b-2xl border-[1px] border-t-0 border-solid border-bg-red bg-bg-red p-4 text-sm font-bold text-contrast"
>
<div class="flex flex-row gap-2">
<PanelErrorIcon class="!size-5" /> Your server has been suspended. Please update your billing
information or contact Modrinth Support for more information.
</div>
<div
v-else-if="status === 'suspended'"
class="relative -mt-4 flex w-full flex-col gap-2 rounded-b-3xl bg-bg-red p-4 text-sm font-bold text-contrast"
>
<div class="flex flex-row gap-2">
<PanelErrorIcon class="!size-5" /> Your server has been suspended. Please update your
billing information or contact Modrinth Support for more information.
</div>
<CopyCode :text="`${props.server_id}`" class="ml-auto" />
<CopyCode :text="`${props.server_id}`" class="ml-auto" />
</div>
<div
v-if="pendingChange && status !== 'suspended'"
class="relative -mt-2 flex w-full flex-col gap-2 rounded-b-2xl border-[1px] border-t-0 border-solid border-orange bg-bg-orange p-4 text-sm font-bold text-contrast"
>
<div>
Your server will {{ pendingChange.verb.toLowerCase() }} to the "{{ pendingChange.planSize }}"
plan on {{ formatDate(pendingChange.date) }}.
</div>
</NuxtLink>
<ServersSpecs
class="!font-normal !text-contrast"
:ram="Math.round((pendingChange.ramGb ?? 0) * 1024)"
:storage="Math.round((pendingChange.storageGb ?? 0) * 1024)"
:cpus="pendingChange.cpuBurst"
bursting-link="https://docs.modrinth.com/servers/bursting"
/>
</div>
</template>

<script setup lang="ts">
import { ChevronRightIcon, LockIcon, SparklesIcon } from '@modrinth/assets'
import { Avatar, CopyCode } from '@modrinth/ui'
import { Avatar, CopyCode, ServersSpecs } from '@modrinth/ui'
import type { Project, Server } from '@modrinth/utils'
import dayjs from 'dayjs'

import { useModrinthServers } from '~/composables/servers/modrinth-servers.ts'

Expand All @@ -111,7 +124,19 @@ import PanelSpinner from './PanelSpinner.vue'
import ServerIcon from './ServerIcon.vue'
import ServerInfoLabels from './ServerInfoLabels.vue'

const props = defineProps<Partial<Server>>()
type PendingChange = {
planSize: string
cpu: number
cpuBurst: number
ramGb: number
swapGb?: number
storageGb?: number
date: string | number | Date
intervalChange?: string | null
verb: string
}

const props = defineProps<Partial<Server> & { pendingChange?: PendingChange }>()

if (props.server_id && props.status === 'available') {
// Necessary only to get server icon
Expand All @@ -138,4 +163,12 @@ if (props.upstream) {
const image = useState<string | undefined>(`server-icon-${props.server_id}`, () => undefined)
const iconUrl = computed(() => projectData.value?.icon_url || undefined)
const isConfiguring = computed(() => props.flows?.intro)

const formatDate = (d: unknown) => {
try {
return dayjs(d as any).format('MMMM D, YYYY')
} catch {
return ''
}
}
</script>
Loading