시나리오 탭 처리

This commit is contained in:
현성필
2024-01-08 10:20:58 +09:00
parent b4c43a2138
commit 2861d3d393
7 changed files with 260 additions and 78 deletions
@@ -18,15 +18,48 @@
<!-- csrf -->
<input id="csrf" type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">
<div class="pt-layout">
<aside th:replace="page/tester/apiCollection :: collectionFragment"></aside>
<th:block th:replace="page/tester/apiCollection :: collectionScript"></th:block>
<div class="api-tester-layout">
<div class="tester-toolbar">
<button type="button" class="btn btn-primary btn-sm" id="toggle_tester">시나리오 보기</button>
<button type="button" class="btn btn-primary btn-sm" id="new_collection"><i class="fa fa-plus"></i> 새 컬렉션
</button>
<button type="button" class="btn btn-primary btn-sm" id="new_request"><i class="fa fa-plus"></i> 새 요청</button>
<button type="button" class="btn btn-primary btn-sm" id="new_scenario"><i class="fa fa-plus"></i> 새로운 시나리오
</button>
<button type="button" class="btn btn-primary btn-sm" id="full_screen"><i class="fa-solid fa-display"></i> 전체화면</button>
</div>
<div class="tester">
<section th:replace="page/tester/apiScenario :: scenarioFragment">
</section>
<aside th:replace="page/tester/apiCollection :: collectionFragment"></aside>
<section class="api-tester" layout:fragment="contentFragment">
</section>
<section th:replace="page/tester/apiScenario :: scenarioScript">
</section>
</div>
<th:block th:replace="page/tester/apiCollection :: collectionScript">
<section class="pt-main order-1" layout:fragment="contentFragment">
</section>
<th:block layout:fragment="contentScript">
</th:block>
<th:block layout:fragment="contentScript">
</th:block>
<script>
$(function () {
const container = document.querySelector('.api-tester-layout');
$('#full_screen').on('click', function () {
container.classList.toggle('full-screen');
});
document.addEventListener('keydown', (event) => {
if (event.key === 'Escape') {
container.classList.remove('full-screen');
// layoutManager.resize();
}
});
});
</script>
</div>
<footer th:replace="fragment/footer :: footerFragment"></footer>