Spaces:
Sleeping
Sleeping
Harshit Ghosh commited on
Commit ·
31bb73c
1
Parent(s): 46811bc
some optimization
Browse filesFiles changed (3)
- auth_utils.py+1-2
- docs/_config.yml+15
- static/js/batch.js+22-5
12345678910"""Authentication utilities and decorators for user management and security"""import osimport loggingfrom functools import wrapsfrom flask import session, redirect, url_for, request, g, abort, has_request_contextfrom flask_login import LoginManager, current_userfrom models import db, User, AuditLog, now_istfrom sqlalchemy.exc import SQLAlchemyError123456789"""Authentication utilities and decorators for user management and security"""import loggingfrom functools import wrapsfrom flask import session, redirect, url_for, request, has_request_contextfrom flask_login import LoginManager, current_userfrom models import db, User, AuditLog, now_istfrom sqlalchemy.exc import SQLAlchemyError
123theme: jekyll-theme-minimaltitle: Intracranial Hemorrhage Detectiondescription: AI-assisted CT-based ICH screening with explainability and reporting.123456789101112131415161718theme: jekyll-theme-minimaltitle: Intracranial Hemorrhage Detectiondescription: AI-assisted CT-based ICH screening with explainability and reporting.markdown: kramdownplugins:- jekyll-remote-themeremote_theme: pages-themes/slate@v0.2.0# Custom CSS for theme improvements# Uses theSlate theme's color palette (dark gray background, light text)# Exclude files that shouldn't be in the final siteexclude:- Gemfile- Gemfile.lock- README.md- _venv
26 unmodified lines272829303132338 unmodified lines4243444546474818 unmodified lines67686970717223 unmodified lines969798991001011021031 unmodified line1051061071081091101112 unmodified lines11411511611711811912012112212312412526 unmodified linesvar failPanel = document.getElementById('failPanel');var failList = document.getElementById('failList');var cancelBtn = document.getElementById('cancelBatch');var prevIds = [];var canceled = false;if (!statusUrl || !title || !subtitle || !fill || !pctLabel || !currentFile || !statTotal || !statProc || !statOK || !statFail || !feedPanel || !feedList || !donePanel || !doneSummary || !failPanel || !failList) {8 unmodified linescancelBtn.disabled = true;fetch(cancelUrl, { method: 'POST' }).then(function (response) { return response.json(); }).then(function (data) {canceled = true;title.textContent = 'Batch Canceled';subtitle.textContent = 'The batch was canceled. You can start a new upload anytime.';18 unmodified linesreturn;}var total = data.total > 0 ? data.total : expectedTotal;var pct = total > 0 ? Math.round(data.processed / total * 100) : 0;23 unmodified linesif (data.image_ids && data.image_ids.length) {feedPanel.style.display = 'block';data.image_ids.forEach(function (imageId) {if (prevIds.indexOf(imageId) === -1) {prevIds.push(imageId);var li = document.createElement('li');var link = document.createElement('a');link.href = '/case/' + imageId;1 unmodified lineli.appendChild(link);feedList.insertBefore(li, feedList.firstChild);while (feedList.children.length > 20) {feedList.removeChild(feedList.lastChild);}}});2 unmodified linesif (data.status === 'canceled') {title.textContent = 'Batch Canceled';subtitle.textContent = 'The batch was canceled.';return;}if (data.status === 'completed' || data.status === 'failed') {title.textContent = 'Batch Complete';subtitle.textContent = '';donePanel.style.display = 'block';var failCount = data.failed_ids ? data.failed_ids.length : 0;doneSummary.textContent = data.succeeded + ' of ' + total + ' files processed successfully' + (failCount > 0 ? ', ' + failCount + ' failed' : '') + '.';26 unmodified lines272829303132338 unmodified lines4243444546474818 unmodified lines67686970717273747523 unmodified lines991001011021031041051061 unmodified line1081091101111121131141151161171181191201211222 unmodified lines12512612712812913013113213313413513613713813914014114226 unmodified linesvar failPanel = document.getElementById('failPanel');var failList = document.getElementById('failList');var cancelBtn = document.getElementById('cancelBatch');var seenIds = new Set();var canceled = false;if (!statusUrl || !title || !subtitle || !fill || !pctLabel || !currentFile || !statTotal || !statProc || !statOK || !statFail || !feedPanel || !feedList || !donePanel || !doneSummary || !failPanel || !failList) {8 unmodified linescancelBtn.disabled = true;fetch(cancelUrl, { method: 'POST' }).then(function (response) { return response.json(); }).then(function () {canceled = true;title.textContent = 'Batch Canceled';subtitle.textContent = 'The batch was canceled. You can start a new upload anytime.';18 unmodified linesreturn;}if (data.total > 0 && expectedTotal === 0) {expectedTotal = data.total;}var total = data.total > 0 ? data.total : expectedTotal;var pct = total > 0 ? Math.round(data.processed / total * 100) : 0;23 unmodified linesif (data.image_ids && data.image_ids.length) {feedPanel.style.display = 'block';data.image_ids.forEach(function (imageId) {if (!seenIds.has(imageId)) {seenIds.add(imageId);var li = document.createElement('li');var link = document.createElement('a');link.href = '/case/' + imageId;1 unmodified lineli.appendChild(link);feedList.insertBefore(li, feedList.firstChild);while (feedList.children.length > 20) {var last = feedList.lastChild;if (!last) {break;}var lastLink = last.querySelector('a');if (lastLink && lastLink.textContent) {seenIds.delete(lastLink.textContent);}feedList.removeChild(last);}}});2 unmodified linesif (data.status === 'canceled') {title.textContent = 'Batch Canceled';subtitle.textContent = 'The batch was canceled.';if (cancelBtn) {cancelBtn.disabled = true;}return;}if (data.status === 'completed' || data.status === 'failed') {title.textContent = 'Batch Complete';subtitle.textContent = '';if (cancelBtn) {cancelBtn.disabled = true;}donePanel.style.display = 'block';var failCount = data.failed_ids ? data.failed_ids.length : 0;doneSummary.textContent = data.succeeded + ' of ' + total + ' files processed successfully' + (failCount > 0 ? ', ' + failCount + ' failed' : '') + '.';
auth_utils.py+1-2
docs/_config.yml+15
static/js/batch.js+22-5