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