updating find computer page
This commit is contained in:
22469
Client/package-lock.json
generated
22469
Client/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -33,7 +33,7 @@
|
|||||||
"@capacitor/status-bar": "1.0.6",
|
"@capacitor/status-bar": "1.0.6",
|
||||||
"@ionic-native/core": "^5.36.0",
|
"@ionic-native/core": "^5.36.0",
|
||||||
"@ionic-native/zeroconf": "^5.36.0",
|
"@ionic-native/zeroconf": "^5.36.0",
|
||||||
"@ionic/angular": "^5.5.2",
|
"@ionic/angular": "^6.2.3",
|
||||||
"@ionic/storage": "^3.0.6",
|
"@ionic/storage": "^3.0.6",
|
||||||
"@ionic/storage-angular": "^3.0.6",
|
"@ionic/storage-angular": "^3.0.6",
|
||||||
"@ngrx/effects": "^13.0.2",
|
"@ngrx/effects": "^13.0.2",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<ion-header [translucent]="true">
|
<ion-header [translucent]="true">
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-title>Search Host</ion-title>
|
<ion-title>Search computer</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
@@ -13,19 +13,33 @@
|
|||||||
<ion-title size="large">WOL</ion-title>
|
<ion-title size="large">WOL</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
<!-- WOL -->
|
<!-- WOL -->
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-item *ngIf="netWorkDevices.length == 0">
|
<ion-item *ngIf="netWorkDevices.length === 0">
|
||||||
<ion-label>No Devices found</ion-label>
|
<ion-label>No Devices found</ion-label>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
<ion-item-sliding *ngFor="let device of netWorkDevices">
|
<ion-accordion-group>
|
||||||
<ion-item>
|
<ion-accordion *ngFor="let device of netWorkDevices">
|
||||||
<ion-label>{{device.ipv4Addresses[0]}}</ion-label>
|
<ion-item slot="header" color="light">
|
||||||
</ion-item>
|
<ion-icon name="desktop-outline"></ion-icon>
|
||||||
<ion-item-options>
|
<ion-label>{{device.ipv4Addresses[0]}}</ion-label>
|
||||||
<ion-item-option (click)="saveWolDevice(device)">Save</ion-item-option>
|
</ion-item>
|
||||||
</ion-item-options>
|
<div slot="content">
|
||||||
</ion-item-sliding>
|
<ion-item>
|
||||||
</ion-list>
|
<ion-label>IP: {{device.ipv4Addresses[0]}}</ion-label>
|
||||||
<!-- wol end -->
|
</ion-item>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>PORT: {{device.PORT}}</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
<ion-item>
|
||||||
|
<ion-label>MAC-Address: {{device.txtRecord.mac}}</ion-label>
|
||||||
|
</ion-item>
|
||||||
|
<ion-button expand="full" (click)="saveWolDevice(null)"
|
||||||
|
>Configure</ion-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</ion-accordion>
|
||||||
|
</ion-accordion-group>
|
||||||
|
</ion-list>
|
||||||
|
<!-- wol end -->
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
ion-icon {
|
||||||
|
padding-right: 5px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { WolAddressChanged } from './../../store/gotobed.actions';
|
import { PortSettingsChanged, SaveAddressSettings, WolAddressChanged } from './../../store/gotobed.actions';
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { Zeroconf, ZeroconfResult, ZeroconfService } from "@ionic-native/zeroconf";
|
import { Zeroconf, ZeroconfService } from "@ionic-native/zeroconf";
|
||||||
import { Store } from '@ngrx/store';
|
import { Store } from '@ngrx/store';
|
||||||
import { ServiceOptions } from 'src/app/gotobed.models';
|
|
||||||
import { MacSettingsChanged } from 'src/app/store/gotobed.actions';
|
import { MacSettingsChanged } from 'src/app/store/gotobed.actions';
|
||||||
import { GotobedState } from 'src/app/store/gotobed.state';
|
import { GotobedState } from 'src/app/store/gotobed.state';
|
||||||
|
import { ToastController } from '@ionic/angular';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-searchhost',
|
selector: 'app-searchhost',
|
||||||
templateUrl: 'searchHost.page.html',
|
templateUrl: 'searchHost.page.html',
|
||||||
@@ -13,7 +13,10 @@ import { GotobedState } from 'src/app/store/gotobed.state';
|
|||||||
export class SearchHostPage implements OnInit {
|
export class SearchHostPage implements OnInit {
|
||||||
netWorkDevices: ZeroconfService[] = [];
|
netWorkDevices: ZeroconfService[] = [];
|
||||||
|
|
||||||
constructor(private store: Store<GotobedState>) {}
|
constructor(
|
||||||
|
private store: Store<GotobedState>,
|
||||||
|
public toastController: ToastController
|
||||||
|
) {}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.scanDevices();
|
this.scanDevices();
|
||||||
@@ -31,8 +34,11 @@ export class SearchHostPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
saveWolDevice(device: ZeroconfService) {
|
saveWolDevice(device: ZeroconfService) {
|
||||||
|
this.presentToast();
|
||||||
this.store.dispatch(new MacSettingsChanged(device.txtRecord.mac));
|
this.store.dispatch(new MacSettingsChanged(device.txtRecord.mac));
|
||||||
this.store.dispatch(new WolAddressChanged(this.convertToBroadcast(device.ipv4Addresses[0])));
|
this.store.dispatch(new WolAddressChanged(this.convertToBroadcast(device.ipv4Addresses[0])));
|
||||||
|
this.store.dispatch(new SaveAddressSettings(device.ipv4Addresses[0]));
|
||||||
|
this.store.dispatch(new PortSettingsChanged(device.port.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh(event) {
|
refresh(event) {
|
||||||
@@ -44,6 +50,14 @@ export class SearchHostPage implements OnInit {
|
|||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async presentToast() {
|
||||||
|
const toast = await this.toastController.create({
|
||||||
|
message: 'Your settings have been saved.',
|
||||||
|
duration: 2000,
|
||||||
|
});
|
||||||
|
toast.present();
|
||||||
|
}
|
||||||
|
|
||||||
private convertToBroadcast(ip: string) {
|
private convertToBroadcast(ip: string) {
|
||||||
let subnetArray = ip.split('.');
|
let subnetArray = ip.split('.');
|
||||||
subnetArray[3] = '255';
|
subnetArray[3] = '255';
|
||||||
|
|||||||
10
package-lock.json
generated
10
package-lock.json
generated
@@ -1,11 +1,3 @@
|
|||||||
{
|
{
|
||||||
"requires": true,
|
"lockfileVersion": 1
|
||||||
"lockfileVersion": 1,
|
|
||||||
"dependencies": {
|
|
||||||
"cordova-arp-cache-fetch": {
|
|
||||||
"version": "0.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/cordova-arp-cache-fetch/-/cordova-arp-cache-fetch-0.3.2.tgz",
|
|
||||||
"integrity": "sha512-8EYOUkIztG794jzY/qDy8AMxwIfpMYwaaffBnDp7HSLeQpXXBR2W5FibRhjoGyHxwopXTUIKoPhrtqTdB8LCKQ=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user