mirror of
https://github.com/biersoeckli/QuickStack.git
synced 2026-02-10 21:49:19 -06:00
feat: update QuickStack version info component layout
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { purgeRegistryImages, setCanaryChannel, updateQuickstack, updateRegistry } from "../server/actions";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Toast } from "@/frontend/utils/toast.utils";
|
||||
@@ -17,7 +17,7 @@ export default function QuickStackVersionInfo({
|
||||
currentVersion
|
||||
}: {
|
||||
useCanaryChannel: boolean;
|
||||
currentVersion: string;
|
||||
currentVersion?: string;
|
||||
}) {
|
||||
|
||||
const useConfirm = useConfirmDialog();
|
||||
@@ -31,6 +31,7 @@ export default function QuickStackVersionInfo({
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-6">
|
||||
|
||||
|
||||
<div className="flex items-center space-x-2 pl-1">
|
||||
<Switch id="canary-channel-mode" disabled={loading} checked={useCanaryChannel} onCheckedChange={(checked) => {
|
||||
try {
|
||||
@@ -43,15 +44,19 @@ export default function QuickStackVersionInfo({
|
||||
<Label htmlFor="canary-channel-mode">Use Canary Channel for Updates</Label>
|
||||
</div>
|
||||
|
||||
<Button variant="secondary" disabled={loading} onClick={async () => {
|
||||
if (await useConfirm.openConfirmDialog({
|
||||
title: 'Update QuickStack',
|
||||
description: 'This action will restart the QuickStack service and installs the lastest version. It may take a few minutes to complete.',
|
||||
okButton: "Update QuickStack",
|
||||
})) {
|
||||
Toast.fromAction(() => updateQuickstack());
|
||||
}
|
||||
}}><Rocket /> Update QuickStack</Button>
|
||||
<div className="flex items-center gap-4">
|
||||
<Button variant="secondary" disabled={loading} onClick={async () => {
|
||||
if (await useConfirm.openConfirmDialog({
|
||||
title: 'Update QuickStack',
|
||||
description: 'This action will restart the QuickStack service and installs the lastest version. It may take a few minutes to complete.',
|
||||
okButton: "Update QuickStack",
|
||||
})) {
|
||||
Toast.fromAction(() => updateQuickstack());
|
||||
}
|
||||
}}><Rocket /> Update QuickStack</Button>
|
||||
<p className="text-slate-500 text-sm flex-1 text-right">Installed: {currentVersion ?? 'unknown'}</p>
|
||||
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card >
|
||||
</>;
|
||||
|
||||
Reference in New Issue
Block a user