add model count feedback to refresh button: shows loading state and final count
This commit is contained in:
parent
cd218cc4a1
commit
595ac0a597
1 changed files with 26 additions and 1 deletions
|
|
@ -502,7 +502,32 @@ async function openUncloseaiEmbeddedModalNew() {
|
|||
actionsGrid.className = "uncloseai-grid-actions";
|
||||
|
||||
const actions = [
|
||||
{ text: getUIText("refreshModels"), action: loadModels },
|
||||
{
|
||||
text: getUIText("refreshModels"),
|
||||
action: async () => {
|
||||
const button = event.target;
|
||||
const originalText = button.textContent;
|
||||
button.textContent = "🔄 Loading...";
|
||||
button.disabled = true;
|
||||
|
||||
try {
|
||||
await loadModels();
|
||||
// Show model count briefly
|
||||
const modelCount = modelSelect.options.length;
|
||||
button.textContent = `✅ ${modelCount} models`;
|
||||
setTimeout(() => {
|
||||
button.textContent = originalText;
|
||||
button.disabled = false;
|
||||
}, 2000);
|
||||
} catch (error) {
|
||||
button.textContent = "❌ Failed";
|
||||
setTimeout(() => {
|
||||
button.textContent = originalText;
|
||||
button.disabled = false;
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
text: getUIText("clearChat"),
|
||||
action: async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue