Fix: pending_calibration shows Identify Version button instead of checkmark
Chronicler #85 direct fix (Code unavailable on mobile): - ModpackAPIController: add pending_calibration flag to serverStatus response - wrapper.tsx: add pending_calibration to StatusData interface - wrapper.tsx: render Identify Version button when pending_calibration is true Replaces false green checkmark for servers needing calibration.
This commit is contained in:
@@ -311,6 +311,7 @@ class ModpackAPIController extends Controller
|
||||
|
||||
return response()->json([
|
||||
'configured' => !empty($cached->platform) && $cached->status !== 'unconfigured',
|
||||
'pending_calibration' => $cached->status === 'pending_calibration',
|
||||
'platform' => $cached->platform,
|
||||
'modpack_name' => $cached->modpack_name,
|
||||
'current_version' => $cached->current_version,
|
||||
|
||||
@@ -15,6 +15,7 @@ interface StatusData {
|
||||
last_checked?: string;
|
||||
detection_method?: string;
|
||||
is_ignored?: boolean;
|
||||
pending_calibration?: boolean;
|
||||
}
|
||||
|
||||
interface Release {
|
||||
@@ -141,6 +142,30 @@ const ModpackVersionCard: React.FC = () => {
|
||||
</div>
|
||||
);
|
||||
|
||||
// Pending calibration — version unknown, show Identify Version button
|
||||
if (data?.pending_calibration) {
|
||||
return (
|
||||
<div className={classNames(
|
||||
'rounded shadow-lg bg-gray-600',
|
||||
'col-span-3 md:col-span-2 lg:col-span-6',
|
||||
'px-3 py-2 md:p-3 lg:p-4 mt-2'
|
||||
)}>
|
||||
<div className={'flex items-center justify-between'}>
|
||||
<div className={'flex items-center'}>
|
||||
<FontAwesomeIcon icon={faCube} className={'w-4 h-4 mr-2 text-gray-400'} />
|
||||
<span className={'text-gray-400 text-sm'}>
|
||||
{data.modpack_name || 'Modpack'} — Version unknown
|
||||
</span>
|
||||
</div>
|
||||
<button onClick={openCalibrate}
|
||||
className={'text-xs px-3 py-1 bg-cyan-600 hover:bg-cyan-500 text-white rounded transition-colors'}>
|
||||
Identify Version
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// Calibrate dropdown (reusable)
|
||||
const renderCalibrateDropdown = () => (
|
||||
<div className={'mt-2 bg-gray-800 rounded p-2 max-h-48 overflow-y-auto'}>
|
||||
|
||||
Reference in New Issue
Block a user