Skip to content

Commit c1b4222

Browse files
committed
touch up
1 parent b8e89d0 commit c1b4222

File tree

2 files changed

+103
-94
lines changed

2 files changed

+103
-94
lines changed

components/Sidebar.jsx

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,7 @@ export function Sidebar() {
8181
System Logs
8282
</TooltipContent>
8383
</Tooltip>
84-
<Tooltip delayDuration={0}>
85-
<TooltipTrigger asChild>
86-
<Button
87-
variant="ghost"
88-
onClick={() => router.push("/help")}
89-
className={cn(
90-
"w-10 h-10 p-0 hover:bg-transparent [&:not(:disabled)]:hover:bg-transparent text-yellow-40 text-2xl font-bold text-yellow-400",
91-
pathname === "/settings"
92-
? "text-yellow-400"
93-
: "hover:text-yellow-200"
94-
)}
95-
>
96-
?{/* <MessageCircleQuestion className="h-5 w-5" /> */}
97-
</Button>
98-
</TooltipTrigger>
99-
<TooltipContent side="right" className="border-0 bg-muted">
100-
Recent Updates Help & Fixes
101-
</TooltipContent>
102-
</Tooltip>
84+
10385
<Tooltip delayDuration={0}>
10486
<TooltipTrigger asChild>
10587
<Button

components/UpdateAlert.jsx

Lines changed: 102 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ export default function VersionAlert() {
2424
const [isAlertVisible, setIsAlertVisible] = useState(true);
2525
const [isModalOpen, setIsModalOpen] = useState(false);
2626
const [isChangeLogOpen, setIsChangeLogOpen] = useState(false);
27-
const [changelog, setChangelog] = useState(null);
28-
const [isLoading, setIsLoading] = useState(true);
2927

3028
useEffect(() => {
3129
setMounted(true);
@@ -89,7 +87,6 @@ export default function VersionAlert() {
8987

9088
const handleDismiss = () => {
9189
try {
92-
// Save dismissal time and version to localStorage
9390
localStorage.setItem(
9491
"versionAlertDismissed",
9592
JSON.stringify({
@@ -160,66 +157,94 @@ export default function VersionAlert() {
160157
<DialogTitle>Update Instructions</DialogTitle>
161158
</DialogHeader>
162159
<div className="space-y-6">
163-
<div>
164-
<p className="mb-8">
165-
In the same directory you originally deployed from:
160+
{/* Option 1: Automatic Update */}
161+
<div className="space-y-4 border rounded-lg p-4">
162+
<h3 className="text-lg font-semibold">
163+
Option 1: Automatic Update (Linux/MacOS only)
164+
</h3>
165+
<p className="text-sm">
166+
In the same directory you originally deployed from, run these
167+
commands to download and execute the automatic update script:
166168
</p>
167-
<p className="mb-2">
168-
1. Get the migrations.sql file to update your database schema:
169-
</p>
170-
<div className="bg-slate-950 dark:bg-neutral-800 text-slate-50 p-3 rounded-md font-mono text-sm">
169+
<div className="bg-slate-950 dark:bg-neutral-800 text-slate-50 p-3 rounded-md font-mono text-sm mb-2">
171170
curl -O
172-
https://raw.githubusercontent.com/algertc/ALPR-Database/main/migrations.sql
171+
https://raw.githubusercontent.com/algertc/ALPR-Database/refs/heads/main/update.sh
173172
</div>
174-
<p className="mt-1 text-sm text-muted-foreground">
175-
This file should be in the same directory as your
176-
docker-compose.yml file. Alternatively, you can
177-
<a
178-
href="https://github.com/algertc/ALPR-Database/blob/main/migrations.sql"
179-
target="_blank"
180-
rel="noopener noreferrer"
181-
className="text-blue-600 hover:text-blue-800 ml-1"
182-
>
183-
download it manually from GitHub
184-
</a>
185-
.
173+
<div className="bg-slate-950 dark:bg-neutral-800 text-slate-50 p-3 rounded-md font-mono text-sm mb-2">
174+
chmod +x update.sh
175+
</div>
176+
<div className="bg-slate-950 dark:bg-neutral-800 text-slate-50 p-3 rounded-md font-mono text-sm">
177+
./update.sh
178+
</div>
179+
<p className="text-sm text-muted-foreground">
180+
Follow the on-screen instructions after running the update
181+
script.
186182
</p>
187183
</div>
188184

189-
<div>
190-
<p className="mb-2">
191-
2. Check for updates to the
192-
<a
193-
href="https://github.com/algertc/ALPR-Database/blob/main/docker-compose.yml"
194-
target="_blank"
195-
rel="noopener noreferrer"
196-
className="text-blue-600 hover:text-blue-800 ml-1"
197-
>
198-
docker-compose.yml
199-
</a>
200-
{" "}
201-
file on GitHub. Ensure your file is up-to-date with the latest
202-
version.
203-
</p>
204-
</div>
185+
{/* Option 2: Manual Update */}
186+
<div className="space-y-4 border rounded-lg p-4">
187+
<h3 className="text-lg font-semibold">Option 2: Manual Update</h3>
188+
<div>
189+
<p className="text-sm">
190+
In the same directory you originally deployed from:
191+
</p>
192+
<p className="mb-2">
193+
1. Get the migrations.sql file to update your database schema:
194+
</p>
195+
<div className="bg-slate-950 dark:bg-neutral-800 text-slate-50 p-3 rounded-md font-mono text-sm">
196+
curl -O
197+
https://raw.githubusercontent.com/algertc/ALPR-Database/main/migrations.sql
198+
</div>
199+
<p className="mt-1 text-sm text-muted-foreground">
200+
This file should be in the same directory as your
201+
docker-compose.yml file. Alternatively, you can
202+
<a
203+
href="https://github.com/algertc/ALPR-Database/blob/main/migrations.sql"
204+
target="_blank"
205+
rel="noopener noreferrer"
206+
className="text-blue-600 hover:text-blue-800 ml-1"
207+
>
208+
download it manually from GitHub
209+
</a>
210+
.
211+
</p>
212+
</div>
205213

206-
<div>
214+
<div>
215+
<p className="mb-2">
216+
2. Check for updates to the
217+
<a
218+
href="https://github.com/algertc/ALPR-Database/blob/main/docker-compose.yml"
219+
target="_blank"
220+
rel="noopener noreferrer"
221+
className="text-blue-600 hover:text-blue-800 ml-1"
222+
>
223+
docker-compose.yml
224+
</a>
225+
{" "}
226+
file on GitHub. Ensure your file is up-to-date with the latest
227+
version.
228+
</p>
229+
</div>
207230
<p className="mb-2">
208-
2. Restart the application with the latest version:
231+
3. Create the a directory called "storage" in the same location
232+
as your auth and config directories.
209233
</p>
210-
<div className="bg-slate-950 dark:bg-neutral-800 text-slate-50 p-3 rounded-md font-mono text-sm mb-2">
211-
docker compose pull
212-
</div>
213-
<div className="bg-slate-950 dark:bg-neutral-800 text-slate-50 p-3 rounded-md font-mono text-sm">
214-
docker compose up -d
234+
<div>
235+
<p className="mb-2">
236+
4. Restart the application with the latest version:
237+
</p>
238+
<div className="bg-slate-950 dark:bg-neutral-800 text-slate-50 p-3 rounded-md font-mono text-sm mb-2">
239+
docker compose pull
240+
</div>
241+
<div className="bg-slate-950 dark:bg-neutral-800 text-slate-50 p-3 rounded-md font-mono text-sm">
242+
docker compose up -d
243+
</div>
215244
</div>
216-
<p className="mt-1 text-sm text-muted-foreground">
217-
Run these commands in the directory containing your
218-
docker-compose.yml file.
219-
</p>
220245
</div>
221246

222-
<p className="text-sm text-muted-foreground mt-4">
247+
<p className="text-sm text-muted-foreground mt-2">
223248
Note: Your existing data will be preserved during the update.
224249
</p>
225250
</div>
@@ -232,36 +257,38 @@ export default function VersionAlert() {
232257
<DialogTitle>Changelog</DialogTitle>
233258
</DialogHeader>
234259
<ScrollArea className="h-[60vh] pr-4">
235-
{!versionInfo?.changelog ? (
260+
{!versionInfo || !versionInfo.changelog ? (
236261
<div className="flex items-center justify-center h-full">
237262
<p className="text-muted-foreground">No changelog available</p>
238263
</div>
239264
) : (
240265
<div className="space-y-6">
241-
{versionInfo.changelog.map((version) => (
242-
<div key={version.version} className="space-y-2">
243-
<div className="flex items-center gap-2">
244-
<h3 className="text-lg font-semibold">
245-
Version {version.version}
246-
</h3>
247-
{version.version === versionInfo.current && (
248-
<Badge variant="outline" className="text-xs">
249-
Current
250-
</Badge>
251-
)}
266+
{Array.isArray(versionInfo.changelog) &&
267+
versionInfo.changelog.map((version) => (
268+
<div key={version.version} className="space-y-2">
269+
<div className="flex items-center gap-2">
270+
<h3 className="text-lg font-semibold">
271+
Version {version.version}
272+
</h3>
273+
{version.version === versionInfo.current && (
274+
<Badge variant="outline" className="text-xs">
275+
Current
276+
</Badge>
277+
)}
278+
</div>
279+
<p className="text-sm text-muted-foreground">
280+
{version.date}
281+
</p>
282+
<ul className="space-y-1 list-disc list-inside">
283+
{version.changes &&
284+
version.changes.map((change, index) => (
285+
<li key={index} className="text-sm">
286+
{change}
287+
</li>
288+
))}
289+
</ul>
252290
</div>
253-
<p className="text-sm text-muted-foreground">
254-
{version.date}
255-
</p>
256-
<ul className="space-y-1 list-disc list-inside">
257-
{version.changes.map((change, index) => (
258-
<li key={index} className="text-sm">
259-
{change}
260-
</li>
261-
))}
262-
</ul>
263-
</div>
264-
))}
291+
))}
265292
</div>
266293
)}
267294
</ScrollArea>

0 commit comments

Comments
 (0)