190 build попытка 2
This commit is contained in:
@@ -2934,11 +2934,8 @@
|
||||
const selectedDevice = devices.find((item) => String(item.device_id || "") === selectedDeviceId) || null;
|
||||
const profileButtons = profiles.length ? profiles.map((item) => {
|
||||
const isUsed = Boolean(selectedDevice?.mapping && Number(selectedDevice.mapping.source_profile_id || selectedDevice.mapping.id || 0) === Number(item.id));
|
||||
<<<<<<< HEAD
|
||||
const isCurrent = isUsed && Number(selectedDevice.mapping.version || 1) === Number(item.version || 1);
|
||||
const publishLabel = isUsed && !isCurrent ? `Обновить мой Agent с v${Number(selectedDevice.mapping.version || 1)} до v${Number(item.version || 1)}` : (isCurrent ? "Эта версия используется на моём Agent" : "Применить к моему Agent");
|
||||
=======
|
||||
>>>>>>> e4bedb1264fca8a6bc8a41f0ca1ff67b176c6651
|
||||
return `
|
||||
<div class="hockey-mapping-profile-row ${profile?.id === item.id ? "is-active" : ""}">
|
||||
<button type="button" class="hockey-mapping-profile ${profile?.id === item.id ? "is-active" : ""}" data-mapping-profile="${item.id}" title="Открыть и редактировать конфиг">
|
||||
@@ -2946,11 +2943,7 @@
|
||||
<small>v${Number(item.version || 1)} · ${Number(item.field_count || 0)} связей${item.created_by ? ` · ${escapeHtml(item.created_by)}` : ""}</small>
|
||||
</button>
|
||||
<div class="hockey-map-profile-actions">
|
||||
<<<<<<< HEAD
|
||||
<button type="button" class="hockey-map-profile-icon hockey-map-use-profile ${isCurrent ? "is-used" : ""}" data-map-use-profile="${item.id}" title="${publishLabel}" aria-label="${publishLabel}">${isCurrent ? "✓" : (isUsed ? "↻" : "▶")}</button>
|
||||
=======
|
||||
<button type="button" class="hockey-map-profile-icon hockey-map-use-profile ${isUsed ? "is-used" : ""}" data-map-use-profile="${item.id}" title="${isUsed ? "Этот конфиг уже используется на моём Agent" : "Применить к моему Agent"}" aria-label="${isUsed ? "Используется на моём Agent" : "Применить к моему Agent"}">${isUsed ? "✓" : "▶"}</button>
|
||||
>>>>>>> e4bedb1264fca8a6bc8a41f0ca1ff67b176c6651
|
||||
<button type="button" class="hockey-map-profile-icon hockey-map-copy-profile" data-map-copy-profile="${item.id}" title="Копировать конфиг" aria-label="Копировать конфиг">⧉</button>
|
||||
<button type="button" class="hockey-map-profile-icon hockey-map-rename-profile" data-map-rename-profile="${item.id}" title="Переименовать конфиг" aria-label="Переименовать конфиг">✎</button>
|
||||
<button type="button" class="hockey-map-profile-icon hockey-map-delete-profile" data-map-delete-profile="${item.id}" title="Удалить конфиг" aria-label="Удалить конфиг">×</button>
|
||||
@@ -3458,7 +3451,6 @@
|
||||
try {
|
||||
const renamed = await request(`/api/hockey/admin/vmix-mapping/profiles/${profileId}`, {
|
||||
method: "PUT",
|
||||
<<<<<<< HEAD
|
||||
body: JSON.stringify({ expected_version: item.version, name, description: item.description || "", active: item.active !== false }),
|
||||
});
|
||||
item.name = renamed.name || name;
|
||||
@@ -3469,14 +3461,6 @@
|
||||
state.mappingActiveProfile.name = item.name;
|
||||
state.mappingActiveProfile.version = item.version;
|
||||
}
|
||||
=======
|
||||
body: JSON.stringify({ name, description: item.description || "", active: item.active !== false }),
|
||||
});
|
||||
item.name = renamed.name || name;
|
||||
item.description = renamed.description || item.description || "";
|
||||
item.updated_at = renamed.updated_at || item.updated_at;
|
||||
if (Number(state.mappingActiveProfile?.id || 0) === profileId) state.mappingActiveProfile.name = item.name;
|
||||
>>>>>>> e4bedb1264fca8a6bc8a41f0ca1ff67b176c6651
|
||||
setStatus(`Mapping переименован: «${item.name}».`);
|
||||
} catch (error) { setStatus(error.message || "Не удалось переименовать Mapping-конфиг", true); }
|
||||
renderMapping();
|
||||
@@ -3946,14 +3930,8 @@
|
||||
if (currentScroll) state.mappingVmixScrollTop = currentScroll.scrollTop;
|
||||
const id = state.mappingActiveProfile.id;
|
||||
try {
|
||||
<<<<<<< HEAD
|
||||
const result = await request(`/api/hockey/admin/vmix-mapping/profiles/${id}/configuration`, { method: "PUT", body: JSON.stringify({ expected_version: state.mappingActiveProfile.version, name: modal.querySelector("[data-mapping-name]")?.value || state.mappingActiveProfile.name, description: modal.querySelector("[data-mapping-description]")?.value || "", active: modal.querySelector("[data-mapping-active]") ? Boolean(modal.querySelector("[data-mapping-active]")?.checked) : state.mappingActiveProfile.active !== false, fields: collectMappingFields() }) });
|
||||
await loadMapping(id); setStatus(`Mapping сохранён · версия ${result.version}. Для обновления своего Agent нажмите ▶ или ↻ рядом с конфигом.`);
|
||||
=======
|
||||
await request(`/api/hockey/admin/vmix-mapping/profiles/${id}`, { method: "PUT", body: JSON.stringify({ name: modal.querySelector("[data-mapping-name]")?.value || state.mappingActiveProfile.name, description: modal.querySelector("[data-mapping-description]")?.value || "", active: modal.querySelector("[data-mapping-active]") ? Boolean(modal.querySelector("[data-mapping-active]")?.checked) : state.mappingActiveProfile.active !== false }) });
|
||||
const result = await request(`/api/hockey/admin/vmix-mapping/profiles/${id}/fields`, { method: "PUT", body: JSON.stringify({ fields: collectMappingFields() }) });
|
||||
await loadMapping(id); setStatus(`Mapping сохранён · версия ${result.version}.`);
|
||||
>>>>>>> e4bedb1264fca8a6bc8a41f0ca1ff67b176c6651
|
||||
} catch (error) { setStatus(error.message, true); }
|
||||
renderMapping();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user