Version: 0.9.79.dev.260506
后端: 1. 本地后端启动体系收口到 `backend/scripts`,移除 `cmd/all` 聚合入口,并将仓库根兼容启动语义收敛为 `StartAPI` 别名;新增 dev-up / dev-down / services-up / services-down / dev-status / dev-logs / service-restart 脚本,统一托管多服务进程、日志、PID 与基础设施启动。 2. 课表服务超时口径统一放宽到 5 分钟,覆盖 gateway / client / rpc server / config example,避免课表导入与图片识别在长耗时场景下被内层提前截断。 3. `today` 课表查询修正为读取真实当前日期,不再使用硬编码测试日期;同时剔除旧缓存与返回结果里的 `empty` 占位事件,后端只返回真实日程,空档改由前端时间轴自行补齐。 前端: 4. 首页路由切回改为复用 `DashboardView` 实例,补 `keep-alive`、`onActivated` 与双帧缩放重算,修复从侧栏返回首页时首帧布局放大与重复加载闪动问题。 5. 首页加载态与今日时间线口径收口:移除额外 800ms `pageLoading` 人为延迟,task / schedule 改为分开驱动;时间线忽略 `empty` 事件,并统一空档文案为“无课”。 6. 收敛助手页与首页若干进场/弹性动画,降低结果卡片、微调弹窗、思考区与面板切换时的抖动感。 仓库: 7. README 补充后端本地快速启动说明,`.gitignore` 忽略 `backend/.dev` 脚本运行态产物。
This commit is contained in:
67
backend/scripts/dev-logs.ps1
Normal file
67
backend/scripts/dev-logs.ps1
Normal file
@@ -0,0 +1,67 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$Service,
|
||||
|
||||
[ValidateSet("stdout", "stderr", "both")]
|
||||
[string]$Stream = "stdout",
|
||||
|
||||
[int]$Tail = 80,
|
||||
|
||||
[switch]$Follow
|
||||
)
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
. "$PSScriptRoot\dev-common.ps1"
|
||||
|
||||
Initialize-DevState
|
||||
|
||||
if ($Tail -le 0) {
|
||||
throw "Tail must be greater than 0"
|
||||
}
|
||||
|
||||
$serviceDef = Get-BackendServiceDefinition -Name $Service
|
||||
$streams = @(
|
||||
if ($Stream -eq "both") {
|
||||
"stdout"
|
||||
"stderr"
|
||||
}
|
||||
else {
|
||||
$Stream
|
||||
}
|
||||
)
|
||||
|
||||
if ($Follow -and $streams.Count -gt 1) {
|
||||
throw "Follow mode only supports a single stream. Use -Stream stdout or -Stream stderr."
|
||||
}
|
||||
|
||||
$paths = @()
|
||||
foreach ($selectedStream in $streams) {
|
||||
$path = Get-LatestServiceLogPath -Service $serviceDef -Stream $selectedStream
|
||||
if ([string]::IsNullOrWhiteSpace($path)) {
|
||||
throw "No log file found for service $Service stream $selectedStream"
|
||||
}
|
||||
|
||||
$paths += [pscustomobject]@{
|
||||
Stream = $selectedStream
|
||||
Path = $path
|
||||
}
|
||||
}
|
||||
$paths = @($paths)
|
||||
|
||||
for ($index = 0; $index -lt $paths.Count; $index++) {
|
||||
$entry = $paths[$index]
|
||||
Write-Host "==> $Service [$($entry.Stream)]"
|
||||
Write-Host "Path: $($entry.Path)"
|
||||
if ($Follow) {
|
||||
Get-Content -LiteralPath $entry.Path -Encoding UTF8 -Tail $Tail -Wait
|
||||
return
|
||||
}
|
||||
|
||||
Get-Content -LiteralPath $entry.Path -Encoding UTF8 -Tail $Tail
|
||||
if ($paths.Count -gt 1 -and $index -lt ($paths.Count - 1)) {
|
||||
Write-Host ""
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user