Radek Krejci | 80e003e | 2017-09-21 14:20:20 +0200 | [diff] [blame] | 1 | <div class="netopeer-content"> |
| 2 | |
| 3 | <div class="items_manipulation"> |
| 4 | <button (click)="getDevices()">Refresh</button> |
| 5 | <button (click)="showAddDevice()">Add</button> |
| 6 | <div *ngIf="addingDevice"> |
| 7 | <hr/> |
| 8 | <form (submit)="addDevice(action.value)" #newDeviceForm> |
Radek Krejci | 2b51068 | 2018-04-27 14:31:39 +0200 | [diff] [blame] | 9 | <div class="input_line"> |
| 10 | <label for="name" class="input_line">Device Name</label> |
| 11 | <input type="text" name="name" #name placeholder="{{namePlaceholder}}" [class.invalid]="false" [(ngModel)]="newDevice.name"/> |
Radek Krejci | 80e003e | 2017-09-21 14:20:20 +0200 | [diff] [blame] | 12 | </div> |
Radek Krejci | 2b51068 | 2018-04-27 14:31:39 +0200 | [diff] [blame] | 13 | <div class="input_line"> |
| 14 | <label for="hostname" class="input_line">Hostname / IP</label> |
| 15 | <input type="text" name="hostname" required |
| 16 | #host [class.invalid]="!bitStatus(8)" [(ngModel)]="newDevice.hostname" (keyup)="checkString(host.value, 8);namePlaceholderUpdate()"/> |
| 17 | <div [hidden]="bitStatus(8)" class="input_line_alert">Hostname or IP address is required</div> |
| 18 | </div> |
| 19 | <div class="input_line"> |
| 20 | <label for="port" class="input_line">Port</label> |
| 21 | <input type="number" name="port" required |
| 22 | #port [class.invalid]="!bitStatus(1)" [(ngModel)]="newDevice.port" (keyup)="checkPort(port.value)" (change)="checkPort(port.value)"/> |
| 23 | <div [hidden]="bitStatus(1)" class="input_line_alert">Port must be in range 1 - 65535</div> |
| 24 | </div> |
| 25 | <div class="input_line"> |
| 26 | <label for="username" class="input_line">Username</label> |
Radek Krejci | 80e003e | 2017-09-21 14:20:20 +0200 | [diff] [blame] | 27 | <input type="text" name="username" |
Radek Krejci | a6c8b41 | 2017-10-17 16:59:38 +0200 | [diff] [blame] | 28 | #user [class.invalid]="!bitStatus(4)" [(ngModel)]="newDevice.username" (keyup)="checkString(user.value, 4)"/> |
| 29 | <div [hidden]="bitStatus(4)" class="input_line_alert">User login is required to connect to the device.</div> |
Radek Krejci | 2b51068 | 2018-04-27 14:31:39 +0200 | [diff] [blame] | 30 | </div> |
| 31 | <div class="input_line"> |
| 32 | <label for="password" class="input_line">Password</label> |
Radek Krejci | 80e003e | 2017-09-21 14:20:20 +0200 | [diff] [blame] | 33 | <input type="password" name="password" |
Radek Krejci | a6c8b41 | 2017-10-17 16:59:38 +0200 | [diff] [blame] | 34 | #pass [class.invalid]="!bitStatus(2)" [(ngModel)]="newDevice.password" (keyup)="checkString(pass.value, 2)"/> |
| 35 | <div [hidden]="bitStatus(2)" class="input_line_alert">User password must be specified to connect to the device.</div> |
Radek Krejci | 80e003e | 2017-09-21 14:20:20 +0200 | [diff] [blame] | 36 | </div> |
Radek Krejci | 2b51068 | 2018-04-27 14:31:39 +0200 | [diff] [blame] | 37 | <div class="input_line"> |
| 38 | <label for="autoconnect" class="input_line">Auto Connect</label> |
| 39 | <input type="checkbox" name="autoconnect" |
| 40 | #autoconnect [(ngModel)]="newDevice.autoconnect" title="Automatically connect the device on user login."/> |
| 41 | </div> |
| 42 | <div class="input_line"> |
| 43 | <label for="action" class="input_line">What next</label> |
| 44 | <select name="action" required #action> |
| 45 | <option [value]="'store'">store</option> |
| 46 | <option [value]="'connect'">connect</option> |
| 47 | <option [value]="'store_connect'" selected="selected">store & connect</option> |
| 48 | </select> |
| 49 | </div> |
| 50 | |
| 51 | <div class="input_control"> |
Radek Krejci | a6c8b41 | 2017-10-17 16:59:38 +0200 | [diff] [blame] | 52 | <button type="submit" [disabled]="validAddForm != 15">Done</button> |
Radek Krejci | 80e003e | 2017-09-21 14:20:20 +0200 | [diff] [blame] | 53 | <span [ngSwitch]="addingResult"> |
| 54 | <span *ngSwitchCase="0" class="msg-rounded msg-failure"><span class="msg-close" (click)="addingResult=-1">x</span>failed.</span> |
| 55 | <span *ngSwitchCase="1" class="msg-rounded msg-success"><span class="msg-close" (click)="addingResult=-1">x</span>successfully added.</span> |
| 56 | </span> |
| 57 | </div> |
| 58 | </form> |
| 59 | </div> |
| 60 | <hr/> |
| 61 | </div> |
| 62 | |
Radek Krejci | 39cce67 | 2018-06-15 16:15:18 +0200 | [diff] [blame] | 63 | <div *ngIf="hostcheck" class="user-dialogue"> |
| 64 | <div *ngIf="hostcheck.msg">{{hostcheck.msg}}</div> |
| 65 | <div>The authenticity of the host <span class="keyword">{{hostcheck.hostname}}</span> cannot be established.<br/> |
| 66 | <span class="keyword">{{hostcheck.keytype}}</span> key fingerprint is <span class="keyword">{{hostcheck.hexa}}</span>.</div> |
| 67 | <div>Are you sure you want to continue connecting? |
| 68 | <button (click)="hostcheckAnswer(true)">yes</button> / |
| 69 | <button (click)="hostcheckAnswer(false)">no</button> |
| 70 | </div> |
| 71 | </div> |
| 72 | |
Radek Krejci | 80e003e | 2017-09-21 14:20:20 +0200 | [diff] [blame] | 73 | <p class="msg-failure msg-rounded" *ngIf="err_msg"><span class="msg-close" (click)="err_msg=''">x</span>{{err_msg}}</p> |
| 74 | <table class="items"> |
| 75 | <tr class="item_header"> |
Radek Krejci | ae75839 | 2017-10-20 10:53:26 +0200 | [diff] [blame] | 76 | <th class="item_left"> </th> |
Radek Krejci | 2b51068 | 2018-04-27 14:31:39 +0200 | [diff] [blame] | 77 | <th>name</th> |
Radek Krejci | 80e003e | 2017-09-21 14:20:20 +0200 | [diff] [blame] | 78 | <th>hostname : port</th> |
Radek Krejci | a747832 | 2018-06-19 13:09:52 +0200 | [diff] [blame^] | 79 | <th>fingerprint</th> |
Radek Krejci | 2b51068 | 2018-04-27 14:31:39 +0200 | [diff] [blame] | 80 | <th>username</th> |
| 81 | <th class="item_right">autoconnect</th> |
Radek Krejci | 80e003e | 2017-09-21 14:20:20 +0200 | [diff] [blame] | 82 | </tr> |
Radek Krejci | 2b51068 | 2018-04-27 14:31:39 +0200 | [diff] [blame] | 83 | <tr class="item" *ngFor="let device of devices" (click)="connect(device)"> |
Radek Krejci | e1a9850 | 2017-11-03 15:44:39 +0100 | [diff] [blame] | 84 | <td class="item_left item_actions"> |
Radek Krejci | 2b51068 | 2018-04-27 14:31:39 +0200 | [diff] [blame] | 85 | <img class="item_action_delete" (click)="rmDevice(device); $event.stopPropagation()" |
Radek Krejci | e1a9850 | 2017-11-03 15:44:39 +0100 | [diff] [blame] | 86 | src="assets/netopeer/icons/close.svg" alt="x" title="delete" |
| 87 | onmouseover="this.src='assets/netopeer/icons/close_active.svg'" |
| 88 | onmouseout="this.src='assets/netopeer/icons/close.svg'"/> |
Radek Krejci | 2b51068 | 2018-04-27 14:31:39 +0200 | [diff] [blame] | 89 | </td> |
| 90 | <td>{{device.name}}</td> |
| 91 | <td>{{device.hostname}} : {{device.port}}</td> |
Radek Krejci | a747832 | 2018-06-19 13:09:52 +0200 | [diff] [blame^] | 92 | <td>{{device.fingerprint}}</td> |
Radek Krejci | 2b51068 | 2018-04-27 14:31:39 +0200 | [diff] [blame] | 93 | <td>{{device.username}}</td> |
| 94 | <td class="item_right"><input type="checkbox" name="autoconnect" disabled [checked]="device.autoconnect" |
| 95 | title="Automatically connect the device on user login."/></td> |
Radek Krejci | 80e003e | 2017-09-21 14:20:20 +0200 | [diff] [blame] | 96 | </tr> |
| 97 | </table> |
| 98 | |
Radek Krejci | cd1ebe1 | 2018-01-11 11:34:17 +0100 | [diff] [blame] | 99 | </div> |