refactor: remove progress bar from job loading UI

- Removed progress bar HTML element and CSS
- Removed startProgress() and finishProgress() functions
- Simplified job loading flow (jobs now display instantly)
- Progress tracking removed; jobs render as they load
This commit is contained in:
2026-01-08 17:29:54 +00:00
parent d7228626fb
commit e7baa94322
3 changed files with 97 additions and 23 deletions
+1 -1
View File
@@ -219,7 +219,7 @@ app.onError((err, c) => {
return c.text('Internal Server Error', 500); return c.text('Internal Server Error', 500);
}); });
const PORT = Number(process.env.PORT || 3003); const PORT = Number(process.env.PORT || 3000);
logLine('logs/server.log', `Starting frontend server on port ${PORT}`); logLine('logs/server.log', `Starting frontend server on port ${PORT}`);
+1 -22
View File
@@ -33,10 +33,6 @@
</div> </div>
<h1 class="m-0 mb-3 text-center text-blue-600 text-[33px] font-bold">Job Info</h1> <h1 class="m-0 mb-3 text-center text-blue-600 text-[33px] font-bold">Job Info</h1>
<div class="w-full bg-blue-50 h-1.5 rounded overflow-hidden mb-3">
<div id="progressBar" class="h-full w-0 bg-blue-600 transition-all duration-300 ease-out"></div>
</div>
<input id="searchBox" placeholder="Search jobs (just start typing)" class="w-full p-2.5 rounded-lg border border-gray-300 mb-2 text-lg placeholder:text-gray-400"> <input id="searchBox" placeholder="Search jobs (just start typing)" class="w-full p-2.5 rounded-lg border border-gray-300 mb-2 text-lg placeholder:text-gray-400">
<button id="filterToggle" class="bg-blue-600 text-white py-2 px-2.5 rounded-lg border-none cursor-pointer mb-2 inline-block min-w-[140px]">Show Filters</button> <button id="filterToggle" class="bg-blue-600 text-white py-2 px-2.5 rounded-lg border-none cursor-pointer mb-2 inline-block min-w-[140px]">Show Filters</button>
@@ -256,7 +252,6 @@
} }
window.clearJobsCache = clearJobsCache; window.clearJobsCache = clearJobsCache;
const progressBar = document.getElementById('progressBar');
const searchBox = document.getElementById('searchBox'); const searchBox = document.getElementById('searchBox');
const resultsEl = document.getElementById('results'); const resultsEl = document.getElementById('results');
const filtersPanel = document.getElementById('filtersPanel'); const filtersPanel = document.getElementById('filtersPanel');
@@ -350,20 +345,8 @@
} }
loadVersion(); loadVersion();
let progTimer=null;
function startProgress(){
progressBar.style.width='0%';
if(progTimer) clearInterval(progTimer);
let simulatedProg=0;
progTimer=setInterval(()=>{
if(simulatedProg<65){ simulatedProg+=0.8; progressBar.style.width=Math.min(65,simulatedProg).toFixed(1)+'%'; }
},150);
}
function finishProgress(){ if(progTimer) clearInterval(progTimer); progressBar.style.width='100%'; setTimeout(()=>{progressBar.parentElement.classList.add('hidden');},400); }
// --- Fetch all jobs --- // --- Fetch all jobs ---
async function fetchAllJobs(){ async function fetchAllJobs(){
startProgress();
clearJobsCache('Loading…'); clearJobsCache('Loading…');
let page=1, totalItems=0; let page=1, totalItems=0;
try{ try{
@@ -379,14 +362,10 @@
// Apply filters on the currently loaded pages so initial results reflect preferences immediately. // Apply filters on the currently loaded pages so initial results reflect preferences immediately.
applyFiltersAndRender(); applyFiltersAndRender();
if(progTimer) clearInterval(progTimer);
const realProg=Math.min(95, Math.floor((jobsCache.length / Math.max(1,totalItems)) * 95));
progressBar.style.width=realProg+'%';
if(jobsCache.length >= totalItems || items.length===0) break; if(jobsCache.length >= totalItems || items.length===0) break;
page++; page++;
} }
finishProgress(); }catch(err){ alert('Failed to fetch jobs: '+err.message); console.error(err);}
}catch(err){ finishProgress(); alert('Failed to fetch jobs: '+err.message); console.error(err);}
} }
function renderInitialBatch(jobs){ function renderInitialBatch(jobs){
+95
View File
@@ -0,0 +1,95 @@
file:///home/admin/Job-Info/node_modules/hono/dist/adapter/bun/ssg.js:3
var { write } = Bun;
^
ReferenceError: Bun is not defined
at file:///home/admin/Job-Info/node_modules/hono/dist/adapter/bun/ssg.js:3:17
at ModuleJob.run (node:internal/modules/esm/module_job:413:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:654:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)
Node.js v25.2.1
[dotenv@17.2.3] injecting env (0) from .env -- tip: ⚙️ override existing env vars with { override: true }
Started server: http://localhost:3000
[job-files] Request received
[getGraphToken] Header token: NONE
[getGraphToken] Env token: NOT SET
[getGraphToken] Using: NONE
[job-files] No token found
[job-files] Request received
[getGraphToken] Header token: NONE
[getGraphToken] Env token: NOT SET
[getGraphToken] Using: NONE
[job-files] No token found
[job-files] Request received
[getGraphToken] Header token: eyJ0eXAiOiJKV1QiLCJu...
[getGraphToken] Env token: NOT SET
[getGraphToken] Using: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Token found: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Link: https://czflex.sharepoint.com/:f:/s/Team/IgDPpHWv5q5qT4doe96ablfoAY46huDKF2eBDSmsG0zrmH0
[job-files] Request received
[getGraphToken] Header token: eyJ0eXAiOiJKV1QiLCJu...
[getGraphToken] Env token: NOT SET
[getGraphToken] Using: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Token found: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Link: https://czflex.sharepoint.com/:f:/s/Team/IgDPpHWv5q5qT4doe96ablfoAY46huDKF2eBDSmsG0zrmH0
[job-files] Request received
[getGraphToken] Header token: eyJ0eXAiOiJKV1QiLCJu...
[getGraphToken] Env token: NOT SET
[getGraphToken] Using: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Token found: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Link: https://czflex.sharepoint.com/:f:/s/Team/IgDPpHWv5q5qT4doe96ablfoAY46huDKF2eBDSmsG0zrmH0
[job-files] Request received
[getGraphToken] Header token: eyJ0eXAiOiJKV1QiLCJu...
[getGraphToken] Env token: NOT SET
[getGraphToken] Using: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Token found: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Link: https://czflex.sharepoint.com/:f:/s/Team/IgDPpHWv5q5qT4doe96ablfoAY46huDKF2eBDSmsG0zrmH0
[job-files] Request received
[getGraphToken] Header token: eyJ0eXAiOiJKV1QiLCJu...
[getGraphToken] Env token: NOT SET
[getGraphToken] Using: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Token found: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Link: https://czflex.sharepoint.com/:f:/s/Team/IgDPpHWv5q5qT4doe96ablfoAY46huDKF2eBDSmsG0zrmH0
[job-files] Request received
[getGraphToken] Header token: eyJ0eXAiOiJKV1QiLCJu...
[getGraphToken] Env token: NOT SET
[getGraphToken] Using: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Token found: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Link: https://czflex.sharepoint.com/:f:/s/Team/IgDPpHWv5q5qT4doe96ablfoAY46huDKF2eBDSmsG0zrmH0
[job-files] Request received
[getGraphToken] Header token: eyJ0eXAiOiJKV1QiLCJu...
[getGraphToken] Env token: NOT SET
[getGraphToken] Using: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Token found: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Link: https://czflex.sharepoint.com/:f:/s/Team/IgDPpHWv5q5qT4doe96ablfoAY46huDKF2eBDSmsG0zrmH0
[job-files] Request received
[getGraphToken] Header token: eyJ0eXAiOiJKV1QiLCJu...
[getGraphToken] Env token: NOT SET
[getGraphToken] Using: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Token found: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Link: https://czflex.sharepoint.com/:f:/s/Team/IgDPpHWv5q5qT4doe96ablfoAY46huDKF2eBDSmsG0zrmH0
[job-files] Request received
[getGraphToken] Header token: eyJ0eXAiOiJKV1QiLCJu...
[getGraphToken] Env token: NOT SET
[getGraphToken] Using: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Token found: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Link: https://czflex.sharepoint.com/:f:/s/Team/IgDPpHWv5q5qT4doe96ablfoAY46huDKF2eBDSmsG0zrmH0
[job-files] Request received
[getGraphToken] Header token: eyJ0eXAiOiJKV1QiLCJu...
[getGraphToken] Env token: NOT SET
[getGraphToken] Using: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Token found: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Link: https://czflex.sharepoint.com/:f:/s/Team/IgDPpHWv5q5qT4doe96ablfoAY46huDKF2eBDSmsG0zrmH0
[job-files] Request received
[getGraphToken] Header token: eyJ0eXAiOiJKV1QiLCJu...
[getGraphToken] Env token: NOT SET
[getGraphToken] Using: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Token found: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Link: https://czflex.sharepoint.com/:f:/s/Team/IgDPpHWv5q5qT4doe96ablfoAY46huDKF2eBDSmsG0zrmH0
[job-files] Request received
[getGraphToken] Header token: eyJ0eXAiOiJKV1QiLCJu...
[getGraphToken] Env token: NOT SET
[getGraphToken] Using: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Token found: eyJ0eXAiOiJKV1QiLCJu...
[job-files] Link: https://czflex.sharepoint.com/:f:/s/Team/IgDPpHWv5q5qT4doe96ablfoAY46huDKF2eBDSmsG0zrmH0