-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: changes how to serve client app files
- Loading branch information
1 parent
f13157a
commit c934899
Showing
26 changed files
with
309 additions
and
284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,4 @@ | |
</div> | ||
</div> | ||
</nav> | ||
<app-consumer [groups]="groups"></app-consumer> | ||
<app-consumer></app-consumer> |
32 changes: 2 additions & 30 deletions
32
src/KafkaFlow.Admin.Dashboard/ClientApp/src/app/home/home.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,13 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { ConsumerService } from '../consumer.service' | ||
import {interval} from "rxjs"; | ||
|
||
@Component({ | ||
selector: 'app-home', | ||
templateUrl: './home.component.html' | ||
}) | ||
export class HomeComponent implements OnInit { | ||
public groups: Array<any> = []; | ||
constructor (private consumerService: ConsumerService) { | ||
interval(1000).subscribe(_ => consumerService.get().subscribe((data: any) => this.groups = this.buildCalculatedProperties(data))); | ||
constructor () { | ||
} | ||
|
||
buildCalculatedProperties(groups: any) { | ||
var self = this; | ||
groups.forEach(function (g: any) { | ||
g.consumers.forEach(function (c: any) { | ||
c.status = | ||
c.partitionAssignments.some(function (pa: any){ return pa.runningPartitions?.length > 0 && self.isActive(pa.lastUpdate);}) ? | ||
"Running" : | ||
c.partitionAssignments.some(function (pa: any){ return pa.pausedPartitions?.length > 0 && self.isActive(pa.lastUpdate);}) ? | ||
"Paused" : | ||
"Not Running"; | ||
c.partitionAssignments.forEach(function (pa: any) { | ||
pa.isLost = !self.isActive(pa.lastUpdate); | ||
}) | ||
}) | ||
}); | ||
|
||
return groups; | ||
} | ||
|
||
isActive(date: string) { | ||
return Math.abs((new Date().getTime() - new Date(date).getTime())/1000) < 5; | ||
} | ||
|
||
ngOnInit(): void { | ||
} | ||
ngOnInit(): void { } | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
src/KafkaFlow.Admin.Dashboard/Properties/launchSettings.json
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.