blob: c4e8fca092ebe4626b341da64d9740b6c13e9368 [file] [log] [blame]
Radek Krejci80e003e2017-09-21 14:20:20 +02001<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 Krejci2b510682018-04-27 14:31:39 +02009 <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 Krejci80e003e2017-09-21 14:20:20 +020012 </div>
Radek Krejci2b510682018-04-27 14:31:39 +020013 <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 Krejci80e003e2017-09-21 14:20:20 +020027 <input type="text" name="username"
Radek Krejcia6c8b412017-10-17 16:59:38 +020028 #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 Krejci2b510682018-04-27 14:31:39 +020030 </div>
31 <div class="input_line">
32 <label for="password" class="input_line">Password</label>
Radek Krejci80e003e2017-09-21 14:20:20 +020033 <input type="password" name="password"
Radek Krejcia6c8b412017-10-17 16:59:38 +020034 #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 Krejci80e003e2017-09-21 14:20:20 +020036 </div>
Radek Krejci2b510682018-04-27 14:31:39 +020037 <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 Krejcia6c8b412017-10-17 16:59:38 +020052 <button type="submit" [disabled]="validAddForm != 15">Done</button>
Radek Krejci80e003e2017-09-21 14:20:20 +020053 <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 Krejci39cce672018-06-15 16:15:18 +020063<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 Krejci80e003e2017-09-21 14:20:20 +020073<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 Krejciae758392017-10-20 10:53:26 +020076 <th class="item_left">&nbsp;</th>
Radek Krejci2b510682018-04-27 14:31:39 +020077 <th>name</th>
Radek Krejci80e003e2017-09-21 14:20:20 +020078 <th>hostname : port</th>
Radek Krejcia7478322018-06-19 13:09:52 +020079 <th>fingerprint</th>
Radek Krejci2b510682018-04-27 14:31:39 +020080 <th>username</th>
81 <th class="item_right">autoconnect</th>
Radek Krejci80e003e2017-09-21 14:20:20 +020082 </tr>
Radek Krejci2b510682018-04-27 14:31:39 +020083 <tr class="item" *ngFor="let device of devices" (click)="connect(device)">
Radek Krejcie1a98502017-11-03 15:44:39 +010084 <td class="item_left item_actions">
Radek Krejci2b510682018-04-27 14:31:39 +020085 <img class="item_action_delete" (click)="rmDevice(device); $event.stopPropagation()"
Radek Krejcie1a98502017-11-03 15:44:39 +010086 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 Krejci2b510682018-04-27 14:31:39 +020089 </td>
90 <td>{{device.name}}</td>
91 <td>{{device.hostname}} : {{device.port}}</td>
Radek Krejcia7478322018-06-19 13:09:52 +020092 <td>{{device.fingerprint}}</td>
Radek Krejci2b510682018-04-27 14:31:39 +020093 <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 Krejci80e003e2017-09-21 14:20:20 +020096 </tr>
97</table>
98
Radek Krejcicd1ebe12018-01-11 11:34:17 +010099</div>