Skip to content

Commit be96df5

Browse files
committed
fix: kv table
1 parent db8530c commit be96df5

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

client/assets/profile.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ func PrintProfileSettings() {
120120
orderedKeys := []string{"MCP Enable", "MCP Address", "LocalRPC Enable", "LocalRPC Address", "Max Server Log Size", "Opsec Threshold"}
121121

122122
// 使用tui.RenderKV显示配置
123-
tui.RenderKV(settingsMap, orderedKeys)
123+
tui.RenderKVWithOptions(settingsMap, orderedKeys, tui.KVOptions{ShowHeader: false})
124124
}
125125

126126
// formatBool 格式化布尔值

client/command/build/artifact.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func printArtifact(artifact *clientpb.Artifact) {
147147
"Comment": artifact.Comment,
148148
}
149149
orderedKeys := []string{"ID", "Name", "Type", "Target", "Profile", "Pipeline", "Size", "Comment"}
150-
tui.RenderKV(art, orderedKeys)
150+
tui.RenderKVWithOptions(art, orderedKeys, tui.KVOptions{ShowHeader: true})
151151
}
152152

153153
// Some optimization is needed.

client/command/cert/cert.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func printCert(cert *clientpb.TLS) {
143143
"Expire": expireStr,
144144
}
145145
orderedKeys := []string{"Name", "Type", "Organization", "Country", "Locality", "OrganizationalUnit", "StreetAddress", "Expire"}
146-
tui.RenderKV(certMap, orderedKeys)
146+
tui.RenderKVWithOptions(certMap, orderedKeys, tui.KVOptions{ShowHeader: true})
147147
}
148148

149149
func printCerts(certs *clientpb.Certs, con *core.Console) {

client/command/generic/license.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ func printLicense(license *clientpb.LicenseInfo) {
3232
"MaxBuilds": license.MaxBuilds,
3333
}
3434
orderedKeys := []string{"Type", "ExpireAt", "ProBuildCount", "MaxBuilds"}
35-
tui.RenderKV(licenseMap, orderedKeys)
35+
tui.RenderKVWithOptions(licenseMap, orderedKeys, tui.KVOptions{ShowHeader: true})
3636
}

client/core/server.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func HandlerTask(sess *client.Session, log *client.Logger, ctx *clientpb.TaskCon
141141
ctx.Task.Progress(),
142142
message))
143143

144-
if callee != consts.CalleePty {
144+
if callee != consts.CalleePty && callee != consts.CalleeGui {
145145
log.Importantf(s)
146146
}
147147

@@ -279,11 +279,15 @@ func (s *Server) handlerTask(event *clientpb.Event) {
279279
case consts.CtrlTaskFinish:
280280
s.triggerTaskFinish(event)
281281
case consts.CtrlTaskCancel:
282-
log := s.ObserverLog(event.Task.SessionId)
283-
log.Importantf("[%s.%d] task canceled\n", event.Task.SessionId, event.Task.TaskId)
282+
if event.Callee != consts.CalleeGui {
283+
log := s.ObserverLog(event.Task.SessionId)
284+
log.Importantf("[%s.%d] task canceled\n", event.Task.SessionId, event.Task.TaskId)
285+
}
284286
case consts.CtrlTaskError:
285-
log := s.ObserverLog(event.Task.SessionId)
286-
log.Errorf("[%s.%d] %s\n", event.Task.SessionId, event.Task.TaskId, event.Err)
287+
if event.Callee != consts.CalleeGui {
288+
log := s.ObserverLog(event.Task.SessionId)
289+
log.Errorf("[%s.%d] %s\n", event.Task.SessionId, event.Task.TaskId, event.Err)
290+
}
287291
}
288292
}
289293

external/tui

Submodule tui updated 1 file

0 commit comments

Comments
 (0)