chore(sidebar): konsol loglarını kaldır
This commit is contained in:
@@ -27,13 +27,11 @@ let hasMusic = false;
|
|||||||
// Store'u değişkene bağla
|
// Store'u değişkene bağla
|
||||||
unsubscribeDiskSpace = diskSpaceStore.subscribe(value => {
|
unsubscribeDiskSpace = diskSpaceStore.subscribe(value => {
|
||||||
diskSpace = value;
|
diskSpace = value;
|
||||||
console.log('🔄 Disk space updated from store:', diskSpace);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Disk space'i reaktif olarak güncellemek için bir fonksiyon
|
// Disk space'i reaktif olarak güncellemek için bir fonksiyon
|
||||||
function updateDiskSpace(newData) {
|
function updateDiskSpace(newData) {
|
||||||
diskSpaceStore.update(current => Object.assign({}, current, newData));
|
diskSpaceStore.update(current => Object.assign({}, current, newData));
|
||||||
console.log('🔄 Disk space update called with:', newData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const unsubscribeMovie = movieCount.subscribe((count) => {
|
const unsubscribeMovie = movieCount.subscribe((count) => {
|
||||||
@@ -76,7 +74,6 @@ const unsubscribeMusic = musicCount.subscribe((count) => {
|
|||||||
const response = await apiFetch('/api/disk-space');
|
const response = await apiFetch('/api/disk-space');
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
console.log('Disk space data received:', data);
|
|
||||||
updateDiskSpace(data);
|
updateDiskSpace(data);
|
||||||
} else {
|
} else {
|
||||||
console.error('Disk space API error:', response.status, response.statusText);
|
console.error('Disk space API error:', response.status, response.statusText);
|
||||||
@@ -88,7 +85,6 @@ const unsubscribeMusic = musicCount.subscribe((count) => {
|
|||||||
|
|
||||||
// Component yüklendiğinde disk space bilgilerini al
|
// Component yüklendiğinde disk space bilgilerini al
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
console.log('🔌 Sidebar component mounted');
|
|
||||||
fetchDiskSpace();
|
fetchDiskSpace();
|
||||||
|
|
||||||
// WebSocket bağlantısı kur
|
// WebSocket bağlantısı kur
|
||||||
@@ -98,16 +94,12 @@ const unsubscribeMusic = musicCount.subscribe((count) => {
|
|||||||
// Eğer client farklı portta çalışıyorsa, server port'unu manuel belirt
|
// Eğer client farklı portta çalışıyorsa, server port'unu manuel belirt
|
||||||
const wsHost = currentHost.includes(':3000') ? currentHost.replace(':3000', ':3001') : currentHost;
|
const wsHost = currentHost.includes(':3000') ? currentHost.replace(':3000', ':3001') : currentHost;
|
||||||
const wsUrl = `${wsProtocol}//${wsHost}`;
|
const wsUrl = `${wsProtocol}//${wsHost}`;
|
||||||
console.log('🔌 Connecting to WebSocket at:', wsUrl);
|
|
||||||
|
|
||||||
diskSpaceWs = new WebSocket(wsUrl);
|
diskSpaceWs = new WebSocket(wsUrl);
|
||||||
|
|
||||||
diskSpaceWs.onmessage = (event) => {
|
diskSpaceWs.onmessage = (event) => {
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(event.data);
|
const data = JSON.parse(event.data);
|
||||||
console.log('WebSocket message received:', data);
|
|
||||||
if (data.type === 'diskSpace') {
|
if (data.type === 'diskSpace') {
|
||||||
console.log('Disk space update received:', data.data);
|
|
||||||
updateDiskSpace(data.data);
|
updateDiskSpace(data.data);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -115,17 +107,9 @@ const unsubscribeMusic = musicCount.subscribe((count) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
diskSpaceWs.onopen = () => {
|
|
||||||
console.log('WebSocket connected for disk space updates');
|
|
||||||
};
|
|
||||||
|
|
||||||
diskSpaceWs.onerror = (error) => {
|
diskSpaceWs.onerror = (error) => {
|
||||||
console.error('WebSocket error:', error);
|
console.error('WebSocket error:', error);
|
||||||
};
|
};
|
||||||
|
|
||||||
diskSpaceWs.onclose = () => {
|
|
||||||
console.log('WebSocket disconnected');
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user