[Developer] #424 simplify ORDS handler target form
This commit is contained in:
@@ -38,13 +38,11 @@ public class ProtectedObjectController {
|
||||
@RequestParam String owner,
|
||||
@RequestParam String objectName,
|
||||
@RequestParam String ordsPath,
|
||||
@RequestParam(required = false) String columns,
|
||||
@RequestParam(required = false) String sensitiveColumns,
|
||||
RedirectAttributes redirectAttributes
|
||||
) {
|
||||
try {
|
||||
protectedObjectService.createObject(
|
||||
new ProtectedObjectCreateCommand(owner, objectName, ordsPath, columns, sensitiveColumns));
|
||||
new ProtectedObjectCreateCommand(owner, objectName, ordsPath, null, null));
|
||||
redirectAttributes.addFlashAttribute("message", "ORDS 조회 Handler 대상을 추가했습니다.");
|
||||
} catch (AppException exception) {
|
||||
redirectAttributes.addFlashAttribute("errorMessage", exception.getMessage());
|
||||
|
||||
@@ -188,31 +188,16 @@ async function syncObjectCatalogSelection() {
|
||||
const ownerInput = document.querySelector('input[name="owner"]');
|
||||
const objectInput = document.querySelector('input[name="objectName"]');
|
||||
const ordsPathInput = document.querySelector('input[name="ordsPath"]');
|
||||
const columnsInput = document.querySelector('input[name="columns"]');
|
||||
if (ownerInput) {
|
||||
ownerInput.value = selected.dataset.owner || '';
|
||||
}
|
||||
if (objectInput) {
|
||||
objectInput.value = selected.dataset.objectName || '';
|
||||
}
|
||||
if (ordsPathInput && !ordsPathInput.value) {
|
||||
ordsPathInput.focus();
|
||||
}
|
||||
if (!columnsInput) {
|
||||
return;
|
||||
}
|
||||
columnsInput.value = '';
|
||||
try {
|
||||
const response = await fetch(`/permissions/object-columns?objectRef=${encodeURIComponent(`db:${catalog.value}`)}`);
|
||||
if (!response.ok) {
|
||||
return;
|
||||
}
|
||||
const columns = await response.json();
|
||||
if (Array.isArray(columns)) {
|
||||
columnsInput.value = columns.join(',');
|
||||
}
|
||||
} catch (error) {
|
||||
columnsInput.value = '';
|
||||
if (ordsPathInput) {
|
||||
const owner = (selected.dataset.owner || '').toLowerCase();
|
||||
const objectName = (selected.dataset.objectName || '').toLowerCase();
|
||||
ordsPathInput.value = owner && objectName ? `cb-ords/cb-object-query/${owner}/${objectName}` : '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,10 +16,12 @@
|
||||
<h2>조회 Handler 대상 추가</h2>
|
||||
<form method="post" action="/objects" class="form-grid">
|
||||
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}">
|
||||
<input type="hidden" name="owner" required>
|
||||
<input type="hidden" name="objectName" required>
|
||||
<label>
|
||||
DB 객체 선택
|
||||
<select class="form-select" id="objectCatalogSelect">
|
||||
<option value="">직접 입력</option>
|
||||
<select class="form-select" id="objectCatalogSelect" required>
|
||||
<option value="">선택하세요</option>
|
||||
<option th:each="dbObject : ${dbObjects}"
|
||||
th:value="${dbObject.value()}"
|
||||
th:data-owner="${dbObject.owner()}"
|
||||
@@ -27,25 +29,9 @@
|
||||
th:text="${dbObject.label()}"></option>
|
||||
</select>
|
||||
</label>
|
||||
<label>
|
||||
Owner
|
||||
<input class="form-control" name="owner" value="ADMIN" autocomplete="off" required>
|
||||
</label>
|
||||
<label>
|
||||
Object
|
||||
<input class="form-control" name="objectName" placeholder="CB_V_SEARCH_DOCUMENTS" autocomplete="off" required>
|
||||
</label>
|
||||
<label>
|
||||
ORDS Path
|
||||
<input class="form-control" name="ordsPath" placeholder="cb-ords/cb-object-query/admin/board_posts" required>
|
||||
</label>
|
||||
<label>
|
||||
컬럼
|
||||
<input class="form-control" name="columns" placeholder="DOC_ID,TITLE,CONTENTS">
|
||||
</label>
|
||||
<label>
|
||||
민감 컬럼
|
||||
<input class="form-control" name="sensitiveColumns" placeholder="CONTENTS">
|
||||
<input class="form-control" name="ordsPath" placeholder="DB 객체 선택 시 자동 입력" required>
|
||||
</label>
|
||||
<button class="btn btn-primary" type="submit">대상 추가</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user