- Timestamp:
- Oct 20, 2019, 6:34:05 PM (7 years ago)
- Branches:
- debian/bullseye, master
- Children:
- 4348785
- Parents:
- ca1bb14
- Location:
- src/mapservice-webclient/src/app
- Files:
-
- 2 added
- 6 edited
-
app.module.ts (modified) (2 diffs)
-
app.routing.ts (modified) (2 diffs)
-
mygnuboat/deviceadd.component.html (added)
-
mygnuboat/deviceadd.component.ts (added)
-
mygnuboat/index.ts (modified) (1 diff)
-
mygnuboat/user.component.html (modified) (1 diff)
-
mygnuboat/user.component.ts (modified) (5 diffs)
-
water/gauges.component.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/mapservice-webclient/src/app/app.module.ts
rca1bb14 r955f4b4 16 16 import { WatersComponent, WaterComponent, WaterDetailsComponent, GaugesComponent } from './water'; 17 17 import { MapComponent } from './map'; 18 import { UserComponent, WaterAddComponent, GaugeEditComponent } from './mygnuboat';18 import { UserComponent, WaterAddComponent, GaugeEditComponent, DeviceAddComponent } from './mygnuboat'; 19 19 20 20 … … 40 40 WaterAddComponent, 41 41 GaugeEditComponent, 42 DeviceAddComponent, 42 43 MapComponent, 43 44 ], -
src/mapservice-webclient/src/app/app.routing.ts
rca1bb14 r955f4b4 4 4 import { LoginComponent, RegisterComponent } from './user'; 5 5 import { WatersComponent, WaterDetailsComponent } from './water'; 6 import { UserComponent, WaterAddComponent } from './mygnuboat';6 import { UserComponent, WaterAddComponent, DeviceAddComponent } from './mygnuboat'; 7 7 import { HomeComponent } from './home'; 8 8 … … 12 12 { path: 'mygnuboat', component: UserComponent, canActivate: [AuthGuard] }, 13 13 { path: 'mygnuboat/water/add', component: WaterAddComponent, canActivate: [AuthGuard] }, 14 { path: 'mygnuboat/device/add', component: DeviceAddComponent, canActivate: [AuthGuard] }, 14 15 { path: 'water', component: WatersComponent }, 15 16 { path: 'water/:id', component: WaterDetailsComponent }, -
src/mapservice-webclient/src/app/mygnuboat/index.ts
rca1bb14 r955f4b4 2 2 export * from './wateradd.component'; 3 3 export * from './gaugeedit.component'; 4 export * from './deviceadd.component'; -
src/mapservice-webclient/src/app/mygnuboat/user.component.html
rca1bb14 r955f4b4 19 19 </div> 20 20 <h2 class="content-subhead"><object data="/resources/gnuboat-device.svg" ype="image/svg++xml" class="svg-icon"></object>Devices</h2> 21 <div> 22 <a name="devices"></a> 23 <p><a class="pure-button button-add" routerLink="device/add">Add Device</a></p> 24 <table id="devices" class="pure-table pure-table-horizontal pure-table-striped"> 25 <thead> 26 <tr> 27 <th>Name</th> 28 <th>Sensor Depth</th> 29 <th>Comment</th> 30 <th></th> 31 <th></th> 32 </tr> 33 </thead> 34 <tbody> 35 <tr *ngFor="let device of devices"> 36 <td id="name">{{device.name}}</td> 37 <td id="sensorDepth">{{device.sensorDepth}}cm</td> 38 <td id="comment">{{device.comment}}</td> 39 <td id="button"><button disabled (click)="deviceUploadLogfile(apiKey)" class="button-add pure-button">Upload Logfile</button></td> 40 <td id="button"><button (click)="deviceDelete(device)" class="button-remove pure-button">Delete</button></td> 41 </tr> 42 </tbody> 43 </table> 44 </div> 21 45 <h2 class="content-subhead">Your API keys</h2> 22 46 <div> -
src/mapservice-webclient/src/app/mygnuboat/user.component.ts
rca1bb14 r955f4b4 3 3 import { first } from 'rxjs/operators'; 4 4 5 import { User, UsersService, Water, WatersService } from '../../../src-gen/gnuboat-mapservice';6 import { AuthenticationService } from '../services';5 import { User, UsersService, Water, WatersService, Device, DevicesService } from '../../../src-gen/gnuboat-mapservice'; 6 import { AuthenticationService, AlertService } from '../services'; 7 7 8 8 @Component({ templateUrl: 'user.component.html' }) … … 12 12 apiKeys: string[] = []; 13 13 waters: Water[] = []; 14 devices: Device[] = []; 14 15 15 16 constructor( 16 17 private authenticationService: AuthenticationService, 17 18 private usersService: UsersService, 18 private watersService: WatersService 19 private watersService: WatersService, 20 private devicesService: DevicesService, 21 private alertService: AlertService 19 22 ) { 20 23 this.currentUserSubscription = this.authenticationService.currentUser.subscribe(user => { … … 26 29 this.watersService.watersGet(undefined, user.username).pipe(first()).subscribe(waters => { 27 30 this.waters = waters 31 }); 32 this.devicesService.devicesGet().pipe(first()).subscribe(devices => { 33 this.devices = devices 28 34 }); 29 35 }); … … 39 45 } 40 46 47 deviceDelete(device: Device) { 48 this.devicesService.devicesDeviceDelete(device.deviceId).pipe(first()).subscribe(devices => { 49 this.devices = devices 50 }, 51 error => { 52 this.alertService.error(error); 53 }); 54 } 55 41 56 apiKeyDelete(apiKey: string) { 42 57 this.usersService.usersApiKeyDelete(apiKey).pipe(first()).subscribe(keys => { 43 58 this.apiKeys = keys 59 }, 60 error => { 61 this.alertService.error(error); 44 62 }); 45 63 } … … 48 66 this.usersService.usersApiKeyCreate().pipe(first()).subscribe(keys => { 49 67 this.apiKeys = keys 68 }, 69 error => { 70 this.alertService.error(error); 50 71 }); 51 72 } -
src/mapservice-webclient/src/app/water/gauges.component.html
rca1bb14 r955f4b4 15 15 <td>{{decimalDegreesToDegreesMinutesSeconds(gauge.location[1], Coordinate.Latitude)}}</td> 16 16 <td>{{decimalDegreesToDegreesMinutesSeconds(gauge.location[0], Coordinate.Longitude)}}</td> 17 <td><a *ngIf="user && gauge.manager==currentuser.username" class="pure-button" [routerLink]="['/water', water.waterId]">Edit</a></td> 17 <td> 18 <a *ngIf="currentUser" class="pure-button" [routerLink]="['/water', water.waterId]">Edit</a> 19 </td> 18 20 </tr> 19 21 </ng-container>
Note:
See TracChangeset
for help on using the changeset viewer.
