Skip to content

Commit

Permalink
fix: minor changes + promiseAll on home view
Browse files Browse the repository at this point in the history
  • Loading branch information
matthprost committed Aug 14, 2021
1 parent f5affcb commit fb415f5
Show file tree
Hide file tree
Showing 13 changed files with 135 additions and 100 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "com.matthiasprost.scalewaymanager"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 20205
versionName "2.2.5"
versionCode 20206
versionName "2.2.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
4 changes: 2 additions & 2 deletions ios/App/App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.2.5;
MARKETING_VERSION = 2.2.6;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = com.matthiasprost.scalewaymanager;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -375,7 +375,7 @@
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 2.2.5;
MARKETING_VERSION = 2.2.6;
PRODUCT_BUNDLE_IDENTIFIER = com.matthiasprost.scalewaymanager;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "scaleway-manager",
"description": "A server manager",
"version": "2.2.1",
"version": "2.2.6",
"author": "Matthias Porst",
"homepage": "https://matthias-prost.com/",
"scripts": {
Expand Down
97 changes: 49 additions & 48 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
import { NgModule } from "@angular/core";
import { PreloadAllModules, RouterModule, Routes } from "@angular/router";
import {NgModule} from '@angular/core';
import {PreloadAllModules, RouterModule, Routes} from '@angular/router';

import { DoubleAuthGuard } from "./guards/double-auth/double-auth.guard";
import { HomeGuard } from "./guards/home/home.guard";
import { LoginGuard } from "./guards/login/login.guard";
import {DoubleAuthGuard} from './guards/double-auth/double-auth.guard';
import {HomeGuard} from './guards/home/home.guard';
import {LoginGuard} from './guards/login/login.guard';

const routes: Routes = [
{
path: "",
redirectTo: "home",
pathMatch: "full",
path: '',
redirectTo: 'home',
pathMatch: 'full',
},
{
path: "home",
path: 'home',
children: [
{
path: "",
loadChildren: "./pages/home/home.module#HomePageModule",
path: '',
loadChildren: './pages/home/home.module#HomePageModule',
},
{
path: "account",
path: 'account',
children: [
{
path: "",
loadChildren: "./pages/account/account.module#AccountPageModule",
path: '',
loadChildren: './pages/account/account.module#AccountPageModule',
},
{
path: "ssh-keys",
path: 'ssh-keys',
loadChildren:
"./pages/account/ssh-keys/ssh-keys.module#SshKeysPageModule",
'./pages/account/ssh-keys/ssh-keys.module#SshKeysPageModule',
},
{
path: "tokens",
path: 'tokens',
loadChildren:
"./pages/account/tokens/tokens.module#TokensPageModule",
'./pages/account/tokens/tokens.module#TokensPageModule',
},
],
},
],
canActivate: [HomeGuard],
},
{
path: "instances",
path: 'instances',
children: [
{
path: "",
path: '',
loadChildren:
"./pages/products/instances/instances.module#InstancesPageModule",
'./pages/products/instances/instances.module#InstancesPageModule',
},
{
path: ":zone/:id",
path: ':zone/:id',
loadChildren:
"./pages/products/instances/details/details.module#DetailsPageModule",
'./pages/products/instances/details/details.module#DetailsPageModule',
},
],
canActivate: [HomeGuard],
Expand All @@ -72,77 +72,78 @@ const routes: Routes = [
]
},*/
{
path: "login",
path: 'login',
children: [
{
path: "",
loadChildren: "./pages/auth/login/login.module#LoginPageModule",
path: '',
loadChildren: './pages/auth/login/login.module#LoginPageModule',
canActivate: [LoginGuard],
},
{
path: "double-auth",
path: 'double-auth',
loadChildren:
"./pages/auth/double-auth/double-auth.module#DoubleAuthPageModule",
'./pages/auth/double-auth/double-auth.module#DoubleAuthPageModule',
canActivate: [DoubleAuthGuard],
},
],
},
{
path: "about",
loadChildren: "./pages/about/about.module#AboutPageModule",
path: 'about',
loadChildren: './pages/about/about.module#AboutPageModule',
canActivate: [HomeGuard],
},
{
path: "billing",
loadChildren: "./pages/billing/billing.module#BillingPageModule",
path: 'billing',
loadChildren: './pages/billing/billing.module#BillingPageModule',
canActivate: [HomeGuard],
},
{
path: "settings",
loadChildren: "./pages/settings/settings.module#SettingsPageModule",
path: 'settings',
loadChildren: './pages/settings/settings.module#SettingsPageModule',
canActivate: [HomeGuard],
},
{
path: "help",
loadChildren: "./pages/auth/login/help/help.module#HelpPageModule",
path: 'help',
loadChildren: './pages/auth/login/help/help.module#HelpPageModule',
canActivate: [HomeGuard],
},
{
path: "buckets",
path: 'buckets',
children: [
{
path: "",
path: '',
loadChildren:
"./pages/products/buckets/buckets.module#ObjectsPageModule",
'./pages/products/buckets/buckets.module#ObjectsPageModule',
},
{
path: ":region/:bucket",
path: ':region/:bucket',
children: [
{
path: "",
path: '',
loadChildren:
"./pages/products/buckets/objects/objects.module#ObjectsPageModule",
'./pages/products/buckets/objects/objects.module#ObjectsPageModule',
},
{
path: "**",
path: '**',
loadChildren:
"./pages/products/buckets/objects/objects.module#ObjectsPageModule",
'./pages/products/buckets/objects/objects.module#ObjectsPageModule',
},
],
},
],
},
{
path: "change-project",
path: 'change-project',
loadChildren:
"./pages/account/change-project/change-project.module#ChangeProjectPageModule",
'./pages/account/change-project/change-project.module#ChangeProjectPageModule',
},
];

@NgModule({
imports: [
RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }),
RouterModule.forRoot(routes, {preloadingStrategy: PreloadAllModules}),
],
exports: [RouterModule],
})
export class AppRoutingModule {}
export class AppRoutingModule {
}
52 changes: 25 additions & 27 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
import { Component } from "@angular/core";
import { Plugins, StatusBarStyle } from "@capacitor/core";
import { ScreenOrientation } from "@ionic-native/screen-orientation/ngx";
import { Platform } from "@ionic/angular";
import {Component} from '@angular/core';
import {Plugins, StatusBarStyle} from '@capacitor/core';
import {Platform} from '@ionic/angular';

const { StatusBar, SplashScreen } = Plugins;
const {StatusBar, SplashScreen} = Plugins;

@Component({
selector: "app-root",
templateUrl: "app.component.html",
selector: 'app-root',
templateUrl: 'app.component.html',
})
export class AppComponent {
public appPages = [
{
title: "Dashboard",
url: "/home",
icon: "home",
title: 'Dashboard',
url: '/home',
icon: 'home',
new: false,
},
{
title: "Instances",
url: "/instances",
icon: "server",
title: 'Instances',
url: '/instances',
icon: 'server',
new: false,
},
/* {
Expand All @@ -30,42 +29,41 @@ export class AppComponent {
new: false,
},*/
{
title: "Object Storage",
url: "/buckets",
icon: "database",
title: 'Object Storage',
url: '/buckets',
icon: 'database',
new: true,
},
{
title: "Billing",
url: "/billing",
icon: "chart-line",
title: 'Billing',
url: '/billing',
icon: 'chart-line',
new: false,
},
];

public appPagesFooter = [
{
title: "Settings",
url: "/settings",
icon: "cog",
title: 'Settings',
url: '/settings',
icon: 'cog',
},
{
title: "About",
url: "/about",
icon: "life-ring",
title: 'About',
url: '/about',
icon: 'life-ring',
},
];

constructor(
private platform: Platform,
private screenOrientation: ScreenOrientation
) {
this.initializeApp();
}

initializeApp(): void {
this.platform.ready().then(() => {
StatusBar.setStyle({ style: StatusBarStyle.Light });
StatusBar.setStyle({style: StatusBarStyle.Light});
SplashScreen.hide();
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/components/graph/graph.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<div class="header">
<div class="header-left">
<span class="header-left-organization">{{
currentOrganization.name
organizationName
}}</span>
<fa-icon
slot="start"
[icon]="['fas', 'chevron-right']"
class="icon-separator"
></fa-icon>
{{ currentProject.name }}
{{ projectName }}
</div>
<div *ngIf="values && values.length > 0" class="header-right">
Current
Expand Down
8 changes: 3 additions & 5 deletions src/app/components/graph/graph.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@ import { BillingDto } from "../../services/billing/billing.dto";
})
export class GraphComponent implements OnChanges {
@Input() billings: BillingDto;
@Input() currentOrganization: any;
@Input() currentProject: any;
@Input() organizationName: any;
@Input() projectName: any;

@ViewChild("billingCanvas") barCanvas: ElementRef;
private barChart: Chart;
private dates;
public values;
public currency;

constructor() {}

ngOnChanges() {
ngOnChanges(): void {
this.formatData(this.billings);

this.barChart = new Chart(this.barCanvas.nativeElement, {
Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/home/home.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
<app-graph
[billings]="billings"
*ngIf="!isLoading && !billingError"
[currentOrganization]="currentOrganization"
[currentProject]="currentProject"
[organizationName]="currentOrganization ? currentOrganization.name: ''"
[projectName]="currentProject ? currentProject.name : ''"
></app-graph>
<app-error *ngIf="billingError" variant="light"></app-error>
</div>
Expand Down
Loading

0 comments on commit fb415f5

Please sign in to comment.