Merge pull request #4132 from CalamitousFelicitousness/dev

Add reload notice to hints
This commit is contained in:
Vladimir Mandic
2025-08-20 08:52:16 -04:00
committed by GitHub
3 changed files with 1311 additions and 1275 deletions
+1275 -1275
View File
File diff suppressed because it is too large Load Diff
+11
View File
@@ -732,6 +732,17 @@ div#extras_scale_to_tab div.form {
background: var(--background-fill-primary) !important;
}
.tooltip-reload-notice {
margin-top: 0.3em;
}
.tooltip-reload-text {
font-size: var(--text-xs);
font-style: italic;
opacity: 0.75;
display: block;
}
.locale {
background-color: var(--input-background-fill);
color: var(--body-text-color);
+25
View File
@@ -122,6 +122,27 @@ async function tooltipShow(e) {
content += `<div class="long-content"><div class="separator"></div>${e.target.dataset.longHint}</div>`;
}
// Add reload notice if needed
if (e.target.dataset.reload) {
const reloadType = e.target.dataset.reload;
let reloadText = '';
if (reloadType === 'model') {
reloadText = 'Requires model reload';
} else if (reloadType === 'server') {
reloadText = 'Requires server restart';
}
if (reloadText) {
content += `
<div class="tooltip-reload-notice">
<div class="separator"></div>
<span class="tooltip-reload-text">${reloadText}</span>
</div>
`;
}
}
localeData.hint.innerHTML = content;
localeData.hint.classList.add('tooltip-show');
@@ -302,6 +323,10 @@ async function setHints(analyze = false) {
if (found.longHint && found.longHint.length > 0) {
el.dataset.longHint = found.longHint;
}
// Set reload type if available
if (found.reload && found.reload.length > 0) {
el.dataset.reload = found.reload;
}
el.addEventListener('mouseover', tooltipShow);
el.addEventListener('mouseout', tooltipHide);
} else {