Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion knox-homepage-ui/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default [
languageOptions: {
parser: tsParser,
parserOptions: {
project: ["./tsconfig.json"],
project: ["home/tsconfig.json"],
tsconfigRootDir: import.meta.dirname,
},
globals: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<h3 mat-dialog-title class="dialog-title">
{{ data?.shortDesc }}
Expand All @@ -22,7 +22,9 @@ <h3 mat-dialog-title class="dialog-title">
<div class="info-label"><strong>Knox Service Name</strong></div>
<div class="info-value">
{{ data?.serviceName }}
<span class="small" *ngIf="data?.version">(v{{ data?.version }})</span>
@if (data?.version) {
<span class="small">(v{{ data?.version }})</span>
}
</div>
</div>

Expand All @@ -34,16 +36,16 @@ <h3 mat-dialog-title class="dialog-title">
<div class="info-row">
<div class="info-label"><strong>Sample(s)</strong></div>
<div class="info-value">
<ng-container *ngIf="data.samples?.sample?.length > 0; else noSamples">
@if (data.samples?.sample?.length > 0) {
<div class="samples-container">
<div *ngFor="let sample of data.samples.sample" class="sample-item">
<div class="sample-desc"><strong>{{ sample.description }}</strong></div>
<div class="sample-value">{{ sample.value }}</div>
</div>
@for (sample of data.samples.sample; track sample) {
<div class="sample-item">
<div class="sample-desc"><strong>{{ sample.description }}</strong></div>
<div class="sample-value">{{ sample.value }}</div>
</div>
}
</div>
</ng-container>

<ng-template #noSamples>
} @else {
<div class="no-samples">
<p><strong>No samples found in service metadata.</strong></p>
<p>
Expand All @@ -53,7 +55,8 @@ <h3 mat-dialog-title class="dialog-title">
</a>
</p>
</div>
</ng-template>
}

</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import { MatButtonModule } from '@angular/material/button';
import { MatGridListModule } from '@angular/material/grid-list';
import { MatListModule } from '@angular/material/list';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { CommonModule } from '@angular/common';


@Component({
selector: 'app-apiservice-dialog',
imports: [MatDialogModule, MatButtonModule, MatGridListModule, MatListModule, CommonModule],
imports: [MatDialogModule, MatButtonModule, MatGridListModule, MatListModule],
templateUrl: './apiservice-dialog.component.html',
styleUrl: './apiservice-dialog.component.css'
})
Expand Down
3 changes: 0 additions & 3 deletions knox-homepage-ui/home/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { HttpClientModule, HttpClientXsrfModule } from '@angular/common/http';
import { MatGridListModule } from '@angular/material/grid-list';
import { RouterModule } from '@angular/router';

Expand All @@ -25,8 +24,6 @@ import { HomepageService } from './service/homepage.service';
@NgModule({
imports: [
BrowserModule,
HttpClientModule,
HttpClientXsrfModule,
MatGridListModule,
RouterModule.forRoot([]),
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,85 +1,107 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div>
<h4 (click)="toggleBoolean('showGeneralProxyInformation')" class="d-flex align-items-center">
<mat-icon *ngIf="this['showGeneralProxyInformation']">remove</mat-icon>
<mat-icon *ngIf="!this['showGeneralProxyInformation']">add</mat-icon>
General Proxy Information
</h4>
<h4 (click)="toggleBoolean('showGeneralProxyInformation')" class="d-flex align-items-center">
@if (this['showGeneralProxyInformation']) {
<mat-icon>remove</mat-icon>
}
@if (!this['showGeneralProxyInformation']) {
<mat-icon>add</mat-icon>
}
General Proxy Information
</h4>
</div>
<div class="table-responsive" *ngIf="this['showGeneralProxyInformation']">
@if (this['showGeneralProxyInformation']) {
<div class="table-responsive">
<table class="table table-striped table-hover">
<colgroup>
<col width="30%">
<col width="70%">
</colgroup>
<tbody>
<tr *ngIf="this['showKnoxVersion']">
<td>Knox Version</td>
<td>{{ getVersion() }}</td>
</tr>
<tr *ngIf="this['showKnoxHostname']">
<td>Hostname</td>
<td>{{ getHostname() }}</td>
</tr>
<tr *ngIf="this['showPublicCerts']">
<td>TLS Public Certificate</td>
<td>
<a href="{{ getMetadataAPIUrl('publicCert?type=pem') }}">PEM</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="{{ getMetadataAPIUrl('publicCert?type=jks') }}">JKS</a>
</td>
</tr>
<tr *ngIf="this['showAdminUI']">
<td>Admin UI URL</td>
<td><a href="{{ getAdminUiUrl() }}" target="_blank">{{ getAdminUiUrl() }}</a></td>
</tr>
<tr *ngIf="this['showAdminAPI']">
<td>
Admin API Details
<span class="inline-glyph glyphicon glyphicon-info-sign btn btn-xs"
title="{{ getAdminApiDescription() }}" data-toggle="tooltip"></span>
</td>
<td>
<a href="{{ getAdminApiBookUrl() }}" target="_blank">{{ getAdminApiBookUrl() }}</a>
</td>
</tr>
<tr *ngIf="this['showMetadataAPI']">
<td>
Metadata API
</td>
<td>
<a href="{{ getMetadataAPIUrl('info') }}" target="_blank">General Proxy Information</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="{{ getMetadataAPIUrl('topologies') }}" target="_blank">Topologies</a>
</td>
</tr>
<tr *ngIf="this.isTokenManagementEnabled() && this['showTokens']">
<td>
Integration Tokens
</td>
<td>
<a href="{{ getTokenManagementUrl() }}" target="_blank">Token Management</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="{{ getTokenGenerationUrl() }}" target="_blank">Token Generation</a>
</td>
</tr>
<tr *ngIf="this.isWebshellEnabled() && this['showWebShell']">
<td>Web Shell</td>
<td><a href="{{ getWebShellUrl() }}" target="_blank">{{ getWebShellUrl() }}</a></td>
</tr>
</tbody>
</table>
</div>
<colgroup>
<col width="30%">
<col width="70%">
</colgroup>
<tbody>
@if (this['showKnoxVersion']) {
<tr>
<td>Knox Version</td>
<td>{{ getVersion() }}</td>
</tr>
}
@if (this['showKnoxHostname']) {
<tr>
<td>Hostname</td>
<td>{{ getHostname() }}</td>
</tr>
}
@if (this['showPublicCerts']) {
<tr>
<td>TLS Public Certificate</td>
<td>
<a href="{{ getMetadataAPIUrl('publicCert?type=pem') }}">PEM</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="{{ getMetadataAPIUrl('publicCert?type=jks') }}">JKS</a>
</td>
</tr>
}
@if (this['showAdminUI']) {
<tr>
<td>Admin UI URL</td>
<td><a href="{{ getAdminUiUrl() }}" target="_blank">{{ getAdminUiUrl() }}</a></td>
</tr>
}
@if (this['showAdminAPI']) {
<tr>
<td>
Admin API Details
<span class="inline-glyph glyphicon glyphicon-info-sign btn btn-xs"
title="{{ getAdminApiDescription() }}" data-toggle="tooltip"></span>
</td>
<td>
<a href="{{ getAdminApiBookUrl() }}" target="_blank">{{ getAdminApiBookUrl() }}</a>
</td>
</tr>
}
@if (this['showMetadataAPI']) {
<tr>
<td>
Metadata API
</td>
<td>
<a href="{{ getMetadataAPIUrl('info') }}" target="_blank">General Proxy Information</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="{{ getMetadataAPIUrl('topologies') }}" target="_blank">Topologies</a>
</td>
</tr>
}
@if (this.isTokenManagementEnabled() && this['showTokens']) {
<tr>
<td>
Integration Tokens
</td>
<td>
<a href="{{ getTokenManagementUrl() }}" target="_blank">Token Management</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
<a href="{{ getTokenGenerationUrl() }}" target="_blank">Token Generation</a>
</td>
</tr>
}
@if (this.isWebshellEnabled() && this['showWebShell']) {
<tr>
<td>Web Shell</td>
<td><a href="{{ getWebShellUrl() }}" target="_blank">{{ getWebShellUrl() }}</a></td>
</tr>
}
</tbody>
</table>
</div>
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {HomepageService} from '../service/homepage.service';
import {GeneralProxyInformation} from '../model/general.proxy.information';
import { CommonModule } from '@angular/common';

import { MatIconModule } from '@angular/material/icon';

@Component({
selector: 'app-general-proxy-information',
templateUrl: './general.proxy.information.component.html',
providers: [HomepageService],
imports: [CommonModule, MatIconModule]
imports: [MatIconModule]
})

export class GeneralProxyInformationComponent implements OnInit {
Expand All @@ -34,7 +34,7 @@ export class GeneralProxyInformationComponent implements OnInit {
profile: JSON;

constructor(private homepageService: HomepageService, private route: ActivatedRoute) {
this['showGeneralProxyInformation'] = false;
this['showGeneralProxyInformation'] = true;
this['showKnoxVersion'] = true;
this['showKnoxHostname'] = true;
this['showPublicCerts'] = true;
Expand Down
2 changes: 1 addition & 1 deletion knox-homepage-ui/home/app/service/homepage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export class HomepageService {

getProfile(profileName: string): Promise<JSON> {
let headers = this.addJsonHeaders(new HttpHeaders());
let url = `${this.apiUrl}/profiles/${profileName}`;
let url = `${this.apiUrl}profiles/${profileName}`;
return firstValueFrom(this.http.get(url, { headers }))
.catch(err => this.handleError(err));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div style="text-align: right; color: rgb(130, 180, 93);">Welcome {{ getUser() }}</div>
<div *ngIf="logoutSupported" style="text-align: right;"><a class="btn btn-primary" (click)="logout()">logout</a></div>
@if (logoutSupported) {
<div style="text-align: right;"><a class="btn btn-primary" (click)="logout()">logout</a></div>
}
<div style="margin-left: 15%; text-align: center; color: rgb(130,180, 93); max-width: 70%; word-wrap: break-word;" [innerHTML]="getBannerText() | safeHtml"></div>
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
import {Component, OnInit} from '@angular/core';
import {HomepageService} from '../service/homepage.service';
import {SessionInformation} from '../model/session.information';
import { CommonModule } from '@angular/common';

import { SafeHtmlPipe } from '../util/safehtml';

@Component({
selector: 'app-session-information',
templateUrl: './session.information.component.html',
providers: [HomepageService],
imports: [CommonModule, SafeHtmlPipe]
imports: [SafeHtmlPipe]
})

export class SessionInformationComponent implements OnInit {
Expand Down
Loading
Loading