Skip to content

Commit

Permalink
cleanup and docker support 🚢
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenOTT committed Jun 30, 2021
1 parent f4dd75f commit 4385db0
Show file tree
Hide file tree
Showing 16 changed files with 123 additions and 29 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Default app is a "Kitchen Sick" app that covers runtime and history apis.

Contributions and collaboration is always welcomed.


## Features:

1. Extendable
Expand All @@ -17,6 +18,10 @@ Contributions and collaboration is always welcomed.
7. Swap APIs for your custom endpoints
8. What more do you need?

# Quick Start for Demos and Development Testing

See [Docker](./docker) folder

## Screenshots

### Process Definitions
Expand Down
3 changes: 3 additions & 0 deletions docker/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cammand/
*.jar
*.p12
27 changes: 27 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Cammad Docker Setup (Alternative UI for Camunda / Replacement for Camunda Webapps)

**This is a development version for demo purposes!**

You must access the UI from the root url.
If you copy a url with path or query parameters the page will fail to load.

## Setup:

1. Download the Cammand.zip from the Releases and uzip into the `docker/cammand` folder.
1. Add your `keystore.p12` or pcks file for https into the root of the docker folder.
1. Update the `default.yml` for the ssl settings:
```yml
server.ssl.key-store: classpath:keystore.p12
server.ssl.key-store-password: 1234567890
server.ssl.key-store-type: PKCS12
server.ssl.key-alias: tomcat
```
1. run from the docker folder: `docker-compose up`
1. `https://locahost:8080` (note **s** in the https)

If you want to access the original Camunda WebApps:

1. `localhost:8080/camunda/app/welcome`
1. `localhost:8080/camunda/app/cockpit`
1. `localhost:8080/camunda/app/tasklist`
1. `localhost:8080/camunda/app/admin`
17 changes: 17 additions & 0 deletions docker/default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#spring:
# datasource:
# url: jdbc:h2:./build/DB/dbdevDb1;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=TRUE # jdbc:h2:~/devDb1;MODE=PostgreSQL;AUTO_SERVER=TRUE
# username: sa
# password: ''

server:
ssl:
key-store: classpath:keystore.p12
key-store-password: 1234567890
key-store-type: PKCS12
key-alias: tomcat

camunda:
bpm:
webapp:
index-redirect-enabled: false
20 changes: 20 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
version: '3.7'

services:
camunda:
image: camunda/camunda-bpm-platform:run-latest
container_name: camunda-with-cammand
ports:
- "8080:8080"
expose:
- 8080
volumes:
- ./cammand:/camunda/configuration/userlib/META-INF/resources/
- ./default.yml:/camunda/configuration/default.yml
- ./keystore.p12:/camunda/configuration/keystore/keystore.p12
networks:
- camunda-net

networks:
camunda-net:
driver: bridge
2 changes: 1 addition & 1 deletion src/MainApp/Components/Deployment/DeploymentsTable.razor
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@if (_selectedDeployment?.Id == parentContext.Id)
{
<MudTr>
<td colspan="4">
<td colspan="100">
<MudCard Elevation="0" Outlined="true">
<MudCardHeader>
<CardHeaderContent>
Expand Down
16 changes: 9 additions & 7 deletions src/MainApp/Components/Job/HistoricJobsTable.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,25 @@
OnRowClick="@OnRowClicked"
Elevation="0">
<HeaderContent>
<MudTh>Id</MudTh>
<MudTh>Log Id</MudTh>
<MudTh>Log Type</MudTh>
<MudTh>Job Id</MudTh>
<MudTh>Job Type</MudTh>
<MudTh>Hostname</MudTh>
<MudTh>Timestamp</MudTh>
<MudTh>Activity Id</MudTh>
<MudTh>Job Id</MudTh>
<MudTh>Job Priority</MudTh>
<MudTh>Job Due Date</MudTh>
</HeaderContent>

<RowTemplate>
<MudTd DataLabel="Id">@context.Id</MudTd>
<MudTd DataLabel="Log Id">@context.Id</MudTd>
<MudTd DataLabel="Log Type">@LogTypeElement(context)</MudTd>
<MudTd DataLabel="Job Id">@context.JobId</MudTd>
<MudTd DataLabel="Job Type">@context.JobDefinitionType</MudTd>
<MudTd DataLabel="Hostname">@context.Hostname</MudTd>
<MudTd DataLabel="Timestamp">@context.Timestamp</MudTd>
<MudTd DataLabel="Activity Id">@context.ActivityId</MudTd>
<MudTd DataLabel="Job Id">@context.JobId</MudTd>
<MudTd DataLabel="Job Priority">@context.JobPriority</MudTd>
<MudTd DataLabel="Job Due Date">@context.JobDueDate</MudTd>
</RowTemplate>
Expand All @@ -35,7 +37,7 @@
@if (_selectedJobLog?.Id == parentContext.Id)
{
<MudTr>
<td colspan="4">
<td colspan="100">
<MudCard Elevation="0" Outlined="true">
<MudCardHeader>
<CardHeaderContent>
Expand Down Expand Up @@ -125,8 +127,8 @@
return @<MudIcon Icon="@Icons.Outlined.CheckCircleOutline" Color="Color.Success" Title="Success"/>;
}
Console.Error.WriteLine("Unknown Historic Job Log DTO Log type: " + log.ToJson());
return @<MudIcon Icon="@Icons.Outlined.HelpOutline" Title="UNKNOWN - See Error Logs"/>;

return @<MudIcon Icon="@Icons.Outlined.HelpOutline" Title="UNKNOWN - See Error Logs"/>;
}

void OnRowClicked(TableRowClickEventArgs<HistoricJobLogDto> clickedRow)
Expand Down
2 changes: 1 addition & 1 deletion src/MainApp/Components/Job/RuntimeJobsTable.razor
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
@if (_selectedJob?.Id == parentContext.Id)
{
<MudTr>
<td colspan="4">
<td colspan="100">
<MudCard Elevation="0" Outlined="true">
<MudCardHeader>
<CardHeaderContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<MudText>Definition: @ProcessDefinitionId</MudText>
</MudItem>
<MudItem xs="6">
<MudCheckBox Label="Cascade?" @bind-Checked="_cascade" Color="Color.Primary"/>
<MudCheckBox Label="Cascade" @bind-Checked="_cascade" Color="Color.Primary"/>
</MudItem>
<MudItem xs="6">
@if (_cascade)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@if (_selectedSubDefinition?.Id == parentContext.Id)
{
<MudTr>
<td colspan="4">
<td colspan="100">
<MudCard Elevation="0" Outlined="true">
<MudCardHeader>
<CardHeaderContent>
Expand Down Expand Up @@ -86,8 +86,8 @@
<MudTd>
<MudIconButton Icon="@Icons.Outlined.Info" OnClick="@(() => OnDetailsClick(context.Id))" Title="Definition Details"/>
<MudIconButton Icon="@Icons.Outlined.NotStarted" OnClick="@(() => OpenProcessDefinitionSuspensionAction(context.Id))" Title="Definition Action"/>
<MudIconButton Icon="@Icons.Outlined.AutoDelete" OnClick="@(() => OpenHistoryTimeToLiveDialog(context.Id))" Title="Change History Time To Live"/>
<MudIconButton Icon="@Icons.Outlined.DeleteSweep" OnClick="@(() => OpenProcessDefinitionDeleteDialog(context.Id))" Title="Delete Process Definition"/>
<MudIconButton Icon="@Icons.Outlined.HistoryToggleOff" OnClick="@(() => OpenHistoryTimeToLiveDialog(context.Id))" Title="Change History Time To Live"/>
<MudIconButton Icon="@Icons.Outlined.DeleteForever" OnClick="@(() => OpenProcessDefinitionDeleteDialog(context.Id))" Title="Delete Process Definition"/>
</MudTd>
</RowTemplate>

Expand Down
1 change: 1 addition & 0 deletions src/MainApp/MainApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.7" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="5.0.7" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Configuration" Version="5.0.0" />
<PackageReference Include="MudBlazor" Version="5.0.14" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" />
Expand Down
20 changes: 13 additions & 7 deletions src/MainApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using Microsoft.Extensions.DependencyInjection;
using MudBlazor;
using MudBlazor.Services;
using Microsoft.Extensions.Logging;


namespace MainApp
{
Expand All @@ -16,20 +18,24 @@ public static async Task Main(string[] args)
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");

builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });

builder.Services.AddHttpClient("CamundaAPI", client => {
client.BaseAddress = new Uri("https://localhost:8080/engine-rest");
});
builder.Services.AddScoped(
sp => new HttpClient {BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)});

builder.Services.AddHttpClient("CamundaAPI",
client => { client.BaseAddress = new Uri("https://localhost:8080/engine-rest"); });

builder.Services.AddSingleton<MainApp.Shared.AppData>();

builder.Services.AddOidcAuthentication(options => {
builder.Services.AddOidcAuthentication(options =>
{
// Configure your authentication provider options here.
// For more information, see https://aka.ms/blazor-standalone-auth
builder.Configuration.Bind("Local", options.ProviderOptions);
});

builder.Logging.AddConfiguration(
builder.Configuration.GetSection("Logging"));

builder.Services
.AddMudServices(config =>
{
Expand All @@ -48,4 +54,4 @@ public static async Task Main(string[] args)
await builder.Build().RunAsync();
}
}
}
}
16 changes: 8 additions & 8 deletions src/MainApp/Shared/NavMenu.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<MudNavLink Href="">Dashboard</MudNavLink>

<MudNavGroup Title="Management" Expanded="true">
<MudNavLink Href="/process-definitions">Process Definitions</MudNavLink>
<MudNavLink Href="/deployments">Deployments</MudNavLink>
<MudNavLink Href="/deployments/create">Create Deployment</MudNavLink>
<MudNavLink Href="/forms/builder">Form Builder</MudNavLink>
<MudNavLink Href="/start">Start New Process Instance</MudNavLink>
<MudNavLink Href="/jobs">Jobs</MudNavLink>
<MudNavLink Href="/settings">Settings</MudNavLink>
<MudNavLink Href="process-definitions">Process Definitions</MudNavLink>
<MudNavLink Href="deployments">Deployments</MudNavLink>
<MudNavLink Href="deployments/create">Create Deployment</MudNavLink>
<MudNavLink Href="forms/builder">Form Builder</MudNavLink>
<MudNavLink Href="start">Start New Process Instance</MudNavLink>
<MudNavLink Href="jobs">Jobs</MudNavLink>
<MudNavLink Href="settings">Settings</MudNavLink>
</MudNavGroup>

<MudNavGroup Title="Tasklist" Expanded="false">
<MudNavLink Href="/tasklist">My Tasks</MudNavLink>
<MudNavLink Href="tasklist">My Tasks</MudNavLink>
</MudNavGroup>

<MudNavGroup Title="Admin" Expanded="false">
Expand Down
5 changes: 5 additions & 0 deletions src/MainApp/wwwroot/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
"Local": {
"Authority": "https:login.microsoftonline.com/",
"ClientId": "33333333-3333-3333-33333333333333333"
},
"Logging": {
"LogLevel": {
"Default": "Information"
}
}
}
5 changes: 5 additions & 0 deletions src/MainApp/wwwroot/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,10 @@
"Local": {
"Authority": "https://login.microsoftonline.com/",
"ClientId": "33333333-3333-3333-33333333333333333"
},
"Logging": {
"LogLevel": {
"Default": "Warning"
}
}
}
5 changes: 4 additions & 1 deletion src/MainApp/wwwroot/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
<!DOCTYPE html>

<html>

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>MainApp</title>
<base href="/" />
<base href="/">

<link href="favicon.ico" rel="icon" type="image/x-icon" />

<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
Expand Down

0 comments on commit 4385db0

Please sign in to comment.