feat(registratura): all 4 NAS drives (A/O/P/T) + hostnameIP fallback
- nas-paths.ts: A:\=Arhiva, O:\=Organizare, P:\=Proiecte, T:\=Transfer - toUncPathByIp() / toFileUrlByIp() helpers for DNS failure fallback - shareLabelFor() returns human-readable share name for badges - UI: 'IP' fallback link on hover, badge shows share label - Validation hints updated to show all 4 drive letters - Docs updated: CLAUDE.md, ROADMAP.md, SESSION-LOG.md
This commit is contained in:
@@ -34,8 +34,10 @@ import {
|
||||
isNetworkPath,
|
||||
toUncPath,
|
||||
toFileUrl,
|
||||
toFileUrlByIp,
|
||||
pathFileName,
|
||||
shortDisplayPath,
|
||||
shareLabelFor,
|
||||
} from "@/config/nas-paths";
|
||||
import { Input } from "@/shared/components/ui/input";
|
||||
import { Label } from "@/shared/components/ui/label";
|
||||
@@ -1223,7 +1225,7 @@ export function RegistryEntryForm({
|
||||
<div className="mt-2 rounded-md border border-blue-200 bg-blue-50/50 dark:border-blue-800 dark:bg-blue-950/30 p-3 space-y-2">
|
||||
<Label className="text-xs flex items-center gap-1">
|
||||
<HardDrive className="h-3 w-3" />
|
||||
Cale fișier pe NAS (\\newamun sau P:\\...)
|
||||
Cale fișier pe NAS (A:\ O:\ P:\ T:\ sau \\newamun\\...)
|
||||
</Label>
|
||||
<div className="flex gap-2">
|
||||
<Input
|
||||
@@ -1254,7 +1256,8 @@ export function RegistryEntryForm({
|
||||
)}
|
||||
{networkPathInput.trim() && !isNetworkPath(networkPathInput) && (
|
||||
<p className="text-[10px] text-amber-600 dark:text-amber-400">
|
||||
Calea nu pare a fi pe NAS. Introdu o cale de tip P:\\... sau \\newamun\\...
|
||||
Calea nu pare a fi pe NAS. Introdu o cale de tip A:\ O:\ P:\ T:\
|
||||
sau \\newamun\\...
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
@@ -1275,7 +1278,6 @@ export function RegistryEntryForm({
|
||||
className="flex-1 min-w-0 flex items-center gap-1 text-blue-700 dark:text-blue-300 hover:underline cursor-pointer"
|
||||
title={`Deschide în Explorer: ${att.networkPath}`}
|
||||
onClick={(e) => {
|
||||
// file:/// links might be blocked by browser; copy path as fallback
|
||||
e.preventDefault();
|
||||
window.open(toFileUrl(att.networkPath!), "_blank");
|
||||
}}
|
||||
@@ -1285,11 +1287,23 @@ export function RegistryEntryForm({
|
||||
{shortDisplayPath(att.networkPath)}
|
||||
</span>
|
||||
</a>
|
||||
{/* IP fallback link — visible on hover when DNS fails */}
|
||||
<a
|
||||
href={toFileUrlByIp(att.networkPath)}
|
||||
className="opacity-0 group-hover:opacity-100 transition-opacity text-[10px] text-blue-400 hover:text-blue-600 dark:hover:text-blue-200 shrink-0"
|
||||
title={`Fallback IP: ${toFileUrlByIp(att.networkPath!)}`}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
window.open(toFileUrlByIp(att.networkPath!), "_blank");
|
||||
}}
|
||||
>
|
||||
IP
|
||||
</a>
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="text-[10px] border-blue-300 dark:border-blue-700 text-blue-600 dark:text-blue-400 shrink-0"
|
||||
>
|
||||
NAS
|
||||
{shareLabelFor(att.networkPath) ?? "NAS"}
|
||||
</Badge>
|
||||
<button
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user