feat(web): add restart notice to LLM Provider settings

This commit is contained in:
italic-jinxin
2026-03-27 17:46:08 +08:00
parent 42f6dbdfe9
commit ca80be6d97
2 changed files with 28 additions and 0 deletions
+14
View File
@@ -5181,6 +5181,14 @@ function loadInferenceSettings() {
title.textContent = I18n.t('cfg.group.llm');
group.appendChild(title);
var notice = document.createElement('div');
notice.className = 'config-notice';
notice.id = 'llm-restart-notice';
var restartNoticeEl = document.getElementById('config-restart-notice');
notice.style.display = (restartNoticeEl && restartNoticeEl.style.display !== 'none') ? 'flex' : 'none';
notice.innerHTML = '<span>\u26A0</span><span>' + escapeHtml(I18n.t('config.restartNotice')) + '</span>';
group.appendChild(notice);
var backendRow = document.createElement('div');
backendRow.className = 'settings-row';
backendRow.innerHTML =
@@ -6338,6 +6346,8 @@ function setActiveProvider(id) {
loadInferenceSettings();
scrollToProviders();
document.getElementById('config-restart-notice').style.display = 'flex';
var llmNotice = document.getElementById('llm-restart-notice');
if (llmNotice) llmNotice.style.display = 'flex';
showToast(I18n.t('config.providerActivated', { name: id }));
})
.catch((e) => showToast(I18n.t('error.unknown') + ': ' + e.message, 'error'));
@@ -6563,6 +6573,8 @@ document.getElementById('save-provider-btn').addEventListener('click', () => {
scrollToProviders();
if (isActive) {
document.getElementById('config-restart-notice').style.display = 'flex';
var llmNotice = document.getElementById('llm-restart-notice');
if (llmNotice) llmNotice.style.display = 'flex';
}
showToast(I18n.t('config.providerConfigured', { name: id }));
})
@@ -6616,6 +6628,8 @@ document.getElementById('save-provider-btn').addEventListener('click', () => {
scrollToProviders();
if (isActive) {
document.getElementById('config-restart-notice').style.display = 'flex';
var llmNotice = document.getElementById('llm-restart-notice');
if (llmNotice) llmNotice.style.display = 'flex';
}
showToast(I18n.t('config.providerUpdated', { name }));
}).catch((e) => {
+14
View File
@@ -2801,10 +2801,22 @@ body {
padding: var(--space-4);
}
#settings-inference > .extensions-container {
display: flex;
flex-direction: column;
}
.extensions-section {
margin-bottom: 24px;
}
#providers-section {
flex: 1;
min-height: 0;
display: flex;
flex-direction: column;
}
.extensions-section h3 {
font-size: var(--text-xs);
font-weight: 600;
@@ -5484,6 +5496,8 @@ body.theme-transition *:not(svg):not(path):not(line):not(circle):not(rect) {
display: flex;
flex-direction: column;
gap: 8px;
min-height: 420px;
overflow-y: auto;
}
.provider-card {