Add HttpClient.post, dummy-only, remove reconcile, v1.0.7

This commit is contained in:
2026-07-24 07:49:37 +04:00
parent 68306764cf
commit 098cc2ace6
3 changed files with 18 additions and 6 deletions
+11 -5
View File
@@ -94,11 +94,17 @@
<script>
let selectedSvc=null, selectedOp=null, svcInstances=[];
// Load services
fetch('/api/services').then(r=>r.json()).then(data=>{
// Load services — only dummy for now
(async function(){
const el=document.getElementById('svc-list');
el.innerHTML=data.map(s=>`<div class="svc-item" data-svc-id="${s.svcId}" onclick="selectService(${s.svcId})">${s.svcId}. ${s.svc}${s.svcExtendedName?' — '+s.svcExtendedName:''}</div>`).join('');
});
try{
const r=await fetch('/api/services');
const data=await r.json();
const dummy=data.find(s=>s.svcId===1);
if(dummy) el.innerHTML=`<div class="svc-item active" data-svc-id="1" onclick="selectService(1)">1. ${dummy.svc}</div>`;
selectService(1);
}catch(e){el.innerHTML='<span style="color:var(--destructive);font-size:11px;">Ошибка загрузки</span>';}
})();
async function selectService(svcId){
selectedSvc=svcId; selectedOp=null;
@@ -117,7 +123,7 @@ async function selectService(svcId){
document.getElementById('ops-title').textContent=d.svc+' — операции';
const opsList=document.getElementById('ops-list');
opsList.innerHTML=d.operations.map(o=>{
opsList.innerHTML=d.operations.filter(o=>o.operation!=='reconcile').map(o=>{
let disabled=!hasInstance && o.operation!=='create';
if(hasInstance && o.operation==='create') disabled=true;
if(o.operation==='reconcile') disabled=false;