refactor(parcel-sync): global UAT bar, connection pill, reorder tabs
- UAT autocomplete always visible above tabs (all tabs share it) - Connection status pill in top-right: breathing green dot when connected, dropdown with credentials form / disconnect button - Tab order: Cautare Parcele (1st) -> Catalog Layere -> Export (last) - Renamed 'Butonul Magic' to just 'Magic' - Removed connection/UAT cards from inside Export tab
This commit is contained in:
@@ -75,11 +75,7 @@ export async function POST(req: Request) {
|
||||
pushProgress();
|
||||
};
|
||||
|
||||
const setPhaseState = (
|
||||
next: string,
|
||||
weight: number,
|
||||
nextTotal?: number,
|
||||
) => {
|
||||
const setPhaseState = (next: string, weight: number, nextTotal?: number) => {
|
||||
phase = next;
|
||||
currentWeight = weight;
|
||||
phaseTotal = nextTotal;
|
||||
@@ -108,7 +104,7 @@ export async function POST(req: Request) {
|
||||
updateOverall(0);
|
||||
};
|
||||
|
||||
const withHeartbeat = async <T,>(task: () => Promise<T>) => {
|
||||
const withHeartbeat = async <T>(task: () => Promise<T>) => {
|
||||
let tick = 0.1;
|
||||
updatePhaseProgress(tick, 1);
|
||||
const interval = setInterval(() => {
|
||||
@@ -161,8 +157,7 @@ export async function POST(req: Request) {
|
||||
count = await client.countLayer(layer, validated.siruta);
|
||||
}
|
||||
} catch (error) {
|
||||
const msg =
|
||||
error instanceof Error ? error.message : "Count error";
|
||||
const msg = error instanceof Error ? error.message : "Count error";
|
||||
if (!msg.toLowerCase().includes("count unavailable")) throw error;
|
||||
}
|
||||
updatePhaseProgress(2, 2);
|
||||
@@ -187,9 +182,7 @@ export async function POST(req: Request) {
|
||||
onProgress: (value, totalCount) => {
|
||||
updatePhaseProgress(
|
||||
value,
|
||||
typeof totalCount === "number"
|
||||
? totalCount
|
||||
: value + pageSize,
|
||||
typeof totalCount === "number" ? totalCount : value + pageSize,
|
||||
);
|
||||
},
|
||||
})
|
||||
@@ -200,16 +193,11 @@ export async function POST(req: Request) {
|
||||
onProgress: (value, totalCount) => {
|
||||
updatePhaseProgress(
|
||||
value,
|
||||
typeof totalCount === "number"
|
||||
? totalCount
|
||||
: value + pageSize,
|
||||
typeof totalCount === "number" ? totalCount : value + pageSize,
|
||||
);
|
||||
},
|
||||
});
|
||||
updatePhaseProgress(
|
||||
features.length,
|
||||
count ?? features.length,
|
||||
);
|
||||
updatePhaseProgress(features.length, count ?? features.length);
|
||||
finishPhase();
|
||||
|
||||
/* Fields */
|
||||
@@ -274,9 +262,7 @@ export async function POST(req: Request) {
|
||||
scheduleClear(jobId);
|
||||
const lower = errMessage.toLowerCase();
|
||||
const statusCode =
|
||||
lower.includes("login failed") || lower.includes("session")
|
||||
? 401
|
||||
: 400;
|
||||
lower.includes("login failed") || lower.includes("session") ? 401 : 400;
|
||||
return new Response(JSON.stringify({ error: errMessage }), {
|
||||
status: statusCode,
|
||||
headers: { "Content-Type": "application/json" },
|
||||
|
||||
Reference in New Issue
Block a user