-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
627 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
183 changes: 183 additions & 0 deletions
183
...p/src/app/pacman-features/modules/admin/system-management/system-management.component.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
/* | ||
*Copyright 2018 T Mobile, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); You may not use | ||
* this file except in compliance with the License. A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or | ||
* implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
.system-container{ | ||
border: 1px solid lightgrey; | ||
width: 100%; | ||
height: 100%; | ||
max-height: 36em; | ||
border-radius: .2em; | ||
background-color: #ffff; | ||
} | ||
.container{ | ||
width: 100%; | ||
height: 100%; | ||
padding: 1em 3em 1em; | ||
} | ||
.align-start{ | ||
align-self:flex-start; | ||
} | ||
.w-100{ | ||
width:100%; | ||
} | ||
.outer-box{ | ||
padding:2em 5em; | ||
overflow:auto; | ||
} | ||
.each-item{ | ||
border-bottom: 1px solid lightgrey; | ||
padding: 1.5em .1em; | ||
width:100%; | ||
} | ||
.each-item:last-child{ | ||
border:none; | ||
} | ||
.toggle{ | ||
padding: .1em 4em; | ||
align-self: center; | ||
} | ||
.left-header{ | ||
font-size: 20px; | ||
font-weight: bold; | ||
padding: .3em .1em; | ||
} | ||
.left-element{ | ||
padding: .3em .1em; | ||
} | ||
|
||
.switch { | ||
position: relative; | ||
display: block; | ||
width: 100px; | ||
height: 29px; | ||
cursor: pointer; | ||
} | ||
.switch-input { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
opacity: 0; | ||
} | ||
.switch-label { | ||
position: relative; | ||
display: block; | ||
height: inherit; | ||
background-color: #CCCCCC; | ||
border-radius: 3px; | ||
} | ||
.switch-label:before, .switch-label:after { | ||
position: absolute; | ||
top: 9px; | ||
} | ||
.switch-label:before { | ||
content: attr(data-off); | ||
right: 18px; | ||
color:white; | ||
} | ||
.switch-label:after { | ||
content: attr(data-on); | ||
left: 18px; | ||
opacity: 1; | ||
color:white; | ||
} | ||
.switch-input:checked ~ .switch-label:before { | ||
opacity: 1; | ||
} | ||
.switch-input:checked ~ .switch-label:after { | ||
opacity: 1; | ||
} | ||
.switch-handle { | ||
position: absolute; | ||
top: 0px; | ||
left: 0px; | ||
width: 50px; | ||
height: 29px; | ||
background-color: #50C17C; | ||
border-radius: 3px; | ||
color: white; | ||
padding-top: 8px; | ||
text-align: center; | ||
padding-top: 8px; | ||
} | ||
|
||
.switch-input:checked ~ .switch-handle { | ||
left: 50px; | ||
background-color: #F2425F; | ||
} | ||
|
||
.switch-label, .switch-handle { | ||
transition: All 0.3s ease; | ||
} | ||
.confirm-box{ | ||
/* width: 27em; */ | ||
width:100%; | ||
height: 2.5em; | ||
padding: 6px; | ||
background-color: #FBFBFB; | ||
border: 1px solid #c5bfbf; | ||
} | ||
.text-center{ | ||
text-align: center; | ||
} | ||
.action-text{ | ||
padding: 2em 2em; | ||
font-size: 1.3em; | ||
line-height: 1.2em; | ||
} | ||
.input-box{ | ||
padding:2em 5em; | ||
width: 100%; | ||
min-width: 26em; | ||
} | ||
.container{ | ||
min-height: 20em; | ||
} | ||
.modal-footer{ | ||
border-top: 1px solid #cccc; | ||
padding: 2em 1em 0em; | ||
} | ||
.submit-button{ | ||
padding: .6em 2.1em; | ||
border: none; | ||
background-color: #E20074; | ||
color: white; | ||
font-weight: bold; | ||
letter-spacing: .6px; | ||
border-radius: 14px; | ||
cursor: pointer; | ||
} | ||
.cancel{ | ||
color: #E20074; | ||
font-weight: bold; | ||
padding: 0 2em; | ||
} | ||
.submit-button:disabled{ | ||
background-color: silver; | ||
pointer-events: none; | ||
cursor: not-allowed; | ||
} | ||
|
||
.confirmation-txt { | ||
font-size: 1.2em; | ||
line-height: 1.4; | ||
padding-bottom: 2.5em; | ||
word-break: break-word; | ||
text-align: center; | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
flex-grow: 1; | ||
justify-content: center; | ||
} |
75 changes: 75 additions & 0 deletions
75
.../src/app/pacman-features/modules/admin/system-management/system-management.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<!-- | ||
*Copyright 2018 T Mobile, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); You may not use | ||
* this file except in compliance with the License. A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or | ||
* implied. See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
--> | ||
|
||
<div class="compliance-dashboard-wrapper flex flex-between"> | ||
<div class="floating-widgets-section-full flex flex-col flex-align-center"> | ||
<div class="floating-widgets-header admin-widgets-header flex flex-between align-start w-100 no-shrink"> | ||
<div> | ||
<!-- <app-back-navigation [pageTitle]='pageTitle'></app-back-navigation> --> | ||
<h1 class="title-text">{{pageTitle}}</h1> | ||
</div> | ||
</div> | ||
<div class="container no-shrink"> | ||
<div class="system-container flex-center flex flex-col flex-align-center"> | ||
<div class="flex flex-col flex-align-center outer-box w-100 "> | ||
<div class="flex each-item flex-between no-shrink"> | ||
<div class="rules"> | ||
<div class="left-header">Rules</div> | ||
<div class="left-element">This action will stop PacBot compliance evaluation for all cloud resources. </div> | ||
</div> | ||
<div class="toggle"> | ||
<label class="switch"> | ||
<input [(ngModel)]="isCheckedRules" (click)="ontoggleAccess($event, 'rule');" class="switch-input" type="checkbox" /> | ||
<span class="switch-label" data-on="On" data-off="Off"></span> | ||
<span class="switch-handle" [innerHtml]="isCheckedRules? 'Off': 'On'"></span> | ||
</label> | ||
</div> | ||
</div> | ||
<div class="flex each-item flex-between no-shrink"> | ||
<div class="rules"> | ||
<div class="left-header">Jobs</div> | ||
<div class="left-element">This action will stop all inventory collection by PacBot. </div> | ||
</div> | ||
<div class="toggle"> | ||
<label class="switch"> | ||
<input [(ngModel)]="isCheckedJobs" (click)="ontoggleAccess($event, 'job')" class="switch-input" type="checkbox" /> | ||
<span class="switch-label" data-on="On" data-off="Off"></span> | ||
<span class="switch-handle" [innerHtml]="isCheckedJobs? 'Off': 'On'"></span> | ||
</label> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<app-generic-modal [title]="modalTitle" *ngIf="OpenModal" (emitClose)='closeModal()'> | ||
<div class="flex flex-col flex-align-center container"> | ||
<div *ngIf="selectedValue === 'rule' && !showLoader && errorVal == 0" class="action-text text-center">This action will stop PacBot compliance evaluation for all cloud resources ( Rules ). </div> | ||
<div *ngIf="selectedValue === 'job' && !showLoader && errorVal == 0" class="action-text text-center">This action will stop all inventory collection by PacBot (jobs). </div> | ||
<div *ngIf='!showLoader && errorVal == 0' class="input-box text-center"> | ||
<input type="text" [(ngModel)]="inputValue" class="confirm-box" placeholder="Type 'Confirm' to authorize"> | ||
</div> | ||
<div class='confirmation-txt' *ngIf='errorVal == -1'>{{errorMsg}}</div> | ||
<div class='confirmation-txt' *ngIf='errorVal == 1'>{{errorMsg}}</div> | ||
</div> | ||
<div *ngIf='errorVal == 0' class="modal-footer flex flex-align-center flex-end "> | ||
<a class="cancel" (click)='closeModal()' [class.disabled]="showLoader">CANCEL</a> | ||
<button class="submit-button" (click)= "submitToCheckConfirm()" [disabled]="showLoader || (inputValue && inputValue.toLowerCase() === 'confirm'? false : true)" >SUBMIT</button> | ||
</div> | ||
<div *ngIf='errorVal == 1 || errorVal == -1 ' class="modal-footer flex flex-align-center flex-end "> | ||
<button class="submit-button" (click)= "closeModal()" >CLOSE</button> | ||
</div> | ||
<div class='loader' *ngIf='showLoader'></div> | ||
</app-generic-modal> |
39 changes: 39 additions & 0 deletions
39
...c/app/pacman-features/modules/admin/system-management/system-management.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
*Copyright 2018 T Mobile, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); You may not use | ||
* this file except in compliance with the License. A copy of the License is located at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed on | ||
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 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 { SystemManagementComponent } from './system-management.component'; | ||
|
||
describe('SystemManagementComponent', () => { | ||
let component: SystemManagementComponent; | ||
let fixture: ComponentFixture<SystemManagementComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ SystemManagementComponent ] | ||
}) | ||
.compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(SystemManagementComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.