Centralize icon resolution into core/icons.js, fix auto-start row alignment
- Create core/icons.js with type-resolution getters and icon constants - Replace inline emoji literals across 11 feature files with imports - Remove duplicate icon maps (getEngineIcon, _vsTypeIcons, typeIcons, etc.) - Fix dashboard auto-start row missing metrics placeholder div Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,10 @@ import { API_BASE, getHeaders, fetchWithAuth, escapeHtml } from '../core/api.js'
|
||||
import { t } from '../core/i18n.js';
|
||||
import { lockBody, showToast, showConfirm, formatUptime } from '../core/ui.js';
|
||||
import { Modal } from '../core/modal.js';
|
||||
import { getValueSourceIcon } from './value-sources.js';
|
||||
import {
|
||||
getValueSourceIcon, getPictureSourceIcon,
|
||||
ICON_CLONE, ICON_EDIT, ICON_TEST, ICON_START, ICON_STOP,
|
||||
} from '../core/icons.js';
|
||||
|
||||
class KCEditorModal extends Modal {
|
||||
constructor() {
|
||||
@@ -152,21 +155,21 @@ export function createKCTargetCard(target, sourceMap, patternTemplateMap, valueS
|
||||
<div class="card-actions">
|
||||
${isProcessing ? `
|
||||
<button class="btn btn-icon btn-danger" onclick="stopTargetProcessing('${target.id}')" title="${t('targets.button.stop')}">
|
||||
⏹️
|
||||
${ICON_STOP}
|
||||
</button>
|
||||
` : `
|
||||
<button class="btn btn-icon btn-primary" onclick="startTargetProcessing('${target.id}')" title="${t('targets.button.start')}">
|
||||
▶️
|
||||
${ICON_START}
|
||||
</button>
|
||||
`}
|
||||
<button class="btn btn-icon btn-secondary" onclick="testKCTarget('${target.id}')" title="${t('kc.test')}">
|
||||
🧪
|
||||
${ICON_TEST}
|
||||
</button>
|
||||
<button class="btn btn-icon btn-secondary" onclick="cloneKCTarget('${target.id}')" title="${t('common.clone')}">
|
||||
📋
|
||||
${ICON_CLONE}
|
||||
</button>
|
||||
<button class="btn btn-icon btn-secondary" onclick="showKCEditor('${target.id}')" title="${t('common.edit')}">
|
||||
✏️
|
||||
${ICON_EDIT}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -396,8 +399,7 @@ export async function showKCEditor(targetId = null, cloneData = null) {
|
||||
const opt = document.createElement('option');
|
||||
opt.value = s.id;
|
||||
opt.dataset.name = s.name;
|
||||
const typeIcon = s.stream_type === 'raw' ? '\uD83D\uDDA5\uFE0F' : s.stream_type === 'static_image' ? '\uD83D\uDDBC\uFE0F' : '\uD83C\uDFA8';
|
||||
opt.textContent = `${typeIcon} ${s.name}`;
|
||||
opt.textContent = `${getPictureSourceIcon(s.stream_type)} ${s.name}`;
|
||||
sourceSelect.appendChild(opt);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user