blob: 8bc554a61daaadbff3af8aa721e412a41ca2aecf [file] [log] [blame]
Radek Krejci80e003e2017-09-21 14:20:20 +02001<div class="netopeer-content">
Radek Krejci80e003e2017-09-21 14:20:20 +02002<div class="items_manipulation">
3 <button (click)="getDevices()">Refresh</button>
4 <button (click)="showAddDevice()">Add</button>
5 <div *ngIf="addingDevice">
6 <hr/>
7 <form (submit)="addDevice(action.value)" #newDeviceForm>
Radek Krejci2b510682018-04-27 14:31:39 +02008 <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 Krejci80e003e2017-09-21 14:20:20 +020011 </div>
Radek Krejci2b510682018-04-27 14:31:39 +020012 <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 Krejci80e003e2017-09-21 14:20:20 +020026 <input type="text" name="username"
Radek Krejcia6c8b412017-10-17 16:59:38 +020027 #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 Krejci2b510682018-04-27 14:31:39 +020029 </div>
30 <div class="input_line">
31 <label for="password" class="input_line">Password</label>
Radek Krejci80e003e2017-09-21 14:20:20 +020032 <input type="password" name="password"
Radek Krejcia6c8b412017-10-17 16:59:38 +020033 #pass [class.invalid]="!bitStatus(2)" [(ngModel)]="newDevice.password" (keyup)="checkString(pass.value, 2)"/>
34 <div [hidden]="bitStatus(2)" class="input_line_alert">User password must be specified to connect to the device.</div>
Radek Krejci80e003e2017-09-21 14:20:20 +020035 </div>
Radek Krejci2b510682018-04-27 14:31:39 +020036 <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 Krejcia6c8b412017-10-17 16:59:38 +020051 <button type="submit" [disabled]="validAddForm != 15">Done</button>
Radek Krejci80e003e2017-09-21 14:20:20 +020052 <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 Krejciae758392017-10-20 10:53:26 +020065 <th class="item_left">&nbsp;</th>
Radek Krejci2b510682018-04-27 14:31:39 +020066 <th>name</th>
Radek Krejci80e003e2017-09-21 14:20:20 +020067 <th>hostname : port</th>
Radek Krejcia7478322018-06-19 13:09:52 +020068 <th>fingerprint</th>
Radek Krejci2b510682018-04-27 14:31:39 +020069 <th>username</th>
70 <th class="item_right">autoconnect</th>
Radek Krejci80e003e2017-09-21 14:20:20 +020071 </tr>
Radek Krejci2b510682018-04-27 14:31:39 +020072 <tr class="item" *ngFor="let device of devices" (click)="connect(device)">
Radek Krejcie1a98502017-11-03 15:44:39 +010073 <td class="item_left item_actions">
Radek Krejci2b510682018-04-27 14:31:39 +020074 <img class="item_action_delete" (click)="rmDevice(device); $event.stopPropagation()"
Radek Krejcie1a98502017-11-03 15:44:39 +010075 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 Krejci2b510682018-04-27 14:31:39 +020078 </td>
79 <td>{{device.name}}</td>
80 <td>{{device.hostname}} : {{device.port}}</td>
Radek Krejcia7478322018-06-19 13:09:52 +020081 <td>{{device.fingerprint}}</td>
Radek Krejci2b510682018-04-27 14:31:39 +020082 <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 Krejci80e003e2017-09-21 14:20:20 +020085 </tr>
86</table>
87
Radek Krejcicd1ebe12018-01-11 11:34:17 +010088</div>