mirror of
https://github.com/sensebox/blockly-app
synced 2025-04-07 03:30:28 +02:00
remove blockly-unrelated pages & functionality
This commit is contained in:
parent
d33ca28f13
commit
0a97aec403
14 changed files with 12 additions and 157 deletions
|
@ -3,8 +3,8 @@ import { Nav, Platform } from 'ionic-angular';
|
|||
import { StatusBar } from '@ionic-native/status-bar';
|
||||
import { SplashScreen } from '@ionic-native/splash-screen';
|
||||
|
||||
import { HomePage } from '../pages/home/home';
|
||||
import { BlocklyPage } from '../pages/Blockly/blockly';
|
||||
import { BlocklyPage } from '../pages/blockly/blockly';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'app.html'
|
||||
|
@ -13,13 +13,11 @@ export class openSenseApp {
|
|||
|
||||
@ViewChild(Nav) nav: Nav;
|
||||
|
||||
rootPage:any = BlocklyPage; // TODO: for development, revert to HomePage
|
||||
rootPage:any = BlocklyPage;
|
||||
|
||||
pages: Array<{title: string, component: any}> = [
|
||||
{ title: 'Home', component: HomePage },
|
||||
{ title:'Blockly', component:'BlocklyPage' },
|
||||
{ title: 'About', component: 'AboutPage' },
|
||||
{ title: 'senseBox', component: 'SenseBoxPage' },
|
||||
{title:'Blockly', component:'BlocklyPage'}
|
||||
];
|
||||
|
||||
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
|
||||
|
|
|
@ -5,18 +5,15 @@ import { SplashScreen } from '@ionic-native/splash-screen';
|
|||
import { StatusBar } from '@ionic-native/status-bar';
|
||||
|
||||
import { openSenseApp } from './app.component';
|
||||
import { HomePage } from '../pages/home/home';
|
||||
import { ApiProvider } from '../providers/api/api';
|
||||
import { HttpClientModule } from '@angular/common/http';
|
||||
import { OtaWizardPage } from '../pages/ota-wizard/ota-wizard';
|
||||
import { OtaWizardPageModule } from '../pages/ota-wizard/ota-wizard.module';
|
||||
import { BlocklyPage } from '../pages/Blockly/blockly';
|
||||
import { BlocklyPageModule } from '../pages/blockly/blockly.module';
|
||||
import { BlocklyPageModule } from '../pages/Blockly/blockly.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
openSenseApp,
|
||||
HomePage,
|
||||
],
|
||||
imports: [
|
||||
HttpClientModule,
|
||||
|
@ -28,15 +25,11 @@ import { BlocklyPageModule } from '../pages/Blockly/blockly.module';
|
|||
bootstrap: [IonicApp],
|
||||
entryComponents: [
|
||||
openSenseApp,
|
||||
OtaWizardPage,
|
||||
BlocklyPage,
|
||||
HomePage
|
||||
],
|
||||
providers: [
|
||||
StatusBar,
|
||||
SplashScreen,
|
||||
{provide: ErrorHandler, useClass: IonicErrorHandler},
|
||||
ApiProvider,
|
||||
]
|
||||
})
|
||||
export class AppModule {}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<button ion-button menuToggle>
|
||||
<ion-icon name="menu"></ion-icon>
|
||||
</button>
|
||||
<ion-title>Blockly for SenseBox</ion-title>
|
||||
<ion-title>{{ 'BLOCKLY.TITLE' | translate }}</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from 'ionic-angular';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { BlocklyPage } from './blockly';
|
||||
|
||||
@NgModule({
|
||||
|
@ -7,6 +9,7 @@ import { BlocklyPage } from './blockly';
|
|||
BlocklyPage,
|
||||
],
|
||||
imports: [
|
||||
TranslateModule,
|
||||
IonicPageModule.forChild(BlocklyPage)
|
||||
],
|
||||
})
|
|
@ -1,7 +1,8 @@
|
|||
import { Component, ViewChild, ElementRef } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||
import { OtaWizardPage } from '../ota-wizard/ota-wizard';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
|
||||
import { OtaWizardPage } from '../ota-wizard/ota-wizard';
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
|
@ -15,7 +16,8 @@ export class BlocklyPage {
|
|||
|
||||
constructor(
|
||||
public navCtrl: NavController,
|
||||
public navParams: NavParams
|
||||
public navParams: NavParams,
|
||||
public translate: TranslateService,
|
||||
) {
|
||||
// need to assign it here to keep the function reference for unsubscribing again
|
||||
// and to maintain the this scope properly
|
|
@ -1,13 +0,0 @@
|
|||
<ion-header>
|
||||
<ion-navbar>
|
||||
<button ion-button menuToggle>
|
||||
<ion-icon name="menu"></ion-icon>
|
||||
</button>
|
||||
<ion-title>Home</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding>
|
||||
<h1>Its all about sensors.</h1>
|
||||
<p>Create new pages for your project und link them in the menu please.</p>
|
||||
</ion-content>
|
|
@ -1,3 +0,0 @@
|
|||
page-home {
|
||||
|
||||
}
|
|
@ -1,14 +0,0 @@
|
|||
import { Component } from '@angular/core';
|
||||
import { NavController } from 'ionic-angular';
|
||||
|
||||
@Component({
|
||||
selector: 'page-home',
|
||||
templateUrl: 'home.html'
|
||||
})
|
||||
export class HomePage {
|
||||
|
||||
constructor(public navCtrl: NavController) {
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
<!--
|
||||
Generated template for the SenseBoxPage page.
|
||||
|
||||
See http://ionicframework.com/docs/components/#navigation for more info on
|
||||
Ionic pages and navigation.
|
||||
-->
|
||||
<ion-header>
|
||||
<ion-navbar>
|
||||
<button ion-button menuToggle>
|
||||
<ion-icon name="menu"></ion-icon>
|
||||
</button>
|
||||
<ion-title>senseBox</ion-title>
|
||||
</ion-navbar>
|
||||
</ion-header>
|
||||
|
||||
|
||||
|
||||
|
||||
<ion-content padding>
|
||||
|
||||
<button (click)="getData()" ion-button color="secondary">
|
||||
get data
|
||||
</button>
|
||||
|
||||
<div *ngIf="boxData">
|
||||
<h1>{{boxData.name}}</h1>
|
||||
<ion-list>
|
||||
<div ion-item *ngFor="let sensor of boxData.sensors">
|
||||
<h3>{{sensor.title}}</h3>
|
||||
<p>{{sensor.lastMeasurement.value}} {{sensor.unit}}</p>
|
||||
</div>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
|
@ -1,13 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from 'ionic-angular';
|
||||
import { SenseBoxPage } from './sense-box';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
SenseBoxPage,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(SenseBoxPage),
|
||||
],
|
||||
})
|
||||
export class SenseBoxPageModule {}
|
|
@ -1,3 +0,0 @@
|
|||
page-sense-box {
|
||||
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
import { ApiProvider } from './../../providers/api/api';
|
||||
import { Component } from '@angular/core';
|
||||
import { IonicPage, NavController, NavParams } from 'ionic-angular';
|
||||
|
||||
/**
|
||||
* Generated class for the SenseBoxPage page.
|
||||
*
|
||||
* See https://ionicframework.com/docs/components/#navigation for more info on
|
||||
* Ionic pages and navigation.
|
||||
*/
|
||||
|
||||
@IonicPage()
|
||||
@Component({
|
||||
selector: 'page-sense-box',
|
||||
templateUrl: 'sense-box.html',
|
||||
})
|
||||
export class SenseBoxPage {
|
||||
|
||||
boxData: any;
|
||||
|
||||
constructor(public navCtrl: NavController, public navParams: NavParams, private api: ApiProvider) {
|
||||
}
|
||||
|
||||
ionViewDidLoad() {
|
||||
console.log('ionViewDidLoad SenseBoxPage');
|
||||
}
|
||||
|
||||
getData(){
|
||||
this.api.getData().subscribe(res => {
|
||||
console.log(res);
|
||||
this.boxData = res;
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
/*
|
||||
Generated class for the ApiProvider provider.
|
||||
|
||||
See https://angular.io/guide/dependency-injection for more info on providers
|
||||
and Angular DI.
|
||||
*/
|
||||
@Injectable()
|
||||
export class ApiProvider {
|
||||
|
||||
private API_URL = 'https://api.testing.opensensemap.org'
|
||||
|
||||
constructor(public http: HttpClient) {
|
||||
console.log('Hello ApiProvider Provider');
|
||||
}
|
||||
|
||||
|
||||
getData(){
|
||||
return this.http.get(`${this.API_URL}/boxes/5b0d436fd40a290019ef444d`);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue