You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2017/06/22 13:16:42 UTC
[15/21] ambari git commit: AMBARI-21318 Log Search UI: implement
filters panel. (ababiichuk)
AMBARI-21318 Log Search UI: implement filters panel. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/6fc2fef6
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/6fc2fef6
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/6fc2fef6
Branch: refs/heads/branch-feature-logsearch-ui
Commit: 6fc2fef6e0f3480551bbd18a888ad44b0005fade
Parents: ae40a5f
Author: ababiichuk <ab...@hortonworks.com>
Authored: Thu Jun 8 13:35:12 2017 +0300
Committer: ababiichuk <ab...@hortonworks.com>
Committed: Thu Jun 22 15:40:37 2017 +0300
----------------------------------------------------------------------
.../ambari-logsearch-web-new/package.json | 4 +
.../src/app/app.component.html | 2 +-
.../src/app/app.component.less | 6 +-
.../src/app/app.component.ts | 2 +-
.../src/app/app.module.ts | 15 +-
.../dropdown-list/dropdown-list.component.html | 20 +++
.../dropdown-list.component.spec.ts | 92 ++++++++++
.../dropdown-list/dropdown-list.component.ts | 50 ++++++
.../filter-dropdown.component.html | 23 +++
.../filter-dropdown.component.less | 31 ++++
.../filter-dropdown.component.spec.ts | 95 +++++++++++
.../filter-dropdown.component.ts | 45 +++++
.../filter-text-field.component.html | 21 +++
.../filter-text-field.component.less | 33 ++++
.../filter-text-field.component.spec.ts | 61 +++++++
.../filter-text-field.component.ts | 35 ++++
.../filters-panel/filters-panel.component.html | 36 ++++
.../filters-panel/filters-panel.component.less | 38 +++++
.../filters-panel.component.spec.ts | 59 +++++++
.../filters-panel/filters-panel.component.ts | 35 ++++
.../app/login-form/login-form.component.html | 2 +-
.../app/login-form/login-form.component.less | 22 +++
.../app/login-form/login-form.component.spec.ts | 2 +-
.../src/app/login-form/login-form.component.ts | 3 +-
.../main-container.component.html | 19 +++
.../main-container.component.spec.ts | 49 ++++++
.../main-container/main-container.component.ts | 33 ++++
.../app/menu-button/menu-button.component.html | 17 +-
.../app/menu-button/menu-button.component.less | 4 +
.../menu-button/menu-button.component.spec.ts | 39 ++++-
.../app/menu-button/menu-button.component.ts | 25 ++-
.../app/services/component-actions.service.ts | 6 -
.../src/app/services/filtering.service.spec.ts | 33 ++++
.../src/app/services/filtering.service.ts | 167 +++++++++++++++++++
.../src/app/top-menu/top-menu.component.html | 5 +-
.../src/app/top-menu/top-menu.component.less | 6 +-
.../src/app/top-menu/top-menu.component.ts | 60 ++++---
.../src/assets/i18n/en.json | 29 +++-
.../ambari-logsearch-web-new/src/styles.less | 15 ++
.../ambari-logsearch-web-new/yarn.lock | 20 ++-
40 files changed, 1194 insertions(+), 65 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/package.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/package.json b/ambari-logsearch/ambari-logsearch-web-new/package.json
index 0994703..da44d30 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/package.json
+++ b/ambari-logsearch/ambari-logsearch-web-new/package.json
@@ -27,6 +27,8 @@
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"jquery": "^1.12.4",
+ "moment": "^2.18.1",
+ "moment-timezone": "^0.5.13",
"ngx-bootstrap": "^1.6.6",
"rxjs": "^5.1.0",
"zone.js": "^0.8.4"
@@ -35,6 +37,8 @@
"@angular/cli": "1.0.0",
"@angular/compiler-cli": "^4.0.0",
"@types/jasmine": "2.5.38",
+ "@types/moment": "^2.13.0",
+ "@types/moment-timezone": "^0.2.34",
"@types/node": "~6.0.60",
"angular-in-memory-web-api": "^0.3.1",
"codelyzer": "~2.0.0",
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.html b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.html
index 8b8687a..267e08b 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.html
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.html
@@ -29,4 +29,4 @@
<h1> </h1>
</div>
-<login-form *ngIf="!httpClient.isAuthorized"></login-form>
+<main-container></main-container>
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.less b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.less
index e09da49..3affd3f 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.less
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.less
@@ -15,18 +15,16 @@
* limitations under the License.
*/
-
@import '../styles.less';
.navbar {
+ margin-bottom: 0;
border-radius: 0;
background-color: @navbar-background-color;
color: #fff;
.container-fluid {
- display: flex;
- align-items: center;
- justify-content: space-between;
+ .default-flex;
}
h1 {
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.ts
index fb79ccb..e86a8a1 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.component.ts
@@ -18,7 +18,7 @@
import {Component} from '@angular/core';
import {TranslateService} from '@ngx-translate/core';
-import {HttpClientService} from './services/http-client.service';
+import {HttpClientService} from '@app/services/http-client.service';
@Component({
selector: 'app-root',
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/app.module.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.module.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.module.ts
index f4ee972..f7221b3 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/app.module.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/app.module.ts
@@ -28,6 +28,8 @@ import {TranslateHttpLoader} from '@ngx-translate/http-loader';
import {StoreModule} from '@ngrx/store';
import {HttpClientService} from '@app/services/http-client.service';
import {ComponentActionsService} from '@app/services/component-actions.service';
+import {FilteringService} from '@app/services/filtering.service';
+
import {AuditLogsService, auditLogs} from '@app/services/storage/audit-logs.service';
import {ServiceLogsService, serviceLogs} from '@app/services/storage/service-logs.service';
import {BarGraphsService, barGraphs} from '@app/services/storage/bar-graphs.service';
@@ -40,6 +42,11 @@ import {AppComponent} from '@app/app.component';
import {LoginFormComponent} from '@app/login-form/login-form.component';
import {TopMenuComponent} from '@app/top-menu/top-menu.component';
import {MenuButtonComponent} from '@app/menu-button/menu-button.component';
+import {MainContainerComponent} from '@app/main-container/main-container.component';
+import {FiltersPanelComponent} from '@app/filters-panel/filters-panel.component';
+import {FilterDropdownComponent} from '@app/filter-dropdown/filter-dropdown.component';
+import {DropdownListComponent} from '@app/dropdown-list/dropdown-list.component';
+import {FilterTextFieldComponent} from '@app/filter-text-field/filter-text-field.component';
export function HttpLoaderFactory(http: Http) {
return new TranslateHttpLoader(http, 'assets/i18n/', '.json');
@@ -50,7 +57,12 @@ export function HttpLoaderFactory(http: Http) {
AppComponent,
LoginFormComponent,
TopMenuComponent,
- MenuButtonComponent
+ MenuButtonComponent,
+ MainContainerComponent,
+ FiltersPanelComponent,
+ DropdownListComponent,
+ FilterDropdownComponent,
+ FilterTextFieldComponent
],
imports: [
BrowserModule,
@@ -80,6 +92,7 @@ export function HttpLoaderFactory(http: Http) {
providers: [
HttpClientService,
ComponentActionsService,
+ FilteringService,
AuditLogsService,
ServiceLogsService,
BarGraphsService,
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/dropdown-list/dropdown-list.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/dropdown-list/dropdown-list.component.html b/ambari-logsearch/ambari-logsearch-web-new/src/app/dropdown-list/dropdown-list.component.html
new file mode 100644
index 0000000..db4ee79
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/dropdown-list/dropdown-list.component.html
@@ -0,0 +1,20 @@
+<!--
+ 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.
+-->
+
+<li *ngFor="let item of items">
+ <a href="#" (click)="changeSelectedItem({value: item.value, label: item.label})">{{item.label | translate}}</a>
+</li>
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/dropdown-list/dropdown-list.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/dropdown-list/dropdown-list.component.spec.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/dropdown-list/dropdown-list.component.spec.ts
new file mode 100644
index 0000000..445ee97
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/dropdown-list/dropdown-list.component.spec.ts
@@ -0,0 +1,92 @@
+/**
+ * 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.
+ */
+
+import {async, ComponentFixture, TestBed} from '@angular/core/testing';
+import {Http} from '@angular/http';
+import {TranslateModule, TranslateLoader} from '@ngx-translate/core';
+import {TranslateHttpLoader} from '@ngx-translate/http-loader';
+
+import {DropdownListComponent} from './dropdown-list.component';
+
+export function HttpLoaderFactory(http: Http) {
+ return new TranslateHttpLoader(http, 'assets/i18n/', '.json');
+}
+
+describe('DropdownListComponent', () => {
+ let component: DropdownListComponent;
+ let fixture: ComponentFixture<DropdownListComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [DropdownListComponent],
+ imports: [TranslateModule.forRoot({
+ provide: TranslateLoader,
+ useFactory: HttpLoaderFactory,
+ deps: [Http]
+ })]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(DropdownListComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create component', () => {
+ expect(component).toBeTruthy();
+ });
+
+ describe('#changeSelectedItem()', () => {
+
+ beforeEach(() => {
+ spyOn(component.selectedItemChange, 'emit').and.callFake(() => {});
+ });
+
+ describe('not a filter list', () => {
+ it('event should not be emitted', () => {
+ component.isFilter = false;
+ component.changeSelectedItem({});
+ expect(component.selectedItemChange.emit).not.toHaveBeenCalled();
+ });
+ });
+
+ describe('filter list', () => {
+ const options = {
+ label: 'l',
+ value: 'v'
+ };
+
+ beforeEach(() => {
+ component.isFilter = true;
+ component.changeSelectedItem(options);
+ });
+
+ it('event should be emitted', () => {
+ expect(component.selectedItemChange.emit).toHaveBeenCalled();
+ });
+
+ it('event emitter should be called with correct arguments', () => {
+ expect(component.selectedItemChange.emit).toHaveBeenCalledWith(options);
+ });
+
+ });
+
+ });
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/dropdown-list/dropdown-list.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/dropdown-list/dropdown-list.component.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/dropdown-list/dropdown-list.component.ts
new file mode 100644
index 0000000..dfd2527
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/dropdown-list/dropdown-list.component.ts
@@ -0,0 +1,50 @@
+/**
+ * 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.
+ */
+
+import {Component, OnInit, Input, Output, EventEmitter} from '@angular/core';
+
+@Component({
+ selector: 'ul.dropdown-menu',
+ templateUrl: './dropdown-list.component.html'
+})
+export class DropdownListComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+ @Input()
+ items: any[];
+
+ @Input()
+ defaultAction: Function;
+
+ @Input()
+ isFilter: boolean;
+
+ @Output()
+ selectedItemChange: EventEmitter<any> = new EventEmitter();
+
+ changeSelectedItem(options: any): void {
+ if (this.isFilter) {
+ this.selectedItemChange.emit(options);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.html b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.html
new file mode 100644
index 0000000..1ac663e
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.html
@@ -0,0 +1,23 @@
+<!--
+ 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 class="filter-label" *ngIf="filterInstance.label">{{filterInstance.label | translate}}</div>
+<button class="btn btn-link dropdown-toggle" data-toggle="dropdown">
+ {{filterInstance.selectedLabel | translate}} <span class="caret"></span>
+</button>
+<ul class="dropdown-menu" [items]="filterInstance.options" [isFilter]="true"
+ (selectedItemChange)="setSelectedValue($event)"></ul>
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.less b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.less
new file mode 100644
index 0000000..c3a25cb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.less
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+@import '../../styles.less';
+
+:host {
+ position: relative;
+ .default-flex;
+
+ .filter-label {
+ padding: @input-group-addon-padding;
+ }
+
+ .btn {
+ text-transform: none;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.spec.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.spec.ts
new file mode 100644
index 0000000..49eaf1f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.spec.ts
@@ -0,0 +1,95 @@
+/*
+ * 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.
+ */
+
+import {NO_ERRORS_SCHEMA} from '@angular/core';
+import {async, ComponentFixture, TestBed} from '@angular/core/testing';
+import {Http} from '@angular/http';
+import {TranslateModule, TranslateLoader} from '@ngx-translate/core';
+import {TranslateHttpLoader} from '@ngx-translate/http-loader';
+
+import {FilterDropdownComponent} from './filter-dropdown.component';
+
+export function HttpLoaderFactory(http: Http) {
+ return new TranslateHttpLoader(http, 'assets/i18n/', '.json');
+}
+
+describe('FilterDropdownComponent', () => {
+ let component: FilterDropdownComponent;
+ let fixture: ComponentFixture<FilterDropdownComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [FilterDropdownComponent],
+ imports: [TranslateModule.forRoot({
+ provide: TranslateLoader,
+ useFactory: HttpLoaderFactory,
+ deps: [Http]
+ })],
+ schemas: [NO_ERRORS_SCHEMA]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(FilterDropdownComponent);
+ component = fixture.componentInstance;
+ component.filterInstance = {
+ options: [
+ {
+ value: 'v0',
+ label: 'l0'
+ },
+ {
+ value: 'v1',
+ label: 'l1'
+ }
+ ]
+ };
+ fixture.detectChanges();
+ });
+
+ it('should create component', () => {
+ expect(component).toBeTruthy();
+ });
+
+ describe('should take initial filter values from 1st item', () => {
+ it('selectedValue', () => {
+ expect(component.filterInstance.selectedValue).toEqual('v0');
+ });
+
+ it('selectedLabel', () => {
+ expect(component.filterInstance.selectedLabel).toEqual('l0');
+ });
+ });
+
+ describe('#setSelectedValue()', () => {
+ beforeEach(() => {
+ component.setSelectedValue({
+ value: 'v2',
+ label: 'l2'
+ });
+ });
+
+ it('selectedValue', () => {
+ expect(component.filterInstance.selectedValue).toEqual('v2');
+ });
+
+ it('selectedLabel', () => {
+ expect(component.filterInstance.selectedLabel).toEqual('l2');
+ });
+ });
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.ts
new file mode 100644
index 0000000..65446da
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-dropdown/filter-dropdown.component.ts
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+import {Component, OnInit, Input} from '@angular/core';
+
+@Component({
+ selector: 'filter-dropdown',
+ templateUrl: './filter-dropdown.component.html',
+ styleUrls: ['./filter-dropdown.component.less']
+})
+export class FilterDropdownComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ this.filterInstance.selectedValue = this.filterInstance.options[0].value;
+ this.filterInstance.selectedLabel = this.filterInstance.options[0].label;
+ }
+
+ @Input()
+ filterInstance: any;
+
+ @Input()
+ options: any[];
+
+ setSelectedValue(options: any): void {
+ this.filterInstance.selectedValue = options.value;
+ this.filterInstance.selectedLabel = options.label;
+ };
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.html b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.html
new file mode 100644
index 0000000..3ccbd6f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.html
@@ -0,0 +1,21 @@
+<!--
+ 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 class="input-group">
+ <span class="input-group-addon">{{filterInstance.label | translate}}</span>
+ <input type="text" class="form-control" [(ngModel)]="filterInstance.value">
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.less b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.less
new file mode 100644
index 0000000..b5e65c9
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.less
@@ -0,0 +1,33 @@
+/*
+ * 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.
+ */
+
+@import '../../styles.less';
+
+.input-group {
+ border: @input-border;
+ border-right-width: 0;
+}
+
+.input-group-addon {
+ border: none;
+ background-color: transparent;
+ text-transform: uppercase;
+
+ & + input {
+ border: none;
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.spec.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.spec.ts
new file mode 100644
index 0000000..d1df7b0
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.spec.ts
@@ -0,0 +1,61 @@
+/*
+ * 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.
+ */
+
+import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
+import {async, ComponentFixture, TestBed} from '@angular/core/testing';
+import {Http} from '@angular/http';
+import {FormsModule} from '@angular/forms';
+import {TranslateModule, TranslateLoader} from '@ngx-translate/core';
+import {TranslateHttpLoader} from '@ngx-translate/http-loader';
+
+import {FilterTextFieldComponent} from './filter-text-field.component';
+
+export function HttpLoaderFactory(http: Http) {
+ return new TranslateHttpLoader(http, 'assets/i18n/', '.json');
+}
+
+describe('FilterTextFieldComponent', () => {
+ let component: FilterTextFieldComponent;
+ let fixture: ComponentFixture<FilterTextFieldComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [FilterTextFieldComponent],
+ imports: [
+ FormsModule,
+ TranslateModule.forRoot({
+ provide: TranslateLoader,
+ useFactory: HttpLoaderFactory,
+ deps: [Http]
+ })
+ ],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(FilterTextFieldComponent);
+ component = fixture.componentInstance;
+ component.filterInstance = {};
+ fixture.detectChanges();
+ });
+
+ it('should create component', () => {
+ expect(component).toBeTruthy();
+ });
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.ts
new file mode 100644
index 0000000..c86d4cb
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/filter-text-field/filter-text-field.component.ts
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+import {Component, OnInit, Input} from '@angular/core';
+
+@Component({
+ selector: 'filter-text-field',
+ templateUrl: './filter-text-field.component.html',
+ styleUrls: ['./filter-text-field.component.less']
+})
+export class FilterTextFieldComponent implements OnInit {
+
+ constructor() { }
+
+ ngOnInit() {
+ }
+
+ @Input()
+ filterInstance: any;
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.html b/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.html
new file mode 100644
index 0000000..20f4353
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.html
@@ -0,0 +1,36 @@
+<!--
+ 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 class="form-inline filter-input-container col-md-8">
+ <filter-dropdown [filterInstance]="filtering.filters.clusters"></filter-dropdown>
+ <filter-text-field [filterInstance]="filtering.filters.text"></filter-text-field>
+ <filter-dropdown [filterInstance]="filtering.filters.timeRange"></filter-dropdown>
+ <filter-dropdown [filterInstance]="filtering.filters.timeZone"></filter-dropdown>
+ <button class="btn btn-success" type="button">
+ <span class="fa fa-search"></span>
+ </button>
+</div>
+<div class="default-flex col-md-4">
+ <menu-button [label]="filtering.filters.components.label" [iconClass]="filtering.filters.components.iconClass"
+ [subItems]="filtering.filters.components.options" [isFilter]="true"></menu-button>
+ <menu-button [label]="filtering.filters.levels.label" [iconClass]="filtering.filters.levels.iconClass"
+ [subItems]="filtering.filters.levels.options" [isFilter]="true"></menu-button>
+ <menu-button label="filter.capture" iconClass="fa fa-caret-right"></menu-button>
+ <a href="#">
+ <span class="fa fa-search-minus"></span> {{'filter.excluded' | translate}}
+ </a>
+</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.less b/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.less
new file mode 100644
index 0000000..b393196
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.less
@@ -0,0 +1,38 @@
+/**
+ * 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.
+ */
+
+@import '../../styles.less';
+
+.filter-input-container {
+ .flex-vertical-align;
+ justify-content: flex-start;
+
+ .btn-success {
+ border-top-left-radius: 0;
+ border-bottom-left-radius: 0;
+ }
+
+ filter-dropdown {
+ border: @input-border;
+ border-right-width: 0;
+
+ &:first-child {
+ border-radius: @button-border-radius 0 0 @button-border-radius;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.spec.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.spec.ts
new file mode 100644
index 0000000..934f37a
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.spec.ts
@@ -0,0 +1,59 @@
+/**
+ * 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.
+ */
+
+import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
+import {async, ComponentFixture, TestBed} from '@angular/core/testing';
+import {Http} from '@angular/http';
+import {TranslateModule, TranslateLoader} from '@ngx-translate/core';
+import {TranslateHttpLoader} from '@ngx-translate/http-loader';
+import {FilteringService} from '@app/services/filtering.service';
+
+import {FiltersPanelComponent} from './filters-panel.component';
+
+export function HttpLoaderFactory(http: Http) {
+ return new TranslateHttpLoader(http, 'assets/i18n/', '.json');
+}
+
+describe('FiltersPanelComponent', () => {
+ let component: FiltersPanelComponent;
+ let fixture: ComponentFixture<FiltersPanelComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [FiltersPanelComponent],
+ imports: [TranslateModule.forRoot({
+ provide: TranslateLoader,
+ useFactory: HttpLoaderFactory,
+ deps: [Http]
+ })],
+ providers: [FilteringService],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(FiltersPanelComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create component', () => {
+ expect(component).toBeTruthy();
+ });
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.ts
new file mode 100644
index 0000000..8c986f4
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/filters-panel/filters-panel.component.ts
@@ -0,0 +1,35 @@
+/**
+ * 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.
+ */
+
+import {Component, OnInit} from '@angular/core';
+import {FilteringService} from '@app/services/filtering.service';
+
+@Component({
+ selector: 'filters-panel',
+ templateUrl: './filters-panel.component.html',
+ styleUrls: ['./filters-panel.component.less']
+})
+export class FiltersPanelComponent implements OnInit {
+
+ constructor(private filtering: FilteringService) {
+ }
+
+ ngOnInit() {
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.html b/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.html
index 4b7951a..37a96e9 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.html
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.html
@@ -15,7 +15,7 @@
limitations under the License.
-->
-<div class="well col-md-4 col-md-offset-4 col-sm-offset-4">
+<div class="login-form well col-md-4 col-md-offset-4 col-sm-offset-4">
<div class="alert alert-danger" *ngIf="isLoginAlertDisplayed" [innerHTML]="'authorization.error' | translate"></div>
<form #loginForm="ngForm" (ngSubmit)="login()">
<div class="form-group">
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.less b/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.less
new file mode 100644
index 0000000..7e37ea1
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.less
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+@import '../../styles.less';
+
+.login-form {
+ margin-top: @login-form-top-margin;
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.spec.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.spec.ts
index 55d125a..0498ee4 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.spec.ts
@@ -21,7 +21,7 @@ import {FormsModule} from '@angular/forms';
import {HttpModule, Http} from '@angular/http';
import {TranslateModule, TranslateLoader} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
-import {HttpClientService} from '../services/http-client.service';
+import {HttpClientService} from '@app/services/http-client.service';
import {LoginFormComponent} from './login-form.component';
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.ts
index 400e65b..2a93775 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/login-form/login-form.component.ts
@@ -22,7 +22,8 @@ import {HttpClientService} from '@app/services/http-client.service';
@Component({
selector: 'login-form',
- templateUrl: './login-form.component.html'
+ templateUrl: './login-form.component.html',
+ styleUrls: ['./login-form.component.less']
})
export class LoginFormComponent implements OnInit {
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/main-container/main-container.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/main-container/main-container.component.html b/ambari-logsearch/ambari-logsearch-web-new/src/app/main-container/main-container.component.html
new file mode 100644
index 0000000..bc641a6
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/main-container/main-container.component.html
@@ -0,0 +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.
+-->
+
+<login-form *ngIf="!httpClient.isAuthorized"></login-form>
+<filters-panel *ngIf="httpClient.isAuthorized" class="row"></filters-panel>
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/main-container/main-container.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/main-container/main-container.component.spec.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/main-container/main-container.component.spec.ts
new file mode 100644
index 0000000..536f1ef
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/main-container/main-container.component.spec.ts
@@ -0,0 +1,49 @@
+/**
+ * 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.
+ */
+
+import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
+import {async, ComponentFixture, TestBed} from '@angular/core/testing';
+import {HttpModule} from '@angular/http';
+import {HttpClientService} from '@app/services/http-client.service';
+
+import {MainContainerComponent} from './main-container.component';
+
+describe('MainContainerComponent', () => {
+ let component: MainContainerComponent;
+ let fixture: ComponentFixture<MainContainerComponent>;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [MainContainerComponent],
+ imports: [HttpModule],
+ schemas: [CUSTOM_ELEMENTS_SCHEMA],
+ providers: [HttpClientService]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(MainContainerComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create component', () => {
+ expect(component).toBeTruthy();
+ });
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/main-container/main-container.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/main-container/main-container.component.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/main-container/main-container.component.ts
new file mode 100644
index 0000000..d2e6a7f
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/main-container/main-container.component.ts
@@ -0,0 +1,33 @@
+/**
+ * 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.
+ */
+
+import {Component, OnInit} from '@angular/core';
+import {HttpClientService} from '@app/services/http-client.service';
+
+@Component({
+ selector: 'main-container',
+ templateUrl: './main-container.component.html'
+})
+export class MainContainerComponent implements OnInit {
+
+ constructor(private httpClient: HttpClientService) {}
+
+ ngOnInit() {
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.html b/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.html
index 1afe6c0..4ed01bd 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.html
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.html
@@ -16,16 +16,11 @@
-->
<div #dropdown [ngClass]="{'dropdown': hasSubItems, 'text-center': true}">
- <span (mousedown)="onMouseDown($event)" (mouseup)="onMouseUp($event)" (click)="$event.stopPropagation()">
- <a *ngIf="title" class="icon" [ngClass]="iconClassNames"></a>
- <span *ngIf="!title" class="icon" [ngClass]="iconClassNames"></span>
- </span>
- <a #dropdownToggle [ngClass]="{'dropdown-toggle': hasSubItems, 'caret': true}" [attr.data-toggle]="hasSubItems ? 'dropdown': null" *ngIf="hasSubItems"></a>
+ <a [ngClass]="iconClass + ' icon'" (mousedown)="onMouseDown($event)" (mouseup)="onMouseUp($event)"
+ (click)="$event.stopPropagation()"></a>
+ <a #dropdownToggle class="dropdown-toggle caret" data-toggle="dropdown" *ngIf="hasCaret"></a>
<br>
- <span class="icon-title" *ngIf="title" (mousedown)="onMouseDown($event)" (mouseup)="onMouseUp($event)" (click)="$event.stopPropagation()">{{title | translate}}</span>
- <ul class="dropdown-menu" *ngIf="hasSubItems">
- <li *ngFor="let item of subItems">
- <a href="#">{{item.title}}</a>
- </li>
- </ul>
+ <a *ngIf="label" (mousedown)="onMouseDown($event)" [ngClass]="labelClass" (mouseup)="onMouseUp($event)"
+ (click)="$event.stopPropagation()">{{label | translate}}</a>
+ <ul class="dropdown-menu" [isFilter]="isFilter" *ngIf="hasSubItems" [items]="subItems"></ul>
</div>
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.less b/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.less
index 16b06c4..d6024c2 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.less
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.less
@@ -26,4 +26,8 @@
.icon {
padding: 5px;
}
+
+ .unstyled-link {
+ color: inherit;
+ }
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.spec.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.spec.ts
index 5419b36..9af8f00 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.spec.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.spec.ts
@@ -16,6 +16,7 @@
* limitations under the License.
*/
+import {NO_ERRORS_SCHEMA} from '@angular/core';
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {Http} from '@angular/http';
import {TranslateModule, TranslateLoader} from '@ngx-translate/core';
@@ -41,7 +42,8 @@ describe('MenuButtonComponent', () => {
useFactory: HttpLoaderFactory,
deps: [Http]
})],
- providers: [ComponentActionsService]
+ providers: [ComponentActionsService],
+ schemas: [NO_ERRORS_SCHEMA]
})
.compileComponents();
}));
@@ -57,7 +59,6 @@ describe('MenuButtonComponent', () => {
});
describe('#hasSubItems', () => {
-
const cases = [
{
subItems: null,
@@ -82,6 +83,40 @@ describe('MenuButtonComponent', () => {
expect(component.hasSubItems).toEqual(test.hasSubItems);
});
});
+ });
+
+ describe('#hasCaret', () => {
+ const cases = [
+ {
+ subItems: null,
+ hasCaret: false,
+ title: 'no sub-items'
+ },
+ {
+ subItems: [],
+ hasCaret: false,
+ title: 'empty sub-items array'
+ },
+ {
+ subItems: [{}],
+ hideCaret: false,
+ hasCaret: true,
+ title: 'sub-items present, caret not hidden'
+ },
+ {
+ subItems: [{}],
+ hideCaret: true,
+ hasCaret: true,
+ title: 'sub-items present, caret hidden'
+ }
+ ];
+ cases.forEach((test) => {
+ it(test.title, () => {
+ component.subItems = test.subItems;
+ component.hideCaret = Boolean(test.hideCaret);
+ expect(component.hasSubItems).toEqual(test.hasCaret);
+ });
+ });
});
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.ts
index 716d3ae..9505f5b 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/menu-button/menu-button.component.ts
@@ -18,6 +18,7 @@
import {Component, AfterViewInit, Input, ViewChild, ElementRef} from '@angular/core';
import {ComponentActionsService} from '@app/services/component-actions.service';
+import * as $ from 'jquery';
@Component({
selector: 'menu-button',
@@ -36,28 +37,40 @@ export class MenuButtonComponent implements AfterViewInit {
dropdown: ElementRef;
@Input()
- title?: string;
+ label?: string;
@Input()
action: string;
@Input()
- iconClassNames: string[];
+ isFilter: boolean;
+
+ @Input()
+ iconClass: string;
+
+ @Input()
+ labelClass?: string;
@Input()
subItems?: any[];
@Input()
+ hideCaret?: boolean;
+
get hasSubItems(): boolean {
return Boolean(this.subItems && this.subItems.length);
}
+ get hasCaret(): boolean {
+ return this.hasSubItems && !this.hideCaret;
+ }
+
private clickStartTime: number;
private readonly longClickInterval = 1000;
onMouseDown(event: MouseEvent): void {
- if (event.button === 0) {
+ if (this.action && event.button === 0) {
this.clickStartTime = (new Date()).getTime();
}
}
@@ -65,9 +78,9 @@ export class MenuButtonComponent implements AfterViewInit {
onMouseUp(event: MouseEvent): void {
if (event.button === 0) {
const clickEndTime = (new Date()).getTime();
- if (this.hasSubItems && clickEndTime - this.clickStartTime >= this.longClickInterval) {
- this.dropdown.nativeElement.classList.add('open');
- } else {
+ if (this.hasSubItems && (!this.action || clickEndTime - this.clickStartTime >= this.longClickInterval)) {
+ $(this.dropdown.nativeElement).toggleClass('open');
+ } else if (this.action) {
this.actions[this.action]();
}
event.stopPropagation();
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/services/component-actions.service.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/services/component-actions.service.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/services/component-actions.service.ts
index 1a1062e..4cde0a0 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/services/component-actions.service.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/services/component-actions.service.ts
@@ -38,10 +38,4 @@ export class ComponentActionsService {
openHistory() {
}
- openAlerts() {
- }
-
- openUserDetails() {
- }
-
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/services/filtering.service.spec.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/services/filtering.service.spec.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/services/filtering.service.spec.ts
new file mode 100644
index 0000000..d471e00
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/services/filtering.service.spec.ts
@@ -0,0 +1,33 @@
+/**
+ * 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.
+ */
+
+import {TestBed, inject} from '@angular/core/testing';
+
+import {FilteringService} from './filtering.service';
+
+describe('FilteringService', () => {
+ beforeEach(() => {
+ TestBed.configureTestingModule({
+ providers: [FilteringService]
+ });
+ });
+
+ it('should create service', inject([FilteringService], (service: FilteringService) => {
+ expect(service).toBeTruthy();
+ }));
+});
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/services/filtering.service.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/services/filtering.service.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/services/filtering.service.ts
new file mode 100644
index 0000000..84cbc50
--- /dev/null
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/services/filtering.service.ts
@@ -0,0 +1,167 @@
+/**
+ * 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.
+ */
+
+import {Injectable} from '@angular/core';
+import * as moment from 'moment-timezone';
+
+@Injectable()
+export class FilteringService {
+
+ constructor() {
+ }
+
+ // TODO implement loading of real options data
+ readonly filters = {
+ clusters: {
+ label: 'filter.clusters',
+ options: [
+ {
+ label: 'filter.all',
+ value: 'ALL'
+ },
+ {
+ label: 'c0',
+ value: 'c0'
+ },
+ {
+ label: 'c1',
+ value: 'c1'
+ }
+ ],
+ selectedValue: '',
+ selectedLabel: ''
+ },
+ text: {
+ label: 'filter.message',
+ value: ''
+ },
+ timeRange: {
+ options: [
+ {
+ label: 'filter.timeRange.1hr',
+ value: '1HR'
+ },
+ {
+ label: 'filter.timeRange.24hr',
+ value: '24HR'
+ },
+ {
+ label: 'filter.timeRange.today',
+ value: 'TODAY'
+ },
+ {
+ label: 'filter.timeRange.yesterday',
+ value: 'YESTERDAY'
+ },
+ {
+ label: 'filter.timeRange.7d',
+ value: '7D'
+ },
+ {
+ label: 'filter.timeRange.30d',
+ value: '30d'
+ },
+ {
+ label: 'filter.timeRange.thisMonth',
+ value: 'THIS_MONTH'
+ },
+ {
+ label: 'filter.timeRange.lastMonth',
+ value: 'LAST_MONTH'
+ },
+ {
+ label: 'filter.timeRange.custom',
+ value: 'CUSTOM'
+ }
+ ],
+ selectedValue: '',
+ selectedLabel: ''
+ },
+ timeZone: {
+ options: moment.tz.names().map(zone => {
+ return {
+ label: zone,
+ value: zone
+ };
+ }),
+ selectedValue: '',
+ selectedLabel: ''
+ },
+ components: {
+ label: 'filter.components',
+ iconClass: 'fa fa-cubes',
+ options: [
+ {
+ label: 'DataNode',
+ value: 'DATANODE'
+ },
+ {
+ label: 'NameNode',
+ value: 'NAMENODE'
+ },
+ {
+ label: 'ZooKeeper Server',
+ value: 'ZOOKEEPER_SERVER'
+ },
+ {
+ label: 'Metrics Collector',
+ value: 'METRICS_COLLECTOR'
+ }
+ ],
+ selectedValue: '',
+ selectedLabel: ''
+ },
+ levels: {
+ label: 'filter.levels',
+ iconClass: 'fa fa-sort-amount-asc',
+ options: [
+ {
+ label: 'levels.fatal',
+ value: 'FATAL'
+ },
+ {
+ label: 'levels.error',
+ value: 'ERROR'
+ },
+ {
+ label: 'levels.warn',
+ value: 'WARN'
+ },
+ {
+ label: 'levels.info',
+ value: 'INFO'
+ },
+ {
+ label: 'levels.debug',
+ value: 'DEBUG'
+ },
+ {
+ label: 'levels.trace',
+ value: 'TRACE'
+ },
+ {
+ label: 'levels.unknown',
+ value: 'UNKNOWN'
+ }
+ ],
+ selectedValue: '',
+ selectedLabel: ''
+ }
+ };
+
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.html
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.html b/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.html
index 82ab60a..6898354 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.html
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.html
@@ -15,4 +15,7 @@
limitations under the License.
-->
-<menu-button *ngFor="let item of items" [title]="item.title" [action]="item.action" [iconClassNames]="item.iconClassNames" [subItems]="item.subItems"></menu-button>
+<menu-button *ngFor="let item of items" [label]="item.label" [action]="item.action"
+ [iconClass]="item.iconClass" [labelClass]="item.labelClass"
+ [subItems]="item.subItems" [hideCaret]="item.hideCaret">
+</menu-button>
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.less b/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.less
index c992c9e..8728ecf 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.less
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.less
@@ -15,8 +15,8 @@
* limitations under the License.
*/
+@import '../../styles.less';
+
:host {
- display: flex;
- align-items: center;
- justify-content: space-between;
+ .default-flex;
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.ts
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.ts b/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.ts
index 641fca0..bad588b 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.ts
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/app/top-menu/top-menu.component.ts
@@ -34,76 +34,88 @@ export class TopMenuComponent implements OnInit {
//TODO implement loading of real data into subItems
readonly items = [
{
- iconClassNames: ['fa', 'fa-arrow-left'],
- title: 'topMenu.undo',
+ iconClass: 'fa fa-arrow-left',
+ label: 'topMenu.undo',
+ labelClass: 'unstyled-link',
action: 'undo',
subItems: [
{
- title: 'Apply \'Last week\' filter'
+ label: 'Apply \'Last week\' filter'
},
{
- title: 'Clear all filters'
+ label: 'Clear all filters'
},
{
- title: 'Apply \'HDFS\' filter'
+ label: 'Apply \'HDFS\' filter'
},
{
- title: 'Apply \'Errors\' filter'
+ label: 'Apply \'Errors\' filter'
}
]
},
{
- iconClassNames: ['fa', 'fa-arrow-right'],
- title: 'topMenu.redo',
+ iconClass: 'fa fa-arrow-right',
+ label: 'topMenu.redo',
+ labelClass: 'unstyled-link',
action: 'redo',
subItems: [
{
- title: 'Apply \'Warnings\' filter'
+ label: 'Apply \'Warnings\' filter'
},
{
- title: 'Switch to graph mode'
+ label: 'Switch to graph mode'
},
{
- title: 'Apply \'Custom Date\' filter'
+ label: 'Apply \'Custom Date\' filter'
}
]
},
{
- iconClassNames: ['fa', 'fa-refresh'],
- title: 'topMenu.refresh',
+ iconClass: 'fa fa-refresh',
+ label: 'topMenu.refresh',
+ labelClass: 'unstyled-link',
action: 'refresh'
},
{
- iconClassNames: ['fa', 'fa-clock-o'],
- title: 'topMenu.history',
+ iconClass: 'fa fa-clock-o',
+ label: 'topMenu.history',
+ labelClass: 'unstyled-link',
action: 'openHistory',
subItems: [
{
- title: 'Apply \'Custom Date\' filter'
+ label: 'Apply \'Custom Date\' filter'
},
{
- title: 'Switch to graph mode'
+ label: 'Switch to graph mode'
},
{
- title: 'Apply \'Warnings\' filter'
+ label: 'Apply \'Warnings\' filter'
},
{
- title: 'Apply \'Last week\' filter'
+ label: 'Apply \'Last week\' filter'
},
{
- title: 'Clear all filters'
+ label: 'Clear all filters'
},
{
- title: 'Apply \'HDFS\' filter'
+ label: 'Apply \'HDFS\' filter'
},
{
- title: 'Apply \'Errors\' filter'
+ label: 'Apply \'Errors\' filter'
}
]
},
{
- iconClassNames: ['fa', 'fa-user'],
- action: 'openUserDetails'
+ iconClass: 'fa fa-user unstyled-link',
+ hideCaret: true,
+ subItems: [
+ {
+ label: 'Options'
+ },
+ {
+ label: 'Logout'
+ }
+ ]
}
];
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/assets/i18n/en.json
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/assets/i18n/en.json b/ambari-logsearch/ambari-logsearch-web-new/src/assets/i18n/en.json
index dea8120..755f307 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/assets/i18n/en.json
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/assets/i18n/en.json
@@ -9,5 +9,32 @@
"topMenu.undo": "Undo",
"topMenu.redo": "Redo",
"topMenu.refresh": "Refresh",
- "topMenu.history": "History"
+ "topMenu.history": "History",
+
+ "filter.all": "All",
+
+ "filter.clusters": "Clusters",
+ "filter.message": "Message:",
+ "filter.components": "Components",
+ "filter.levels": "Levels",
+ "filter.capture": "Capture",
+ "filter.excluded": "Excluded",
+
+ "filter.timeRange.1hr": "Last 1 hour",
+ "filter.timeRange.24hr": "Last 24 hours",
+ "filter.timeRange.today": "Today",
+ "filter.timeRange.yesterday": "Yesterday",
+ "filter.timeRange.7d": "Last 7 days",
+ "filter.timeRange.30d": "Last 30 days",
+ "filter.timeRange.thisMonth": "This month",
+ "filter.timeRange.lastMonth": "Last month",
+ "filter.timeRange.custom": "Custom range",
+
+ "levels.fatal": "Fatal",
+ "levels.error": "Error",
+ "levels.warn": "Warn",
+ "levels.info": "Info",
+ "levels.debug": "Debug",
+ "levels.trace": "Trace",
+ "levels.unknown": "Unknown"
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/src/styles.less
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/src/styles.less b/ambari-logsearch/ambari-logsearch-web-new/src/styles.less
index 24136fe..db6da5c 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/src/styles.less
+++ b/ambari-logsearch/ambari-logsearch-web-new/src/styles.less
@@ -18,3 +18,18 @@
@navbar-background-color: #323544;
@h1-vertical-margin: 20px;
+@button-border-radius: 4px;
+@input-border: 1px solid #CFD3D7;
+@button-border-radius: 4px;
+@input-group-addon-padding: 6px 12px;
+@login-form-top-margin: 20px;
+
+.flex-vertical-align {
+ display: flex;
+ align-items: center;
+}
+
+.default-flex {
+ .flex-vertical-align;
+ justify-content: space-between;
+}
http://git-wip-us.apache.org/repos/asf/ambari/blob/6fc2fef6/ambari-logsearch/ambari-logsearch-web-new/yarn.lock
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-web-new/yarn.lock b/ambari-logsearch/ambari-logsearch-web-new/yarn.lock
index d521f70..5412b84 100644
--- a/ambari-logsearch/ambari-logsearch-web-new/yarn.lock
+++ b/ambari-logsearch/ambari-logsearch-web-new/yarn.lock
@@ -137,6 +137,18 @@
version "2.5.38"
resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-2.5.38.tgz#a4379124c4921d4e21de54ec74669c9e9b356717"
+"@types/moment-timezone@^0.2.34":
+ version "0.2.34"
+ resolved "https://registry.yarnpkg.com/@types/moment-timezone/-/moment-timezone-0.2.34.tgz#948e0aff82742a31dd63714d1aac9616bc375053"
+ dependencies:
+ moment ">=2.14.0"
+
+"@types/moment@^2.13.0":
+ version "2.13.0"
+ resolved "https://registry.yarnpkg.com/@types/moment/-/moment-2.13.0.tgz#604ebd189bc3bc34a1548689404e61a2a4aac896"
+ dependencies:
+ moment "*"
+
"@types/node@^6.0.46", "@types/node@~6.0.60":
version "6.0.73"
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.73.tgz#85dc4bb6f125377c75ddd2519a1eeb63f0a4ed70"
@@ -3019,7 +3031,13 @@ mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@~0.5.0, mkd
dependencies:
minimist "0.0.8"
-moment@2.18.1:
+moment-timezone@^0.5.13:
+ version "0.5.13"
+ resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.13.tgz#99ce5c7d827262eb0f1f702044177f60745d7b90"
+ dependencies:
+ moment ">= 2.9.0"
+
+moment@*, moment@2.18.1, "moment@>= 2.9.0", moment@>=2.14.0, moment@^2.18.1:
version "2.18.1"
resolved "https://registry.yarnpkg.com/moment/-/moment-2.18.1.tgz#c36193dd3ce1c2eed2adb7c802dbbc77a81b1c0f"