parent
09e1de06ce
commit
6991724258
|
|
@ -185,6 +185,9 @@ message GetReadyzResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
message EventConfigChanged {}
|
message EventConfigChanged {}
|
||||||
|
message EventExecutionFinished {
|
||||||
|
LogEntry log_entry = 1;
|
||||||
|
}
|
||||||
|
|
||||||
service OliveTinApiService {
|
service OliveTinApiService {
|
||||||
rpc GetDashboardComponents(GetDashboardComponentsRequest) returns (GetDashboardComponentsResponse) {
|
rpc GetDashboardComponents(GetDashboardComponentsRequest) returns (GetDashboardComponentsResponse) {
|
||||||
|
|
|
||||||
|
|
@ -62,24 +62,26 @@ func checkOriginPermissive(r *http.Request) bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (WebsocketExecutionListener) OnExecutionFinished(logEntry *executor.InternalLogEntry) {
|
func (WebsocketExecutionListener) OnExecutionFinished(logEntry *executor.InternalLogEntry) {
|
||||||
le := &pb.LogEntry{
|
evt := &pb.EventExecutionFinished{
|
||||||
ActionTitle: logEntry.ActionTitle,
|
LogEntry: &pb.LogEntry{
|
||||||
ActionIcon: logEntry.ActionIcon,
|
ActionTitle: logEntry.ActionTitle,
|
||||||
ActionId: logEntry.ActionId,
|
ActionIcon: logEntry.ActionIcon,
|
||||||
DatetimeStarted: logEntry.DatetimeStarted.Format("2006-01-02 15:04:05"),
|
ActionId: logEntry.ActionId,
|
||||||
DatetimeFinished: logEntry.DatetimeFinished.Format("2006-01-02 15:04:05"),
|
DatetimeStarted: logEntry.DatetimeStarted.Format("2006-01-02 15:04:05"),
|
||||||
Stdout: logEntry.Stdout,
|
DatetimeFinished: logEntry.DatetimeFinished.Format("2006-01-02 15:04:05"),
|
||||||
Stderr: logEntry.Stderr,
|
Stdout: logEntry.Stdout,
|
||||||
TimedOut: logEntry.TimedOut,
|
Stderr: logEntry.Stderr,
|
||||||
Blocked: logEntry.Blocked,
|
TimedOut: logEntry.TimedOut,
|
||||||
ExitCode: logEntry.ExitCode,
|
Blocked: logEntry.Blocked,
|
||||||
Tags: logEntry.Tags,
|
ExitCode: logEntry.ExitCode,
|
||||||
ExecutionTrackingId: logEntry.ExecutionTrackingID,
|
Tags: logEntry.Tags,
|
||||||
ExecutionStarted: logEntry.ExecutionStarted,
|
ExecutionTrackingId: logEntry.ExecutionTrackingID,
|
||||||
ExecutionFinished: logEntry.ExecutionFinished,
|
ExecutionStarted: logEntry.ExecutionStarted,
|
||||||
|
ExecutionFinished: logEntry.ExecutionFinished,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
broadcast(le)
|
broadcast(evt)
|
||||||
}
|
}
|
||||||
|
|
||||||
func broadcast(pbmsg protoreflect.ProtoMessage) {
|
func broadcast(pbmsg protoreflect.ProtoMessage) {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export function initMarshaller () {
|
||||||
|
|
||||||
window.logEntries = {}
|
window.logEntries = {}
|
||||||
|
|
||||||
window.addEventListener('ExecutionFinished', onExecutionFinished)
|
window.addEventListener('EventExecutionFinished', onExecutionFinished)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function marshalDashboardComponentsJsonToHtml (json) {
|
export function marshalDashboardComponentsJsonToHtml (json) {
|
||||||
|
|
@ -52,7 +52,7 @@ function marshalActionsJsonToHtml (json) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onExecutionFinished (evt) {
|
function onExecutionFinished (evt) {
|
||||||
const logEntry = evt.payload
|
const logEntry = evt.payload.logEntry
|
||||||
|
|
||||||
const actionButton = window.actionButtons[logEntry.actionTitle]
|
const actionButton = window.actionButtons[logEntry.actionTitle]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ function websocketOnMessage (msg) {
|
||||||
|
|
||||||
switch (j.type) {
|
switch (j.type) {
|
||||||
case 'EventConfigChanged':
|
case 'EventConfigChanged':
|
||||||
case 'ExecutionFinished':
|
case 'EventExecutionFinished':
|
||||||
window.dispatchEvent(e)
|
window.dispatchEvent(e)
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue