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