Skip to content
Open
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
4 changes: 2 additions & 2 deletions zeppelin-web-angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"build:tslint-rules": "tsc tslint-rules/*.ts --types node",
"build:projects": "npm run build-project:sdk && npm run build-project:vis && npm run build-project:helium",
"build-helium-vis-example": " ng build --project helium-vis-example",
"build-project:sdk": " ng build --project zeppelin-sdk",
"build-project:vis": " ng build --project zeppelin-visualization",
"build-project:sdk": "ng build --project zeppelin-sdk",
"build-project:vis": "ng build --project zeppelin-visualization",
"build-project:helium": "ng build --project zeppelin-helium",
"test": "ng test",
"lint": "ng lint && prettier --check \"src/**/*.{ts,js,css,html}\"",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,94 +28,92 @@ export interface Ticket {
roles: string;
}

export interface ConfigurationsInfo {
configurations: {
'zeppelin.war.tempdir': string;
'zeppelin.notebook.azure.user': string;
'zeppelin.helium.npm.installer.url': string;
'zeppelin.notebook.git.remote.username': string;
'zeppelin.interpreter.remoterunner': string;
'zeppelin.notebook.s3.user': string;
'zeppelin.server.port': string;
'zeppelin.plugins.dir': string;
'zeppelin.notebook.new_format.delete_old': string;
'zeppelin.ssl.truststore.type': string;
'zeppelin.ssl.keystore.path': string;
'zeppelin.notebook.s3.bucket': string;
'zeppelin.notebook.git.remote.access-token': string;
'zeppelin.recovery.dir': string;
'zeppelin.notebook.s3.timeout': string;
'zeppelin.notebook.cron.enable': string;
'zeppelin.server.addr': string;
'zeppelin.username.force.lowercase': string;
'zeppelin.ssl.keystore.type': string;
'zeppelin.ssl.truststore.path': string;
'zeppelin.notebook.dir': string;
'zeppelin.interpreter.lifecyclemanager.class': string;
'zeppelin.notebook.gcs.dir': string;
'zeppelin.notebook.s3.sse': string;
'zeppelin.websocket.max.text.message.size': string;
'zeppelin.notebook.git.remote.origin': string;
'zeppelin.server.authorization.header.clear': string;
'zeppelin.interpreter.dep.mvnRepo': string;
'zeppelin.ssl': string;
'zeppelin.notebook.autoInterpreterBinding': string;
'zeppelin.config.storage.class': string;
'zeppelin.helium.node.installer.url': string;
'zeppelin.notebook.storage': string;
'zeppelin.notebook.new_format.convert': string;
'zeppelin.interpreter.dir': string;
'zeppelin.anonymous.allowed': string;
'zeppelin.credentials.persist': string;
'zeppelin.notebook.mongo.uri': string;
'zeppelin.config.fs.dir': string;
'zeppelin.server.allowed.origins': string;
'zeppelin.notebook.mongo.database': string;
'zeppelin.encoding': string;
'zeppelin.server.jetty.request.header.size': string;
'zeppelin.search.temp.path': string;
'zeppelin.notebook.s3.endpoint': string;
'zeppelin.notebook.homescreen.hide': string;
'zeppelin.scheduler.threadpool.size': string;
'zeppelin.notebook.azure.share': string;
'zeppelin.helium.yarnpkg.installer.url': string;
'zeppelin.server.strict.transport': string;
'zeppelin.interpreter.setting': string;
'zeppelin.server.xxss.protection': string;
'zeppelin.server.rpc.portRange': string;
'zeppelin.war': string;
'zeppelin.interpreter.output.limit': string;
'zeppelin.dep.localrepo': string;
'zeppelin.interpreter.max.poolsize': string;
'zeppelin.server.ssl.port': string;
'zeppelin.notebook.mongo.collection': string;
'zeppelin.notebook.public': string;
'zeppelin.helium.registry': string;
'zeppelin.server.kerberos.principal': string;
'zeppelin.server.default.dir.allowed': string;
'zeppelin.ssl.client.auth': string;
'zeppelin.server.context.path': string;
'zeppelin.recovery.storage.class': string;
'zeppelin.notebook.default.owner.username': string;
'zeppelin.home': string;
'zeppelin.interpreter.lifecyclemanager.timeout.threshold': string;
'zeppelin.notebook.git.remote.url': string;
'zeppelin.notebook.mongo.autoimport': string;
'zeppelin.notebook.one.way.sync': string;
'zeppelin.notebook.homescreen': string;
'zeppelin.interpreter.connect.timeout': string;
'zeppelin.server.xframe.options': string;
'zeppelin.interpreter.lifecyclemanager.timeout.checkinterval': string;
'zeppelin.server.kerberos.keytab': string;
'zeppelin.interpreter.rpc.portRange': string;
'zeppelin.interpreter.group.default': string;
'zeppelin.conf.dir': string;
'zeppelin.interpreter.localRepo': string;
'zeppelin.notebook.collaborative.mode.enable': string;
'zeppelin.search.use.disk': string;
'zeppelin.notebook.s3.cannedAcl': string;
'zeppelin.notebook.s3.pathStyleAccess': string;
};
export interface Configuration {
'zeppelin.war.tempdir': string;
'zeppelin.notebook.azure.user': string;
'zeppelin.helium.npm.installer.url': string;
'zeppelin.notebook.git.remote.username': string;
'zeppelin.interpreter.remoterunner': string;
'zeppelin.notebook.s3.user': string;
'zeppelin.server.port': string;
'zeppelin.plugins.dir': string;
'zeppelin.notebook.new_format.delete_old': string;
'zeppelin.ssl.truststore.type': string;
'zeppelin.ssl.keystore.path': string;
'zeppelin.notebook.s3.bucket': string;
'zeppelin.notebook.git.remote.access-token': string;
'zeppelin.recovery.dir': string;
'zeppelin.notebook.s3.timeout': string;
'zeppelin.notebook.cron.enable': string;
'zeppelin.server.addr': string;
'zeppelin.username.force.lowercase': string;
'zeppelin.ssl.keystore.type': string;
'zeppelin.ssl.truststore.path': string;
'zeppelin.notebook.dir': string;
'zeppelin.interpreter.lifecyclemanager.class': string;
'zeppelin.notebook.gcs.dir': string;
'zeppelin.notebook.s3.sse': string;
'zeppelin.websocket.max.text.message.size': string;
'zeppelin.notebook.git.remote.origin': string;
'zeppelin.server.authorization.header.clear': string;
'zeppelin.interpreter.dep.mvnRepo': string;
'zeppelin.ssl': string;
'zeppelin.notebook.autoInterpreterBinding': string;
'zeppelin.config.storage.class': string;
'zeppelin.helium.node.installer.url': string;
'zeppelin.notebook.storage': string;
'zeppelin.notebook.new_format.convert': string;
'zeppelin.interpreter.dir': string;
'zeppelin.anonymous.allowed': string;
'zeppelin.credentials.persist': string;
'zeppelin.notebook.mongo.uri': string;
'zeppelin.config.fs.dir': string;
'zeppelin.server.allowed.origins': string;
'zeppelin.notebook.mongo.database': string;
'zeppelin.encoding': string;
'zeppelin.server.jetty.request.header.size': string;
'zeppelin.search.temp.path': string;
'zeppelin.notebook.s3.endpoint': string;
'zeppelin.notebook.homescreen.hide': string;
'zeppelin.scheduler.threadpool.size': string;
'zeppelin.notebook.azure.share': string;
'zeppelin.helium.yarnpkg.installer.url': string;
'zeppelin.server.strict.transport': string;
'zeppelin.interpreter.setting': string;
'zeppelin.server.xxss.protection': string;
'zeppelin.server.rpc.portRange': string;
'zeppelin.war': string;
'zeppelin.interpreter.output.limit': string;
'zeppelin.dep.localrepo': string;
'zeppelin.interpreter.max.poolsize': string;
'zeppelin.server.ssl.port': string;
'zeppelin.notebook.mongo.collection': string;
'zeppelin.notebook.public': string;
'zeppelin.helium.registry': string;
'zeppelin.server.kerberos.principal': string;
'zeppelin.server.default.dir.allowed': string;
'zeppelin.ssl.client.auth': string;
'zeppelin.server.context.path': string;
'zeppelin.recovery.storage.class': string;
'zeppelin.notebook.default.owner.username': string;
'zeppelin.home': string;
'zeppelin.interpreter.lifecyclemanager.timeout.threshold': string;
'zeppelin.notebook.git.remote.url': string;
'zeppelin.notebook.mongo.autoimport': string;
'zeppelin.notebook.one.way.sync': string;
'zeppelin.notebook.homescreen': string;
'zeppelin.interpreter.connect.timeout': string;
'zeppelin.server.xframe.options': string;
'zeppelin.interpreter.lifecyclemanager.timeout.checkinterval': string;
'zeppelin.server.kerberos.keytab': string;
'zeppelin.interpreter.rpc.portRange': string;
'zeppelin.interpreter.group.default': string;
'zeppelin.conf.dir': string;
'zeppelin.interpreter.localRepo': string;
'zeppelin.notebook.collaborative.mode.enable': string;
'zeppelin.search.use.disk': string;
'zeppelin.notebook.s3.cannedAcl': string;
'zeppelin.notebook.s3.pathStyleAccess': string;
}

export interface ErrorInfo {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* limitations under the License.
*/

import { AuthInfo, ConfigurationsInfo, ErrorInfo } from './message-common.interface';
import { AuthInfo, ErrorInfo } from './message-common.interface';
import {
CheckpointNote,
CloneNote,
Expand Down Expand Up @@ -86,7 +86,6 @@ export type MixMessageDataTypeMap = MessageSendDataTypeMap & MessageReceiveDataT
export interface MessageReceiveDataTypeMap {
[OP.COMPLETION_LIST]: CompletionReceived;
[OP.NOTES_INFO]: NotesInfo;
[OP.CONFIGURATIONS_INFO]: ConfigurationsInfo;
[OP.NOTE]: Note;
[OP.NOTE_REVISION]: NoteRevision;
[OP.ERROR_INFO]: ErrorInfo;
Expand Down Expand Up @@ -118,7 +117,6 @@ export interface MessageReceiveDataTypeMap {

export interface MessageSendDataTypeMap {
[OP.PING]: undefined;
[OP.LIST_CONFIGURATIONS]: undefined;
[OP.LIST_NOTES]: undefined;
[OP.GET_HOME_NOTE]: undefined;
[OP.RESTORE_ALL]: undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,19 +264,6 @@ export enum OP {
*/
ANGULAR_OBJECT_CLIENT_UNBIND = 'ANGULAR_OBJECT_CLIENT_UNBIND',

/**
* [c-s]
* ask all key/value pairs of configurations
*/
LIST_CONFIGURATIONS = 'LIST_CONFIGURATIONS',

/**
* [s-c]
* all key/value pairs of configurations
* @param settings serialized Map<String = 'String', String> object
*/
CONFIGURATIONS_INFO = 'CONFIGURATIONS_INFO',

/**
* [c-s]
* checkpoint note to storage repository
Expand Down
4 changes: 0 additions & 4 deletions zeppelin-web-angular/projects/zeppelin-sdk/src/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,10 +546,6 @@ export class Message {
{noteId: noteId, selectedSettingIds: selectedSettingIds});
}

listConfigurations(): void {
this.send<OP.LIST_CONFIGURATIONS>(OP.LIST_CONFIGURATIONS);
}

getInterpreterSettings(): void {
this.send<OP.GET_INTERPRETER_SETTINGS>(OP.GET_INTERPRETER_SETTINGS);
}
Expand Down
10 changes: 8 additions & 2 deletions zeppelin-web-angular/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import { registerLocaleData } from '@angular/common';
import { HttpClientModule, HTTP_INTERCEPTORS } from '@angular/common/http';
import en from '@angular/common/locales/en';
import { NgModule } from '@angular/core';
import { APP_INITIALIZER, NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
Expand All @@ -26,7 +26,7 @@ import { NzNotificationService } from 'ng-zorro-antd/notification';

import { MESSAGE_INTERCEPTOR, TRASH_FOLDER_ID_TOKEN } from '@zeppelin/interfaces';
import { loadMonacoBefore } from '@zeppelin/languages';
import { TicketService } from '@zeppelin/services';
import { ConfigurationService, TicketService } from '@zeppelin/services';
import { ShareModule } from '@zeppelin/share';

import { JoinedEditorOptions, NZ_CODE_EDITOR_CONFIG } from '@zeppelin/share/code-editor';
Expand Down Expand Up @@ -66,6 +66,12 @@ registerLocaleData(en);
multi: true,
deps: [TicketService]
},
{
provide: APP_INITIALIZER,
useFactory: (configService: ConfigurationService) => () => configService.initialize(),
deps: [ConfigurationService],
multi: true
},
{
provide: NZ_CODE_EDITOR_CONFIG,
useValue: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
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">
<nz-table nzSize="small" [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 *ngFor="let entry of configuration | keyvalue">
<td>{{ entry.key }}</td>
<td>{{ entry.value }}</td>
</tr>
</tbody>
</nz-table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { Configuration } from '@zeppelin/sdk';
import { ConfigurationService } from '@zeppelin/services';

@Component({
Expand All @@ -18,19 +19,10 @@ import { ConfigurationService } from '@zeppelin/services';
styleUrls: ['./configuration.component.less'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class ConfigurationComponent implements OnInit {
configEntries: Array<[string, string]> = [];
export class ConfigurationComponent {
constructor(private configurationService: ConfigurationService) {}

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

ngOnInit() {
this.getAllConfig();
}

getAllConfig(): void {
this.configurationService.getAll().subscribe(data => {
this.configEntries = [...Object.entries<string>(data)].sort((a, b) => a[0].localeCompare(b[0]));
this.cdr.markForCheck();
});
get configuration(): Configuration | null {
return this.configurationService.configuration ?? null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ import { NzModalService } from 'ng-zorro-antd/modal';
import { MessageListener, MessageListenersManager } from '@zeppelin/core';
import { TRASH_FOLDER_ID_TOKEN } from '@zeppelin/interfaces';
import { MessageReceiveDataTypeMap, Note, OP, RevisionListItem } from '@zeppelin/sdk';
import { MessageService, NoteStatusService, SaveAsService, TicketService } from '@zeppelin/services';
import {
ConfigurationService,
MessageService,
NoteStatusService,
SaveAsService,
TicketService
} from '@zeppelin/services';

import { NotebookService } from '@zeppelin/services/notebook.service';
import { NoteCreateComponent } from '@zeppelin/share/note-create/note-create.component';
Expand Down Expand Up @@ -185,10 +191,10 @@ export class NotebookActionBarComponent extends MessageListenersManager implemen
}

exportNote() {
if (!this.ticketService.configuration) {
if (!this.configurationService.configuration) {
throw new Error('Configuration is not loaded');
}
const sizeLimit = +this.ticketService.configuration['zeppelin.websocket.max.text.message.size'];
const sizeLimit = +this.configurationService.configuration['zeppelin.websocket.max.text.message.size'];
const jsonContent = JSON.stringify(this.note);
if (jsonContent.length > sizeLimit) {
this.nzModalService.confirm({
Expand Down Expand Up @@ -296,11 +302,12 @@ export class NotebookActionBarComponent extends MessageListenersManager implemen
private noteStatusService: NoteStatusService,
private notebookService: NotebookService,
private activatedRoute: ActivatedRoute,
private saveAsService: SaveAsService
private saveAsService: SaveAsService,
private configurationService: ConfigurationService
) {
super(messageService);
this.updateIsNoteParagraphRunning();
if (!this.ticketService.configuration) {
if (!this.configurationService.configuration) {
throw new Error('Configuration is not loaded');
}
}
Expand Down
Loading
Loading