This commit is contained in:
insanity 2018-04-12 12:29:53 +09:00
parent 11b4fcfaf2
commit c39e7ed1ab
5 changed files with 99 additions and 151 deletions

View File

@ -31,33 +31,36 @@ export class ListComponent implements OnInit, AfterContentInit {
} }
ngAfterContentInit() { ngAfterContentInit() {
// this.store.select(AuthSelector.select('domain')).subscribe( this.store.select(AuthSelector.select('domain')).subscribe(
// (domain: Domain) => { (domain: Domain) => {
// this.store.dispatch(new ListStore.ReadAllByDomain(domain)); this.store.dispatch(new ListStore.ReadAllByDomain(domain));
// } }
// ); );
// this.noAuthProbes$.subscribe( this.noAuthProbes$.subscribe(
// (noAuthProbes: NoAuthProbe[]) => { (result: NoAuthProbe[]) => {
// }, if (result) {
// (error: RPCClientError) => { this.noauthProbes = result;
// console.log(error.response.message); }
// } },
// ); (error: RPCClientError) => {
console.log(error.response.message);
}
);
} }
ngOnInit() { ngOnInit() {
// Temporary Data // Temporary Data
this.noauthProbes = new Array(); // this.noauthProbes = new Array();
for (let i = 0; i < 10; i++) { // for (let i = 0; i < 10; i++) {
const p: NoAuthProbe = { // const p: NoAuthProbe = {
id: i, // id: i,
tempProbeKey: 'TempKey' + i, // tempProbeKey: 'TempKey' + i,
createDate: new Date(), // createDate: new Date(),
description: 'Description' + i, // description: 'Description' + i,
}; // };
this.noauthProbes.push(p); // this.noauthProbes.push(p);
} // }
} }
handleSelect(selected: NoAuthProbe) { handleSelect(selected: NoAuthProbe) {

View File

@ -1 +1,9 @@
<div>
<p-dialog [modal]="true" [width]="800" [(visible)]="sensorSettingDisplay">
<of-sensor-setting></of-sensor-setting>
</p-dialog>
<button type="button" label="Add Sensor" icon="ui-icon-add" pButton (click)="onAddSensor()"></button>
</div>
<div>sensor list</div> <div>sensor list</div>

View File

@ -22,32 +22,29 @@ import { Page, PageParams } from 'app/commons/model';
export class ListComponent implements OnInit, AfterContentInit { export class ListComponent implements OnInit, AfterContentInit {
sensorList$ = this.store.pipe(select(sensorListSelector.select('page'))); sensorList$ = this.store.pipe(select(sensorListSelector.select('page')));
displayedColumns = ['target', 'crawler', 'itemCount', 'status'];
PAGE_SIZE = '10'; PAGE_SIZE = '10';
totalLength = 0; totalLength = 0;
sensorSettingDisplay = false;
constructor(private router: Router, constructor(private router: Router,
private store: Store<ListStore.State>, private store: Store<ListStore.State>,
) { } ) { }
ngOnInit() { ngOnInit() {
this.sensorList$.subscribe( // this.sensorList$.subscribe(
(page: Page) => { // (page: Page) => {
if (page != null) { // if (page != null) {
this.totalLength = page.totalElements; // this.totalLength = page.totalElements;
// this.dataSource = new MatTableDataSource(page.content); // }
// this.dataSource.sort = this.sort; // },
} // (error: RPCClientError) => {
}, // console.log(error.response.message);
(error: RPCClientError) => { // }
console.log(error.response.message); // );
}
);
} }
ngAfterContentInit() { ngAfterContentInit() {
this.getSensors(0); // this.getSensors(0);
} }
getSensors(pageIndex: number) { getSensors(pageIndex: number) {
@ -72,14 +69,8 @@ export class ListComponent implements OnInit, AfterContentInit {
this.router.navigate(['target', obj.id]); this.router.navigate(['target', obj.id]);
} }
// addSensor() { onAddSensor() {
// const dialogRef = this.dialog.open(SettingComponent, { this.sensorSettingDisplay = true;
// width: '80%', }
// });
// dialogRef.afterClosed().subscribe(result => {
// console.log('The dialog was closed');
// });
// }
} }

View File

@ -1,95 +1,41 @@
<div class="card no-margin" style="height: 250px; overflow: auto"> <p-panel header="3. Credential">
<h1>3. Credential for </h1> <div class="ui-g" style="height: 180px; overflow: auto">
<div class="ui-g-12">
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label for="input">User</label>
</div>
<div class="ui-g-12 ui-md-4">
<span class="md-inputfield"> <span class="md-inputfield">
<input id="input" type="text" pInputText/> <input id="name" type="text" pInputText />
<label>Username</label> <label for="name">User</label>
</span>
</div>
<div class="ui-g-12">
<span class="md-inputfield">
<input id="age" type="text" pInputText />
<label for="age">Password</label>
</span>
</div>
<div class="ui-g-12">
<span class="md-inputfield">
<input id="name" type="text" pInputText />
<label for="name">User</label>
</span>
</div>
<div class="ui-g-12">
<span class="md-inputfield">
<input id="age" type="text" pInputText />
<label for="age">Password</label>
</span>
</div>
<div class="ui-g-12">
<span class="md-inputfield">
<input id="name" type="text" pInputText />
<label for="name">User</label>
</span>
</div>
<div class="ui-g-12">
<span class="md-inputfield">
<input id="age" type="text" pInputText />
<label for="age">Password</label>
</span> </span>
</div> </div>
</div> </div>
<button type="button" label="Test" icon="ui-icon-send" pButton></button>
<div class="ui-g form-group"> </p-panel>
<div class="ui-g-12 ui-md-2">
<label for="input">User</label>
</div>
<div class="ui-g-12 ui-md-4">
<span class="md-inputfield">
<input id="input" type="text" pInputText/>
<label>Username</label>
</span>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label for="input">User</label>
</div>
<div class="ui-g-12 ui-md-4">
<span class="md-inputfield">
<input id="input" type="text" pInputText/>
<label>Username</label>
</span>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label for="input">User</label>
</div>
<div class="ui-g-12 ui-md-4">
<span class="md-inputfield">
<input id="input" type="text" pInputText/>
<label>Username</label>
</span>
</div>
</div>
<div class="ui-g form-group">
<div class="ui-g-12 ui-md-2">
<label for="input">User</label>
</div>
<div class="ui-g-12 ui-md-4">
<span class="md-inputfield">
<input id="input" type="text" pInputText/>
<label>Username</label>
</span>
</div>
</div>
</div>
<!-- <div>
<mat-card>
<mat-card-header>
<mat-card-title>Step 3</mat-card-title>
<mat-card-subtitle>Crawler 인증</mat-card-subtitle>
</mat-card-header>
<mat-card-content *ngIf="inputItems">
<perfect-scrollbar style="height: 150px">
<div *ngFor="let inputItem of inputItems">
<mat-form-field>
<input *ngIf="inputItem.inputType.id == 1" matInput type="text" placeholder={{inputItem.name}} required={{inputItem.required}}>
<input *ngIf="inputItem.inputType.id == 2" matInput type="password" placeholder={{inputItem.name}} required={{inputItem.required}}>
<input *ngIf="inputItem.inputType.id == 3" matInput type="number" placeholder={{inputItem.name}} required={{inputItem.required}}>
<mat-select *ngIf="inputItem.inputType.id == 4" placeholder={{inputItem.name}}>
<mat-option value="true">Yes</mat-option>
<mat-option value="true">No</mat-option>
</mat-select>
<mat-select *ngIf="inputItem.inputType.id == 5" placeholder={{inputItem.name}}>
<mat-option *ngFor="let option of inputItem.keyValue.split('|')" value="option">{{option}}</mat-option>
</mat-select>
</mat-form-field>
</div>
<div fxLayoutAlign="end" *ngIf="inputItems.length > 0">
<button mat-raised-button (click)="testConnect()" color="primary">Test</button>
</div>
</perfect-scrollbar>
</mat-card-content>
</mat-card>
</div> -->

View File

@ -66,20 +66,20 @@ export class TargetSelectorComponent implements OnInit {
} }
getTargetList() { getTargetList() {
this.store.select(AuthSelector.select('domain')).subscribe( // this.store.select(AuthSelector.select('domain')).subscribe(
(domain: Domain) => { // (domain: Domain) => {
const pageParams: PageParams = { // const pageParams: PageParams = {
pageNo: '0', // pageNo: '0',
countPerPage: '9999', // countPerPage: '9999',
sortCol: 'id', // sortCol: 'id',
sortDirection: 'descending' // sortDirection: 'descending'
}; // };
this.store.dispatch(new ListStore.ReadAllByDomain({ domain, pageParams })); // this.store.dispatch(new ListStore.ReadAllByDomain({ domain, pageParams }));
}, // },
(error) => { // (error) => {
console.log(error); // console.log(error);
} // }
); // );
} }
targetSelected(t: Target) { targetSelected(t: Target) {