# All Stop — 최종 수정 (제외 패턴 축소 + 확인 팝업)

## ★★★ 절대 금지 ★★★
**`curl -X POST /api/system/all-stop`을 절대 실행하지 마라.**
**코드 수정 + 문법 검증만 수행. 실제 API 호출 금지.**

## 수정 1: 제외 패턴 축소

**파일**: `dashboard/server.py` — all-stop 핸들러 (line 5826~5834)

현재 EXCLUDE_PATTERNS:
```python
EXCLUDE_PATTERNS = [
    "dashboard/server.py",
    "cokacdir",          # ← 제거
    ".cokacdir/",        # ← 제거
    "systemd",
    "grep",
    "dispatch.py",       # ← 제거
    "task-timer",        # ← 제거
]
```

변경 후:
```python
EXCLUDE_PATTERNS = [
    "dashboard/server.py",     # 대시보드 자체만 제외
    "systemd",                 # systemd 프로세스
    "grep",                    # grep 자체
]
```

All Stop은 **제이회장님이 의도적으로 누르는 비상 버튼**이므로, cokacdir 봇 포함 모든 claude 프로세스를 kill하는 게 맞음. 대시보드 자체만 살리면 됨.

## 수정 2: 확인 팝업 추가

**파일**: `dashboard/components/SystemView.js`

현재 버튼 클릭 시 바로 API 호출되는 부분을 수정:

```javascript
// 현재: 바로 호출 또는 간단 confirm
// 변경: window.confirm 으로 확인 팝업
const handleAllStop = () => {
    if (window.confirm('정말 모든 프로세스를 kill 하겠습니까?')) {
        setAllStopLoading(true);
        fetch('/api/system/all-stop', { method: 'POST' })
            .then(res => res.json())
            .then(data => {
                setAllStopResult(data);
                setAllStopLoading(false);
            })
            .catch(err => {
                setAllStopResult({ status: 'error', message: err.message });
                setAllStopLoading(false);
            });
    }
};
```

기존에 confirm이 이미 있다면 → 메시지만 "정말 모든 프로세스를 kill 하겠습니까?"로 변경.

## 검증 방법 (★ API 호출 금지 ★)
1. `python3 -c "import ast; ast.parse(open('/home/jay/workspace/dashboard/server.py').read())"` 통과
2. EXCLUDE_PATTERNS에 "cokacdir"가 없는지 grep 확인
3. SystemView.js에 `window.confirm` 또는 `confirm(` 존재하는지 확인
4. 확인 메시지가 "정말 모든 프로세스를 kill 하겠습니까?"인지 확인
5. 대시보드 재시작: `systemctl --user restart dashboard`
6. **API 호출은 하지 않는다**