v1.1.2: UI — params inline, no header, create button below list
This commit is contained in:
+1
-1
@@ -18,7 +18,7 @@ from routes.api import bp as api_bp
|
|||||||
from routes.api_test import bp as api_test_bp
|
from routes.api_test import bp as api_test_bp
|
||||||
|
|
||||||
# Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI.
|
# Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI.
|
||||||
VERSION = "1.1.1"
|
VERSION = "1.1.2"
|
||||||
|
|
||||||
app = Flask(__name__, template_folder="templates", static_folder="static")
|
app = Flask(__name__, template_folder="templates", static_folder="static")
|
||||||
app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-test.ngcloud.ru/api/v1/svc")
|
app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-test.ngcloud.ru/api/v1/svc")
|
||||||
|
|||||||
+4
-8
@@ -35,7 +35,7 @@ selectService(currentSvcId);
|
|||||||
async function selectService(svcId){
|
async function selectService(svcId){
|
||||||
currentSvcId=svcId;
|
currentSvcId=svcId;
|
||||||
selectedInst=null; selectedOp=null; stopPoll();
|
selectedInst=null; selectedOp=null; stopPoll();
|
||||||
document.getElementById('params-card').style.display='none';
|
document.getElementById('params-area').style.display='none';
|
||||||
document.getElementById('stages-box').style.display='none';
|
document.getElementById('stages-box').style.display='none';
|
||||||
// Подсветить активный сервис в боковой панели
|
// Подсветить активный сервис в боковой панели
|
||||||
document.querySelectorAll('.svc-item').forEach(e=>e.classList.remove('active'));
|
document.querySelectorAll('.svc-item').forEach(e=>e.classList.remove('active'));
|
||||||
@@ -56,8 +56,6 @@ async function selectService(svcId){
|
|||||||
</div>`;
|
</div>`;
|
||||||
html+=`<div class="inst-ops" id="ops-${i.instanceUid}"></div>`;
|
html+=`<div class="inst-ops" id="ops-${i.instanceUid}"></div>`;
|
||||||
});
|
});
|
||||||
html+=`<div class="inst-item" style="margin-top:8px;border-top:1px solid var(--brand-gray);padding-top:8px;" onclick="startCreate()">
|
|
||||||
<span style="flex:1;color:var(--brand-primary);">+ Создать новый инстанс</span>
|
|
||||||
</div>`;
|
</div>`;
|
||||||
document.getElementById('inst-list').innerHTML=html;
|
document.getElementById('inst-list').innerHTML=html;
|
||||||
}
|
}
|
||||||
@@ -65,7 +63,7 @@ async function selectService(svcId){
|
|||||||
async function toggleInstance(iuid){
|
async function toggleInstance(iuid){
|
||||||
selectedInst=iuid; stopPoll();
|
selectedInst=iuid; stopPoll();
|
||||||
document.querySelectorAll('[data-iuid]').forEach(e=>e.classList.toggle('active',e.dataset.iuid===iuid));
|
document.querySelectorAll('[data-iuid]').forEach(e=>e.classList.toggle('active',e.dataset.iuid===iuid));
|
||||||
document.getElementById('params-card').style.display='none';
|
document.getElementById('params-area').style.display='none';
|
||||||
|
|
||||||
const opsEl=document.getElementById('ops-'+iuid);
|
const opsEl=document.getElementById('ops-'+iuid);
|
||||||
if(opsEl.classList.contains('open')){opsEl.classList.remove('open');return;}
|
if(opsEl.classList.contains('open')){opsEl.classList.remove('open');return;}
|
||||||
@@ -130,7 +128,7 @@ function findInstName(){
|
|||||||
|
|
||||||
function showParams(opId,opName){
|
function showParams(opId,opName){
|
||||||
selectedOp={opId,opName,svcId:currentSvcId};
|
selectedOp={opId,opName,svcId:currentSvcId};
|
||||||
document.getElementById('params-card').style.display='block';
|
document.getElementById('params-area').style.display='block';
|
||||||
document.getElementById('stages-box').style.display='none';
|
document.getElementById('stages-box').style.display='none';
|
||||||
document.getElementById('test-status').textContent='';
|
document.getElementById('test-status').textContent='';
|
||||||
|
|
||||||
@@ -235,7 +233,7 @@ async function executeOp(params){
|
|||||||
const displayNameInput=document.getElementById('param-displayname');
|
const displayNameInput=document.getElementById('param-displayname');
|
||||||
const displayNameSuffix=(displayNameInput?.value||'').trim();
|
const displayNameSuffix=(displayNameInput?.value||'').trim();
|
||||||
const displayName=isCreate ? `${AUTOTEST_PREFIX}${displayNameSuffix || makeCreateDisplayName()}` : findInstName();
|
const displayName=isCreate ? `${AUTOTEST_PREFIX}${displayNameSuffix || makeCreateDisplayName()}` : findInstName();
|
||||||
document.getElementById('params-card').style.display='block';
|
document.getElementById('params-area').style.display='block';
|
||||||
document.getElementById('params-form').innerHTML='';
|
document.getElementById('params-form').innerHTML='';
|
||||||
const btn=document.getElementById('btn-test');
|
const btn=document.getElementById('btn-test');
|
||||||
btn.style.display='inline-flex';
|
btn.style.display='inline-flex';
|
||||||
@@ -308,8 +306,6 @@ async function refreshInstances(){
|
|||||||
</div>`;
|
</div>`;
|
||||||
html+=`<div class="inst-ops" id="ops-${i.instanceUid}"></div>`;
|
html+=`<div class="inst-ops" id="ops-${i.instanceUid}"></div>`;
|
||||||
});
|
});
|
||||||
html+=`<div class="inst-item" style="margin-top:8px;border-top:1px solid var(--brand-gray);padding-top:8px;" onclick="startCreate()">
|
|
||||||
<span style="flex:1;color:var(--brand-primary);">+ Создать новый инстанс</span>
|
|
||||||
</div>`;
|
</div>`;
|
||||||
document.getElementById('inst-list').innerHTML=html;
|
document.getElementById('inst-list').innerHTML=html;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,15 +110,19 @@
|
|||||||
<div class="card-body" style="padding:4px;" id="inst-list">
|
<div class="card-body" style="padding:4px;" id="inst-list">
|
||||||
<span style="color:var(--muted);font-size:11px;">Загрузка...</span>
|
<span style="color:var(--muted);font-size:11px;">Загрузка...</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div style="padding:4px 8px 8px;" id="create-btn-area">
|
||||||
|
<div class="inst-item" style="border-top:1px solid var(--brand-gray);padding-top:8px;margin-top:4px;" onclick="startCreate()">
|
||||||
|
<span style="flex:1;color:var(--brand-primary);cursor:pointer;">+ Создать новый инстанс</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="card" id="params-card" style="margin-top:8px;display:none;">
|
</div>
|
||||||
<div class="card-header" style="font-size:12px;">Параметры</div>
|
</div>
|
||||||
<div class="card-body" style="padding:8px;" id="params-form"></div>
|
<div id="params-area" style="display:none;padding:0 8px 8px;">
|
||||||
<div style="padding:0 8px 8px;">
|
<div id="params-form"></div>
|
||||||
<button class="btn btn-primary btn-sm" onclick="runTest()" id="btn-test" style="display:none;">Запустить тест</button>
|
<div style="padding:4px 0;">
|
||||||
|
<button class="btn btn-primary btn-sm" id="btn-test" style="display:none;">Запустить</button>
|
||||||
<span id="test-status" style="font-size:11px;margin-left:8px;"></span>
|
<span id="test-status" style="font-size:11px;margin-left:8px;"></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="stages-box" style="display:none;padding:0 8px 8px;max-height:200px;overflow-y:auto;"></div>
|
<div id="stages-box" style="display:none;max-height:200px;overflow-y:auto;"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card" id="history-card" style="margin-top:8px;">
|
<div class="card" id="history-card" style="margin-top:8px;">
|
||||||
<div class="card-header" style="font-size:12px;cursor:pointer;" onclick="toggleHistory()">История <span style="color:var(--muted);font-size:10px;">(последние 50)</span></div>
|
<div class="card-header" style="font-size:12px;cursor:pointer;" onclick="toggleHistory()">История <span style="color:var(--muted);font-size:10px;">(последние 50)</span></div>
|
||||||
|
|||||||
Reference in New Issue
Block a user