Created the base design
This commit is contained in:
@@ -1,11 +1,18 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"root": true,
|
||||||
"ignorePatterns": ["projects/**/*"],
|
"ignorePatterns": [
|
||||||
|
"projects/**/*"
|
||||||
|
],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts"],
|
"files": [
|
||||||
|
"*.ts"
|
||||||
|
],
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"project": ["tsconfig.json", "e2e/tsconfig.json"],
|
"project": [
|
||||||
|
"tsconfig.json",
|
||||||
|
"e2e/tsconfig.json"
|
||||||
|
],
|
||||||
"createDefaultProgram": true
|
"createDefaultProgram": true
|
||||||
},
|
},
|
||||||
"extends": [
|
"extends": [
|
||||||
@@ -17,7 +24,10 @@
|
|||||||
"@angular-eslint/component-class-suffix": [
|
"@angular-eslint/component-class-suffix": [
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
"suffixes": ["Page", "Component"]
|
"suffixes": [
|
||||||
|
"Page",
|
||||||
|
"Component"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"@angular-eslint/component-selector": [
|
"@angular-eslint/component-selector": [
|
||||||
@@ -39,9 +49,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["*.html"],
|
"files": [
|
||||||
"extends": ["plugin:@angular-eslint/template/recommended"],
|
"*.html"
|
||||||
|
],
|
||||||
|
"extends": [
|
||||||
|
"plugin:@angular-eslint/template/recommended"
|
||||||
|
],
|
||||||
"rules": {}
|
"rules": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"files": [
|
||||||
|
"*.ts"
|
||||||
|
],
|
||||||
|
"extends": [
|
||||||
|
"plugin:ngrx/recommended"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,10 @@
|
|||||||
"output": "./svg"
|
"output": "./svg"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"styles": ["src/theme/variables.scss", "src/global.scss"],
|
"styles": [
|
||||||
|
"src/theme/variables.scss",
|
||||||
|
"src/global.scss",
|
||||||
|
"node_modules/@nebular/theme/styles/prebuilt/cosmic.css"],
|
||||||
"scripts": [],
|
"scripts": [],
|
||||||
"aot": false,
|
"aot": false,
|
||||||
"vendorChunk": true,
|
"vendorChunk": true,
|
||||||
|
|||||||
15346
package-lock.json
generated
Normal file
15346
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@@ -2,7 +2,7 @@
|
|||||||
"name": "go-to-bed",
|
"name": "go-to-bed",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"author": "Ionic Framework",
|
"author": "Ionic Framework",
|
||||||
"homepage": "https://ionicframework.com/",
|
"menupage": "https://ionicframework.com/",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
@@ -13,6 +13,8 @@
|
|||||||
},
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@angular/animations": "^12.1.1",
|
||||||
|
"@angular/cdk": "^12.1.1",
|
||||||
"@angular/common": "~12.1.1",
|
"@angular/common": "~12.1.1",
|
||||||
"@angular/core": "~12.1.1",
|
"@angular/core": "~12.1.1",
|
||||||
"@angular/forms": "~12.1.1",
|
"@angular/forms": "~12.1.1",
|
||||||
@@ -25,6 +27,13 @@
|
|||||||
"@capacitor/keyboard": "1.1.3",
|
"@capacitor/keyboard": "1.1.3",
|
||||||
"@capacitor/status-bar": "1.0.6",
|
"@capacitor/status-bar": "1.0.6",
|
||||||
"@ionic/angular": "^5.5.2",
|
"@ionic/angular": "^5.5.2",
|
||||||
|
"@nebular/auth": "^9.0.0",
|
||||||
|
"@nebular/eva-icons": "^8.0.0",
|
||||||
|
"@nebular/security": "^9.0.0",
|
||||||
|
"@nebular/theme": "^8.0.0",
|
||||||
|
"@ngrx/router-store": "^13.0.2",
|
||||||
|
"@ngrx/store": "^13.0.2",
|
||||||
|
"eva-icons": "^1.1.3",
|
||||||
"rxjs": "~6.6.0",
|
"rxjs": "~6.6.0",
|
||||||
"tslib": "^2.2.0",
|
"tslib": "^2.2.0",
|
||||||
"zone.js": "~0.11.4"
|
"zone.js": "~0.11.4"
|
||||||
@@ -60,7 +69,8 @@
|
|||||||
"karma-jasmine-html-reporter": "^1.5.0",
|
"karma-jasmine-html-reporter": "^1.5.0",
|
||||||
"protractor": "~7.0.0",
|
"protractor": "~7.0.0",
|
||||||
"ts-node": "~8.3.0",
|
"ts-node": "~8.3.0",
|
||||||
"typescript": "~4.2.4"
|
"typescript": "~4.2.4",
|
||||||
|
"eslint-plugin-ngrx": "^2.0.0"
|
||||||
},
|
},
|
||||||
"description": "An Ionic project"
|
"description": "An Ionic project"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
|
|||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
loadChildren: () => import('./tabs/tabs.module').then(m => m.TabsPageModule)
|
loadChildren: () => import('./menu/menu.module').then(page => page.MenuPageModule)
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
|
||||||
|
|||||||
18
src/app/app-store.module.ts
Normal file
18
src/app/app-store.module.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
import { StoreRouterConnectingModule } from '@ngrx/router-store';
|
||||||
|
import { StoreModule } from '@ngrx/store';
|
||||||
|
import { gotobedReducer } from './store/gotobed.reducer';
|
||||||
|
const routes: Routes = [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
loadChildren: () => import('./menu/menu.module').then(page => page.MenuPageModule)
|
||||||
|
}
|
||||||
|
];
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
StoreModule.forFeature('Gotobed', gotobedReducer), StoreRouterConnectingModule.forRoot(),
|
||||||
|
],
|
||||||
|
exports: [RouterModule]
|
||||||
|
})
|
||||||
|
export class AppStoreModule {}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
<ion-app>
|
<ion-app>
|
||||||
<ion-router-outlet></ion-router-outlet>
|
<ion-router-outlet></ion-router-outlet>
|
||||||
|
<app-menu></app-menu>
|
||||||
</ion-app>
|
</ion-app>
|
||||||
|
|||||||
@@ -3,15 +3,33 @@ import { BrowserModule } from '@angular/platform-browser';
|
|||||||
import { RouteReuseStrategy } from '@angular/router';
|
import { RouteReuseStrategy } from '@angular/router';
|
||||||
|
|
||||||
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
|
||||||
|
import { NbCardModule, NbThemeModule } from '@nebular/theme';
|
||||||
|
|
||||||
import { AppRoutingModule } from './app-routing.module';
|
import { AppRoutingModule } from './app-routing.module';
|
||||||
import { AppComponent } from './app.component';
|
import { AppComponent } from './app.component';
|
||||||
|
import { MenuPage } from './menu/menu.page';
|
||||||
|
import { NetworkRequestsService } from './network/networkRequests.service';
|
||||||
|
import { StoreModule } from '@ngrx/store';
|
||||||
|
import { StoreRouterConnectingModule } from '@ngrx/router-store';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
import { AppStoreModule } from './app-store.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
declarations: [AppComponent],
|
declarations: [AppComponent, MenuPage],
|
||||||
entryComponents: [],
|
entryComponents: [],
|
||||||
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
|
imports: [
|
||||||
|
BrowserModule,
|
||||||
|
IonicModule.forRoot(),
|
||||||
|
AppRoutingModule,
|
||||||
|
NbCardModule,
|
||||||
|
NbThemeModule.forRoot(),
|
||||||
|
StoreModule.forRoot({}, {}),
|
||||||
|
StoreRouterConnectingModule.forRoot(),
|
||||||
|
HttpClientModule,
|
||||||
|
AppStoreModule
|
||||||
|
],
|
||||||
providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
|
providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
|
||||||
bootstrap: [AppComponent],
|
bootstrap: [AppComponent],
|
||||||
|
exports: [NetworkRequestsService]
|
||||||
})
|
})
|
||||||
export class AppModule {}
|
export class AppModule {}
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { RouterModule, Routes } from '@angular/router';
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
import { Tab1Page } from './tab1.page';
|
import { HomePage } from './home.page';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: Tab1Page,
|
component: HomePage,
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -13,4 +13,4 @@ const routes: Routes = [
|
|||||||
imports: [RouterModule.forChild(routes)],
|
imports: [RouterModule.forChild(routes)],
|
||||||
exports: [RouterModule]
|
exports: [RouterModule]
|
||||||
})
|
})
|
||||||
export class Tab1PageRoutingModule {}
|
export class HomePageRoutingModule {}
|
||||||
28
src/app/home/home.module.ts
Normal file
28
src/app/home/home.module.ts
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { CommonModule } from '@angular/common';
|
||||||
|
import { FormsModule } from '@angular/forms';
|
||||||
|
import { HomePage } from './home.page';
|
||||||
|
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
||||||
|
|
||||||
|
import { HomePageRoutingModule } from './home-routing.module';
|
||||||
|
import { NbButtonModule, NbCardModule, NbLayoutModule, NbSidebarModule, NbThemeModule } from '@nebular/theme';
|
||||||
|
import { RouterModule } from '@angular/router';
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
IonicModule,
|
||||||
|
CommonModule,
|
||||||
|
FormsModule,
|
||||||
|
ExploreContainerComponentModule,
|
||||||
|
HomePageRoutingModule,
|
||||||
|
NbCardModule,
|
||||||
|
RouterModule, // RouterModule.forRoot(routes, { useHash: true }), if this is your app.module
|
||||||
|
NbLayoutModule,
|
||||||
|
NbSidebarModule, // NbSidebarModule.forRoot(), //if this is your app.module
|
||||||
|
NbButtonModule,
|
||||||
|
NbThemeModule
|
||||||
|
],
|
||||||
|
declarations: [HomePage]
|
||||||
|
})
|
||||||
|
export class HomePageModule {}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<ion-header [translucent]="true">
|
<ion-header [translucent]="true">
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-title>
|
<ion-title>
|
||||||
Tab 1
|
Home
|
||||||
</ion-title>
|
</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
@@ -12,6 +12,14 @@
|
|||||||
<ion-title size="large">Tab 1</ion-title>
|
<ion-title size="large">Tab 1</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
<app-explore-container name="Tab 1 page"></app-explore-container>
|
<app-explore-container name="Tab 1 page"></app-explore-container>
|
||||||
</ion-content>
|
<ion-card class="noselect" (click)="presentAlert('shutdown')">
|
||||||
|
<ion-card-header>
|
||||||
|
<ion-card-title>Shutdown</ion-card-title>
|
||||||
|
</ion-card-header>
|
||||||
|
|
||||||
|
<ion-card-content>
|
||||||
|
<ion-icon name="alert-circle-outline"></ion-icon>
|
||||||
|
</ion-card-content>
|
||||||
|
</ion-card>
|
||||||
|
</ion-content>
|
||||||
21
src/app/home/home.page.scss
Normal file
21
src/app/home/home.page.scss
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
ion-icon {font-size: 64px;}
|
||||||
|
ion-card-content {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding-bottom: 37px;
|
||||||
|
}
|
||||||
|
ion-card-content, ion-card-header {
|
||||||
|
background-color: #1b1b38;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.noselect {
|
||||||
|
-webkit-touch-callout: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-khtml-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
user-select: none;
|
||||||
|
-webkit-tap-highlight-color: transparent;
|
||||||
|
}
|
||||||
@@ -2,19 +2,19 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|||||||
import { IonicModule } from '@ionic/angular';
|
import { IonicModule } from '@ionic/angular';
|
||||||
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
||||||
|
|
||||||
import { Tab3Page } from './tab3.page';
|
import { HomePage } from './home.page';
|
||||||
|
|
||||||
describe('Tab3Page', () => {
|
describe('HomePage', () => {
|
||||||
let component: Tab3Page;
|
let component: HomePage;
|
||||||
let fixture: ComponentFixture<Tab3Page>;
|
let fixture: ComponentFixture<HomePage>;
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
declarations: [Tab3Page],
|
declarations: [HomePage],
|
||||||
imports: [IonicModule.forRoot(), ExploreContainerComponentModule]
|
imports: [IonicModule.forRoot(), ExploreContainerComponentModule]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(Tab3Page);
|
fixture = TestBed.createComponent(HomePage);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
}));
|
}));
|
||||||
51
src/app/home/home.page.ts
Normal file
51
src/app/home/home.page.ts
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { AlertController } from '@ionic/angular';
|
||||||
|
import { Store } from '@ngrx/store';
|
||||||
|
import { NetworkRequestsService } from '../network/networkRequests.service';
|
||||||
|
import { SendCommandChanged } from '../store/gotobed.actions';
|
||||||
|
import { getCommandType } from '../store/gotobed.selectors';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-home',
|
||||||
|
templateUrl: 'home.page.html',
|
||||||
|
styleUrls: ['home.page.scss']
|
||||||
|
})
|
||||||
|
|
||||||
|
export class HomePage {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
public alertController: AlertController,
|
||||||
|
private httpCommand: NetworkRequestsService,
|
||||||
|
private store: Store) {}
|
||||||
|
|
||||||
|
commandtype$ = this.store.select(getCommandType);
|
||||||
|
|
||||||
|
async presentAlert(commandType) {
|
||||||
|
const alert = await this.alertController.create({
|
||||||
|
cssClass: 'my-custom-class',
|
||||||
|
header: 'Are you sure?',
|
||||||
|
message: `You are about to send a ${commandType} command to the device.`,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
text: 'Cancel',
|
||||||
|
role: 'cancel',
|
||||||
|
cssClass: 'secondary',
|
||||||
|
handler: (blah) => {
|
||||||
|
console.log('Confirm Cancel: blah');
|
||||||
|
this.commandtype$.subscribe(commandType => {
|
||||||
|
console.log(commandType);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
text: 'Send',
|
||||||
|
handler: () => {
|
||||||
|
this.store.dispatch(new SendCommandChanged(commandType));
|
||||||
|
this.httpCommand.sendCommand(commandType, "192.168.1.255:3000");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
await alert.present();
|
||||||
|
}
|
||||||
|
}
|
||||||
17
src/app/menu/menu-routing.module.ts
Normal file
17
src/app/menu/menu-routing.module.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { NgModule } from '@angular/core';
|
||||||
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
|
import { HomePage } from '../home/home.page';
|
||||||
|
import { SearchHostPage } from '../searchHost/searchHost.page';
|
||||||
|
import { SettingsPage } from '../settings/settings.page';
|
||||||
|
|
||||||
|
const routes: Routes = [
|
||||||
|
{ path: '', redirectTo: '/home', pathMatch: 'full' },
|
||||||
|
{ path: 'home', component: HomePage, pathMatch: 'full',},
|
||||||
|
{ path: 'searchHost', component: SearchHostPage, pathMatch: 'full',},
|
||||||
|
{ path: 'settings', component: SettingsPage, pathMatch: 'full',}
|
||||||
|
];
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [RouterModule.forChild(routes)],
|
||||||
|
})
|
||||||
|
export class MenuPageRoutingModule {}
|
||||||
@@ -3,17 +3,15 @@ import { NgModule } from '@angular/core';
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
|
|
||||||
import { TabsPageRoutingModule } from './tabs-routing.module';
|
import { MenuPageRoutingModule } from './menu-routing.module';
|
||||||
|
|
||||||
import { TabsPage } from './tabs.page';
|
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
IonicModule,
|
IonicModule,
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
TabsPageRoutingModule
|
MenuPageRoutingModule
|
||||||
],
|
],
|
||||||
declarations: [TabsPage]
|
declarations: []
|
||||||
})
|
})
|
||||||
export class TabsPageModule {}
|
export class MenuPageModule {}
|
||||||
20
src/app/menu/menu.page.html
Normal file
20
src/app/menu/menu.page.html
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
<ion-tabs>
|
||||||
|
|
||||||
|
<ion-tab-bar slot="bottom">
|
||||||
|
<ion-tab-button tab="home">
|
||||||
|
<ion-icon name="triangle"></ion-icon>
|
||||||
|
<ion-label>Home</ion-label>
|
||||||
|
</ion-tab-button>
|
||||||
|
|
||||||
|
<ion-tab-button tab="searchHost">
|
||||||
|
<ion-icon name="search-sharp"></ion-icon>
|
||||||
|
<ion-label>Search</ion-label>
|
||||||
|
</ion-tab-button>
|
||||||
|
|
||||||
|
<ion-tab-button tab="settings">
|
||||||
|
<ion-icon name="settings-sharp"></ion-icon>
|
||||||
|
<ion-label>Settings</ion-label>
|
||||||
|
</ion-tab-button>
|
||||||
|
</ion-tab-bar>
|
||||||
|
|
||||||
|
</ion-tabs>
|
||||||
13
src/app/menu/menu.page.ts
Normal file
13
src/app/menu/menu.page.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-menu',
|
||||||
|
templateUrl: 'menu.page.html',
|
||||||
|
styleUrls: ['menu.page.scss'],
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
|
})
|
||||||
|
export class MenuPage {
|
||||||
|
|
||||||
|
constructor() {}
|
||||||
|
|
||||||
|
}
|
||||||
16
src/app/network/networkRequests.service.spec.ts
Normal file
16
src/app/network/networkRequests.service.spec.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
/* tslint:disable:no-unused-variable */
|
||||||
|
|
||||||
|
import { TestBed, async, inject } from '@angular/core/testing';
|
||||||
|
import { NetworkRequestsService } from './networkRequests.service';
|
||||||
|
|
||||||
|
describe('Service: NetworkRequests', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
providers: [NetworkRequestsService]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should ...', inject([NetworkRequestsService], (service: NetworkRequestsService) => {
|
||||||
|
expect(service).toBeTruthy();
|
||||||
|
}));
|
||||||
|
});
|
||||||
33
src/app/network/networkRequests.service.ts
Normal file
33
src/app/network/networkRequests.service.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { ToastController } from '@ionic/angular';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class NetworkRequestsService {
|
||||||
|
|
||||||
|
constructor(private readonly _httpClient: HttpClient, public toastController: ToastController) { }
|
||||||
|
|
||||||
|
public sendCommand(command: string, address: string, connectionType?: string){
|
||||||
|
console.log("Sending command: " + command + " to address: " + address);
|
||||||
|
this._httpClient.post<string>(`${connectionType ?? "http"}://${address}/commandbridge`, command)
|
||||||
|
.subscribe(data => {
|
||||||
|
console.log(data['_body']);
|
||||||
|
}, error => {
|
||||||
|
console.log(error);
|
||||||
|
this.showErrorMessage(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async showErrorMessage(errorMessage: HttpErrorResponse ) {
|
||||||
|
const toast = await this.toastController.create({
|
||||||
|
message: errorMessage.name + ": " + errorMessage.message,
|
||||||
|
duration: 40000,
|
||||||
|
color: "danger",
|
||||||
|
position: "top"
|
||||||
|
});
|
||||||
|
toast.present();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { RouterModule, Routes } from '@angular/router';
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
import { Tab3Page } from './tab3.page';
|
import { SearchHostPage } from './searchHost.page';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: Tab3Page,
|
component: SearchHostPage,
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -13,4 +13,4 @@ const routes: Routes = [
|
|||||||
imports: [RouterModule.forChild(routes)],
|
imports: [RouterModule.forChild(routes)],
|
||||||
exports: [RouterModule]
|
exports: [RouterModule]
|
||||||
})
|
})
|
||||||
export class Tab3PageRoutingModule {}
|
export class SearchHostPageRoutingModule {}
|
||||||
@@ -3,10 +3,10 @@ import { RouterModule } from '@angular/router';
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { Tab2Page } from './tab2.page';
|
import { SearchHostPage } from './searchHost.page';
|
||||||
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
||||||
|
|
||||||
import { Tab2PageRoutingModule } from './tab2-routing.module';
|
import { SearchHostPageRoutingModule } from './searchHost-routing.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -14,8 +14,8 @@ import { Tab2PageRoutingModule } from './tab2-routing.module';
|
|||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ExploreContainerComponentModule,
|
ExploreContainerComponentModule,
|
||||||
Tab2PageRoutingModule
|
SearchHostPageRoutingModule
|
||||||
],
|
],
|
||||||
declarations: [Tab2Page]
|
declarations: [SearchHostPage]
|
||||||
})
|
})
|
||||||
export class Tab2PageModule {}
|
export class SearchHostPageModule {}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<ion-header [translucent]="true">
|
<ion-header [translucent]="true">
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-title>
|
<ion-title>
|
||||||
Tab 2
|
Search Host
|
||||||
</ion-title>
|
</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
@@ -2,19 +2,19 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|||||||
import { IonicModule } from '@ionic/angular';
|
import { IonicModule } from '@ionic/angular';
|
||||||
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
||||||
|
|
||||||
import { Tab1Page } from './tab1.page';
|
import { SearchHostPage } from './searchHost.page';
|
||||||
|
|
||||||
describe('Tab1Page', () => {
|
describe('SearchHostPage', () => {
|
||||||
let component: Tab1Page;
|
let component: SearchHostPage;
|
||||||
let fixture: ComponentFixture<Tab1Page>;
|
let fixture: ComponentFixture<SearchHostPage>;
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
declarations: [Tab1Page],
|
declarations: [SearchHostPage],
|
||||||
imports: [IonicModule.forRoot(), ExploreContainerComponentModule]
|
imports: [IonicModule.forRoot(), ExploreContainerComponentModule]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(Tab1Page);
|
fixture = TestBed.createComponent(SearchHostPage);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
}));
|
}));
|
||||||
12
src/app/searchHost/searchHost.page.ts
Normal file
12
src/app/searchHost/searchHost.page.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-searchHost',
|
||||||
|
templateUrl: 'searchHost.page.html',
|
||||||
|
styleUrls: ['searchHost.page.scss']
|
||||||
|
})
|
||||||
|
export class SearchHostPage {
|
||||||
|
|
||||||
|
constructor() {}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { RouterModule, Routes } from '@angular/router';
|
import { RouterModule, Routes } from '@angular/router';
|
||||||
import { Tab2Page } from './tab2.page';
|
import { SettingsPage } from './settings.page';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: Tab2Page,
|
component: SettingsPage,
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -13,4 +13,4 @@ const routes: Routes = [
|
|||||||
imports: [RouterModule.forChild(routes)],
|
imports: [RouterModule.forChild(routes)],
|
||||||
exports: [RouterModule]
|
exports: [RouterModule]
|
||||||
})
|
})
|
||||||
export class Tab2PageRoutingModule {}
|
export class SettingsPageRoutingModule {}
|
||||||
@@ -3,10 +3,10 @@ import { RouterModule } from '@angular/router';
|
|||||||
import { NgModule } from '@angular/core';
|
import { NgModule } from '@angular/core';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { Tab3Page } from './tab3.page';
|
import { SettingsPage } from './settings.page';
|
||||||
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
||||||
|
|
||||||
import { Tab3PageRoutingModule } from './tab3-routing.module';
|
import { SettingsPageRoutingModule } from './settings-routing.module';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -14,9 +14,9 @@ import { Tab3PageRoutingModule } from './tab3-routing.module';
|
|||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ExploreContainerComponentModule,
|
ExploreContainerComponentModule,
|
||||||
RouterModule.forChild([{ path: '', component: Tab3Page }]),
|
RouterModule.forChild([{ path: '', component: SettingsPage }]),
|
||||||
Tab3PageRoutingModule,
|
SettingsPageRoutingModule,
|
||||||
],
|
],
|
||||||
declarations: [Tab3Page]
|
declarations: [SettingsPage]
|
||||||
})
|
})
|
||||||
export class Tab3PageModule {}
|
export class SettingsPageModule {}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<ion-header [translucent]="true">
|
<ion-header [translucent]="true">
|
||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-title>
|
<ion-title>
|
||||||
Tab 3
|
Settings
|
||||||
</ion-title>
|
</ion-title>
|
||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
@@ -2,19 +2,19 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|||||||
import { IonicModule } from '@ionic/angular';
|
import { IonicModule } from '@ionic/angular';
|
||||||
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
||||||
|
|
||||||
import { Tab2Page } from './tab2.page';
|
import { SettingsPage } from './settings.page';
|
||||||
|
|
||||||
describe('Tab2Page', () => {
|
describe('SettingsPage', () => {
|
||||||
let component: Tab2Page;
|
let component: SettingsPage;
|
||||||
let fixture: ComponentFixture<Tab2Page>;
|
let fixture: ComponentFixture<SettingsPage>;
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
beforeEach(waitForAsync(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
declarations: [Tab2Page],
|
declarations: [SettingsPage],
|
||||||
imports: [IonicModule.forRoot(), ExploreContainerComponentModule]
|
imports: [IonicModule.forRoot(), ExploreContainerComponentModule]
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
|
|
||||||
fixture = TestBed.createComponent(Tab2Page);
|
fixture = TestBed.createComponent(SettingsPage);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
}));
|
}));
|
||||||
12
src/app/settings/settings.page.ts
Normal file
12
src/app/settings/settings.page.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-settings',
|
||||||
|
templateUrl: 'settings.page.html',
|
||||||
|
styleUrls: ['settings.page.scss']
|
||||||
|
})
|
||||||
|
export class SettingsPage {
|
||||||
|
|
||||||
|
constructor() {}
|
||||||
|
|
||||||
|
}
|
||||||
12
src/app/store/gotobed.actions.ts
Normal file
12
src/app/store/gotobed.actions.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import { Action } from "@ngrx/store";
|
||||||
|
|
||||||
|
export enum EGotobedActions {
|
||||||
|
SendCommandChanged = '[GOTOBED] Command changed',
|
||||||
|
}
|
||||||
|
|
||||||
|
export class SendCommandChanged implements Action {
|
||||||
|
public readonly type = EGotobedActions.SendCommandChanged;
|
||||||
|
constructor(public payload: string) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
export type GotobedActions = SendCommandChanged;
|
||||||
14
src/app/store/gotobed.reducer.ts
Normal file
14
src/app/store/gotobed.reducer.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { EGotobedActions, GotobedActions } from "./gotobed.actions";
|
||||||
|
import { GotobedState, initialGotoBedState } from "./gotobed.state";
|
||||||
|
|
||||||
|
export function gotobedReducer(state = initialGotoBedState, action: GotobedActions): GotobedState {
|
||||||
|
switch (action.type) {
|
||||||
|
case EGotobedActions.SendCommandChanged:
|
||||||
|
return {
|
||||||
|
...state,
|
||||||
|
command: action.payload,
|
||||||
|
};
|
||||||
|
default:
|
||||||
|
return state;
|
||||||
|
}
|
||||||
|
}
|
||||||
11
src/app/store/gotobed.selectors.ts
Normal file
11
src/app/store/gotobed.selectors.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import { createFeatureSelector, createSelector } from "@ngrx/store";
|
||||||
|
import { GotobedState, storeName } from "./gotobed.state";
|
||||||
|
|
||||||
|
export const gotobedState = createFeatureSelector<GotobedState>(
|
||||||
|
storeName
|
||||||
|
)
|
||||||
|
|
||||||
|
export const getCommandType = createSelector(
|
||||||
|
gotobedState,
|
||||||
|
(state: GotobedState) => state.command
|
||||||
|
)
|
||||||
20
src/app/store/gotobed.state.ts
Normal file
20
src/app/store/gotobed.state.ts
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
export const storeName = "Gotobed";
|
||||||
|
|
||||||
|
export interface GotobedState {
|
||||||
|
command: string;
|
||||||
|
isLoading: boolean;
|
||||||
|
protocol: string;
|
||||||
|
port: string;
|
||||||
|
address: string;
|
||||||
|
isConnected: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export const initialGotoBedState: GotobedState = {
|
||||||
|
command: '',
|
||||||
|
isLoading: false,
|
||||||
|
protocol: '',
|
||||||
|
port: '',
|
||||||
|
address: 'localhost:8080',
|
||||||
|
isConnected: false,
|
||||||
|
}
|
||||||
13
src/app/store/gotobed.store.module.ts
Normal file
13
src/app/store/gotobed.store.module.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { NgModule } from "@angular/core";
|
||||||
|
import { StoreModule } from "@ngrx/store";
|
||||||
|
// import { EffectsModule } from "@ngrx/effects";
|
||||||
|
import { gotobedReducer } from "./gotobed.reducer";
|
||||||
|
|
||||||
|
@NgModule({
|
||||||
|
imports: [
|
||||||
|
StoreModule.forFeature('Gotobed', gotobedReducer),
|
||||||
|
// EffectsModule.forFeature([])
|
||||||
|
],
|
||||||
|
providers: [],
|
||||||
|
})
|
||||||
|
export class GotobedStoreModule {}
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
import { IonicModule } from '@ionic/angular';
|
|
||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import { FormsModule } from '@angular/forms';
|
|
||||||
import { Tab1Page } from './tab1.page';
|
|
||||||
import { ExploreContainerComponentModule } from '../explore-container/explore-container.module';
|
|
||||||
|
|
||||||
import { Tab1PageRoutingModule } from './tab1-routing.module';
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
IonicModule,
|
|
||||||
CommonModule,
|
|
||||||
FormsModule,
|
|
||||||
ExploreContainerComponentModule,
|
|
||||||
Tab1PageRoutingModule
|
|
||||||
],
|
|
||||||
declarations: [Tab1Page]
|
|
||||||
})
|
|
||||||
export class Tab1PageModule {}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-tab1',
|
|
||||||
templateUrl: 'tab1.page.html',
|
|
||||||
styleUrls: ['tab1.page.scss']
|
|
||||||
})
|
|
||||||
export class Tab1Page {
|
|
||||||
|
|
||||||
constructor() {}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-tab2',
|
|
||||||
templateUrl: 'tab2.page.html',
|
|
||||||
styleUrls: ['tab2.page.scss']
|
|
||||||
})
|
|
||||||
export class Tab2Page {
|
|
||||||
|
|
||||||
constructor() {}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-tab3',
|
|
||||||
templateUrl: 'tab3.page.html',
|
|
||||||
styleUrls: ['tab3.page.scss']
|
|
||||||
})
|
|
||||||
export class Tab3Page {
|
|
||||||
|
|
||||||
constructor() {}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { RouterModule, Routes } from '@angular/router';
|
|
||||||
import { TabsPage } from './tabs.page';
|
|
||||||
|
|
||||||
const routes: Routes = [
|
|
||||||
{
|
|
||||||
path: 'tabs',
|
|
||||||
component: TabsPage,
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'tab1',
|
|
||||||
loadChildren: () => import('../tab1/tab1.module').then(m => m.Tab1PageModule)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'tab2',
|
|
||||||
loadChildren: () => import('../tab2/tab2.module').then(m => m.Tab2PageModule)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'tab3',
|
|
||||||
loadChildren: () => import('../tab3/tab3.module').then(m => m.Tab3PageModule)
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
redirectTo: '/tabs/tab1',
|
|
||||||
pathMatch: 'full'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
redirectTo: '/tabs/tab1',
|
|
||||||
pathMatch: 'full'
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [RouterModule.forChild(routes)],
|
|
||||||
})
|
|
||||||
export class TabsPageRoutingModule {}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
<ion-tabs>
|
|
||||||
|
|
||||||
<ion-tab-bar slot="bottom">
|
|
||||||
<ion-tab-button tab="tab1">
|
|
||||||
<ion-icon name="triangle"></ion-icon>
|
|
||||||
<ion-label>Tab 1</ion-label>
|
|
||||||
</ion-tab-button>
|
|
||||||
|
|
||||||
<ion-tab-button tab="tab2">
|
|
||||||
<ion-icon name="ellipse"></ion-icon>
|
|
||||||
<ion-label>Tab 2</ion-label>
|
|
||||||
</ion-tab-button>
|
|
||||||
|
|
||||||
<ion-tab-button tab="tab3">
|
|
||||||
<ion-icon name="square"></ion-icon>
|
|
||||||
<ion-label>Tab 3</ion-label>
|
|
||||||
</ion-tab-button>
|
|
||||||
</ion-tab-bar>
|
|
||||||
|
|
||||||
</ion-tabs>
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
|
||||||
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
||||||
|
|
||||||
import { TabsPage } from './tabs.page';
|
|
||||||
|
|
||||||
describe('TabsPage', () => {
|
|
||||||
let component: TabsPage;
|
|
||||||
let fixture: ComponentFixture<TabsPage>;
|
|
||||||
|
|
||||||
beforeEach(waitForAsync(() => {
|
|
||||||
TestBed.configureTestingModule({
|
|
||||||
declarations: [TabsPage],
|
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
||||||
}).compileComponents();
|
|
||||||
}));
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
fixture = TestBed.createComponent(TabsPage);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
|
||||||
expect(component).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
import { Component } from '@angular/core';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-tabs',
|
|
||||||
templateUrl: 'tabs.page.html',
|
|
||||||
styleUrls: ['tabs.page.scss']
|
|
||||||
})
|
|
||||||
export class TabsPage {
|
|
||||||
|
|
||||||
constructor() {}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -24,3 +24,10 @@
|
|||||||
@import "~@ionic/angular/css/text-alignment.css";
|
@import "~@ionic/angular/css/text-alignment.css";
|
||||||
@import "~@ionic/angular/css/text-transformation.css";
|
@import "~@ionic/angular/css/text-transformation.css";
|
||||||
@import "~@ionic/angular/css/flex-utils.css";
|
@import "~@ionic/angular/css/flex-utils.css";
|
||||||
|
|
||||||
|
@import "~@nebular/theme/styles/prebuilt/cosmic.css";
|
||||||
|
|
||||||
|
@import '~@nebular/theme/styles/theming';
|
||||||
|
@import '~@nebular/theme/styles/themes/cosmic';
|
||||||
|
|
||||||
|
$nb-enable-css-custom-properties: false; // <-- enable css custom properties
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
<link rel="icon" type="image/png" href="assets/icon/favicon.png" />
|
<link rel="icon" type="image/png" href="assets/icon/favicon.png" />
|
||||||
|
|
||||||
<!-- add to homescreen for ios -->
|
<!-- add to menuscreen for ios -->
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
2
src/theme/themes.scss
Normal file
2
src/theme/themes.scss
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
@import '~@nebular/theme/styles/theming';
|
||||||
|
@import '~@nebular/theme/styles/themes/default';
|
||||||
@@ -2,79 +2,79 @@
|
|||||||
// http://ionicframework.com/docs/theming/
|
// http://ionicframework.com/docs/theming/
|
||||||
|
|
||||||
/** Ionic CSS Variables **/
|
/** Ionic CSS Variables **/
|
||||||
:root {
|
// :root {
|
||||||
/** primary **/
|
// /** primary **/
|
||||||
--ion-color-primary: #3880FF;
|
// --ion-color-primary: #3880FF;
|
||||||
--ion-color-primary-rgb: 56, 128, 255;
|
// --ion-color-primary-rgb: 56, 128, 255;
|
||||||
--ion-color-primary-contrast: #ffffff;
|
// --ion-color-primary-contrast: #ffffff;
|
||||||
--ion-color-primary-contrast-rgb: 255, 255, 255;
|
// --ion-color-primary-contrast-rgb: 255, 255, 255;
|
||||||
--ion-color-primary-shade: #3171e0;
|
// --ion-color-primary-shade: #3171e0;
|
||||||
--ion-color-primary-tint: #4c8dff;
|
// --ion-color-primary-tint: #4c8dff;
|
||||||
|
|
||||||
/** secondary **/
|
// /** secondary **/
|
||||||
--ion-color-secondary: #3dc2ff;
|
// --ion-color-secondary: #3dc2ff;
|
||||||
--ion-color-secondary-rgb: 61, 194, 255;
|
// --ion-color-secondary-rgb: 61, 194, 255;
|
||||||
--ion-color-secondary-contrast: #ffffff;
|
// --ion-color-secondary-contrast: #ffffff;
|
||||||
--ion-color-secondary-contrast-rgb: 255, 255, 255;
|
// --ion-color-secondary-contrast-rgb: 255, 255, 255;
|
||||||
--ion-color-secondary-shade: #36abe0;
|
// --ion-color-secondary-shade: #36abe0;
|
||||||
--ion-color-secondary-tint: #50c8ff;
|
// --ion-color-secondary-tint: #50c8ff;
|
||||||
|
|
||||||
/** tertiary **/
|
// /** tertiary **/
|
||||||
--ion-color-tertiary: #5260ff;
|
// --ion-color-tertiary: #5260ff;
|
||||||
--ion-color-tertiary-rgb: 82, 96, 255;
|
// --ion-color-tertiary-rgb: 82, 96, 255;
|
||||||
--ion-color-tertiary-contrast: #ffffff;
|
// --ion-color-tertiary-contrast: #ffffff;
|
||||||
--ion-color-tertiary-contrast-rgb: 255, 255, 255;
|
// --ion-color-tertiary-contrast-rgb: 255, 255, 255;
|
||||||
--ion-color-tertiary-shade: #4854e0;
|
// --ion-color-tertiary-shade: #4854e0;
|
||||||
--ion-color-tertiary-tint: #6370ff;
|
// --ion-color-tertiary-tint: #6370ff;
|
||||||
|
|
||||||
/** success **/
|
// /** success **/
|
||||||
--ion-color-success: #2dd36f;
|
// --ion-color-success: #2dd36f;
|
||||||
--ion-color-success-rgb: 45, 211, 111;
|
// --ion-color-success-rgb: 45, 211, 111;
|
||||||
--ion-color-success-contrast: #ffffff;
|
// --ion-color-success-contrast: #ffffff;
|
||||||
--ion-color-success-contrast-rgb: 255, 255, 255;
|
// --ion-color-success-contrast-rgb: 255, 255, 255;
|
||||||
--ion-color-success-shade: #28ba62;
|
// --ion-color-success-shade: #28ba62;
|
||||||
--ion-color-success-tint: #42d77d;
|
// --ion-color-success-tint: #42d77d;
|
||||||
|
|
||||||
/** warning **/
|
// /** warning **/
|
||||||
--ion-color-warning: #ffc409;
|
// --ion-color-warning: #ffc409;
|
||||||
--ion-color-warning-rgb: 255, 196, 9;
|
// --ion-color-warning-rgb: 255, 196, 9;
|
||||||
--ion-color-warning-contrast: #000000;
|
// --ion-color-warning-contrast: #000000;
|
||||||
--ion-color-warning-contrast-rgb: 0, 0, 0;
|
// --ion-color-warning-contrast-rgb: 0, 0, 0;
|
||||||
--ion-color-warning-shade: #e0ac08;
|
// --ion-color-warning-shade: #e0ac08;
|
||||||
--ion-color-warning-tint: #ffca22;
|
// --ion-color-warning-tint: #ffca22;
|
||||||
|
|
||||||
/** danger **/
|
// /** danger **/
|
||||||
--ion-color-danger: #eb445a;
|
// --ion-color-danger: #eb445a;
|
||||||
--ion-color-danger-rgb: 235, 68, 90;
|
// --ion-color-danger-rgb: 235, 68, 90;
|
||||||
--ion-color-danger-contrast: #ffffff;
|
// --ion-color-danger-contrast: #ffffff;
|
||||||
--ion-color-danger-contrast-rgb: 255, 255, 255;
|
// --ion-color-danger-contrast-rgb: 255, 255, 255;
|
||||||
--ion-color-danger-shade: #cf3c4f;
|
// --ion-color-danger-shade: #cf3c4f;
|
||||||
--ion-color-danger-tint: #ed576b;
|
// --ion-color-danger-tint: #ed576b;
|
||||||
|
|
||||||
/** dark **/
|
// /** dark **/
|
||||||
--ion-color-dark: #222428;
|
// --ion-color-dark: #222428;
|
||||||
--ion-color-dark-rgb: 34, 36, 40;
|
// --ion-color-dark-rgb: 34, 36, 40;
|
||||||
--ion-color-dark-contrast: #ffffff;
|
// --ion-color-dark-contrast: #ffffff;
|
||||||
--ion-color-dark-contrast-rgb: 255, 255, 255;
|
// --ion-color-dark-contrast-rgb: 255, 255, 255;
|
||||||
--ion-color-dark-shade: #1e2023;
|
// --ion-color-dark-shade: #1e2023;
|
||||||
--ion-color-dark-tint: #383a3e;
|
// --ion-color-dark-tint: #383a3e;
|
||||||
|
|
||||||
/** medium **/
|
// /** medium **/
|
||||||
--ion-color-medium: #92949c;
|
// --ion-color-medium: #92949c;
|
||||||
--ion-color-medium-rgb: 146, 148, 156;
|
// --ion-color-medium-rgb: 146, 148, 156;
|
||||||
--ion-color-medium-contrast: #ffffff;
|
// --ion-color-medium-contrast: #ffffff;
|
||||||
--ion-color-medium-contrast-rgb: 255, 255, 255;
|
// --ion-color-medium-contrast-rgb: 255, 255, 255;
|
||||||
--ion-color-medium-shade: #808289;
|
// --ion-color-medium-shade: #808289;
|
||||||
--ion-color-medium-tint: #9d9fa6;
|
// --ion-color-medium-tint: #9d9fa6;
|
||||||
|
|
||||||
/** light **/
|
// /** light **/
|
||||||
--ion-color-light: #f4f5f8;
|
// --ion-color-light: #f4f5f8;
|
||||||
--ion-color-light-rgb: 244, 245, 248;
|
// --ion-color-light-rgb: 244, 245, 248;
|
||||||
--ion-color-light-contrast: #000000;
|
// --ion-color-light-contrast: #000000;
|
||||||
--ion-color-light-contrast-rgb: 0, 0, 0;
|
// --ion-color-light-contrast-rgb: 0, 0, 0;
|
||||||
--ion-color-light-shade: #d7d8da;
|
// --ion-color-light-shade: #d7d8da;
|
||||||
--ion-color-light-tint: #f5f6f9;
|
// --ion-color-light-tint: #f5f6f9;
|
||||||
}
|
// }
|
||||||
|
|
||||||
@media (prefers-color-scheme: dark) {
|
@media (prefers-color-scheme: dark) {
|
||||||
/*
|
/*
|
||||||
@@ -153,7 +153,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
.ios body {
|
.ios body {
|
||||||
--ion-background-color: #000000;
|
--ion-background-color: #1b1b38;
|
||||||
--ion-background-color-rgb: 0,0,0;
|
--ion-background-color-rgb: 0,0,0;
|
||||||
|
|
||||||
--ion-text-color: #ffffff;
|
--ion-text-color: #ffffff;
|
||||||
@@ -234,3 +234,17 @@
|
|||||||
--ion-card-background: #1e1e1e;
|
--ion-card-background: #1e1e1e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@import 'themes';
|
||||||
|
|
||||||
|
// framework component styles
|
||||||
|
@import '~@nebular/theme/styles/globals';
|
||||||
|
|
||||||
|
// install the framework style
|
||||||
|
@import '~@nebular/theme/styles/theming';
|
||||||
|
@import '~@nebular/theme/styles/themes/cosmic';
|
||||||
|
|
||||||
|
$nb-themes: nb-register-theme((
|
||||||
|
text-basic-color: color-basic-800, // <- we setting color-basic-800 instead of color-basic-1000
|
||||||
|
text-disabled-color: color-basic-600, // <- and color-basic-600 as instead of color-basic-500
|
||||||
|
), default, default);
|
||||||
Reference in New Issue
Block a user