remove verbose log of webgui

1123
ZhangGe6 4 years ago
parent 131362ce61
commit 43a693dd9d

@ -51,6 +51,7 @@ Click the url in the output info generated by flask (`http://127.0.0.1:5000/` fo
## launch from executable file
<details>
<summary>Click to expand</summary>
- Windows: Download [onnx-modifier.exe (27.6MB)](https://drive.google.com/file/d/1y7mYlvF0G5iiNDgOFh1ESXlTs8I2ipVQ/view?usp=sharing), double-click it and enjoy.
- Edge browser is used for runtime environment by default.

@ -359,30 +359,32 @@ host.BrowserHost = class {
// informs flaskwebgui to keep server running while gui is running
// as illusrated in https://github.com/ClimenteA/flaskwebgui#install
// and here: https://stackoverflow.com/questions/39993676/code-inside-domcontentloaded-event-not-working
async function getRequest(url='') {
const response = await fetch(url, {
method: 'GET',
cache: 'no-cache'
})
return response.json()
}
if (this.document.readyState !== 'loading') {
console.log('document is already ready, just execute code here');
let url = this.document.location
let route = "/flaskwebgui-keep-server-alive"
// let interval_request = 3 * 1000 //sec
let interval_request = 0.5 * 1000 //sec
function keep_alive_server(){
getRequest(url + route)
.then(data => {})
// .then(data => console.log(data))
}
setInterval(keep_alive_server, interval_request)
}
// ============ to make webgui applications, the following code block shoud be added. ============ //
// async function getRequest(url='') {
// const response = await fetch(url, {
// method: 'GET',
// cache: 'no-cache'
// })
// return response.json()
// }
// if (this.document.readyState !== 'loading') {
// console.log('document is already ready, just execute code here');
// let url = this.document.location
// let route = "/flaskwebgui-keep-server-alive"
// // let interval_request = 3 * 1000 //sec
// let interval_request = 0.5 * 1000 //sec
// function keep_alive_server(){
// getRequest(url + route)
// .then(data => {})
// // .then(data => console.log(data))
// }
// setInterval(keep_alive_server, interval_request)
// }
// ============ to make webgui applications, the above code block shoud be added. ============ //
}

Loading…
Cancel
Save