Add reset button and functionality
This commit is contained in:
parent
6a846e3ffd
commit
56db03f8ad
|
|
@ -221,7 +221,8 @@
|
|||
<button onclick="chooseCertificate()" id="custom-cert-path-button">
|
||||
Choose certificate file
|
||||
</button>
|
||||
<p class="hidden" id="custom-cert-path-text"></p>
|
||||
<span class="hidden" id="custom-cert-path-text"></span>
|
||||
<button class="hidden" onclick="resetCertificate()" id="custom-cert-path-reset">Reset</button>
|
||||
</div>
|
||||
<button
|
||||
type="submit"
|
||||
|
|
|
|||
20
myApp.js
20
myApp.js
|
|
@ -672,15 +672,33 @@ ipcMain.on('choose-certificate', () => {
|
|||
mb.window.webContents.executeJavaScript(
|
||||
'document.getElementById("custom-cert-path-button").classList.add("hidden")',
|
||||
);
|
||||
mb.window.webContents.executeJavaScript(
|
||||
`document.getElementById("custom-cert-path-text").innerText="${filepath}"`,
|
||||
);
|
||||
mb.window.webContents.executeJavaScript(
|
||||
'document.getElementById("custom-cert-path-text").classList.remove("hidden")',
|
||||
);
|
||||
mb.window.webContents.executeJavaScript(
|
||||
`document.getElementById("custom-cert-path-text").innerText="${filepath}"`,
|
||||
'document.getElementById("custom-cert-path-reset").classList.remove("hidden")',
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
ipcMain.on('reset-certificate', () => {
|
||||
mb.window.webContents.executeJavaScript(
|
||||
'document.getElementById("custom-cert-path-button").classList.remove("hidden")',
|
||||
);
|
||||
mb.window.webContents.executeJavaScript(
|
||||
'document.getElementById("custom-cert-path-text").innerText=""',
|
||||
);
|
||||
mb.window.webContents.executeJavaScript(
|
||||
'document.getElementById("custom-cert-path-text").classList.add("hidden")',
|
||||
);
|
||||
mb.window.webContents.executeJavaScript(
|
||||
'document.getElementById("custom-cert-path-reset").classList.add("hidden")',
|
||||
);
|
||||
});
|
||||
|
||||
ipcMain.on('start-login', () => {
|
||||
startLogin();
|
||||
});
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ const api = {
|
|||
changeKeepVisible: (value) => ipcRenderer.send('change-keep-visible', value),
|
||||
changeShowDockIcon: (value) => ipcRenderer.send('change-show-dock-icon', value),
|
||||
chooseCertificate: () => ipcRenderer.send('choose-certificate'),
|
||||
resetCertificate: () => ipcRenderer.send('reset-certificate'),
|
||||
startLogin: () => ipcRenderer.send('start-login'),
|
||||
startManualLogin: (value) => ipcRenderer.send('start-manual-login', value),
|
||||
logout: () => ipcRenderer.send('logout'),
|
||||
|
|
|
|||
|
|
@ -134,6 +134,10 @@ function chooseCertificate() {
|
|||
window.electron.chooseCertificate();
|
||||
}
|
||||
|
||||
function resetCertificate() {
|
||||
window.electron.resetCertificate();
|
||||
}
|
||||
|
||||
function startLogin() {
|
||||
window.electron.startLogin();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue