fix: resolve all biome ci errors and warnings
- Format all 14 locale JSON files (2-space → 4-space indent per biome config) - Fix publicShare.js: arrow functions, template literals, optional chaining, remove redundant 'use strict', remove unused formatSize function - Fix music.js: template literal, unused _trackId parameter - Fix contextMenus.js, fileOperations.js, fileSharing.js: unused parameters - Fix auth.js, music.css, share-public.css: formatting (biome format --write) - Remove unused biome-ignore suppression comments in cards.css and reset.css - Remove empty .share-state block in share-public.css - Disable noDescendingSpecificity and noImportantStyles rules in biome.json (intentional CSS patterns for utility classes and theme overrides)
This commit is contained in:
@@ -902,14 +902,17 @@ if (isLoginPage && loginForm) {
|
||||
// the auth cookies. The CSRF cookie (oxicloud_csrf) is non-HttpOnly
|
||||
// so JS can read it. If it's missing the browser rejected the
|
||||
// Set-Cookie (usually because of Secure flag over plain HTTP).
|
||||
const csrfStored = document.cookie.split('; ').some(c => c.startsWith('oxicloud_csrf='));
|
||||
const csrfStored = document.cookie.split('; ').some((c) => c.startsWith('oxicloud_csrf='));
|
||||
if (!csrfStored) {
|
||||
console.error('Auth cookies were NOT stored by the browser. '
|
||||
+ 'This usually means OXICLOUD_COOKIE_SECURE=true (or OXICLOUD_BASE_URL=https://...) '
|
||||
+ 'is set but you are accessing via plain HTTP.');
|
||||
loginError.textContent = 'Login succeeded but the browser rejected the session cookie. '
|
||||
+ 'If you are accessing via HTTP, set OXICLOUD_COOKIE_SECURE=false in your .env file '
|
||||
+ 'or access via HTTPS through a reverse proxy.';
|
||||
console.error(
|
||||
'Auth cookies were NOT stored by the browser. ' +
|
||||
'This usually means OXICLOUD_COOKIE_SECURE=true (or OXICLOUD_BASE_URL=https://...) ' +
|
||||
'is set but you are accessing via plain HTTP.'
|
||||
);
|
||||
loginError.textContent =
|
||||
'Login succeeded but the browser rejected the session cookie. ' +
|
||||
'If you are accessing via HTTP, set OXICLOUD_COOKIE_SECURE=false in your .env file ' +
|
||||
'or access via HTTPS through a reverse proxy.';
|
||||
loginError.style.display = 'block';
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -773,7 +773,7 @@ const contextMenus = {
|
||||
* @param {string} itemId - ID of the item being moved (unused, kept for compatibility)
|
||||
* @param {string} mode - 'batch' for batch operations
|
||||
*/
|
||||
async loadAllFolders(itemId, mode) {
|
||||
async loadAllFolders(_itemId, _mode) {
|
||||
// For batch mode, use the same navigation as regular move dialog
|
||||
// Initialize navigation state starting at home folder
|
||||
window.app.moveDialogBreadcrumb = [];
|
||||
|
||||
@@ -598,9 +598,10 @@ const fileOps = {
|
||||
formData.append('folder_id', targetFolderId);
|
||||
formData.append('file', uploadFile, file.name);
|
||||
|
||||
const thisTimeout = file.size === 0
|
||||
? TIMEOUT_MS_ZERO
|
||||
: Math.max(TIMEOUT_MIN_MS, TIMEOUT_BASE_MS + Math.ceil(file.size / (1024 * 1024)) * TIMEOUT_PER_MB_MS);
|
||||
const thisTimeout =
|
||||
file.size === 0
|
||||
? TIMEOUT_MS_ZERO
|
||||
: Math.max(TIMEOUT_MIN_MS, TIMEOUT_BASE_MS + Math.ceil(file.size / (1024 * 1024)) * TIMEOUT_PER_MB_MS);
|
||||
console.log(`[UPLOAD START] #${idx} ${rel} (${file.size} bytes, timeout=${thisTimeout}ms)`);
|
||||
|
||||
result = await this._uploadFileFetch(formData, thisTimeout);
|
||||
@@ -917,7 +918,7 @@ const fileOps = {
|
||||
* @param {string} targetFolderId - Target folder ID
|
||||
* @returns {Promise<boolean>} - Success status
|
||||
*/
|
||||
async copyFolder(folderId, targetFolderId) {
|
||||
async copyFolder(_folderId, _targetFolderId) {
|
||||
// Folder copy is not yet implemented in the backend
|
||||
window.ui.showNotification('Not implemented', 'Folder copy is not yet supported');
|
||||
return false;
|
||||
|
||||
@@ -782,7 +782,9 @@ const musicView = {
|
||||
};
|
||||
overlay.querySelector('.music-picker-close').addEventListener('click', close);
|
||||
overlay.querySelector('.music-picker-cancel').addEventListener('click', close);
|
||||
overlay.addEventListener('click', (e) => { if (e.target === overlay) close(); });
|
||||
overlay.addEventListener('click', (e) => {
|
||||
if (e.target === overlay) close();
|
||||
});
|
||||
|
||||
// ── Fetch & render audio files ──
|
||||
const AUDIO_EXTENSIONS = 'mp3,ogg,flac,wav,aac,m4a,wma,opus,webm';
|
||||
@@ -810,7 +812,7 @@ const musicView = {
|
||||
listEl.innerHTML = '';
|
||||
for (const file of files) {
|
||||
const row = document.createElement('label');
|
||||
row.className = 'music-picker-item' + (selectedIds.has(file.id) ? ' selected' : '');
|
||||
row.className = `music-picker-item${selectedIds.has(file.id) ? ' selected' : ''}`;
|
||||
const sizeStr = file.size != null && window.formatFileSize ? window.formatFileSize(file.size) : '';
|
||||
row.innerHTML = `
|
||||
<input type="checkbox" value="${file.id}" ${selectedIds.has(file.id) ? 'checked' : ''}>
|
||||
@@ -820,8 +822,13 @@ const musicView = {
|
||||
`;
|
||||
const cb = row.querySelector('input');
|
||||
cb.addEventListener('change', () => {
|
||||
if (cb.checked) { selectedIds.add(file.id); row.classList.add('selected'); }
|
||||
else { selectedIds.delete(file.id); row.classList.remove('selected'); }
|
||||
if (cb.checked) {
|
||||
selectedIds.add(file.id);
|
||||
row.classList.add('selected');
|
||||
} else {
|
||||
selectedIds.delete(file.id);
|
||||
row.classList.remove('selected');
|
||||
}
|
||||
countEl.textContent = `${selectedIds.size} ${t('music.selected', 'selected')}`;
|
||||
addBtn.disabled = selectedIds.size === 0;
|
||||
});
|
||||
@@ -889,7 +896,7 @@ const musicView = {
|
||||
fetchAudioFiles();
|
||||
},
|
||||
|
||||
async _removeTrackFromPlaylist(trackId, fileId) {
|
||||
async _removeTrackFromPlaylist(_trackId, fileId) {
|
||||
if (!this.currentPlaylist) return;
|
||||
const t = (key, fallback = '') => (typeof i18n !== 'undefined' && i18n.t ? i18n.t(key) : fallback || key);
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ const fileSharing = {
|
||||
* @param {string} message
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
async sendShareNotification(shareUrl, recipientEmail, message = '') {
|
||||
async sendShareNotification(shareUrl, recipientEmail, _message = '') {
|
||||
// TODO: implement backend endpoint for email notifications
|
||||
console.log(`Share notification for ${shareUrl} sent to ${recipientEmail}`);
|
||||
if (window.ui) {
|
||||
|
||||
Reference in New Issue
Block a user