diff options
author | AUTOMATIC <16777216c@gmail.com> | 2023-01-18 03:13:45 +0000 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-01-18 03:13:45 +0000 |
commit | dac59b9b073f86508d3ec787ff731af2e101fbcc (patch) | |
tree | 8fe0de61766417858ada500a61a392509517bd68 | |
parent | 3a0d6b77295162146d0a8d04278804334da6f1b4 (diff) | |
download | stable-diffusion-webui-gfx803-dac59b9b073f86508d3ec787ff731af2e101fbcc.tar.gz stable-diffusion-webui-gfx803-dac59b9b073f86508d3ec787ff731af2e101fbcc.tar.bz2 stable-diffusion-webui-gfx803-dac59b9b073f86508d3ec787ff731af2e101fbcc.zip |
return progress percentage to title bar
-rw-r--r-- | javascript/progressbar.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/javascript/progressbar.js b/javascript/progressbar.js index da6709bc..b8473ebf 100644 --- a/javascript/progressbar.js +++ b/javascript/progressbar.js @@ -106,6 +106,19 @@ function formatTime(secs){ } } +function setTitle(progress){ + var title = 'Stable Diffusion' + + if(opts.show_progress_in_title && progress){ + title = '[' + progress.trim() + '] ' + title; + } + + if(document.title != title){ + document.title = title; + } +} + + function randomId(){ return "task(" + Math.random().toString(36).slice(2, 7) + Math.random().toString(36).slice(2, 7) + Math.random().toString(36).slice(2, 7)+")" } @@ -133,6 +146,7 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre parentGallery.insertBefore(livePreview, gallery) var removeProgressBar = function(){ + setTitle("") parentProgressbar.removeChild(divProgress) parentGallery.removeChild(livePreview) atEnd() @@ -165,6 +179,7 @@ function requestProgress(id_task, progressbarContainer, gallery, atEnd, onProgre progressText += " " + res.textinfo } + setTitle(progressText) divInner.textContent = progressText var elapsedFromStart = (new Date() - dateStart) / 1000 |