mirror of
https://github.com/sensebox/blockly-app
synced 2025-07-01 00:00:25 +02:00
added sensor list
This commit is contained in:
parent
bbe07dee10
commit
457a3b7711
8 changed files with 70 additions and 13 deletions
|
@ -16,6 +16,7 @@ import { AddItemPage } from '../pages/add-item/add-item';
|
||||||
import { SensorDetailPage } from '../pages/sensor-detail/sensor-detail';
|
import { SensorDetailPage } from '../pages/sensor-detail/sensor-detail';
|
||||||
import { MySenseBoxPage } from '../pages/my-sense-box/my-sense-box';
|
import { MySenseBoxPage } from '../pages/my-sense-box/my-sense-box';
|
||||||
import { LoginProvider } from '../providers/LoginProvider/LoginProvider';
|
import { LoginProvider } from '../providers/LoginProvider/LoginProvider';
|
||||||
|
import { SensorsPage } from '../pages/sensors/sensors';
|
||||||
|
|
||||||
// For AoT compilation (production builds) we need to have a factory for the loader of translation files.
|
// For AoT compilation (production builds) we need to have a factory for the loader of translation files.
|
||||||
// @TODO: we possibly could optimize this by using a static loader in combination with webpack:
|
// @TODO: we possibly could optimize this by using a static loader in combination with webpack:
|
||||||
|
@ -29,7 +30,8 @@ export function createTranslateLoader(http: HttpClient) {
|
||||||
openSenseApp,
|
openSenseApp,
|
||||||
AddItemPage,
|
AddItemPage,
|
||||||
SensorDetailPage,
|
SensorDetailPage,
|
||||||
MySenseBoxPage
|
MySenseBoxPage,
|
||||||
|
SensorsPage
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
|
@ -50,7 +52,8 @@ export function createTranslateLoader(http: HttpClient) {
|
||||||
openSenseApp,
|
openSenseApp,
|
||||||
AddItemPage,
|
AddItemPage,
|
||||||
SensorDetailPage,
|
SensorDetailPage,
|
||||||
MySenseBoxPage
|
MySenseBoxPage,
|
||||||
|
SensorsPage
|
||||||
|
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
|
|
|
@ -52,3 +52,9 @@ $breakpoints-values: map-values($grid-breakpoints);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
color:#c7254e;
|
||||||
|
background-color: #f9f2f4;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
|
@ -1,8 +1,3 @@
|
||||||
.hint {
|
.hint {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
code {
|
|
||||||
color:#c7254e;
|
|
||||||
background-color: #f9f2f4;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
|
@ -21,15 +21,24 @@
|
||||||
</ion-card-title>
|
</ion-card-title>
|
||||||
</ion-card-header>
|
</ion-card-header>
|
||||||
<ion-card-content>
|
<ion-card-content>
|
||||||
|
<ion-row>
|
||||||
|
Exposure: {{box.exposure}}
|
||||||
|
</ion-row>
|
||||||
|
<ion-row>
|
||||||
|
Model: {{box.model}}
|
||||||
|
</ion-row>
|
||||||
|
<ion-row>
|
||||||
|
ID: <code>{{box._id}}</code>
|
||||||
|
</ion-row>
|
||||||
<ion-row>
|
<ion-row>
|
||||||
<ion-col col-4>
|
<ion-col col-4>
|
||||||
<button class="actionButton" ion-button color="light">Show</button>
|
<button class="actionButton" ion-button color="light"(click)="forwardShow(box)">Show</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col col-4>
|
<ion-col col-4>
|
||||||
<button class="actionButton" ion-button color="light">Edit</button>
|
<button class="actionButton" ion-button color="light" (click)="forwardEdit(box)">Edit</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
<ion-col col-4>
|
<ion-col col-4>
|
||||||
<button class="actionButton" ion-button color="light">Sketch</button>
|
<button class="actionButton" ion-button color="light" (click)="forwardSketch(box)">Sketch</button>
|
||||||
</ion-col>
|
</ion-col>
|
||||||
</ion-row>
|
</ion-row>
|
||||||
</ion-card-content>
|
</ion-card-content>
|
||||||
|
|
|
@ -3,4 +3,14 @@ page-my-sense-box {
|
||||||
}
|
}
|
||||||
.actionButton{
|
.actionButton{
|
||||||
width:100%
|
width:100%
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
color:#c7254e;
|
||||||
|
background-color: #f9f2f4;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.senseBox {
|
||||||
|
background: rgb(114, 176, 38) none repeat scroll 0% 0%
|
||||||
}
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
import { Component } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||||
import {LoginProvider} from "../../providers/LoginProvider/LoginProvider";
|
import {LoginProvider} from "../../providers/LoginProvider/LoginProvider";
|
||||||
|
import { SensorsPage } from '../sensors/sensors';
|
||||||
/**
|
/**
|
||||||
* Generated class for the MySenseBoxPage page.
|
* Generated class for the MySenseBoxPage page.
|
||||||
*
|
*
|
||||||
|
@ -22,6 +23,17 @@ export class MySenseBoxPage {
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
forwardShow(box){
|
||||||
|
this.navCtrl.push(SensorsPage,box)
|
||||||
|
}
|
||||||
|
|
||||||
|
forwardEdit(box){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
forwardSketch(box){
|
||||||
|
}
|
||||||
|
|
||||||
ionViewDidLoad() {
|
ionViewDidLoad() {
|
||||||
console.log('ionViewDidLoad MySenseBoxPage');
|
console.log('ionViewDidLoad MySenseBoxPage');
|
||||||
this.boxes = this.navParams.data.data.boxes
|
this.boxes = this.navParams.data.data.boxes
|
||||||
|
|
|
@ -7,12 +7,34 @@
|
||||||
<ion-header>
|
<ion-header>
|
||||||
|
|
||||||
<ion-navbar>
|
<ion-navbar>
|
||||||
<ion-title>sensors</ion-title>
|
<ion-title>Sensors</ion-title>
|
||||||
</ion-navbar>
|
</ion-navbar>
|
||||||
|
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
|
|
||||||
<ion-content padding>
|
<ion-content padding>
|
||||||
|
<ion-grid>
|
||||||
|
<ion-row *ngFor="let sensor of box.sensors">
|
||||||
|
<ion-card>
|
||||||
|
<ion-card-header>
|
||||||
|
<ion-title>
|
||||||
|
{{sensor.title}}
|
||||||
|
</ion-title>
|
||||||
|
</ion-card-header>
|
||||||
|
<ion-card-content>
|
||||||
|
<ion-row>
|
||||||
|
Typ:{{sensor.sensorType}}
|
||||||
|
</ion-row>
|
||||||
|
<ion-row>
|
||||||
|
Last measurement: {{sensor.lastMeasurement.value}}{{sensor.unit}} at {{sensor.lastMeasurement.createdAt}}
|
||||||
|
</ion-row>
|
||||||
|
<ion-row>
|
||||||
|
ID: <code>{{sensor._id}}</code>
|
||||||
|
</ion-row>
|
||||||
|
</ion-card-content>
|
||||||
|
</ion-card>
|
||||||
|
</ion-row>
|
||||||
|
|
||||||
</ion-content>
|
</ion-grid>
|
||||||
|
</ion-content>
|
|
@ -14,7 +14,7 @@ import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||||
templateUrl: 'sensors.html',
|
templateUrl: 'sensors.html',
|
||||||
})
|
})
|
||||||
export class SensorsPage {
|
export class SensorsPage {
|
||||||
|
public box:Object = this.navParams.data
|
||||||
constructor(public navCtrl: NavController, public navParams: NavParams) {
|
constructor(public navCtrl: NavController, public navParams: NavParams) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue