CP Service generation updated + Add bet component + configurations to automations + WIP Dashboard
This commit is contained in:
parent
cf1300150a
commit
237a74434c
6
package-lock.json
generated
6
package-lock.json
generated
@ -8925,9 +8925,9 @@
|
||||
"integrity": "sha512-p/hzIjUVccW4eJPhuORHI3AUkDpqfvCQVrjxbFEejnTEdWY4C8fomVfjiaA9jCu83fSQnBHuRIGB96iAR8R6uA=="
|
||||
},
|
||||
"primeng": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/primeng/-/primeng-8.0.1.tgz",
|
||||
"integrity": "sha512-87HQEh+S4lm4r280Thlk3pHzJJ1lr4Dl82zidnfWeOBZ5lMbK2w9w9yKJH875aPKWs0MMDVZeQ5V9jMWolRjlA=="
|
||||
"version": "9.0.0",
|
||||
"resolved": "https://registry.npmjs.org/primeng/-/primeng-9.0.0.tgz",
|
||||
"integrity": "sha512-gR9uvEc9/1BXV9tfMt9dggvCAlNZjhrlarbfLPViY6Hqqr588WhOOvU40Gm8rh3sbXkfisuc6Rvhu7ePQXscHA=="
|
||||
},
|
||||
"process": {
|
||||
"version": "0.11.10",
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
"ngx-bootstrap": "^3.2.0",
|
||||
"popper": "^1.0.1",
|
||||
"primeicons": "^1.0.0",
|
||||
"primeng": "^8.0.1",
|
||||
"primeng": "^9.0.0",
|
||||
"rxjs": "~6.5.2",
|
||||
"tslib": "^1.9.0",
|
||||
"zone.js": "~0.9.1"
|
||||
|
||||
@ -5,6 +5,7 @@ export { FacebookAuthModel } from './models/facebook-auth-model';
|
||||
export { GoogleAuthModel } from './models/google-auth-model';
|
||||
export { SmartPrinterMessage } from './models/smart-printer-message';
|
||||
export { SmartGardenMessage } from './models/smart-garden-message';
|
||||
export { TokenDTO } from './models/token-dto';
|
||||
export { UserInfo } from './models/user-info';
|
||||
export { ScreenConfiguration } from './models/screen-configuration';
|
||||
export { Widget } from './models/widget';
|
||||
|
||||
5
src/app/_api/models/token-dto.ts
Normal file
5
src/app/_api/models/token-dto.ts
Normal file
@ -0,0 +1,5 @@
|
||||
/* tslint:disable */
|
||||
export interface TokenDTO {
|
||||
email?: string;
|
||||
password?: string;
|
||||
}
|
||||
@ -2,7 +2,7 @@
|
||||
import { ScreenConfiguration } from './screen-configuration';
|
||||
import { Device } from './device';
|
||||
export interface UserInfo {
|
||||
dateCreation?: string;
|
||||
address?: string;
|
||||
id?: string;
|
||||
email?: string;
|
||||
password?: string;
|
||||
@ -10,10 +10,11 @@ export interface UserInfo {
|
||||
lastName?: string;
|
||||
token?: string;
|
||||
birthday?: string;
|
||||
dateCreation?: string;
|
||||
role?: string;
|
||||
address?: string;
|
||||
city?: string;
|
||||
state?: string;
|
||||
country?: string;
|
||||
language?: string;
|
||||
timeZone?: string;
|
||||
postalCode?: number;
|
||||
|
||||
@ -8,13 +8,14 @@ import { Observable as __Observable } from 'rxjs';
|
||||
import { map as __map, filter as __filter } from 'rxjs/operators';
|
||||
|
||||
import { UserInfo } from '../models/user-info';
|
||||
import { TokenDTO } from '../models/token-dto';
|
||||
import { User } from '../models/user';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
class TokenService extends __BaseService {
|
||||
static readonly CreatePath = '/api/token';
|
||||
static readonly Create_1Path = '/token';
|
||||
static readonly ConnectUserPath = '/api/token';
|
||||
static readonly CreatePath = '/token';
|
||||
|
||||
constructor(
|
||||
config: __Configuration,
|
||||
@ -24,20 +25,14 @@ class TokenService extends __BaseService {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param params The `TokenService.CreateParams` containing the following parameters:
|
||||
*
|
||||
* - `password`:
|
||||
*
|
||||
* - `email`:
|
||||
*
|
||||
* @param tokenDTO undefined
|
||||
* @return Success
|
||||
*/
|
||||
CreateResponse(params: TokenService.CreateParams): __Observable<__StrictHttpResponse<UserInfo>> {
|
||||
ConnectUserResponse(tokenDTO?: TokenDTO): __Observable<__StrictHttpResponse<UserInfo>> {
|
||||
let __params = this.newParams();
|
||||
let __headers = new HttpHeaders();
|
||||
let __body: any = null;
|
||||
if (params.password != null) __params = __params.set('password', params.password.toString());
|
||||
if (params.email != null) __params = __params.set('email', params.email.toString());
|
||||
__body = tokenDTO;
|
||||
let req = new HttpRequest<any>(
|
||||
'POST',
|
||||
this.rootUrl + `/api/token`,
|
||||
@ -56,16 +51,11 @@ class TokenService extends __BaseService {
|
||||
);
|
||||
}
|
||||
/**
|
||||
* @param params The `TokenService.CreateParams` containing the following parameters:
|
||||
*
|
||||
* - `password`:
|
||||
*
|
||||
* - `email`:
|
||||
*
|
||||
* @param tokenDTO undefined
|
||||
* @return Success
|
||||
*/
|
||||
Create(params: TokenService.CreateParams): __Observable<UserInfo> {
|
||||
return this.CreateResponse(params).pipe(
|
||||
ConnectUser(tokenDTO?: TokenDTO): __Observable<UserInfo> {
|
||||
return this.ConnectUserResponse(tokenDTO).pipe(
|
||||
__map(_r => _r.body as UserInfo)
|
||||
);
|
||||
}
|
||||
@ -73,7 +63,7 @@ class TokenService extends __BaseService {
|
||||
/**
|
||||
* @param user undefined
|
||||
*/
|
||||
Create_1Response(user?: User): __Observable<__StrictHttpResponse<null>> {
|
||||
CreateResponse(user?: User): __Observable<__StrictHttpResponse<null>> {
|
||||
let __params = this.newParams();
|
||||
let __headers = new HttpHeaders();
|
||||
let __body: any = null;
|
||||
@ -98,22 +88,14 @@ class TokenService extends __BaseService {
|
||||
/**
|
||||
* @param user undefined
|
||||
*/
|
||||
Create_1(user?: User): __Observable<null> {
|
||||
return this.Create_1Response(user).pipe(
|
||||
Create(user?: User): __Observable<null> {
|
||||
return this.CreateResponse(user).pipe(
|
||||
__map(_r => _r.body as null)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
module TokenService {
|
||||
|
||||
/**
|
||||
* Parameters for Create
|
||||
*/
|
||||
export interface CreateParams {
|
||||
password?: string;
|
||||
email?: string;
|
||||
}
|
||||
}
|
||||
|
||||
export { TokenService }
|
||||
|
||||
@ -4,6 +4,7 @@ import { Observable, BehaviorSubject } from 'rxjs';
|
||||
import { TokenService } from '../_api/services/token.service';
|
||||
import { UserInfo } from '../_api/models/user-info';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { TokenDTO } from '../_api/models';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@ -24,16 +25,16 @@ export class AuthenticationService {
|
||||
this.currentUser = this.currentUserSubject.asObservable();
|
||||
}
|
||||
|
||||
public GetToken(user: UserInfo): Observable<any> {
|
||||
return this._tokenService.Create(user);
|
||||
public GetToken(user: TokenDTO): Observable<any> {
|
||||
return this._tokenService.ConnectUser(user);
|
||||
}
|
||||
|
||||
public GetAuthStatus() {
|
||||
return this.IsLoggedIn;
|
||||
}
|
||||
|
||||
public Login(user: UserInfo) {
|
||||
return this._tokenService.Create(user)
|
||||
public Login(tokenDTO: TokenDTO) {
|
||||
return this._tokenService.ConnectUser(tokenDTO)
|
||||
.pipe(map(user => {
|
||||
// store user details and jwt token in local storage to keep user logged in between page refreshes
|
||||
localStorage.setItem('currentUser', JSON.stringify(user));
|
||||
|
||||
@ -1,14 +1,15 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
import { HomeComponent } from './control-panel/home/home.component';
|
||||
import { ConfigurationComponent } from './control-panel/profile/configuration/configuration.component';
|
||||
import { AutomationComponent } from './control-panel/profile/automation/automation.component';
|
||||
import { AuthGuard } from './_helpers/auth.guard';
|
||||
import { NotFoundComponent } from './control-panel/not-found/not-found.component';
|
||||
import { ProfileComponent } from './control-panel/profile/profile/profile.component';
|
||||
import { EditProfileComponent } from './control-panel/profile/edit-profile/edit-profile.component';
|
||||
import { EditConfigurationComponent } from './control-panel/profile/configuration/edit-configuration/edit-configuration.component';
|
||||
import { EditAutomationComponent } from './control-panel/profile/automation/edit-automation/edit-automation.component';
|
||||
import { DevicesComponent } from './control-panel/profile/devices/devices.component';
|
||||
import { DashboardComponent } from './control-panel/profile/dashboard/dashboard.component';
|
||||
import { BetComponent } from './control-panel/bet/bet.component';
|
||||
|
||||
const routes: Routes =
|
||||
[
|
||||
@ -23,12 +24,15 @@ const routes: Routes =
|
||||
{ path: '', component: ProfileComponent},
|
||||
{ path: 'dashboard', component: DashboardComponent},
|
||||
{ path: 'edit', component: EditProfileComponent},
|
||||
{ path: 'configurations', children: [
|
||||
{ path: '', component: ConfigurationComponent},
|
||||
{ path: ':configurationId', component: EditConfigurationComponent}
|
||||
{ path: 'automation', children: [
|
||||
{ path: '', component: AutomationComponent},
|
||||
{ path: ':configurationId', component: EditAutomationComponent}
|
||||
]},
|
||||
{ path: 'devices', children: [
|
||||
{ path: '', component: DevicesComponent}
|
||||
]},
|
||||
{ path: 'bet', children: [
|
||||
{ path: '', component: BetComponent}
|
||||
]}
|
||||
]}
|
||||
]
|
||||
|
||||
@ -11,7 +11,8 @@
|
||||
<button *ngIf="!Connected" pButton type="button" [label]="LabelHeaderContact" ></button>
|
||||
<button *ngIf="Connected" pButton type="button" label="MY DASHBOARD" (click)="GoToDashboard()"></button>
|
||||
<button *ngIf="Connected" pButton type="button" label="MY DEVICES" (click)="GoToDevices()"></button>
|
||||
<button *ngIf="Connected" pButton type="button" label="MY CONFIGURATIONS" (click)="GoToConfiguration()"></button>
|
||||
<button *ngIf="Connected" pButton type="button" label="MY AUTOMATIONS" (click)="GoToAutomation()"></button>
|
||||
<button *ngIf="Connected" pButton type="button" label="MY BETS" (click)="GoToBet()"></button>
|
||||
<button *ngIf="!Connected" pButton type="button" label="{{LabelHeaderSignIn}}" icon="pi pi-pencil" iconPos="right" (click)="SignUp()"></button>
|
||||
<button *ngIf="!Connected" pButton type="button" label="{{LabelHeaderLogIn}}" icon="pi pi-sign-in" iconPos="right" (click)="DisplayLoginModal = true"></button>
|
||||
<p-splitButton *ngIf="Connected" type="button" [label]="ConnectedUser.firstName" [model]="ItemsUserDropDown" (onClick)="GoToProfile()"></p-splitButton>
|
||||
|
||||
@ -5,7 +5,7 @@ import { TranslateService } from '@ngx-translate/core';
|
||||
import { AuthenticationService } from './_services/authentication.service';
|
||||
import { Router } from '@angular/router';
|
||||
import { first } from 'rxjs/operators';
|
||||
import { UserInfo } from './_api/models';
|
||||
import { UserInfo, TokenDTO } from './_api/models';
|
||||
import { UserService } from './_api/services';
|
||||
|
||||
|
||||
@ -33,7 +33,7 @@ export class AppComponent implements OnInit {
|
||||
|
||||
public CreateUser: UserInfo = {};
|
||||
public ConfirmPassword: string;
|
||||
public UserTryingToLogin: UserInfo = {};
|
||||
public UserTryingToLogin: TokenDTO = {};
|
||||
|
||||
// Sign in
|
||||
public ErrorTextSignIn = '';
|
||||
@ -105,19 +105,20 @@ export class AppComponent implements OnInit {
|
||||
}
|
||||
);
|
||||
|
||||
this._translateService.get('App.Home.UserDropDown.ModifyUser').subscribe(modifyLabel => {
|
||||
this._translateService.get('App.Home.UserDropDown.Logout').subscribe(logoutLabel => {
|
||||
this._translateService.get(['App.Home.UserDropDown.ModifyUser', 'App.Home.UserDropDown.Logout',
|
||||
'App.Home.UserDropDown.Profile']).subscribe(labels => {
|
||||
this.ItemsUserDropDown = [
|
||||
{label: modifyLabel, icon: 'fa fa-edit', command: () => {
|
||||
{label: labels['App.Home.UserDropDown.Profile'], icon: 'fa fa-user', command: () => {
|
||||
this._router.navigate(['/profile/' + this.ConnectedUser.id]);
|
||||
}},
|
||||
{label: labels['App.Home.UserDropDown.ModifyUser'], icon: 'fa fa-edit', command: () => {
|
||||
this._router.navigate(['/profile/' + this.ConnectedUser.id + '/edit']);
|
||||
}},
|
||||
{label: logoutLabel, icon: 'fa fa-sign-out', command: () => {
|
||||
{label: labels['App.Home.UserDropDown.Logout'], icon: 'fa fa-sign-out', command: () => {
|
||||
this.Logout();
|
||||
}}
|
||||
];
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -135,8 +136,8 @@ export class AppComponent implements OnInit {
|
||||
this.Email = null;
|
||||
this.Password = null;
|
||||
this._authService.IsLoggedIn = true;
|
||||
this._router.navigate(['/profile/' + this.ConnectedUser.id]);
|
||||
this.ErrorTextLogin = '';
|
||||
this.GoToDashboard();
|
||||
},
|
||||
error => {
|
||||
this._translateService.get('App.Home.Login.ErrorText').subscribe(loginErrorText => {
|
||||
@ -170,14 +171,18 @@ export class AppComponent implements OnInit {
|
||||
this._router.navigate(['/profile/' + this.ConnectedUser.id]);
|
||||
}
|
||||
|
||||
public GoToConfiguration() {
|
||||
this._router.navigate(['/profile/' + this.ConnectedUser.id + '/configurations']);
|
||||
public GoToAutomation() {
|
||||
this._router.navigate(['/profile/' + this.ConnectedUser.id + '/automation']);
|
||||
}
|
||||
|
||||
public GoToDevices() {
|
||||
this._router.navigate(['/profile/' + this.ConnectedUser.id + '/devices']);
|
||||
}
|
||||
|
||||
public GoToBet() {
|
||||
this._router.navigate(['/profile/' + this.ConnectedUser.id + '/bet']);
|
||||
}
|
||||
|
||||
public CreateProfile() {
|
||||
if (this.CorrectForm()) {
|
||||
this.CreateUser.deviceIds = [];
|
||||
@ -241,50 +246,27 @@ export class AppComponent implements OnInit {
|
||||
|
||||
public InitLabels() {
|
||||
// HEADERS
|
||||
this._translateService.get('App.Home.Login.Header').subscribe(label => {
|
||||
this.LabelHeaderLogIn = label;
|
||||
});
|
||||
this._translateService.get('App.Home.SignIn.Header').subscribe(label => {
|
||||
this.LabelHeaderSignIn = label;
|
||||
});
|
||||
this._translateService.get('App.Home.About.Header').subscribe(label => {
|
||||
this.LabelHeaderAbout = label;
|
||||
});
|
||||
this._translateService.get('App.Home.Team.Header').subscribe(label => {
|
||||
this.LabelHeaderTeam = label;
|
||||
});
|
||||
this._translateService.get('App.Home.Contact.Header').subscribe(label => {
|
||||
this.LabelHeaderContact = label;
|
||||
});
|
||||
|
||||
this._translateService.get(['App.Home.Login.Header', 'App.Home.SignIn.Header', 'App.Home.About.Header', 'App.Home.Team.Header',
|
||||
'App.Home.Contact.Header', 'App.Home.Login.Identify', 'App.Home.SignIn.CreateProfile', 'App.Common.Form.LastName',
|
||||
'App.Common.Form.FirstName', 'App.Common.Form.Email', 'App.Common.Form.Password', 'App.Common.Form.ConfirmPassword',
|
||||
'App.Common.Form.Create'
|
||||
]).subscribe(labelTab => {
|
||||
this.LabelHeaderLogIn = labelTab['App.Home.Login.Header'];
|
||||
this.LabelHeaderSignIn = labelTab['App.Home.SignIn.Header'];
|
||||
this.LabelHeaderAbout = labelTab['App.Home.About.Header'];
|
||||
this.LabelHeaderTeam = labelTab['App.Home.Team.Header'];
|
||||
this.LabelHeaderContact = labelTab['App.Home.Contact.Header'];
|
||||
// LOGIN
|
||||
this._translateService.get('App.Home.Login.Identify').subscribe(label => {
|
||||
this.LabelLoginIdentify = label;
|
||||
});
|
||||
|
||||
this.LabelLoginIdentify = labelTab['App.Home.Login.Identify'];
|
||||
// SIGN IN
|
||||
this._translateService.get('App.Home.SignIn.CreateProfile').subscribe(label => {
|
||||
this.LabelSignInCreateProfile = label;
|
||||
});
|
||||
|
||||
this.LabelSignInCreateProfile = labelTab['App.Home.SignIn.CreateProfile'];
|
||||
// FORM
|
||||
this._translateService.get('App.Common.Form.LastName').subscribe(label => {
|
||||
this.LabelFormLastName = label;
|
||||
});
|
||||
this._translateService.get('App.Common.Form.FirstName').subscribe(label => {
|
||||
this.LabelFormFirstName = label;
|
||||
});
|
||||
this._translateService.get('App.Common.Form.Email').subscribe(label => {
|
||||
this.LabelFormEmail = label;
|
||||
});
|
||||
this._translateService.get('App.Common.Form.Password').subscribe(label => {
|
||||
this.LabelFormPassword = label;
|
||||
});
|
||||
this._translateService.get('App.Common.Form.ConfirmPassword').subscribe(label => {
|
||||
this.LabelFormConfirmPassword = label;
|
||||
});
|
||||
this._translateService.get('App.Common.Form.Create').subscribe(label => {
|
||||
this.LabelFormCreate = label;
|
||||
this.LabelFormLastName = labelTab['App.Common.Form.LastName'];
|
||||
this.LabelFormFirstName = labelTab['App.Common.Form.FirstName'];
|
||||
this.LabelFormEmail = labelTab['App.Common.Form.Email'];
|
||||
this.LabelFormPassword = labelTab['App.Common.Form.Password'];
|
||||
this.LabelFormConfirmPassword = labelTab['App.Common.Form.ConfirmPassword'];
|
||||
this.LabelFormCreate = labelTab['App.Common.Form.Create'];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,12 +22,12 @@ import { AppService } from './_services/app.service';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { CalendarModule } from 'primeng/calendar';
|
||||
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
||||
import { ConfirmationService, MessageService } from 'primeng/api';
|
||||
import { ConfirmationService, MessageService, MenuItem } from 'primeng/api';
|
||||
|
||||
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
||||
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
||||
import { AuthenticationService } from './_services/authentication.service';
|
||||
import { ConfigurationComponent } from './control-panel/profile/configuration/configuration.component';
|
||||
import { AutomationComponent } from './control-panel/profile/automation/automation.component';
|
||||
import { NotFoundComponent } from './control-panel/not-found/not-found.component';
|
||||
import { ProfileComponent } from './control-panel/profile/profile/profile.component';
|
||||
import { EditProfileComponent } from './control-panel/profile/edit-profile/edit-profile.component';
|
||||
@ -36,9 +36,12 @@ import { ErrorInterceptor } from './_helpers/error.interceptor';
|
||||
import { NotificationsService } from './_services/notifications.service';
|
||||
import { ToastModule } from 'primeng/toast';
|
||||
import { DropdownModule } from 'primeng/dropdown';
|
||||
import { EditConfigurationComponent } from './control-panel/profile/configuration/edit-configuration/edit-configuration.component';
|
||||
import { EditAutomationComponent } from './control-panel/profile/automation/edit-automation/edit-automation.component';
|
||||
import { DevicesComponent } from './control-panel/profile/devices/devices.component';
|
||||
import { DashboardComponent } from './control-panel/profile/dashboard/dashboard.component';
|
||||
import { BetComponent } from './control-panel/bet/bet.component';
|
||||
import { PanelMenuModule } from 'primeng/panelmenu';
|
||||
import { EnergyComponent } from './control-panel/profile/dashboard/energy/energy.component';
|
||||
|
||||
|
||||
|
||||
@ -67,13 +70,15 @@ export function HttpLoaderFactory(http: HttpClient) {
|
||||
AppComponent,
|
||||
HomeComponent,
|
||||
BorderCardDirective,
|
||||
ConfigurationComponent,
|
||||
AutomationComponent,
|
||||
NotFoundComponent,
|
||||
ProfileComponent,
|
||||
EditProfileComponent,
|
||||
EditConfigurationComponent,
|
||||
EditAutomationComponent,
|
||||
DevicesComponent,
|
||||
DashboardComponent
|
||||
DashboardComponent,
|
||||
BetComponent,
|
||||
EnergyComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
@ -94,6 +99,7 @@ export function HttpLoaderFactory(http: HttpClient) {
|
||||
ConfirmDialogModule,
|
||||
ToastModule,
|
||||
DropdownModule,
|
||||
PanelMenuModule,
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
|
||||
11
src/app/control-panel/bet/bet.component.html
Normal file
11
src/app/control-panel/bet/bet.component.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!-- THIS NEED TO BE UPDATED PROPERLY -->
|
||||
<div class="blankSpace">
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
<h4>My Bets</h4>
|
||||
<p>
|
||||
This is the bet page. => You will have the possibility to search matches according to the odds you want.
|
||||
</p>
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ConfigurationComponent } from './configuration.component';
|
||||
import { BetComponent } from './bet.component';
|
||||
|
||||
describe('ConfigurationComponent', () => {
|
||||
let component: ConfigurationComponent;
|
||||
let fixture: ComponentFixture<ConfigurationComponent>;
|
||||
describe('BetComponent', () => {
|
||||
let component: BetComponent;
|
||||
let fixture: ComponentFixture<BetComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ConfigurationComponent ]
|
||||
declarations: [ BetComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ConfigurationComponent);
|
||||
fixture = TestBed.createComponent(BetComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
15
src/app/control-panel/bet/bet.component.ts
Normal file
15
src/app/control-panel/bet/bet.component.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-bet',
|
||||
templateUrl: './bet.component.html',
|
||||
styleUrls: ['./bet.component.css']
|
||||
})
|
||||
export class BetComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
<!-- THIS NEED TO BE UPDATED PROPERLY -->
|
||||
<div class="blankSpace">
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<h4>My Automations</h4>
|
||||
|
||||
<p>
|
||||
This is the automatisation page. => You will find list of all automations and link to create new one.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Here a list with :
|
||||
|
||||
Name - last played (used) - Command buttons (edit, delete)
|
||||
</p>
|
||||
|
||||
|
||||
<button type="button" class="btn btn-primary btn-primary" (click)="OpenSelectedAutomation()">
|
||||
Open an automation
|
||||
</button>
|
||||
@ -1,20 +1,20 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EditConfigurationComponent } from './edit-configuration.component';
|
||||
import { AutomationComponent } from './automation.component';
|
||||
|
||||
describe('EditConfigurationComponent', () => {
|
||||
let component: EditConfigurationComponent;
|
||||
let fixture: ComponentFixture<EditConfigurationComponent>;
|
||||
describe('AutomationComponent', () => {
|
||||
let component: AutomationComponent;
|
||||
let fixture: ComponentFixture<AutomationComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditConfigurationComponent ]
|
||||
declarations: [ AutomationComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EditConfigurationComponent);
|
||||
fixture = TestBed.createComponent(AutomationComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@ -5,15 +5,15 @@ import { NotificationsService } from '../../../_services/notifications.service';
|
||||
import { UserInfo } from '../../../_api/models';
|
||||
|
||||
@Component({
|
||||
selector: 'app-configuration',
|
||||
templateUrl: './configuration.component.html',
|
||||
styleUrls: ['./configuration.component.css']
|
||||
selector: 'app-automation',
|
||||
templateUrl: './automation.component.html',
|
||||
styleUrls: ['./automation.component.css']
|
||||
})
|
||||
export class ConfigurationComponent implements OnInit {
|
||||
export class AutomationComponent implements OnInit {
|
||||
|
||||
public ConnectedUser: UserInfo;
|
||||
|
||||
public SelectedConfig = 'hkgskjhdskj15';
|
||||
public SelectedAutomation = 'hkgskjhdskj15';
|
||||
|
||||
constructor(
|
||||
private _notifications: NotificationsService,
|
||||
@ -32,8 +32,8 @@ export class ConfigurationComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
public OpenSelectedConfig() {
|
||||
this._router.navigate([this._router.url, this.SelectedConfig]);
|
||||
public OpenSelectedAutomation() {
|
||||
this._router.navigate([this._router.url, this.SelectedAutomation]);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
<!-- THIS NEED TO BE UPDATED PROPERLY -->
|
||||
<div class="blankSpace">
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
<p>
|
||||
This is the edit automation page. => (Existing one from MyMirror 1.0) => You will have the chance to personnalize your screen configuration
|
||||
</p>
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EditAutomationComponent } from './edit-automation.component';
|
||||
|
||||
describe('EditAutomationComponent', () => {
|
||||
let component: EditAutomationComponent;
|
||||
let fixture: ComponentFixture<EditAutomationComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditAutomationComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EditAutomationComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -4,11 +4,11 @@ import { ConfirmationService } from 'primeng/api';
|
||||
import { NotificationsService } from '../../../../_services/notifications.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-configuration',
|
||||
templateUrl: './edit-configuration.component.html',
|
||||
styleUrls: ['./edit-configuration.component.css']
|
||||
selector: 'app-edit-automation',
|
||||
templateUrl: './edit-automation.component.html',
|
||||
styleUrls: ['./edit-automation.component.css']
|
||||
})
|
||||
export class EditConfigurationComponent implements OnInit {
|
||||
export class EditAutomationComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private _notifications: NotificationsService,
|
||||
@ -1,15 +0,0 @@
|
||||
<!-- THIS NEED TO BE UPDATED PROPERLY -->
|
||||
<div class="blankSpace">
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
This is the config page. => You will find list of all configuration and link to create new one.
|
||||
</p>
|
||||
|
||||
|
||||
<button type="button" class="btn btn-primary btn-primary" (click)="OpenSelectedConfig()">
|
||||
Open a config
|
||||
</button>
|
||||
@ -1,9 +0,0 @@
|
||||
<!-- THIS NEED TO BE UPDATED PROPERLY -->
|
||||
<div class="blankSpace">
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
<p>
|
||||
This is the edit config page. => (Existing one from MyMirror 1.0) => You will have the chance to personnalize your screen configuration
|
||||
</p>
|
||||
@ -1,8 +1,6 @@
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
width: 200px;
|
||||
height: 400px;
|
||||
background: #000;
|
||||
width: 180px;
|
||||
}
|
||||
.content {
|
||||
margin-left: 200px;
|
||||
@ -14,8 +12,6 @@
|
||||
z-index: 1;
|
||||
}
|
||||
.info {
|
||||
width: 1440px;
|
||||
height: 300px;
|
||||
position: relative;
|
||||
background: #f55;
|
||||
}
|
||||
@ -1,9 +1,14 @@
|
||||
<!-- THIS NEED TO BE UPDATED PROPERLY -->
|
||||
<div class="blankSpace">
|
||||
<br>
|
||||
<br>
|
||||
<div style="height: 51px" class="blankSpace">
|
||||
</div>
|
||||
<div class="sidebar">
|
||||
<p-panelMenu [model]="items" [style]="{'color': '#3366ff', 'width':'300px'}"></p-panelMenu>
|
||||
</div>
|
||||
<div class="sidebar"></div>
|
||||
<div class="content">
|
||||
<div class="info"></div>
|
||||
<div class="info">
|
||||
<h4>My Dashboard</h4>
|
||||
<div *ngIf="ShowEnergy">
|
||||
<app-energy></app-energy>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,4 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {PanelMenuModule} from 'primeng/panelmenu';
|
||||
import {MenuItem} from 'primeng/api';
|
||||
import { ElementSchemaRegistry } from '@angular/compiler';
|
||||
|
||||
@Component({
|
||||
selector: 'app-dashboard',
|
||||
@ -7,9 +10,71 @@ import { Component, OnInit } from '@angular/core';
|
||||
})
|
||||
export class DashboardComponent implements OnInit {
|
||||
|
||||
items: MenuItem[];
|
||||
|
||||
ShowEnergy = false;
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
// TODO Retrieve list from service (depends on what the user has access to)
|
||||
this.items = [
|
||||
{
|
||||
icon: 'fas fa-seedling',
|
||||
label: 'Energy',
|
||||
items: [
|
||||
{label: 'Electricity', icon: 'fas fa-bolt',
|
||||
items: [
|
||||
{label: 'Solar Panel', icon: 'fas fa-solar-panel',
|
||||
command: () => { this.Open('Energy/Electricity/SolarPanel'); }}
|
||||
],
|
||||
command: () => { this.Open('Energy/Electricity'); }},
|
||||
{label: 'Gas', icon: 'fas fa-burn'},
|
||||
{label: 'Water', icon: 'fas fa-tint'}
|
||||
], command: () => { this.Open('Energy'); }
|
||||
},
|
||||
{
|
||||
label: 'Security',
|
||||
icon: 'fas fa-lock',
|
||||
items: [
|
||||
{label: 'Alarm', icon: 'fas fa-bell'},
|
||||
{label: 'Camera', icon: 'fas fa-video'}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Entertainment',
|
||||
icon: 'fas fa-music',
|
||||
items: [
|
||||
{
|
||||
label: 'Music',
|
||||
icon: 'fas fa-music'
|
||||
},
|
||||
{
|
||||
label: 'Tv',
|
||||
icon: 'fas fa-tv',
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Health',
|
||||
icon: 'fas fa-heartbeat',
|
||||
items: [
|
||||
{
|
||||
label: 'My body',
|
||||
icon: ' fas fa-user-alt'
|
||||
},
|
||||
{
|
||||
label: 'Fitness',
|
||||
icon: 'fas fa-running',
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
Open(module: string) {
|
||||
console.log(module);
|
||||
this.ShowEnergy = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1 @@
|
||||
<p>energy works!</p>
|
||||
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { EnergyComponent } from './energy.component';
|
||||
|
||||
describe('EnergyComponent', () => {
|
||||
let component: EnergyComponent;
|
||||
let fixture: ComponentFixture<EnergyComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EnergyComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EnergyComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,15 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-energy',
|
||||
templateUrl: './energy.component.html',
|
||||
styleUrls: ['./energy.component.css']
|
||||
})
|
||||
export class EnergyComponent implements OnInit {
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
}
|
||||
@ -4,18 +4,29 @@
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
<h4>My Devices</h4>
|
||||
<p>
|
||||
This is the devices page. => You will have the possibility to change parameters for all your screen devices =>
|
||||
This is the devices page. => You will have the possibility to change parameters for all your devices =>
|
||||
</p>
|
||||
|
||||
<h4>Actions</h4>
|
||||
<p>
|
||||
- Voir l'état de connexion (ou dernière connexion)
|
||||
- Changer parametres
|
||||
- Changer position
|
||||
- Changer Nom
|
||||
- Changer les owners
|
||||
- Supprimer du profil
|
||||
- Voir l'état de connexion
|
||||
- Assigner une configuration (?)
|
||||
- Voir les automatisations dans lesquels les devices jouent un rôle
|
||||
- Voir le niveau de batterie des devices (si applicable)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Ici un petit endroit avec des trois zones : Combien de devices connectés/ non connectés ++
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Ici un tableau avec la liste des devices
|
||||
|
||||
'Etat de connexion/date dernière connexion boule verte ou rouge '- 'Nom' - 'Dernières données recues du devices (si applicable) ou cellule en fonction du type de device' - 'Etat de batterie si applicable' - 'Boutons actions (Edit (changer le nom affiché du device), Supprimer)'
|
||||
</p>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<h4>My Profile</h4>
|
||||
<p>
|
||||
This is your profile view => You can see all your devices (the availability, params?), all your playlists, and links to create new configuration
|
||||
</p>
|
||||
|
||||
@ -27,7 +27,8 @@
|
||||
},
|
||||
"UserDropDown": {
|
||||
"Logout": "Logout",
|
||||
"ModifyUser": "Edit profile"
|
||||
"ModifyUser": "Edit profile",
|
||||
"Profile": "My profile"
|
||||
}
|
||||
},
|
||||
"NotFound": {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user