context menus

This commit is contained in:
Vladimir Mandic
2023-11-03 11:41:08 -04:00
parent 996344c6f7
commit da3d5d0fc7
8 changed files with 105 additions and 32 deletions
+8 -2
View File
@@ -1,4 +1,4 @@
let nvmlInterval = true; // eslint-disable-line prefer-const
let nvmlInterval = null; // eslint-disable-line prefer-const
let nvmlEl = null;
let nvmlTable = null;
@@ -60,7 +60,13 @@ async function initNVML() {
gradioApp().appendChild(nvmlEl);
log('initNVML');
}
nvmlInterval = setInterval(updateNVML, 1000);
if (nvmlInterval) {
clearInterval(nvmlInterval);
nvmlInterval = null;
nvmlEl.style.display = 'none';
} else {
nvmlInterval = setInterval(updateNVML, 1000);
}
}
async function disableNVML() {