This commit is contained in:
2025-03-10 10:50:06 +08:00
commit 81c79275aa
65 changed files with 3648 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import { saveAppConfig } from './electron.js';
window.onload = async () => {
const config = await saveAppConfig();
const pageApi = document.getElementById('pageApi');
const saveResult = document.getElementById('save-result');
pageApi.value = config?.pageApi || 'https://kevisual.silkyai.cn';
console.log('config', config);
const form = document.getElementById('configForm');
// Handle form submission
form.addEventListener('submit', async (e) => {
e.preventDefault();
const config = {
pageApi: pageApi.value,
};
const result = await saveAppConfig(config);
const newPageApi = result?.pageApi || '';
saveResult.innerHTML = `<h1>保存成功</h1>
<p>new pageApi: ${newPageApi}</p>
<button id="relunch">重启</button>`;
const relunchButton = document.getElementById('relunch');
relunchButton.addEventListener('click', () => {
window.electron.ipcRenderer.invoke('relunch');
});
});
};