Skip to content

Commit

Permalink
Merge branch 'milestone-1.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
ulver2812 committed Mar 20, 2019
2 parents 3acadac + dad7818 commit d29ef23
Show file tree
Hide file tree
Showing 27 changed files with 482 additions and 31 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
### Changelog
All notable changes to this project will be documented in this file.

## [1.6.0] - 2019-03-20
### Fixed
- Error popup when trying to run more then one app instance
- Fixed typos in menu and pages
### Added
- S3 Buckets Statistics
- Support for standard storage IA in S3 explorer and statistics

## [1.5.0] - 2019-03-12
### Fixed
- The backup 'is running' spinner remain stuck when the AWS CLI S3 generates an error
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,16 @@ You can find the AWS CLI installer here: [Download AWS CLI](https://aws.amazon.c

After installation go to settings page and configure the AWS credentials.

In order to use the app you must set an "AWS access key ID" and an "AWS secret access key" that you can create through the [IAM service](https://docs.aws.amazon.com/en_us/IAM/latest/UserGuide/introduction.html) in the AWS console.
In order to use the app **you must set** an **"AWS access key ID"**, an **"AWS secret access key"** and an **"AWS Region"** that you can create through the [IAM service](https://docs.aws.amazon.com/en_us/IAM/latest/UserGuide/introduction.html) in the AWS console.
The IAM user needs a programmatic access account with a correct read/write S3 policy attached (e.g AmazonS3FullAccess) and CloudWatch Metrics (e.g CloudWatchReadOnlyAccess).
You can use any IAM S3 policy that grant access to the buckets that you want to use with the app.
Here an example policy: [IAM S3 example policy](https://docs.aws.amazon.com/en_us/IAM/latest/UserGuide/reference_policies_examples_s3_rw-bucket.html)

## How to correctly quit the app
## Wiki

When you try to quit the app the normal behaviour is that the app minimize herself in the icons tray and still run.
To correctly quit the app right click on the tray icon and click "quit".
A complete and detailed documentation can be found here: [https://github.com/ulver2812/aws-s3-backup/wiki](https://github.com/ulver2812/aws-s3-backup/wiki)

<img src="preview.gif">
<img src="preview/preview.gif">

## Windows executable (portable and installer)

Expand Down
2 changes: 1 addition & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function checkSingleInstance() {
});

if (isSecondInstance) {
app.quit();
app.exit();
return;
}
}
Expand Down
46 changes: 43 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-s3-backup",
"version": "1.5.0",
"version": "1.6.0",
"description": "AWS S3 backup system",
"homepage": "https://github.com/ulver2812/aws-s3-backup",
"author": {
Expand Down Expand Up @@ -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",
Expand Down
Binary file removed preview.gif
Binary file not shown.
Binary file added preview/1.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added preview/2.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added preview/3.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added preview/4..PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added preview/5.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added preview/6.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added preview/preview.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand All @@ -28,6 +29,10 @@ const routes: Routes = [
path: 's3-explorer',
component: S3ExplorerComponent
},
{
path: 's3-stats',
component: S3StatsComponent
},
{
path: 'logs',
component: LogsComponent
Expand Down
6 changes: 5 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -58,7 +60,8 @@ export function HttpLoaderFactory(http: HttpClient) {
S3ExplorerComponent,
JobAlertDialogComponent,
JobBackupManuallyComponent,
NoInternetConnectionComponent
NoInternetConnectionComponent,
S3StatsComponent
],
imports: [
BrowserModule,
Expand All @@ -69,6 +72,7 @@ export function HttpLoaderFactory(http: HttpClient) {
FlexLayoutModule,
NgxElectronModule,
ReactiveFormsModule,
ChartModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
Expand Down
4 changes: 4 additions & 0 deletions src/app/components/menu/menu.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<mat-icon svgIcon="custom_icon_s3_explorer"></mat-icon>
<span>{{ 'PAGES.S3-EXPLORER.MENU' | translate}}</span>
</button>
<button routerLink="s3-stats" mat-menu-item>
<mat-icon svgIcon="custom_icon_s3_stats"></mat-icon>
<span>{{ 'PAGES.S3-STATS.MENU' | translate}}</span>
</button>
<button routerLink="settings" mat-menu-item>
<mat-icon svgIcon="custom_icon_settings"></mat-icon>
<span>{{ 'PAGES.SETTINGS.MENU' | translate}}</span>
Expand Down
7 changes: 6 additions & 1 deletion src/app/components/menu/menu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class MenuComponent implements OnInit {
}

helpPage() {
this.electron.shell.openExternal('https://github.com/ulver2812/aws-s3-backup');
this.electron.shell.openExternal('https://github.com/ulver2812/aws-s3-backup/wiki');
}

registerIcons(){
Expand Down Expand Up @@ -63,5 +63,10 @@ export class MenuComponent implements OnInit {
'custom_icon_s3_explorer',
this.domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/s3_explorer.svg')
);

this.matIconRegistry.addSvgIcon(
'custom_icon_s3_stats',
this.domSanitizer.bypassSecurityTrustResourceUrl('assets/icons/stats.svg')
);
}
}
15 changes: 11 additions & 4 deletions src/app/components/s3-explorer/s3-explorer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ <h2>{{'PAGES.S3-EXPLORER.TITLE' | translate}}</h2>
<mat-option *ngFor="let bucket of buckets" [value]="bucket.Name">{{bucket.Name}}</mat-option>
</mat-select>
</mat-form-field>
<div *ngIf="currentBucket !== ''">
<span class="dimension-label">{{'PAGES.S3-EXPLORER.BUCKET-SIZE' | translate}}: </span>{{ currentBucketSize }}
<div *ngIf="currentBucket !== '' && (currentDirs.length > 0 || currentFiles.length > 0)">
<span class="dimension-label">{{'PAGES.S3-EXPLORER.BUCKET-SIZE' | translate}}: </span>{{ currentBucketSize }} -
<span class="dimension-label">{{'PAGES.S3-EXPLORER.BUCKET-SIZE-IA' | translate}}: </span>{{ currentBucketSizeIA }} -
<span class="dimension-label">{{'PAGES.S3-EXPLORER.BUCKET-OBJECTS' | translate}}: </span>{{ currentBucketNumberOfObjects }}
</div>
<br>
Expand All @@ -35,7 +36,8 @@ <h4 mat-line>{{dir.Name}}</h4>
<h4 mat-line>{{file.Name}}</h4>
<p mat-line>
<strong>{{'PAGES.S3-EXPLORER.LAST-UPDATE' | translate}}:</strong> {{file.LastUpdate}} -
<strong>{{'PAGES.S3-EXPLORER.SIZE' | translate}}:</strong> {{file.SizeFormatted}}
<strong>{{'PAGES.S3-EXPLORER.SIZE' | translate}}:</strong> {{file.SizeFormatted}} -
<strong>{{'PAGES.S3-EXPLORER.STORAGE-CLASS' | translate}}:</strong> {{file.StorageClass}}
</p>
<button [disabled]="loadFile" (click)="download(file.Key, $event)" mat-icon-button color="primary" class="float-right">
<mat-icon svgIcon="custom_icon_download" *ngIf="!loadFile" matTooltip="{{'PAGES.S3-EXPLORER.DOWNLOAD' | translate}}"></mat-icon>
Expand All @@ -49,7 +51,12 @@ <h4 mat-line>{{file.Name}}</h4>
<h2 class="no-job">{{'PAGES.S3-EXPLORER.NO-BUCKET' | translate}}</h2>
</section>

<section *ngIf="currentDirs.length === 0 && currentFiles.length === 0" class="mat-typography">
<section *ngIf="buckets.length > 0 && currentBucket === ''" class="mat-typography">
<br>
<h2 class="no-job">{{'PAGES.S3-EXPLORER.NO-BUCKET-SELECTED' | translate}}</h2>
</section>

<section *ngIf="currentDirs.length === 0 && currentFiles.length === 0 && currentBucket !== ''" class="mat-typography">
<br>
<h2 class="no-job">{{'PAGES.S3-EXPLORER.NO-FILES' | translate}}</h2>
</section>
Expand Down
19 changes: 14 additions & 5 deletions src/app/components/s3-explorer/s3-explorer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export class S3ExplorerComponent implements OnInit {
currentPrefix = '';
backPrefix = '';
currentBucketSize = '--';
currentBucketSizeIA = '--';
currentBucketNumberOfObjects = '--';

constructor(
Expand Down Expand Up @@ -56,15 +57,23 @@ export class S3ExplorerComponent implements OnInit {
}

if (prefix === '') {
this.aws.getBucketSizeBytes(this.currentBucket, 'StandardStorage').then((size) => {

const numOfObjs = this.aws.getBucketNumberOfObjects(this.currentBucket).then((number) => {
this.currentBucketNumberOfObjects = number;
});

const standardBucketSize = this.aws.getBucketSizeBytes(this.currentBucket, 'StandardStorage').then((size) => {
this.currentBucketSize = size;
});

this.aws.getBucketNumberOfObjects(this.currentBucket).then((number) => {
this.currentBucketNumberOfObjects = number;
this.spinner = false;
});
const standardIABucketSize = this.aws.getBucketSizeBytes(this.currentBucket, 'StandardIAStorage').then((size) => {
this.currentBucketSizeIA = size;
});

Promise.all([numOfObjs, standardBucketSize, standardIABucketSize]).then(() => {
this.spinner = false;
});

} else {
this.spinner = false;
}
Expand Down
41 changes: 41 additions & 0 deletions src/app/components/s3-stats/s3-stats.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<div class="flex-container" fxLayout fxLayoutGap="40px">
<div class="flex-element" fxFlex>
<mat-card>
<section class="mat-typography">
<h2>{{'PAGES.S3-STATS.TITLE' | translate}}</h2>
</section>
<mat-divider [inset]="true"></mat-divider>
<br>
<div *ngIf="!spinner">
<mat-form-field>
<mat-select [(ngModel)]="currentBucket" (ngModelChange)="selectBucket()" name="currentBucket"
[placeholder]="'PAGES.S3-EXPLORER.BUCKET' | translate">
<mat-option *ngFor="let bucket of buckets" [value]="bucket.Name">{{bucket.Name}}</mat-option>
</mat-select>
</mat-form-field>
<div *ngIf="currentBucket !== ''">
<h3>{{'PAGES.S3-STATS.SIZE-TITLE' | translate}}</h3>
<chart class="chart-canvas" [type]="type" [data]="data" [options]="options"></chart>
<br/>
<mat-divider></mat-divider>
<br/>
<h3>{{'PAGES.S3-STATS.NUMBER-OBJECTS-TITLE' | translate}}</h3>
<chart class="chart-canvas" [type]="type2" [data]="data2" [options]="options2"></chart>
</div>

<section *ngIf="buckets.length > 0 && currentBucket === ''" class="mat-typography">
<br>
<h2 class="no-job">{{'PAGES.S3-EXPLORER.NO-BUCKET-SELECTED' | translate}}</h2>
</section>

<section *ngIf="buckets.length === 0" class="mat-typography">
<br>
<h2 class="no-job">{{'PAGES.S3-EXPLORER.NO-BUCKET' | translate}}</h2>
</section>
</div>

<mat-spinner *ngIf="spinner" style="margin:0 auto;" [diameter]="40"></mat-spinner>

</mat-card>
</div>
</div>
3 changes: 3 additions & 0 deletions src/app/components/s3-stats/s3-stats.component.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.chart-canvas{
height: 300px;
}
25 changes: 25 additions & 0 deletions src/app/components/s3-stats/s3-stats.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { S3StatsComponent } from './s3-stats.component';

describe('S3StatsComponent', () => {
let component: S3StatsComponent;
let fixture: ComponentFixture<S3StatsComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ S3StatsComponent ]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(S3StatsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Loading

0 comments on commit d29ef23

Please sign in to comment.