mirror of
https://github.com/jahruz67/wisp-open.git
synced 2026-08-08 18:14:08 +00:00
feat: implement enhanced Linux hotkey handling and add command copying functionality
This commit is contained in:
+30
-2
@@ -333,7 +333,16 @@
|
||||
const settings = await window.go.main.App.GetSettings();
|
||||
|
||||
document.getElementById('apiKey').value = settings.api_key || '';
|
||||
document.getElementById('shortcutInput').value = settings.shortcut || 'alt+z';
|
||||
const shortcutInput = document.getElementById('shortcutInput');
|
||||
if (shortcutInput) {
|
||||
shortcutInput.value = settings.shortcut || 'alt+z';
|
||||
}
|
||||
if (settings.linux_press_mode) {
|
||||
const section = document.getElementById('linuxPressSection');
|
||||
const cmdInput = document.getElementById('linuxPressCommand');
|
||||
if (section) section.style.display = 'block';
|
||||
if (cmdInput) cmdInput.value = settings.linux_press_command || '';
|
||||
}
|
||||
document.getElementById('whisperModel').value = settings.whisper_model || 'whisper-large-v3-turbo';
|
||||
document.getElementById('aiModel').value = settings.ai_model || 'llama-3.3-70b-versatile';
|
||||
document.getElementById('aiPrompt').value = settings.ai_prompt || '';
|
||||
@@ -407,6 +416,25 @@
|
||||
showSaveStatus('Prompt saved');
|
||||
};
|
||||
|
||||
window.copyLinuxPressCommand = async function () {
|
||||
const cmdInput = document.getElementById('linuxPressCommand');
|
||||
if (!cmdInput) return;
|
||||
|
||||
const command = cmdInput.value || '';
|
||||
try {
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
await navigator.clipboard.writeText(command);
|
||||
} else {
|
||||
cmdInput.focus();
|
||||
cmdInput.select();
|
||||
document.execCommand('copy');
|
||||
}
|
||||
showSaveStatus('Command copied');
|
||||
} catch (err) {
|
||||
console.error('Failed to copy Linux command:', err);
|
||||
}
|
||||
};
|
||||
|
||||
window.toggleStartup = async function () {
|
||||
await window.go.main.App.ToggleStartup(document.getElementById('startupToggle').checked);
|
||||
};
|
||||
@@ -560,4 +588,4 @@
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user