bring back the green refresh button

pull/277/head
butaixianran 2024-03-06 14:59:38 +08:00
parent 302ba65cc4
commit 669c43c02c
3 changed files with 25 additions and 1 deletions

View File

@ -229,6 +229,9 @@ Since v1.5.5, we've already optimized the SHA256 function to the top. So the onl
# Change Log3
## v1.10.2
* Bring back this addon's green refresh button to SD webui v1.8.x
## v1.10.1
* Handle model path cases for linux

View File

@ -1145,11 +1145,32 @@ onUiLoaded(() => {
refresh_btn.onclick = function(event){
console.log("run refresh button on click");
//official's refresh function
//it will send msg to python to reload card list and won't wait for that.
extraNetworksControlRefreshOnClick(event, prefix, js_model_type);
//this will not get card list if cards need to be reloaded from python side.
//user need to click refresh button again, after card list is reloaded.
//which does not feel right by user.
//so, this addon's green refresh button is still needed.
update_card_for_civitai_with_sd1_8();
};
// add refresh button to toolbar
let ch_refresh = document.createElement("button");
ch_refresh.innerHTML = "🔁";
ch_refresh.title = "Refresh Civitai Helper's additional buttons";
ch_refresh.className = "extra-network-control--refresh";
ch_refresh.style.fontSize = "150%";
ch_refresh.onclick = update_card_for_civitai_with_sd1_8;
//extra_toolbar now is displayed as grid
//also grid-template-columns is set to: minmax(0, auto) repeat(4, min-content)
//which only allow 4 buttons
//so here we modify it into 5 to add another refresh button for this addon
extra_toolbar.style.gridTemplateColumns = "minmax(0, auto) repeat(5, min-content)";
extra_toolbar.appendChild(ch_refresh);
}

View File

@ -6,7 +6,7 @@ import requests
import shutil
version = "1.10.1"
version = "1.10.2"
def_headers = {'User-Agent': 'Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',
"Authorization": ""}