feat(console): add voice folder to file manager
Add an Audio/voice directory with upload and preview support, and expose it in the console file manager so the structure now shows Configuration, Music, Voice, Beep, and Station.
This commit is contained in:
@@ -813,6 +813,8 @@
|
||||
<input type="file" id="upload-config" accept=".txt" onchange="performUpload('listFile', '/api/upload/list', this)">
|
||||
<input type="file" id="upload-music" multiple accept=".wav,.mp3,.ogg,.flac,.m4a,.aac,.opus,.dfpwm"
|
||||
onchange="performUpload('musicAudioFiles', '/api/upload/music-audio', this)">
|
||||
<input type="file" id="upload-voice" multiple accept=".wav,.mp3,.ogg,.flac,.m4a,.aac,.opus,.dfpwm"
|
||||
onchange="performUpload('voiceAudioFiles', '/api/upload/voice-audio', this)">
|
||||
<input type="file" id="upload-general" multiple accept=".wav,.mp3,.ogg,.flac,.m4a,.aac,.opus,.dfpwm"
|
||||
onchange="performUpload('generalAudioFiles', '/api/upload/general-audio', this)">
|
||||
<input type="file" id="upload-station" multiple accept=".wav,.mp3,.ogg,.flac,.m4a,.aac,.opus,.dfpwm"
|
||||
@@ -1143,6 +1145,7 @@
|
||||
const nameMap = {
|
||||
config: 'Configuration',
|
||||
music: 'Music',
|
||||
voice: 'Voice',
|
||||
beep: 'Beep',
|
||||
station: 'Station'
|
||||
};
|
||||
@@ -1160,6 +1163,7 @@
|
||||
const folders = [
|
||||
{ id: 'config', name: 'Configuration', count: allFiles.filter(f => f.type === 'config').length },
|
||||
{ id: 'music', name: 'Music', count: allFiles.filter(f => f.type === 'music').length },
|
||||
{ id: 'voice', name: 'Voice', count: allFiles.filter(f => f.type === 'voice').length },
|
||||
{ id: 'beep', name: 'Beep', count: allFiles.filter(f => f.type === 'beep').length },
|
||||
{ id: 'station', name: 'Station', count: allFiles.filter(f => f.type === 'station').length }
|
||||
];
|
||||
@@ -1187,6 +1191,7 @@
|
||||
const typeLabelMap = {
|
||||
config: 'Configuration',
|
||||
music: 'Music',
|
||||
voice: 'Voice',
|
||||
beep: 'Beep',
|
||||
station: 'Station'
|
||||
};
|
||||
@@ -1264,6 +1269,7 @@
|
||||
function triggerUpload() {
|
||||
if (currentPath === 'config') document.getElementById('upload-config').click();
|
||||
else if (currentPath === 'music') document.getElementById('upload-music').click();
|
||||
else if (currentPath === 'voice') document.getElementById('upload-voice').click();
|
||||
else if (currentPath === 'beep') document.getElementById('upload-general').click();
|
||||
else if (currentPath === 'station') document.getElementById('upload-station').click();
|
||||
}
|
||||
@@ -1366,6 +1372,8 @@
|
||||
let source = '/' + path;
|
||||
if (path.startsWith('Audio/music/')) {
|
||||
source = `/media/audio/music/${encodeURIComponent(path.slice('Audio/music/'.length))}`;
|
||||
} else if (path.startsWith('Audio/voice/')) {
|
||||
source = `/media/audio/voice/${encodeURIComponent(path.slice('Audio/voice/'.length))}`;
|
||||
} else if (path.startsWith('Audio/general/')) {
|
||||
source = `/media/audio/general/${encodeURIComponent(path.slice('Audio/general/'.length))}`;
|
||||
} else if (path.startsWith('Audio/station/')) {
|
||||
|
||||
Reference in New Issue
Block a user