Merge pull request 'Fixes and improvements' (#14) from next into master
Reviewed-on: #14
This commit was merged in pull request #14.
This commit is contained in:
38
public/favicon-32x32.svg
Normal file
38
public/favicon-32x32.svg
Normal file
@@ -0,0 +1,38 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
||||
<defs>
|
||||
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" style="stop-color:#007bff;stop-opacity:1" />
|
||||
<stop offset="100%" style="stop-color:#0056b3;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
|
||||
<!-- Background circle -->
|
||||
<circle cx="16" cy="16" r="15" fill="url(#grad1)" stroke="#ffffff" stroke-width="1"/>
|
||||
|
||||
<!-- Cat ears -->
|
||||
<polygon points="8,8 12,4 16,8" fill="#ffffff" opacity="0.9"/>
|
||||
<polygon points="16,8 20,4 24,8" fill="#ffffff" opacity="0.9"/>
|
||||
|
||||
<!-- Cat face -->
|
||||
<ellipse cx="16" cy="18" rx="8" ry="6" fill="#ffffff" opacity="0.9"/>
|
||||
|
||||
<!-- Eyes -->
|
||||
<circle cx="13" cy="16" r="1.5" fill="#007bff"/>
|
||||
<circle cx="19" cy="16" r="1.5" fill="#007bff"/>
|
||||
|
||||
<!-- Nose -->
|
||||
<polygon points="16,18 15,19 17,19" fill="#007bff"/>
|
||||
|
||||
<!-- Mouth -->
|
||||
<path d="M 16 19 Q 14 21 12 20" stroke="#007bff" stroke-width="1" fill="none" stroke-linecap="round"/>
|
||||
<path d="M 16 19 Q 18 21 20 20" stroke="#007bff" stroke-width="1" fill="none" stroke-linecap="round"/>
|
||||
|
||||
<!-- Whiskers -->
|
||||
<line x1="8" y1="17" x2="11" y2="17" stroke="#007bff" stroke-width="0.5"/>
|
||||
<line x1="8" y1="19" x2="11" y2="19" stroke="#007bff" stroke-width="0.5"/>
|
||||
<line x1="21" y1="17" x2="24" y2="17" stroke="#007bff" stroke-width="0.5"/>
|
||||
<line x1="21" y1="19" x2="24" y2="19" stroke="#007bff" stroke-width="0.5"/>
|
||||
|
||||
<!-- Small AI indicator -->
|
||||
<text x="16" y="26" text-anchor="middle" font-family="Arial, sans-serif" font-size="6" font-weight="bold" fill="#ffffff">AI</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
32
public/favicon.svg
Normal file
32
public/favicon.svg
Normal file
@@ -0,0 +1,32 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<defs>
|
||||
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" style="stop-color:#007bff;stop-opacity:1" />
|
||||
<stop offset="100%" style="stop-color:#0056b3;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
|
||||
<!-- Background circle -->
|
||||
<circle cx="8" cy="8" r="7.5" fill="url(#grad1)" stroke="#ffffff" stroke-width="0.5"/>
|
||||
|
||||
<!-- Cat ears -->
|
||||
<polygon points="4,4 6,2 8,4" fill="#ffffff" opacity="0.9"/>
|
||||
<polygon points="8,4 10,2 12,4" fill="#ffffff" opacity="0.9"/>
|
||||
|
||||
<!-- Cat face -->
|
||||
<ellipse cx="8" cy="9" rx="4" ry="3" fill="#ffffff" opacity="0.9"/>
|
||||
|
||||
<!-- Eyes -->
|
||||
<circle cx="6.5" cy="8" r="0.7" fill="#007bff"/>
|
||||
<circle cx="9.5" cy="8" r="0.7" fill="#007bff"/>
|
||||
|
||||
<!-- Nose -->
|
||||
<polygon points="8,9 7.5,9.5 8.5,9.5" fill="#007bff"/>
|
||||
|
||||
<!-- Mouth -->
|
||||
<path d="M 8 9.5 Q 7 10.5 6 10" stroke="#007bff" stroke-width="0.5" fill="none" stroke-linecap="round"/>
|
||||
<path d="M 8 9.5 Q 9 10.5 10 10" stroke="#007bff" stroke-width="0.5" fill="none" stroke-linecap="round"/>
|
||||
|
||||
<!-- Small AI indicator -->
|
||||
<text x="8" y="13" text-anchor="middle" font-family="Arial, sans-serif" font-size="3" font-weight="bold" fill="#ffffff">AI</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
38
public/images/favicon.svg
Normal file
38
public/images/favicon.svg
Normal file
@@ -0,0 +1,38 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
||||
<defs>
|
||||
<linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%">
|
||||
<stop offset="0%" style="stop-color:#007bff;stop-opacity:1" />
|
||||
<stop offset="100%" style="stop-color:#0056b3;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
|
||||
<!-- Background circle -->
|
||||
<circle cx="16" cy="16" r="15" fill="url(#grad1)" stroke="#ffffff" stroke-width="1"/>
|
||||
|
||||
<!-- Cat ears -->
|
||||
<polygon points="8,8 12,4 16,8" fill="#ffffff" opacity="0.9"/>
|
||||
<polygon points="16,8 20,4 24,8" fill="#ffffff" opacity="0.9"/>
|
||||
|
||||
<!-- Cat face -->
|
||||
<ellipse cx="16" cy="18" rx="8" ry="6" fill="#ffffff" opacity="0.9"/>
|
||||
|
||||
<!-- Eyes -->
|
||||
<circle cx="13" cy="16" r="1.5" fill="#007bff"/>
|
||||
<circle cx="19" cy="16" r="1.5" fill="#007bff"/>
|
||||
|
||||
<!-- Nose -->
|
||||
<polygon points="16,18 15,19 17,19" fill="#007bff"/>
|
||||
|
||||
<!-- Mouth -->
|
||||
<path d="M 16 19 Q 14 21 12 20" stroke="#007bff" stroke-width="1" fill="none" stroke-linecap="round"/>
|
||||
<path d="M 16 19 Q 18 21 20 20" stroke="#007bff" stroke-width="1" fill="none" stroke-linecap="round"/>
|
||||
|
||||
<!-- Whiskers -->
|
||||
<line x1="8" y1="17" x2="11" y2="17" stroke="#007bff" stroke-width="0.5"/>
|
||||
<line x1="8" y1="19" x2="11" y2="19" stroke="#007bff" stroke-width="0.5"/>
|
||||
<line x1="21" y1="17" x2="24" y2="17" stroke="#007bff" stroke-width="0.5"/>
|
||||
<line x1="21" y1="19" x2="24" y2="19" stroke="#007bff" stroke-width="0.5"/>
|
||||
|
||||
<!-- Small AI indicator -->
|
||||
<text x="16" y="26" text-anchor="middle" font-family="Arial, sans-serif" font-size="6" font-weight="bold" fill="#ffffff">AI</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -53,9 +53,60 @@ function initializeFileUpload() {
|
||||
|
||||
function showFileInfo(file) {
|
||||
if (fileName && fileSize && fileInfo) {
|
||||
fileName.textContent = file.name;
|
||||
fileSize.textContent = `(${formatFileSize(file.size)})`;
|
||||
// Define allowed file types for client-side validation
|
||||
const allowedExtensions = ['.pdf', '.txt', '.doc', '.docx', '.xlsx', '.xls', '.md', '.json', '.csv', '.xml'];
|
||||
const allowedMimeTypes = [
|
||||
'application/pdf',
|
||||
'text/plain',
|
||||
'text/markdown',
|
||||
'text/csv',
|
||||
'text/xml',
|
||||
'application/xml',
|
||||
'application/json',
|
||||
'application/msword',
|
||||
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
'application/vnd.ms-excel',
|
||||
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
];
|
||||
|
||||
// Get file extension
|
||||
const fileExtension = '.' + file.name.split('.').pop().toLowerCase();
|
||||
const fileMimeType = file.type.toLowerCase();
|
||||
|
||||
// Check if file type is allowed
|
||||
const isExtensionAllowed = allowedExtensions.includes(fileExtension);
|
||||
const isMimeTypeAllowed = allowedMimeTypes.includes(fileMimeType) || fileMimeType === '';
|
||||
|
||||
if (!isExtensionAllowed) {
|
||||
// Show error for invalid file type
|
||||
fileInfo.innerHTML = `
|
||||
<div class="alert alert-danger">
|
||||
<i class="fas fa-exclamation-triangle me-2"></i>
|
||||
<strong>Invalid file type!</strong> "${fileExtension}" files are not supported.
|
||||
<br><small>Only document files (PDF, Word, Excel, text files) are allowed to prevent RAG corruption.</small>
|
||||
</div>
|
||||
`;
|
||||
fileInfo.classList.remove('d-none');
|
||||
uploadBtn.disabled = true;
|
||||
return;
|
||||
}
|
||||
|
||||
// Show valid file info
|
||||
fileInfo.innerHTML = `
|
||||
<div class="alert alert-info">
|
||||
<i class="fas fa-file me-2"></i>
|
||||
<span>${file.name}</span>
|
||||
<span class="text-muted ms-2">(${formatFileSize(file.size)})</span>
|
||||
<div class="mt-2">
|
||||
<small class="text-success">
|
||||
<i class="fas fa-check-circle me-1"></i>
|
||||
File type supported for AI processing
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
fileInfo.classList.remove('d-none');
|
||||
uploadBtn.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user