Skip to content

Commit

Permalink
Merge pull request primefaces#130 from atretyak1985/issue_#126
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred Hall authored Feb 20, 2019
2 parents dba1ad2 + 0ff22d8 commit 4c16d63
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/organization/admin/label/label_list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<div class="panel panel-default blue">
<div class="panel-heading">
<h1 class="panel-title">Labels
<a class="btn btn-primary blackButton" type="submit" (click)="clickCreate($event)">
<button class="btn btn-sm btn-primary pull-right" (click)="refresh()" id="refresh-button" title="Refresh"><i class="fa fa-refresh"></i></button>
<a class="btn btn-primary blackButton m-r-15" type="submit" (click)="clickCreate($event)">
<i class="ace-icon fa fa-plus"></i>
Create Label
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ <h4>Are you sure you want to do this?</h4>
<div class="panel panel-default blue">
<div class="panel-heading">
<h1 class="panel-title" style="display: inline;">Notifications</h1>
<div class="panel-heading-button-wrapper">
<button class="btn btn-sm btn-primary pull-right" (click)="refresh()" id="refresh-button" title="Refresh"><i class="fa fa-refresh"></i></button>
<div class="panel-heading-button-wrapper m-r-15">
<button (click)="clickExpandRecipientAdd()" id="add-recipient-btn" class="btn btn-primary blackButton" style="float: none"><i class="ace-fa fa fa-plus"></i>Add recipient</button>
</div>
<span class="label label-black pull-right m-r-15" style="color:white; width: auto;" *ngIf="response">Total: {{ response.total }}</span>
Expand Down
3 changes: 2 additions & 1 deletion src/organization/admin/settings/settings.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ <h4>Are you sure you want to do this?</h4>
<div class="panel-heading">
<h1 class="panel-title" style="display: inline;">
Settings
<div class="panel-heading-button-wrapper" *ngIf="isTabSelected(2)">
<button *ngIf="isTabSelected(2)" class="btn btn-sm btn-primary pull-right" (click)="refresh()" id="refresh-button" title="Refresh"><i class="fa fa-refresh"></i></button>
<div class="panel-heading-button-wrapper m-r-15" *ngIf="isTabSelected(2)">
<button (click)="clickAddBenchmark()" id="add-benchmark" class="btn btn-primary blackButton" style="float: none"><i class="ace-fa fa fa-plus"></i>Add Benchmark</button>
<div *ngIf="showAddList" class="benchmark-list-container">
<input class="form-control" type="text" placeholder="Search..." id="searchBox" [(ngModel)]="searchString" (ngModelChange)="onSearchChange($event)"/>
Expand Down
9 changes: 8 additions & 1 deletion src/organization/admin/settings/settings.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, OnInit} from '@angular/core';
import {Component, OnInit, ViewChild} from '@angular/core';
import {FormControl} from '@angular/forms';
import {Observable} from 'rxjs';
import {startWith, map} from 'rxjs/operators';
Expand All @@ -12,13 +12,16 @@ import {SpinnerService} from '../../../common/spinner/spinner.service';
import {BenchmarkFamilyItem, BenchmarkAvailableFamilyItem, BenchmarkFamilyListResponse} from './settings.response';
import { ColumnWithSort } from 'common/object';
import { TableCache } from 'common/cache/table-cache';
import { Table } from 'primeng/table';

@Component({
templateUrl: './settings.component.html',
providers: [SettingsService]
})

export class SettingsComponent implements OnInit {
@ViewChild('ptable') ptable: Table;

public HEADER_HEIGHT: number = 300;
public window = window;

Expand Down Expand Up @@ -91,6 +94,10 @@ export class SettingsComponent implements OnInit {
}
this.updateOrganizationModel.logserver_protocol = organization.organization_logserver_protocol;
this.updateVulnerabilitiesModel.enabled = organization.organization_vulnerability_enabled;

if (this.ptable) {
this.ptable.setScrollPosition(0);
}
}

getColumnWidth(field) {
Expand Down
5 changes: 3 additions & 2 deletions src/organization/admin/user/user_list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@
<div class="panel panel-default blue">
<div class="panel-heading">
<h1 class="panel-title">Users
<button *ngIf="isTabSelected(1)" class="btn btn-sm btn-primary pull-right" (click)="refresh()" id="refresh-button" title="Refresh"><i class="fa fa-refresh"></i></button>
<a *ngIf="isTabSelected(1) && !adAuthEnabled" (click)="clickExpandUserAdd($event)"
class="btn btn-primary blackButton add-user-btn" type="submit">
class="btn btn-primary blackButton add-user-btn m-r-15" type="submit">
<i class="ace-icon fa fa-plus"></i>
Add user
</a>
<span *ngIf="isTabSelected(1) && response" class="label label-black pull-right m-r-15" style="color:white; width: auto;">Total: {{ response.total }}</span>
<a *ngIf="isTabSelected(2) && adAuthEnabled" (click)="clickExpandDomainGroupAdd($event)"
class="btn btn-primary blackButton add-user-btn" type="submit">
<i class="ace-icon fa fa-plus"></i>
Add group
</a>
<span class="label label-black pull-right m-r-15" style="color:white; width: auto;" *ngIf="response">Total: {{ response.total }}</span>
</h1>
</div>

Expand Down
1 change: 1 addition & 0 deletions src/organization/collector/collector_list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<div class="panel-heading">
<h1 class="panel-title">
Collectors
<button class="btn btn-sm btn-primary pull-right" (click)="refresh()" id="refresh-button" title="Refresh"><i class="fa fa-refresh"></i></button>
<span class="label label-black pull-right m-r-15" style="color:white; width: auto;" *ngIf="response">Total: {{ response.total }}</span>
</h1>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ <h4>Are you sure you want to do this?</h4>
<div class="panel panel-default blue">
<div class="panel-heading">
<h1 class="panel-title">Organizations
<button class="btn btn-sm btn-primary pull-right" (click)="refresh()" id="refresh-button" title="Refresh"><i class="fa fa-refresh"></i></button>
<span class="label label-black pull-right m-r-15" style="color:white; width: auto;" *ngIf="response">Total:
{{ response.total }}</span>
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export class OrganizationListComponent implements OnInit {
this.ptable.setScrollPosition(0);
this.service.reset();
this.service.getList(currentPage);
jQuery('#refresh-button').blur();
}

sortingChanged(event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ <h4>Are you sure you want to do this?</h4>
<div class="panel panel-default blue">
<div class="panel-heading">
<h1 class="panel-title">Agents
<button class="btn btn-sm btn-primary pull-right" (click)="refresh()" id="refresh-button" title="Refresh"><i class="fa fa-refresh"></i></button>
<span class="label label-black pull-right m-r-15" style="color:white; width: auto;" *ngIf="response">Total: {{ response.total }}</span>
</h1>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class ProductStoreListComponent implements OnInit {
this.ptable.setScrollPosition(0);
this.service.reset();
this.service.getList(currentPage);
jQuery('#refresh-button').blur();
}

sortingChanged(event) {
Expand Down
1 change: 1 addition & 0 deletions src/system-management/user/user_list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ <h4>Are you sure you want to do this?</h4>
<div class="panel panel-default blue">
<div class="panel-heading">
<h1 class="panel-title">Users
<button class="btn btn-sm btn-primary pull-right" (click)="refresh()" id="refresh-button" title="Refresh"><i class="fa fa-refresh"></i></button>
<span class="label label-black pull-right m-r-15" style="color:white; width: auto;" *ngIf="response">Total:
{{ response.total }}</span>
</h1>
Expand Down
6 changes: 5 additions & 1 deletion src/system-management/user/user_list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ export class UserListComponent implements OnInit {
}

refresh() {
this.service.getList();
let currentPage = this.ptable.first / this.ROWS + 1;
this.ptable.setScrollPosition(0);
this.service.reset();
this.service.getList(currentPage);
jQuery('#refresh-button').blur();
}

ngOnInit() {
Expand Down

0 comments on commit 4c16d63

Please sign in to comment.