Restarts only the database - faster but may not be able to recover from all
failure modes
)}
{((project !== undefined && (!canRestartProject || !isProjectActive)) ||
projectRestartDisabled) && (
{projectRestartDisabled
? 'Project restart is currently disabled'
: !canRestartProject
? 'You need additional permissions to restart this project'
: !isProjectActive
? 'Unable to restart project as project is not active'
: ''}
)}
Are you sure you want to restart the{' '}
{serviceToRestart}? There will be a few minutes
of downtime.
>
}
buttonLabel="Restart"
buttonLoadingLabel="Restarting"
onSelectCancel={() => setServiceToRestart(undefined)}
onSelectConfirm={async () => {
if (serviceToRestart === 'project') {
await requestProjectRestart()
} else if (serviceToRestart === 'database') {
await requestDatabaseRestart()
}
}}
/>
>
)
}
export default RestartServerButton