Skip to content

Commit

Permalink
fix: kafkaflow admin dashboard sample
Browse files Browse the repository at this point in the history
  • Loading branch information
JoaoRodriguesGithub committed Mar 13, 2024
1 parent 0beaf75 commit 6f2ae2a
Show file tree
Hide file tree
Showing 10 changed files with 39 additions and 33 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ artifacts/

# Node folders
node_modules/
/dist

# StyleCop
StyleCopReport.xml
Expand Down Expand Up @@ -433,4 +434,4 @@ healthchecksdb
MigrationBackup/

# End of https://www.gitignore.io/api/rider,linux,windows,visualstudio
.DS_Store
.DS_Store
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"KafkaFlow.Sample.Dashboard": {
"commandName": "Project",
"launchBrowser": true,
"applicationUrl": "http://localhost:5000",
"applicationUrl": "http://localhost:5002",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
Expand Down
15 changes: 0 additions & 15 deletions src/KafkaFlow.Admin.Dashboard/ClientApp/dist/index.html

This file was deleted.

1 change: 0 additions & 1 deletion src/KafkaFlow.Admin.Dashboard/ClientApp/dist/main.js

This file was deleted.

1 change: 0 additions & 1 deletion src/KafkaFlow.Admin.Dashboard/ClientApp/dist/polyfills.js

This file was deleted.

1 change: 0 additions & 1 deletion src/KafkaFlow.Admin.Dashboard/ClientApp/dist/runtime.js

This file was deleted.

5 changes: 0 additions & 5 deletions src/KafkaFlow.Admin.Dashboard/ClientApp/dist/styles.css

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

export const environment = {
production: false,
apiUrl: 'http://localhost:5000/kafkaflow'
apiUrl: '/kafkaflow'
};

/*
Expand Down
39 changes: 34 additions & 5 deletions src/KafkaFlow.Admin.Dashboard/KafkaFlow.Admin.Dashboard.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,52 @@
<EmbeddedResource Remove="ClientApp\node_modules\**" />
<Content Remove="ClientApp\node_modules\**" />
</ItemGroup>


<PropertyGroup>
<SpaRoot>ClientApp\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
<AssemblyName>KafkaFlow.Admin.Dashboard</AssemblyName>
</PropertyGroup>

<Target Name="EnsureNode">
<Exec WorkingDirectory="$(SpaRoot)" Command="node --version" ContinueOnError="true">
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
</Exec>
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
</Target>

<Target Name="DebugRunNgBuild" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' ">
<CallTarget Targets="EnsureNode" />
<Message Importance="high" Text="Install packages..." />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
<Message Importance="high" Text="Performing ng build for prd build..." />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build" />
</Target>

<Target Name="ReleaseRunNgBuild" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Release' ">
<CallTarget Targets="EnsureNode" />
<Message Importance="high" Text="Install packages..." />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
<Message Importance="high" Text="Performing ng build for prd build..." />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:prod" />
</Target>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.25" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

<ItemGroup>
<Compile Remove="ClientApp\node_modules\**" />
</ItemGroup>

<ItemGroup>
<Compile Remove="ClientApp\node_modules\**" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\KafkaFlow.Admin\KafkaFlow.Admin.csproj" />
<ProjectReference Include="..\KafkaFlow\KafkaFlow.csproj" />
</ItemGroup>

</Project>
3 changes: 1 addition & 2 deletions website/docs/guides/admin/dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ await kafkaBus.StartAsync();
await app.RunAsync();
```

The dashboard UI will be available at `/kafka-flow` and is refreshed every 5 seconds with telemetry data available at the endpoint `/kafka-flow/telemetry`.
The dashboard UI will be available at `/kafkaflow` and is refreshed every 5 seconds with telemetry data available at the endpoint `/kafkaflow/consumers/telemetry`.

![image](https://user-images.githubusercontent.com/233064/124478023-1d773680-dd7b-11eb-89e4-41a1f4f36a6f.png)

0 comments on commit 6f2ae2a

Please sign in to comment.