From 5682487a5cd4f67eaea68e15a769608c1a8253c4 Mon Sep 17 00:00:00 2001 From: Umberto Russo Date: Thu, 14 Mar 2019 18:11:28 +0100 Subject: [PATCH 1/7] Added S3 Buckets Statistics --- package-lock.json | 46 ++++++- package.json | 1 + src/app/app-routing.module.ts | 5 + src/app/app.module.ts | 6 +- src/app/components/menu/menu.component.html | 4 + src/app/components/menu/menu.component.ts | 5 + .../s3-stats/s3-stats.component.html | 31 +++++ .../s3-stats/s3-stats.component.scss | 3 + .../s3-stats/s3-stats.component.spec.ts | 25 ++++ .../components/s3-stats/s3-stats.component.ts | 117 ++++++++++++++++++ src/app/providers/aws.service.ts | 94 +++++++++++++- src/assets/i18n/en.json | 8 ++ src/assets/i18n/it.json | 8 ++ src/assets/icons/stats.svg | 56 +++++++++ 14 files changed, 401 insertions(+), 8 deletions(-) create mode 100644 src/app/components/s3-stats/s3-stats.component.html create mode 100644 src/app/components/s3-stats/s3-stats.component.scss create mode 100644 src/app/components/s3-stats/s3-stats.component.spec.ts create mode 100644 src/app/components/s3-stats/s3-stats.component.ts create mode 100644 src/assets/icons/stats.svg diff --git a/package-lock.json b/package-lock.json index 95981aa..69da36a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "aws-s3-backup", - "version": "1.4.0", + "version": "1.5.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1008,6 +1008,14 @@ } } }, + "angular2-chartjs": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/angular2-chartjs/-/angular2-chartjs-0.5.1.tgz", + "integrity": "sha512-bxEVxVEv7llMcgwuc9jlc5KmuOEngT7ZlUyCddmsXwQQAahrTeNgFJ1Nc1SVQnq2fl2d8efh6m70DqF5beiA+A==", + "requires": { + "chart.js": "^2.3.0" + } + }, "ansi-align": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-2.0.0.tgz", @@ -2380,6 +2388,39 @@ } } }, + "chart.js": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/chart.js/-/chart.js-2.8.0.tgz", + "integrity": "sha512-Di3wUL4BFvqI5FB5K26aQ+hvWh8wnP9A3DWGvXHVkO13D3DSnaSsdZx29cXlEsYKVkn1E2az+ZYFS4t0zi8x0w==", + "requires": { + "chartjs-color": "^2.1.0", + "moment": "^2.10.2" + } + }, + "chartjs-color": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/chartjs-color/-/chartjs-color-2.3.0.tgz", + "integrity": "sha512-hEvVheqczsoHD+fZ+tfPUE+1+RbV6b+eksp2LwAhwRTVXEjCSEavvk+Hg3H6SZfGlPh/UfmWKGIvZbtobOEm3g==", + "requires": { + "chartjs-color-string": "^0.6.0", + "color-convert": "^0.5.3" + }, + "dependencies": { + "color-convert": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-0.5.3.tgz", + "integrity": "sha1-vbbGnOZg+t/+CwAHzER+G59ygr0=" + } + } + }, + "chartjs-color-string": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/chartjs-color-string/-/chartjs-color-string-0.6.0.tgz", + "integrity": "sha512-TIB5OKn1hPJvO7JcteW4WY/63v6KwEdt6udfnDE9iCAZgy+V4SrbSxoIbTw/xkUIapjEI4ExGtD0+6D3KyFd7A==", + "requires": { + "color-name": "^1.0.0" + } + }, "chokidar": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.4.tgz", @@ -2580,8 +2621,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "colors": { "version": "1.1.2", diff --git a/package.json b/package.json index d870522..48b5b22 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@trodi/electron-splashscreen": "^0.3.4", "@types/fs-extra": "^5.0.4", "@types/node-schedule": "^1.2.2", + "angular2-chartjs": "^0.5.1", "aws-sdk": "^2.335.0", "chokidar": "^2.0.4", "electron-context-menu": "^0.11.0", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 1012490..6300645 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -6,6 +6,7 @@ import {JobsListComponent} from './components/jobs-list/jobs-list.component'; import {SettingsComponent} from './components/settings/settings.component'; import {LogsComponent} from './components/logs/logs.component'; import {S3ExplorerComponent} from './components/s3-explorer/s3-explorer.component'; +import {S3StatsComponent} from './components/s3-stats/s3-stats.component'; const routes: Routes = [ { @@ -28,6 +29,10 @@ const routes: Routes = [ path: 's3-explorer', component: S3ExplorerComponent }, + { + path: 's3-stats', + component: S3StatsComponent + }, { path: 'logs', component: LogsComponent diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 48286f9..ca00a03 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -38,6 +38,8 @@ import { JobBackupManuallyComponent } from './components/dialogs/job-backup-manu import { NoInternetConnectionComponent } from './components/dialogs/no-internet-connection/no-internet-connection.component'; import {NotificationsService} from './providers/notifications.service'; import {ProcessesHandlerService} from './providers/processes-handler.service'; +import { S3StatsComponent } from './components/s3-stats/s3-stats.component'; +import { ChartModule } from 'angular2-chartjs'; // AoT requires an exported function for factories @@ -58,7 +60,8 @@ export function HttpLoaderFactory(http: HttpClient) { S3ExplorerComponent, JobAlertDialogComponent, JobBackupManuallyComponent, - NoInternetConnectionComponent + NoInternetConnectionComponent, + S3StatsComponent ], imports: [ BrowserModule, @@ -69,6 +72,7 @@ export function HttpLoaderFactory(http: HttpClient) { FlexLayoutModule, NgxElectronModule, ReactiveFormsModule, + ChartModule, TranslateModule.forRoot({ loader: { provide: TranslateLoader, diff --git a/src/app/components/menu/menu.component.html b/src/app/components/menu/menu.component.html index ee87cdf..f0b752a 100644 --- a/src/app/components/menu/menu.component.html +++ b/src/app/components/menu/menu.component.html @@ -20,6 +20,10 @@ {{ 'PAGES.S3-EXPLORER.MENU' | translate}} +