This commit is contained in:
Calum H. (IMB11)
2026-08-31 17:52:36 +01:00
parent 097b8dba1e
commit 9ba9ca8fb7
2 changed files with 12 additions and 10 deletions
+6 -5
View File
@@ -909,17 +909,18 @@ function getCardActions(
const isQueued = queuedServerInstallProjectIds.value.has(projectResult.project_id) const isQueued = queuedServerInstallProjectIds.value.has(projectResult.project_id)
const isQueuedRoot = queuedServerInstallRootProjectIds.value.has(projectResult.project_id) const isQueuedRoot = queuedServerInstallRootProjectIds.value.has(projectResult.project_id)
const isInstallingSelection = isInstallingQueuedServerInstalls.value const isInstallingSelection = isInstallingQueuedServerInstalls.value
const showAsInstalling = isInstalling || (isInstallingSelection && isQueuedRoot)
const validatingInstall = const validatingInstall =
isInstalling && currentProjectType !== 'modpack' && !isInstallingSelection isInstalling && currentProjectType !== 'modpack' && !isInstallingSelection
const installLabel = showAsInstalled const installLabel = showAsInstalled
? commonMessages.installedLabel ? commonMessages.installedLabel
: isQueued : isQueued
? isInstalling || isInstallingSelection ? showAsInstalling
? validatingInstall ? validatingInstall
? commonMessages.validatingLabel ? commonMessages.validatingLabel
: messages.installingToServer : messages.installingToServer
: commonMessages.selectedLabel : commonMessages.selectedLabel
: isInstalling || isInstallingSelection : showAsInstalling
? validatingInstall ? validatingInstall
? commonMessages.validatingLabel ? commonMessages.validatingLabel
: messages.installingToServer : messages.installingToServer
@@ -929,15 +930,15 @@ function getCardActions(
key: 'install', key: 'install',
label: formatMessage(installLabel), label: formatMessage(installLabel),
icon: icon:
isInstalling || isInstallingSelection showAsInstalling
? SpinnerIcon ? SpinnerIcon
: isQueued || showAsInstalled : isQueued || showAsInstalled
? CheckIcon ? CheckIcon
: PlusIcon, : PlusIcon,
iconClass: isInstalling || isInstallingSelection ? 'animate-spin' : undefined, iconClass: showAsInstalling ? 'animate-spin' : undefined,
disabled: disabled:
showAsInstalled || isInstalling || isInstallingSelection || (isQueued && !isQueuedRoot), showAsInstalled || isInstalling || isInstallingSelection || (isQueued && !isQueuedRoot),
color: isQueued && !isInstalling && !isInstallingSelection ? 'green' : 'brand', color: isQueued && !showAsInstalling ? 'green' : 'brand',
type: 'outlined', type: 'outlined',
onClick: async () => { onClick: async () => {
if (isQueuedRoot) { if (isQueuedRoot) {
@@ -361,17 +361,18 @@ function getCardActions(
serverData.value.upstream?.project_id === result.project_id serverData.value.upstream?.project_id === result.project_id
const isInstalling = installingProjectIds.value.has(result.project_id) const isInstalling = installingProjectIds.value.has(result.project_id)
const isInstallingSelection = isInstallingQueuedServerInstalls.value const isInstallingSelection = isInstallingQueuedServerInstalls.value
const showAsInstalling = isInstalling || (isInstallingSelection && isQueuedRoot)
const validatingInstall = const validatingInstall =
isInstalling && currentProjectType !== 'modpack' && !isInstallingSelection isInstalling && currentProjectType !== 'modpack' && !isInstallingSelection
const installLabel = isInstalled const installLabel = isInstalled
? formatMessage(commonMessages.installedLabel) ? formatMessage(commonMessages.installedLabel)
: isQueued : isQueued
? isInstalling || isInstallingSelection ? showAsInstalling
? validatingInstall ? validatingInstall
? formatMessage(commonMessages.validatingLabel) ? formatMessage(commonMessages.validatingLabel)
: formatMessage(commonMessages.installingLabel) : formatMessage(commonMessages.installingLabel)
: formatMessage(commonMessages.selectedLabel) : formatMessage(commonMessages.selectedLabel)
: isInstalling || isInstallingSelection : showAsInstalling
? validatingInstall ? validatingInstall
? formatMessage(commonMessages.validatingLabel) ? formatMessage(commonMessages.validatingLabel)
: formatMessage(commonMessages.installingLabel) : formatMessage(commonMessages.installingLabel)
@@ -382,15 +383,15 @@ function getCardActions(
key: 'install', key: 'install',
label: installLabel, label: installLabel,
icon: icon:
isInstalling || isInstallingSelection showAsInstalling
? SpinnerIcon ? SpinnerIcon
: isQueued || isInstalled : isQueued || isInstalled
? CheckIcon ? CheckIcon
: DownloadIcon, : DownloadIcon,
iconClass: isInstalling || isInstallingSelection ? 'animate-spin' : undefined, iconClass: showAsInstalling ? 'animate-spin' : undefined,
disabled: disabled:
!!isInstalled || isInstalling || isInstallingSelection || (isQueued && !isQueuedRoot), !!isInstalled || isInstalling || isInstallingSelection || (isQueued && !isQueuedRoot),
color: isQueued && !isInstalling && !isInstallingSelection ? 'green' : 'brand', color: isQueued && !showAsInstalling ? 'green' : 'brand',
type: 'outlined', type: 'outlined',
onClick: () => serverInstall(projectResult), onClick: () => serverInstall(projectResult),
}, },