fix(web): remove LLM provider restart notices now that hot-reload is supported

LLM provider changes (switch/add/configure/update) now apply without a
restart, so the inline "Changes take effect after restart" banner in the
LLM Providers section, the mirrored banner in the Inference settings
panel, and the "(restart to apply)" suffix on the provider toasts are
all stale. Drops the HTML banner, the dynamic mirror in settings.js,
the three show-calls in config.js, the now-unused .config-notice CSS,
the config.restartNotice i18n key, and the suffix from providerConfigured
/ providerActivated / providerAdded / providerUpdated across en / zh-CN
/ ko. RESTART_REQUIRED_KEYS (embeddings, tunnel, gateway) is untouched —
those still require a restart.
This commit is contained in:
italic-jinxin
2026-04-23 18:30:23 +08:00
parent 9f3d8936f3
commit 27c70552f4
7 changed files with 12 additions and 53 deletions

View File

@@ -455,7 +455,6 @@ I18n.register('en', {
'config.modelProviders': 'Model Providers',
'config.addProvider': '+ Add Provider',
'config.newProvider': 'New Provider',
'config.restartNotice': 'Changes take effect after restart.',
'config.builtin': 'built-in',
'config.useProvider': 'Use',
'config.configureProvider': 'Configure',
@@ -463,7 +462,7 @@ I18n.register('en', {
'config.configureToUse': 'Configure the API key before using this provider.',
'config.baseUrlRequired': 'Base URL is required. Please configure the provider first.',
'config.modelRequired': 'A model must be configured before using this provider.',
'config.providerConfigured': 'Provider "{name}" configured (restart to apply)',
'config.providerConfigured': 'Provider "{name}" configured',
'config.currentModel': 'Model: {model}',
'config.providerName': 'Display Name',
'config.providerNamePlaceholder': 'My Provider',
@@ -480,9 +479,9 @@ I18n.register('en', {
'config.apiKeyFromEnv': 'Key set via environment variable',
'config.apiKeyEnter': 'Enter API key',
'config.providerModel': 'Default Model',
'config.providerActivated': 'Switched to {name} (restart to apply)',
'config.providerAdded': 'Added provider "{name}" (restart to apply)',
'config.providerUpdated': 'Provider "{name}" updated (restart to apply)',
'config.providerActivated': 'Switched to {name}',
'config.providerAdded': 'Added provider "{name}"',
'config.providerUpdated': 'Provider "{name}" updated',
'config.editProvider': 'Edit Provider',
'config.providerDeleted': 'Provider deleted',
'config.confirmDeleteProvider': 'Delete provider "{id}"?',

View File

@@ -454,7 +454,6 @@ I18n.register('ko', {
'config.modelProviders': '모델 공급자',
'config.addProvider': '+ 공급자 추가',
'config.newProvider': '새 공급자',
'config.restartNotice': '변경 사항은 재시작 후 적용됩니다.',
'config.builtin': '내장',
'config.useProvider': '사용',
'config.configureProvider': '구성',
@@ -462,7 +461,7 @@ I18n.register('ko', {
'config.configureToUse': '이 공급자를 사용하기 전에 API 키를 구성하세요.',
'config.baseUrlRequired': '베이스 URL이 필요합니다. 먼저 공급자를 구성하세요.',
'config.modelRequired': '이 공급자를 사용하기 전에 모델을 구성해야 합니다.',
'config.providerConfigured': '공급자 "{name}"이(가) 구성되었습니다 (재시작 필요)',
'config.providerConfigured': '공급자 "{name}"이(가) 구성되었습니다',
'config.currentModel': '모델: {model}',
'config.providerName': '표시 이름',
'config.providerNamePlaceholder': '내 공급자',
@@ -479,9 +478,9 @@ I18n.register('ko', {
'config.apiKeyFromEnv': '환경 변수로 키 설정됨',
'config.apiKeyEnter': 'API 키 입력',
'config.providerModel': '기본 모델',
'config.providerActivated': '{name}으로 전환됨 (재시작 필요)',
'config.providerAdded': '공급자 "{name}"이(가) 추가되었습니다 (재시작 필요)',
'config.providerUpdated': '공급자 "{name}"이(가) 업데이트되었습니다 (재시작 필요)',
'config.providerActivated': '{name}으로 전환됨',
'config.providerAdded': '공급자 "{name}"이(가) 추가되었습니다',
'config.providerUpdated': '공급자 "{name}"이(가) 업데이트되었습니다',
'config.editProvider': '공급자 편집',
'config.providerDeleted': '공급자가 삭제되었습니다',
'config.confirmDeleteProvider': '공급자 "{id}"을(를) 삭제하시겠습니까?',

View File

@@ -454,7 +454,6 @@ I18n.register('zh-CN', {
'config.modelProviders': '模型提供商',
'config.addProvider': '+ 添加提供商',
'config.newProvider': '新建提供商',
'config.restartNotice': '更改将在重启后生效。',
'config.builtin': '内置',
'config.useProvider': '使用',
'config.configureProvider': '配置',
@@ -462,7 +461,7 @@ I18n.register('zh-CN', {
'config.configureToUse': '请先配置 API 密钥后再使用此提供商。',
'config.baseUrlRequired': '需要配置基础 URL请先配置此提供商。',
'config.modelRequired': '使用此提供商前需要配置模型。',
'config.providerConfigured': '提供商 "{name}" 已配置(重启后生效)',
'config.providerConfigured': '提供商 "{name}" 已配置',
'config.currentModel': '模型:{model}',
'config.providerName': '显示名称',
'config.providerNamePlaceholder': '我的提供商',
@@ -479,9 +478,9 @@ I18n.register('zh-CN', {
'config.apiKeyFromEnv': '密钥已通过环境变量设置',
'config.apiKeyEnter': '输入 API 密钥',
'config.providerModel': '默认模型',
'config.providerActivated': '已切换到 {name}(重启后生效)',
'config.providerAdded': '已添加提供商 "{name}"(重启后生效)',
'config.providerUpdated': '提供商 "{name}" 已更新(重启后生效)',
'config.providerActivated': '已切换到 {name}',
'config.providerAdded': '已添加提供商 "{name}"',
'config.providerUpdated': '提供商 "{name}" 已更新',
'config.editProvider': '编辑提供商',
'config.providerDeleted': '提供商已删除',
'config.confirmDeleteProvider': '确定删除提供商 "{id}"',

View File

@@ -447,10 +447,6 @@
<h3 data-i18n="config.modelProviders">Model Providers</h3>
<button id="add-provider-btn" class="btn-add-provider" data-i18n="config.addProvider">+ Add Provider</button>
</div>
<div class="config-notice" id="config-restart-notice" style="display:none">
<span></span>
<span data-i18n="config.restartNotice">Changes take effect after restart.</span>
</div>
<div id="providers-list" class="providers-list">
<div class="empty-state" data-i18n="common.loading">Loading...</div>
</div>

View File

@@ -259,9 +259,6 @@ function setActiveProvider(id) {
renderProviders();
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'));
@@ -484,11 +481,6 @@ document.getElementById('save-provider-btn').addEventListener('click', () => {
if (isActive) loadInferenceSettings();
resetProviderForm();
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 }));
})
.catch((e) => {
@@ -539,11 +531,6 @@ document.getElementById('save-provider-btn').addEventListener('click', () => {
if (isActive) loadInferenceSettings();
resetProviderForm();
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) => {
_customProviders[idx] = original;

View File

@@ -193,14 +193,6 @@ 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 =

View File

@@ -28,19 +28,6 @@
transform: translateY(-1px);
}
.config-notice {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 12px;
background: rgba(245, 166, 35, 0.1);
border: 1px solid rgba(245, 166, 35, 0.3);
border-radius: var(--radius);
color: var(--warning);
font-size: 13px;
margin-bottom: 12px;
}
.providers-list {
display: flex;
flex-direction: column;