add go bench client

This commit is contained in:
Gilles Soulier
2026-01-11 23:41:30 +01:00
parent c67befc549
commit 6abc70cdfe
80 changed files with 13311 additions and 61 deletions

View File

@@ -26,6 +26,8 @@ async function loadBackendConfig() {
document.addEventListener('DOMContentLoaded', async () => {
loadDisplayPreferences();
loadSettings();
loadTheme();
loadIconPack();
await loadBackendConfig();
});
@@ -37,6 +39,7 @@ function loadDisplayPreferences() {
const temperatureUnit = localStorage.getItem('displayPref_temperatureUnit') || 'C';
const sectionIconSize = localStorage.getItem('displayPref_sectionIconSize') || '32';
const buttonIconSize = localStorage.getItem('displayPref_buttonIconSize') || '24';
const searchEngine = localStorage.getItem('searchEngine') || 'google';
document.getElementById('memoryUnit').value = memoryUnit;
document.getElementById('storageUnit').value = storageUnit;
@@ -44,6 +47,7 @@ function loadDisplayPreferences() {
document.getElementById('temperatureUnit').value = temperatureUnit;
document.getElementById('sectionIconSize').value = sectionIconSize;
document.getElementById('buttonIconSize').value = buttonIconSize;
document.getElementById('searchEngine').value = searchEngine;
// Apply icon sizes
applyIconSizes(sectionIconSize, buttonIconSize);
@@ -63,6 +67,7 @@ function saveDisplayPreferences() {
const temperatureUnit = document.getElementById('temperatureUnit').value;
const sectionIconSize = document.getElementById('sectionIconSize').value;
const buttonIconSize = document.getElementById('buttonIconSize').value;
const searchEngine = document.getElementById('searchEngine').value;
localStorage.setItem('displayPref_memoryUnit', memoryUnit);
localStorage.setItem('displayPref_storageUnit', storageUnit);
@@ -70,6 +75,7 @@ function saveDisplayPreferences() {
localStorage.setItem('displayPref_temperatureUnit', temperatureUnit);
localStorage.setItem('displayPref_sectionIconSize', sectionIconSize);
localStorage.setItem('displayPref_buttonIconSize', buttonIconSize);
localStorage.setItem('searchEngine', searchEngine);
// Apply icon sizes immediately
applyIconSizes(sectionIconSize, buttonIconSize);
@@ -226,6 +232,80 @@ async function copyToken() {
}
}
// ==========================================
// THEME MANAGEMENT
// ==========================================
function loadTheme() {
const currentTheme = window.ThemeManager ? window.ThemeManager.getCurrentTheme() : 'monokai-dark';
const select = document.getElementById('themeSelect');
if (select) {
select.value = currentTheme;
}
}
function saveTheme() {
const select = document.getElementById('themeSelect');
if (!select) return;
const theme = select.value;
if (window.ThemeManager) {
window.ThemeManager.applyTheme(theme);
showToast(`Thème "${theme}" appliqué avec succès`, 'success');
} else {
console.error('ThemeManager not available');
showToast('Erreur: ThemeManager non disponible', 'error');
}
}
// ==========================================
// ICON PACK MANAGEMENT
// ==========================================
function loadIconPack() {
const currentPack = window.IconManager ? window.IconManager.getCurrentPack() : 'fontawesome-regular';
const select = document.getElementById('iconPackSelect');
if (select) {
select.value = currentPack;
}
// Initialize icon preview
if (window.IconManager) {
const preview = document.getElementById('iconPreview');
if (preview) {
window.IconManager.inlineSvgIcons(preview);
}
}
}
function saveIconPack() {
const select = document.getElementById('iconPackSelect');
if (!select) return;
const pack = select.value;
if (window.IconManager) {
const success = window.IconManager.applyPack(pack);
if (success) {
showToast(`Pack d'icônes "${pack}" appliqué avec succès`, 'success');
// Refresh preview
const preview = document.getElementById('iconPreview');
if (preview) {
setTimeout(() => {
window.IconManager.inlineSvgIcons(preview);
}, 100);
}
} else {
showToast('Erreur lors de l\'application du pack d\'icônes', 'error');
}
} else {
console.error('IconManager not available');
showToast('Erreur: IconManager non disponible', 'error');
}
}
// Make functions available globally
window.generateBenchCommand = generateBenchCommand;
window.copyGeneratedCommand = copyGeneratedCommand;
@@ -233,3 +313,5 @@ window.toggleTokenVisibility = toggleTokenVisibility;
window.copyToken = copyToken;
window.saveDisplayPreferences = saveDisplayPreferences;
window.resetDisplayPreferences = resetDisplayPreferences;
window.saveTheme = saveTheme;
window.saveIconPack = saveIconPack;