zioinfo-mail/zioinfo/js/form.js
DESKTOP-TKLFCPR\ython e228faabf5 feat(itsm): G-1~G-12 확장 기능 + 하네스/봇/설치스크립트 구현
G-1: 메신저 Webhook Relay + _send_to_room 실제 httpx 호출 구현
G-2: POST /api/tasks/bulk SR 대량작업 엔드포인트 (최대 100건)
G-3: 라이선스 만료 알림 스케줄러 (매일 09:00 KST)
G-4: 체험판 upgrade_banner 필드 + license.py 배너 로직
G-5: core/auto_rca.py + incidents/problem auto-rca 엔드포인트
G-6: core/deploy_impact.py + vibe impact-analysis 엔드포인트
G-7: core/ticket_classifier.py + SR 생성 시 AI 분류 + ai-suggestion API
G-8: VulnPatchRecord 모델 + vuln_scan 패치추적 4개 엔드포인트
G-9: core/jira_sync.py + gateway Jira/Confluence 연동 엔드포인트
G-10: core/push_notify.py + routers/push.py + PushSubscription 모델
G-11: approvals 다중승인 (위임/서명/기한초과/마감연장)
G-12: alembic.ini + migrations/ + cicd/migrate_to_postgres.sh

하네스: guardia-orchestrator 확장기능 Phase 반영
봇명령어: /sr /status /license /bulk 슬래시 명령어 추가
설치스크립트: setup/ (Ubuntu, CentOS, RHEL, Windows) --test 옵션 포함

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-29 18:18:52 +09:00

124 lines
3.4 KiB
JavaScript

/*------------------------------------------------------------------------------
* 1. 파일명: form.js
* 2. 설 명: Form 요소 처리와 관련된 함수를 정의한다.
* 3. 의존성: 없음
* 4. 작성자:
* 5. 작성일: 2006.10.11.
-----------------------------------------------------------------------------*/
function getSelectedValue(selectObj) {
var selectObj = ref(selectObj);
var selectedIndex = selectObj.selectedIndex;
return selectObj.options[selectedIndex].value;
}
/**
* Select 객체에 배열에 있는 값으로 Option 객체를
* 새로 생성한다. 이 때 주어진 insertIndex 값부터
* 채워 나가므로 insertIndex 값 이전 항목들은
* 살아 남는다.
*
* @param selectObj Option 항목을 세팅할 Select 객체 참조 혹은 ID.
* @param optionArr Option 항목을 담고 있는 2차원 배열 객체.
* 이 배열 요소의 각 배열 중 index가 0인건 value로
* 1인 건 text로 사용한다.
* @param insertIndex Option을 추가할 Index.
* 그 전에 있던 이 Index 이하 항목들은 모두 삭제된다.
*/
function setOption(selectObj, optionArr, insertIndex) {
if ( typeof(selectObj) == "string" ) selectObj = document.getElementById(selectObj);
if ( insertIndex == undefined ) insertIndex = 0;
selectObj.options.length = insertIndex ;
if ( optionArr == undefined || optionArr == null || optionArr.length == 0 ) return;
for ( var i = 0; i < optionArr.length; i++ ) {
var text = "(" + optionArr[i][0] + ") " + optionArr[i][1];
selectObj.options[i + 1] = new Option(text, optionArr[i][0]);
}
}
/**
* Select 객체 내에서 주어진 값이 있는지 찾아
* Index를 돌려 준다. 없으면 -1을 돌려 준다.
*
* @param selectObj Select 객체 참조 혹은 ID.
* @param value Index를 찾으려고 하는 값.
*
* @return selectObj의 Option 항목 중 value 속성이 주어진 값인 항목의 Index.
* 없으면 -1.
*/
function indexOfSelect(selectObj, value) {
if ( typeof(selectObj) == "string" ) selectObj = document.getElementById(selectObj);
var index = -1;
for ( var i = 0; i < selectObj.length; i++ ) {
if ( selectObj.options[i].value == value ) {
index = i;
break;
}
}
return index;
}
/**
* Select의 option중 value 항목의 값을 가지는
* option이 선택된 것으로 설정한다.
*
* @param selectObj Select 객체 참조 혹은 ID.
* @param value 선택된 것으로 하려는 값.
*/
function setSelect(selectObj, value) {
if ( typeof(selectObj) == "string" ) selectObj = document.getElementById(selectObj);
if ( value == undefined ) value = "";
selectObj.selectedIndex = indexOfSelect(selectObj, value);
}
var ENABLED_BGCOLOR = "";
var DISABLED_BGCOLOR = "#CDCDCD";
/**
* 주어진 객체 Disable 여부를 disabled 값으로 설정하고
* 배경색을 조절한다.
*
* @param obj Disabled 여부를 세팅할 객체 참조 혹은 ID.
* @param disabled Disabled 여부. Disable 시키려면 true, Enable 시키려면 false.
*/
function setDisabled(obj, disabled) {
if ( typeof(obj) == "string" ) obj = document.getElementById(obj);
obj.disabled = disabled;
obj.style.backgroundColor = disabled ? DISABLED_BGCOLOR : "";
}
var READONLY_BGCOLOR = "#EFEFEF";
/**
* 주어진 객체 ReadOnly 여부를 disabled 값으로 설정하고
* 배경색을 조절한다.
*
* @param obj readOnly 여부를 세팅할 객체 참조 혹은 ID.
* @param readOnly ReadOnly 여부. readOnly 시키려면 true, Enable 시키려면 false.
*/
function setReadOnly(obj, readonly) {
if ( typeof(obj) == "string" ) obj = document.getElementById(obj);
obj.readOnly = readonly;
obj.style.backgroundColor = readonly ? READONLY_BGCOLOR : "";
}