v1.0.68: operation name shown after OK + muted operation buttons
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ from routes.main import bp as main_bp
|
||||
from routes.api import bp as api_bp
|
||||
from routes.api_test import bp as api_test_bp
|
||||
|
||||
VERSION = "1.0.67"
|
||||
VERSION = "1.0.68"
|
||||
|
||||
app = Flask(__name__, template_folder="templates", static_folder="static")
|
||||
app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-dev.ngcloud.ru/api/v1/svc")
|
||||
|
||||
@@ -18,6 +18,20 @@
|
||||
.inst-ops { display:none; margin-left:16px; }
|
||||
.inst-ops.open { display:flex; flex-wrap:wrap; gap:4px; padding:4px 0; }
|
||||
.btn-sm { height:24px; font-size:11px; padding:0 8px; }
|
||||
.op-btn { border-color:#d1d5db; color:#374151; background:#f8fafc; }
|
||||
.op-btn:hover { background:#eef2f7; }
|
||||
.op-btn-modify { background:#eef2ff; border-color:#c7d2fe; color:#3730a3; }
|
||||
.op-btn-modify:hover { background:#e0e7ff; }
|
||||
.op-btn-suspend { background:#fff7ed; border-color:#fed7aa; color:#9a3412; }
|
||||
.op-btn-suspend:hover { background:#ffedd5; }
|
||||
.op-btn-resume { background:#ecfeff; border-color:#a5f3fc; color:#155e75; }
|
||||
.op-btn-resume:hover { background:#cffafe; }
|
||||
.op-btn-delete { background:#fef2f2; border-color:#fecaca; color:#b91c1c; }
|
||||
.op-btn-delete:hover { background:#fee2e2; }
|
||||
.op-btn-redeploy { background:#f5f3ff; border-color:#ddd6fe; color:#6d28d9; }
|
||||
.op-btn-redeploy:hover { background:#ede9fe; }
|
||||
.op-btn-reconcile { background:#f8fafc; border-color:#dbe4ea; color:#475569; }
|
||||
.op-btn-reconcile:hover { background:#eef2f7; }
|
||||
.param-row { display:flex; align-items:center; gap:8px; margin-bottom:6px; }
|
||||
.param-row label { width:160px; font-size:11px; text-align:right; flex-shrink:0; }
|
||||
.param-row label.req { font-weight:600; }
|
||||
@@ -141,11 +155,21 @@ async function toggleInstance(iuid){
|
||||
const d=await r.json();
|
||||
const ops=d.operations.filter(o=>o.operation!=='reconcile'&&o.operation!=='create');
|
||||
opsEl.innerHTML=ops.map(o=>
|
||||
`<button class="btn btn-sm" onclick="runOp('${o.operation}',${o.svcOperationId})">${o.operation}</button>`
|
||||
`<button class="btn btn-sm op-btn ${opClass(o.operation)}" onclick="runOp('${o.operation}',${o.svcOperationId})">${o.operation}</button>`
|
||||
).join('');
|
||||
opsEl.classList.add('open');
|
||||
}
|
||||
|
||||
function opClass(opName){
|
||||
if(opName==='modify') return 'op-btn-modify';
|
||||
if(opName==='suspend') return 'op-btn-suspend';
|
||||
if(opName==='resume') return 'op-btn-resume';
|
||||
if(opName==='delete') return 'op-btn-delete';
|
||||
if(opName==='redeploy') return 'op-btn-redeploy';
|
||||
if(opName==='reconcile') return 'op-btn-reconcile';
|
||||
return '';
|
||||
}
|
||||
|
||||
function startCreate(){
|
||||
selectedInst=null; stopPoll();
|
||||
document.querySelectorAll('[data-iuid]').forEach(e=>e.classList.remove('active'));
|
||||
@@ -230,7 +254,10 @@ function setFinishedState(statusText, statusClass, statusError, statusDuration){
|
||||
btn.disabled=false;
|
||||
btn.textContent='Готово';
|
||||
btn.onclick=null;
|
||||
document.getElementById('test-status').innerHTML=` <span class="badge ${statusClass}">${statusText}</span> ${statusError||''} ${statusDuration||''}s`;
|
||||
const opName=selectedOp?.opName||'операция';
|
||||
const durationText=statusDuration!==undefined&&statusDuration!==null?`${statusDuration}s`:'0s';
|
||||
const extra=statusError||'';
|
||||
document.getElementById('test-status').innerHTML=` <span class="badge ${statusClass}">${statusText}</span> <span style="color:var(--muted);">${opName}</span> <span style="color:var(--muted);">${durationText}</span> ${extra}`;
|
||||
}
|
||||
|
||||
function setRunningState(opName, displayName){
|
||||
|
||||
Reference in New Issue
Block a user