Skip to content

Commit

Permalink
added buildStatus socket
Browse files Browse the repository at this point in the history
  • Loading branch information
tjohnson-bah committed Nov 6, 2019
1 parent 4fde0f0 commit 67321c2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion api/client/dist/walkoff/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
<link rel="stylesheet" href="client/dist/walkoff/styles.16ca3349f52b1833d035.css"></head>
<body>
<main-component>Loading...</main-component>
<script src="client/dist/walkoff/runtime.5978eebdd8411421365f.js"></script><script src="client/dist/walkoff/polyfills-es5.57999a5b683a87ddc4df.js" nomodule></script><script src="client/dist/walkoff/polyfills.14acb39bcf7d0a4305ce.js"></script><script src="client/dist/walkoff/scripts.0fce6945815e7ec88514.js"></script><script src="client/dist/walkoff/main.3b52768f762602c6ad6e.js"></script></body>
<script src="client/dist/walkoff/runtime.5978eebdd8411421365f.js"></script><script src="client/dist/walkoff/polyfills-es5.57999a5b683a87ddc4df.js" nomodule></script><script src="client/dist/walkoff/polyfills.14acb39bcf7d0a4305ce.js"></script><script src="client/dist/walkoff/scripts.0fce6945815e7ec88514.js"></script><script src="client/dist/walkoff/main.fac15a1b24b5d174ece7.js"></script></body>
</html>

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions api/client/src/app/apps/status.modal.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class StatusModalComponent implements OnInit, OnDestroy {

createBuildStatusSocket() {
if (this.buildStatusSocket) this.buildStatusSocket.close();
this.buildStatusSocket = this.utils.createSocket('/nodeStatus', this.buildId);
this.buildStatusSocket = this.utils.createSocket('/buildStatus', this.buildId);

this.buildStatusSocket.on('connected', (data) => {
(data as any[]).forEach(event => this.statusEventHandler(event));
Expand All @@ -79,9 +79,8 @@ export class StatusModalComponent implements OnInit, OnDestroy {
});
}

statusEventHandler(data: any): void {
console.log('build', data);
const consoleEvent = JSON.parse(data);
statusEventHandler(consoleEvent: any): void {
console.log('build', consoleEvent);

switch (consoleEvent.build_status) {
case 'building':
Expand All @@ -91,7 +90,7 @@ export class StatusModalComponent implements OnInit, OnDestroy {
this.consoleLog.push(consoleEvent);
this.completedStatus = { success: false, message: `<b class="text-capitalize">${this.appApi.name}</b> rebuild failed`};
break;
case 'Success':
case 'success':
this.completedStatus = { success: true, message: `<b class="text-capitalize">${this.appApi.name}</b> rebuild successful`};
}
this.statusObserver.next(this.consoleContent);
Expand Down
2 changes: 1 addition & 1 deletion api/client/src/app/execution/execution.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class ExecutionComponent implements OnInit, AfterViewChecked, OnDestroy {

this.displayWorkflowStatuses = this.workflowStatuses.filter((s) => {
return [
s.id, s.execution_id, s.name, s.status, s.action_name, s.app_name, s.label
s.workflow_id, s.execution_id, s.name, s.status, s.action_name, s.app_name, s.label
].some(x => x && x.toLocaleLowerCase().includes(searchFilter));
});

Expand Down
2 changes: 0 additions & 2 deletions api/client/src/app/models/execution/workflowStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { NodeStatus } from './nodeStatus';

export class WorkflowStatus {

id?: string;

execution_id: string;

workflow_id: string;
Expand Down
2 changes: 2 additions & 0 deletions api/client/src/app/utilities.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,11 @@ export class UtilitiesService {
}

createSocket(namespace: string, channel: string = 'all'): SocketIOClient.Socket {
console.log('socket', namespace, channel);
const socket = io(namespace, {
query: { channel },
reconnectionAttempts: 5,
forceNew: true,
path: '/walkoff/sockets/socket.io'
});

Expand Down

0 comments on commit 67321c2

Please sign in to comment.