Files
Nexus/docs/audit/2026-06-10-files-new-file-fix.md
T
Nexus Agent 72042598b0
Nexus CI/CD / test (push) Waiting to run
Nexus CI/CD / e2e (push) Blocked by required conditions
Nexus CI/CD / deploy (push) Blocked by required conditions
Nexus Pre-commit Checks / quick-check (push) Waiting to run
Fix files page new-file flow and SFTP parent directory creation.
Show a clear prompt when no server is selected, wait for the editor workbench before openFile, and mkdir -p parent paths before SFTP writes.
2026-06-13 09:08:17 +08:00

36 lines
1.2 KiB
Markdown

# 审计 — 文件管理「新建文件」修复
**Changelog**: `docs/changelog/2026-06-10-files-new-file-fix.md`
## 变更文件
| 文件 | 说明 |
|------|------|
| `frontend/src/composables/files/useFilesActions.ts` | `openNewFileDialog`、等待编辑器就绪 |
| `frontend/src/composables/files/useFilesEditor.ts` | 导出 `waitForEditorWorkbench` |
| `frontend/src/composables/files/useFilesPage.ts` | 透传 helper |
| `frontend/src/components/files/FilesToolbar.vue` | 未选服务器时提示 |
| `server/infrastructure/ssh/asyncssh_pool.py` | SFTP 写前确保父目录 |
## Step 3(规则扫描)
| 规则 | 结论 | 说明 |
|------|------|------|
| 鉴权 | PASS | 仍走 `/sync/write-file` + admin JWT |
| 路径 | PASS | `validatePathSegment` 不变 |
| 静默失败 | PASS | 编辑器未就绪有 warning snackbar |
| SSH | PASS | `mkdir -p` 仅父目录,不扩大写范围 |
## Closure
| 文件 | 结论 |
|------|------|
| `useFilesActions.ts` | SAFE — 无 v-html;错误经 snackbar |
| `asyncssh_pool.py` | SAFE — 复用已有 `_ensure_remote_parent_dir` |
## DoD
- [x] changelog + 本审计
- [x] frontend type-check
- [ ] 生产:文件管理新建文件 → 编辑器打开