Skip to content

Commit becfcfb

Browse files
committed
v0.9.8
1 parent b4c1aa2 commit becfcfb

File tree

12 files changed

+185
-44
lines changed

12 files changed

+185
-44
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "janusec-admin",
3-
"version": "0.9.7",
3+
"version": "0.9.8",
44
"license": "MIT",
55
"scripts": {
66
"ng": "ng",

src/app/application-detail/application-detail.component.css

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,50 @@
99
mat-form-field {
1010
margin-top:3px;
1111
margin-bottom:3px;
12-
background-color: #F0F0F0;
12+
background-color: #f5f5f5;
1313
}
1414

1515
.inner-container {
1616
border: 1px dashed;
1717
padding: 3px;
18-
}
18+
}
19+
20+
.inline-form {
21+
display: flex;
22+
margin-top: 10px;
23+
}
24+
25+
.inline-form-field-20 {
26+
width: 20%;
27+
margin-right: 5px;
28+
}
29+
30+
.inline-form-field-25 {
31+
width: 25%;
32+
margin-right: 5px;
33+
}
34+
35+
.inline-form-field-50 {
36+
width: 50%;
37+
}
38+
39+
.clickable_btn:hover {
40+
cursor: pointer;
41+
}
42+
43+
.detail_panel {
44+
margin: 10px 0px;
45+
background-color: #f5f5f5;
46+
box-shadow: 5px 5px 3px #d5d5d5;
47+
}
48+
49+
.highlighted {
50+
color: #FF0000;
51+
}
52+
53+
.description_block {
54+
background-color: #f0f0f0;
55+
margin-bottom: 20px;
56+
padding: 5px;
57+
border-radius: 5px;
58+
}

src/app/application-detail/application-detail.component.html

Lines changed: 74 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,100 @@ <h2>
1515
<mat-option value="https">https</mat-option>
1616
</mat-select>
1717
</mat-form-field>
18+
19+
<mat-expansion-panel [expanded]="true" class="detail_panel">
20+
<mat-expansion-panel-header>
21+
<mat-panel-title>
22+
<h3 i18n="@@routing_configuration">Routing Configuration</h3>
23+
</mat-panel-title>
24+
</mat-expansion-panel-header>
25+
26+
<div class="description_block">
27+
<div i18n="@@reference_configuration">Reference configuration</div>
28+
<mat-list-item>
29+
<span i18n="@@request_location">Request Location</span>:
30+
<span i18n="@@default">default</span>&nbsp;<span class="highlighted">/</span>,
31+
<span i18n="@@matching_priority"> include 3 patterns, matching priority</span>:
32+
<span class="highlighted">/abc/</span> &gt; <span class="highlighted">.php</span> &gt; <span class="highlighted">/</span>,
33+
<span i18n="@@more_info_of_request_location">subdirectory /abc/def/ is not supported.</span>
34+
</mat-list-item>
35+
<mat-list-item>
36+
<span i18n="@@routing_type">Routing Type</span>:
37+
<span i18n="@@default">default</span>&nbsp;<span class="highlighted">Reverse_Proxy</span>,
38+
<span i18n="@@more_info_of_routing_type">Local_FastCGI used for PHP, Python etc., Static_Website used for local static resources without backend servers. </span>
39+
</mat-list-item>
40+
<mat-list-item>
41+
<span i18n="@@destination">Destination</span>:
42+
<span i18n="@@default">default</span>&nbsp;<span class="highlighted">IP:Port</span>,
43+
<span i18n="@@more_info_of_destination">or default file (such as index.html) if the routing type is Static_Website. </span>
44+
</mat-list-item>
45+
<mat-list-item>
46+
<span i18n="@@backend_routing">Backend Routing</span>:
47+
<span i18n="@@default">default</span>&nbsp;<span class="highlighted">/</span>,
48+
<span i18n="@@more_info_of_backend_routing">using /xyz/ if the backend is using different URL Path, or absolute path (/path/to/site_dir/) if the routing type is Static_Website or Local_FastCGI. </span>
49+
</mat-list-item>
50+
</div>
1851

19-
<mat-form-field *ngFor="let dest of application.destinations;let i=index; trackBy:trackByFn">
20-
<input matInput i18n-placeholder="@@app_destination" [(ngModel)]="application.destinations[i].destination" [readonly]="readOnlyValue" placeholder="Destination( IPv4 Example: 10.10.10.10:80 , IPv6 Example: [::1%lo]:8080 )" required/>
21-
<mat-icon matSuffix i18n-matTooltip="@@add_destination" matTooltip="Add new destination" matTooltipPosition="left" (click)="addDestination()">add_circle_outline</mat-icon>
22-
<mat-icon *ngIf="application.destinations.length>1" matSuffix (click)="delDestination(i)">remove_circle_outline</mat-icon>
23-
</mat-form-field>
24-
25-
<div class="inner-container" *ngFor="let domain of application.domains; let i=index; trackBy:trackByFn">
26-
<mat-form-field>
52+
<div class="inline-form" *ngFor="let dest of application.destinations;let i=index; trackBy:trackByFn">
53+
<mat-form-field class="inline-form-field-20">
54+
<mat-label i18n="@@request_location">Request Location</mat-label>
55+
<input matInput [(ngModel)]="application.destinations[i].request_route" [readonly]="readOnlyValue" required/>
56+
</mat-form-field>
57+
<mat-form-field class="inline-form-field-20">
58+
<mat-label i18n="@@routing_type">Routing Type</mat-label>
59+
<mat-select [(ngModel)]="application.destinations[i].route_type" [disabled]="readOnlyValue" required>
60+
<mat-option *ngFor="let route_type of enum_route_types;" [value]="route_type.value">
61+
{{ route_type.name }}
62+
</mat-option>
63+
</mat-select>
64+
</mat-form-field>
65+
<mat-form-field class="inline-form-field-25">
66+
<mat-label i18n="@@destination">Destination</mat-label>
67+
<input matInput [(ngModel)]="application.destinations[i].destination" [readonly]="readOnlyValue" required/>
68+
</mat-form-field>
69+
<mat-form-field class="inline-form-field-25">
70+
<mat-label i18n="@@backend_routing">Backend Routing</mat-label>
71+
<input matInput [(ngModel)]="application.destinations[i].backend_route" [readonly]="readOnlyValue" required/>
72+
<mat-icon matSuffix i18n-matTooltip="@@add_new_routing" class="clickable_btn" matTooltip="Add new routing" matTooltipPosition="left" (click)="addDestination()">add_circle_outline</mat-icon>
73+
<mat-icon *ngIf="application.destinations.length>1" matSuffix class="clickable_btn" (click)="delDestination(i)">remove_circle_outline</mat-icon>
74+
</mat-form-field>
75+
76+
</div>
77+
</mat-expansion-panel>
78+
79+
<mat-expansion-panel [expanded]="true" class="detail_panel">
80+
<mat-expansion-panel-header>
81+
<mat-panel-title i18n="@@domain_configuration">Domain Configuration</mat-panel-title>
82+
</mat-expansion-panel-header>
83+
<div class="inline-form" *ngFor="let domain of application.domains; let i=index; trackBy:trackByFn">
84+
<mat-form-field class="inline-form-field-20">
2785
<mat-icon matPrefix>language</mat-icon>
2886
<input matInput i18n-placeholder="@@domain_name" placeholder="Domain name (editable)" [(ngModel)]="application.domains[i].name" [disabled]="readOnlyValue" list="domains" required>
2987
<datalist id="domains">
3088
<option *ngFor="let domain of applicationService.domains;">{{domain.name}}</option>
3189
</datalist>
3290
</mat-form-field>
3391

34-
<mat-form-field>
92+
<mat-form-field class="inline-form-field-20">
3593
<mat-icon matPrefix>lock_outline</mat-icon>
3694
<mat-select i18n-placeholder="@@certificate" placeholder="Certificate" [(ngModel)]="application.domains[i].cert_id" [disabled]="readOnlyValue" required>
3795
<mat-option *ngFor="let certificate of optionCertificates;" [value]="certificate.id">
3896
{{certificate.common_name}}
3997
</mat-option>
4098
</mat-select>
4199
</mat-form-field>
42-
<mat-form-field>
100+
<mat-form-field class="inline-form-field-50">
43101
<mat-checkbox matPrefix i18n="@@redirect" [(ngModel)]="application.domains[i].redirect" [disabled]="readOnlyValue">
44102
Redirect to (301): &nbsp;
45103
</mat-checkbox>
46104
<input matInput placeholder="https://www.your-domain.com/" [(ngModel)]="application.domains[i].location" [disabled]="readOnlyValue">
105+
<mat-icon matSuffix i18n-matTooltip="@@add_domain" matTooltip="Add new domain" matTooltipPosition="right" (click)="addDomain()">add_circle_outline</mat-icon>
106+
<mat-icon matSuffix *ngIf="application.domains.length>1" (click)="delDomain(i)">remove_circle_outline</mat-icon>
47107
</mat-form-field>
48-
<div>
49-
<mat-icon i18n-matTooltip="@@add_domain" matTooltip="Add new domain" matTooltipPosition="right" (click)="addDomain()">add_circle_outline</mat-icon>
50-
<mat-icon *ngIf="application.domains.length>1" (click)="delDomain(i)">remove_circle_outline</mat-icon>
51-
</div>
52108
</div>
109+
</mat-expansion-panel>
110+
111+
53112

54113
<mat-form-field>
55114
<mat-select [(ngModel)]="application.ip_method" i18n-placeholder="@@ip_for_waf"
@@ -80,7 +139,7 @@ <h2>
80139

81140
<section>
82141
<mat-checkbox i18n="@@oauth_required" [(ngModel)]="application.oauth_required" [disabled]="readOnlyValue">
83-
Enable OAuth2 (Only for Internal Employees and Internal Applications. {{ oauth.display_name }})
142+
Enable LDAP or OAuth2 (Depend on configuration file and only for Internal Employees and Internal Applications. {{ oauth.display_name }})
84143
</mat-checkbox>
85144
</section>
86145

src/app/application-detail/application-detail.component.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Component, OnInit, Input } from '@angular/core';
22
import { ActivatedRoute, Router } from '@angular/router';
33
import { HttpClient } from '@angular/common/http';
4-
import { Application, Domain, Certificate,APIResponse, Destination, IPMethod } from '../models';
4+
import { Application, Domain, Certificate,APIResponse, Destination, IPMethod, RouteType } from '../models';
55
import { ApplicationService } from '../application.service';
66
import { FormBuilder, FormGroup } from '@angular/forms';
77
import { MessageService } from '../message.service';
@@ -19,7 +19,8 @@ export class ApplicationDetailComponent implements OnInit {
1919
certIcon: string = "assets/images/cert.png";
2020
optionCertificates: Certificate[];
2121
no_certificate:Certificate;
22-
enum_ip_method_values: {value: number; name: string}[] = []; // number[]=[];
22+
enum_ip_method_values: {value: number; name: string}[] = [];
23+
enum_route_types: {value: number; name: string}[] = [];
2324
oauth: OAuthInfo = new (OAuthInfo);
2425

2526
constructor(
@@ -96,7 +97,10 @@ export class ApplicationDetailComponent implements OnInit {
9697
if(this.readOnlyValue) return;
9798
var new_dest: Destination=new Destination();
9899
new_dest.id = 0;
99-
new_dest.destination = "";
100+
new_dest.route_type = RouteType.Reverse_Proxy;
101+
new_dest.request_route = '/';
102+
new_dest.backend_route = '/';
103+
new_dest.destination = "127.0.0.1:8080";
100104
new_dest.app_id = this.application.id;
101105
new_dest.node_id = 0;
102106
this.application.destinations.push(new_dest);
@@ -161,11 +165,16 @@ export class ApplicationDetailComponent implements OnInit {
161165

162166
ngOnInit() {
163167
//init IPMethod enum
164-
for(var n in IPMethod) {
165-
if (typeof IPMethod[n] == 'number') {
168+
for(var n in IPMethod) {
169+
if (typeof IPMethod[n] == 'number') {
166170
this.enum_ip_method_values.push({value: <any>IPMethod[n], name: n});
171+
}
172+
}
173+
for(var n in RouteType) {
174+
if (typeof RouteType[n] == 'number') {
175+
this.enum_route_types.push({value: <any>RouteType[n], name: n});
176+
}
167177
}
168-
}
169178

170179
if(this.applicationService.domains==null || this.applicationService.domains.length==0) {
171180
this.applicationService.getDomains();

src/app/frontpage/frontpage.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<div class="container">
22

33
<mat-card>
4-
<h2 i18n="@@product_name">Janusec Application Gateway 0.9.7</h2>
4+
<h2 i18n="@@product_name">Janusec Application Gateway 0.9.8</h2>
55
</mat-card>
66

77
<mat-card>
88
<mat-card-content class="card-content">
99
<img mat-card-image src="/janusec-admin/assets/images/gateway.png" class="card-image">
1010
<p i18n="@@product_desc">
11-
Janusec Application Gateway, a Golang based application security solution which provides WAF (Web Application Firewall), CC attack defense, unified web administration portal, private key protection, web routing and scalable load balancing.
11+
Janusec Application Gateway, a Golang based application security solution which provides WAF (Web Application Firewall), CC attack defense, LDAP and OAuth2 Authentication, unified web administration portal, private key protection, web routing and scalable load balancing.
1212
</p>
1313
</mat-card-content>
1414
</mat-card>
@@ -35,7 +35,7 @@ <h2 i18n="@@product_name">Janusec Application Gateway 0.9.7</h2>
3535
</mat-list-item>
3636
<mat-list-item>
3737
<mat-icon mat-card-avatar>done</mat-icon>
38-
<span i18n="@@feature_oauth">OAuth2</span>
38+
<span i18n="@@feature_oauth">LDAP, OAuth2 Authentication</span>
3939
</mat-list-item>
4040
</mat-list>
4141
</mat-card-content>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
.submit {
2-
background-color: #E5E5E5;
3-
}
4-
5-
.oauth {
6-
margin-top: 20px;
1+
.submit {
2+
background-color: #E5E5E5;
3+
}
4+
5+
.oauth {
6+
margin-top: 20px;
77
}

src/app/models.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,17 @@ export class Certificate {
4242
due_to_expire: boolean;
4343
}
4444

45+
export enum RouteType {
46+
Reverse_Proxy =1,
47+
Local_FastCGI =1 << 1,
48+
Static_Website = 1 << 2
49+
}
50+
4551
export class Destination {
4652
id: number;
53+
route_type: RouteType;
54+
request_route: string;
55+
backend_route: string;
4756
destination: string;
4857
app_id: number;
4958
node_id: number;

src/app/navbar/navbar.component.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,15 @@
1818
.logo {
1919
height: 36px;
2020
width: 139px;
21+
}
22+
23+
.text-logo {
24+
font-family: Arial, Helvetica, sans-serif;
25+
font-size: 24px;
26+
color: #f5f5f5;
27+
width: 132px;
28+
text-decoration: none;
29+
text-shadow: 2px 2px 4px #000000;
30+
box-shadow: 2px 2px 2px #888888;
31+
padding-left: 5px;
2132
}

src/app/navbar/navbar.component.html

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
<mat-toolbar color="secondary">
2-
<span class="logo-span">
3-
<a routerLink="/">
4-
<img [src]="logoPath" class="logo">
5-
</a>
6-
</span>
2+
<a routerLink="/" class="text-logo">JANUSEC</a>
3+
74
<span class="spacer"></span>
85
<button mat-button (click)="switchLanguage()" i18n="@@lang">中文</button>
96
<button mat-button [matMenuTriggerFor]="menu" *ngIf="applicationService.auth_user.logged">

0 commit comments

Comments
 (0)