mirror of
https://github.com/skot/ESP-Miner.git
synced 2025-03-29 11:11:45 +01:00
IP validation
This commit is contained in:
parent
c685383114
commit
1879a84e1c
@ -1,7 +1,7 @@
|
||||
<form [formGroup]="form">
|
||||
<label>AxeOS Device IP: </label>
|
||||
<input formControlName="ip" type="text">
|
||||
<button style="margin-left: 15px;" class="btn btn-primary" (click)="add()">Add</button>
|
||||
<button style="margin-left: 15px;" class="btn btn-primary" (click)="add()" [disabled]="form.invalid">Add</button>
|
||||
<!-- <input type="checkbox" formControlName="sync"> Sync All -->
|
||||
</form>
|
||||
<div>
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { FormBuilder, FormGroup } from '@angular/forms';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { BehaviorSubject, catchError, combineLatest, forkJoin, map, Observable, of, startWith, switchMap } from 'rxjs';
|
||||
import { SystemService } from 'src/app/services/system.service';
|
||||
@ -26,7 +26,7 @@ export class SwarmComponent {
|
||||
private toastr: ToastrService
|
||||
) {
|
||||
this.form = this.fb.group({
|
||||
ip: []
|
||||
ip: [null, [Validators.required, Validators.pattern('(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)')]]
|
||||
});
|
||||
|
||||
this.swarm$ = this.systemService.getSwarmInfo().pipe(
|
||||
|
Loading…
x
Reference in New Issue
Block a user