Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Licensed 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.
*/
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ConfigurationComponent } from './configuration.component';

const routes: Routes = [
{
path: '',
component: ConfigurationComponent
}
];

@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule]
})
export class ConfigurationRoutingModule {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!--
~ Licensed 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.
-->

<zeppelin-page-header [description]="configDesc" title="Configurations"></zeppelin-page-header>
<ng-template #configDesc>
Shows current configurations for Zeppelin Server.
<br>
Note: For security reasons, some key/value pairs including passwords would not be shown.
</ng-template>
<div class="content">
<nz-table nzSize="small"
[nzData]="configEntries"
[nzFrontPagination]="false"
[nzShowPagination]="false">
<thead>
<tr>
<th>Name</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let data of configEntries">
<td>{{data[0]}}</td>
<td>{{data[1]}}</td>
</tr>
</tbody>
</nz-table>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Licensed 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.
*/

@import 'theme-mixin';

.themeMixin({
.content {
padding: @card-padding-base / 2;
nz-table {
background: @card-background;
}
}
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Licensed 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.
*/
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { ConfigurationService } from '@zeppelin/services';

@Component({
selector: 'zeppelin-configuration',
templateUrl: './configuration.component.html',
styleUrls: ['./configuration.component.less'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ConfigurationComponent implements OnInit {
configEntries: Array<[string, string]> = [];

constructor(private configurationService: ConfigurationService, private cdr: ChangeDetectorRef) {}

ngOnInit() {
this.getAllConfig();
}

getAllConfig(): void {
this.configurationService.getAll().subscribe(data => {
this.configEntries = [...Object.entries<string>(data)];
this.cdr.markForCheck();
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Licensed 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.
*/
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { ShareModule } from '@zeppelin/share';
import { NzTableModule } from 'ng-zorro-antd';
import { ConfigurationRoutingModule } from './configuration-routing.module';
import { ConfigurationComponent } from './configuration.component';

@NgModule({
declarations: [ConfigurationComponent],
imports: [CommonModule, ShareModule, NzTableModule, ConfigurationRoutingModule]
})
export class ConfigurationModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ const routes: Routes = [
path: 'interpreter',
loadChildren: () =>
import('@zeppelin/pages/workspace/interpreter/interpreter.module').then(m => m.InterpreterModule)
},
{
path: 'configuration',
loadChildren: () =>
import('@zeppelin/pages/workspace/configuration/configuration.module').then(m => m.ConfigurationModule)
}
]
}
Expand Down
30 changes: 30 additions & 0 deletions zeppelin-web-angular/src/app/services/configuration.service.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Licensed 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.
*/

import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

import { BaseRest } from './base-rest';
import { BaseUrlService } from './base-url.service';

@Injectable({
providedIn: 'root'
})
export class ConfigurationService extends BaseRest {
constructor(baseUrlService: BaseUrlService, private http: HttpClient) {
super(baseUrlService);
}

getAll() {
return this.http.get<{ [key: string]: string }>(this.restUrl`/configurations/all`);
}
}
1 change: 1 addition & 0 deletions zeppelin-web-angular/src/app/services/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ export * from './array-ordering.service';
export * from './note-list.service';
export * from './runtime-compiler.service';
export * from './shortcut.service';
export * from './configuration.service';
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<nz-card class="header">
<h2>{{title}} <span class="header-extra"><ng-container [ngTemplateOutlet]="extra"></ng-container></span></h2>
<p>{{description}}</p>
<p><ng-container *nzStringTemplateOutlet="description">{{description}}</ng-container></p>
<nz-divider *ngIf="divider" nzType="horizontal"></nz-divider>
<ng-content></ng-content>
</nz-card>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { InputBoolean } from 'ng-zorro-antd';
})
export class PageHeaderComponent implements OnInit {
@Input() title: string;
@Input() description: string;
@Input() description: string | TemplateRef<void>;
@Input() @InputBoolean() divider = false;
@Input() extra: TemplateRef<void>;

Expand Down
2 changes: 2 additions & 0 deletions zeppelin-web-angular/src/app/share/share.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';

import {
NzAddOnModule,
NzAlertModule,
NzBadgeModule,
NzButtonModule,
Expand Down Expand Up @@ -74,6 +75,7 @@ const PIPES = [HumanizeBytesPipe];
FormsModule,
CommonModule,
NzMenuModule,
NzAddOnModule,
NzIconModule,
NzInputModule,
NzDropDownModule,
Expand Down