// frontend/static/js/workdir_config.js async function getWorkDirConfig() { if (!currentProfile?.work_dir) { showError('No se ha seleccionado un directorio de trabajo'); return null; } try { return await apiRequest(`/workdir-config/${encodeURIComponent(currentProfile.work_dir)}`); } catch (error) { showError('Error al cargar la configuración del directorio de trabajo'); return null; } } async function getGroupConfig(groupId) { if (!currentProfile?.work_dir) { showError('No se ha seleccionado un directorio de trabajo'); return null; } try { return await apiRequest( `/workdir-config/${encodeURIComponent(currentProfile.work_dir)}/group/${groupId}` ); } catch (error) { showError('Error al cargar la configuración del grupo'); return null; } } async function updateGroupConfig(groupId, settings) { if (!currentProfile?.work_dir) { showError('No se ha seleccionado un directorio de trabajo'); return false; } try { await apiRequest( `/workdir-config/${encodeURIComponent(currentProfile.work_dir)}/group/${groupId}`, { method: 'PUT', body: JSON.stringify(settings) } ); showSuccess('Group configuration updated successfully'); return true; } catch (error) { showError('Failed to update group configuration'); return false; } } function showConfigEditor(config, schema) { const modal = document.createElement('div'); modal.className = 'modal active'; const formContent = Object.entries(schema).map(([key, field]) => `
${currentProfile.work_dir}
${config.version}
${JSON.stringify(settings, null, 2)}