Skip to content

Commit

Permalink
Do not display non essential tf commands (#108)
Browse files Browse the repository at this point in the history
* Do not display non essential tf commands

* Add title with correct tabbing

* fix ui issues

* more fixes
  • Loading branch information
msarvar authored and Aayyush committed Dec 9, 2021
1 parent 084c978 commit 1e8729f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server/controllers/logstreaming_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (j *JobsController) GetProjectJobsWS(w http.ResponseWriter, r *http.Request

pull := projectInfo.String()
err = j.ProjectCommandOutputHandler.Receive(pull, receiver, func(msg string) error {
if err := c.WriteMessage(websocket.BinaryMessage, []byte(msg+"\r\n\t")); err != nil {
if err := c.WriteMessage(websocket.BinaryMessage, []byte("\r"+msg+"\n")); err != nil {
j.Logger.Warn("Failed to write ws message: %s", err)
return err
}
Expand Down
2 changes: 1 addition & 1 deletion server/controllers/templates/web_templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ var ProjectJobsTemplate = template.Must(template.New("blank.html.tmpl").Parse(`
document.location.pathname +
"/ws");
socket.onmessage = function(event) {
var msg = String.fromCharCode.apply(null, new Uint8Array(event.data))
var msg = String.fromCharCode.apply(null, new Uint8Array(event.data))
if (msg.trim() === "-----Starting New Process-----") {
term.clear()
return
Expand Down
4 changes: 3 additions & 1 deletion server/core/terraform/terraform_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,9 @@ func (c *DefaultClient) RunCommandAsync(ctx models.ProjectCommandContext, path s
go func() {
// Don't stream terraform show output to outCh
cmds := strings.Split(tfCmd, " ")
c.projectCmdOutputHandler.Send(ctx, fmt.Sprintf("\n----- running terraform %s -----\n", args[0]))
if isValidCommand(cmds[1]) {
c.projectCmdOutputHandler.Send(ctx, fmt.Sprintf("\n----- running terraform %s -----", args[0]))
}
s := bufio.NewScanner(stdout)
for s.Scan() {
message := s.Text()
Expand Down
2 changes: 1 addition & 1 deletion server/events/models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (

const (
planfileSlashReplace = "::"
LogStreamingClearMsg = "\t\n-----Starting New Process-----\n"
LogStreamingClearMsg = "\n-----Starting New Process-----"
)

type PullReqStatus struct {
Expand Down

0 comments on commit 1e8729f

Please sign in to comment.