1
0
Fork 0
forked from lthn/blockchain

Ui fix message failed (#225)

* fixed icon disappear on retina screens

* added error case FAILED and throw it to console with message:
Error: (${error}) was triggered by command: ${command}`
This commit is contained in:
Kirill 2020-10-10 14:09:48 +03:00 committed by GitHub
parent 06ce740345
commit a47e92d117
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 62 additions and 6 deletions

View file

@ -146,6 +146,9 @@ export class BackendService {
case 'ALREADY_EXISTS':
error_translate = 'ERRORS.FILE_EXIST';
break;
case 'FAILED':
BackendService.Debug(0, `Error: (${error}) was triggered by command: ${command}`);
break;
default:
error_translate = error;
}

View file

@ -0,0 +1,14 @@
import {Injectable} from '@angular/core';
@Injectable()
export class UtilsService {
getMinWidthByScale(scale: number) {
switch (scale) {
case 7.5 : return 900;
case 10 : return 1200;
case 12.5 : return 1500;
case 15 : return 1800;
default : return 1200;
}
}
}

View file

@ -8,11 +8,13 @@ import {ContextMenuComponent} from 'ngx-contextmenu';
import {IntToMoneyPipe} from './_helpers/pipes/int-to-money.pipe';
import {BigNumber} from 'bignumber.js';
import {ModalService} from './_helpers/services/modal.service';
import {UtilsService} from './_helpers/services/utils.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
styleUrls: ['./app.component.scss'],
providers: [UtilsService]
})
export class AppComponent implements OnInit, OnDestroy {
@ -37,7 +39,8 @@ export class AppComponent implements OnInit, OnDestroy {
public variablesService: VariablesService,
private ngZone: NgZone,
private intToMoneyPipe: IntToMoneyPipe,
private modalService: ModalService
private modalService: ModalService,
private utilsService: UtilsService
) {
translate.addLangs(['en', 'fr', 'de', 'it', 'pt']);
translate.setDefaultLang('en');
@ -553,6 +556,9 @@ export class AppComponent implements OnInit, OnDestroy {
this.renderer.addClass(document.body, 'theme-' + this.variablesService.defaultTheme);
}
if (this.variablesService.settings.hasOwnProperty('scale') && [7.5, 10, 12.5, 15].indexOf(this.variablesService.settings.scale) !== -1) {
const width = this.utilsService.getMinWidthByScale(this.variablesService.settings.scale);
const app = document.documentElement.querySelector('app-root');
this.renderer.setStyle(app, 'min-width', width + 'px');
this.renderer.setStyle(document.documentElement, 'font-size', this.variablesService.settings.scale + 'px');
}
} else {

View file

@ -71,9 +71,16 @@
}
&.received {
.status-transaction {
mask: url(../../assets/icons/receive.svg) no-repeat center;
background-color: transparent;
}
.status-transaction::after {
display: block;
content:'';
background:url("../../assets/icons/receive-green.svg") no-repeat center;
width: 13px;
height: 13px;
}
}
}

View file

@ -4,11 +4,13 @@ import {BackendService} from '../_helpers/services/backend.service';
import {FormControl, FormGroup, Validators} from '@angular/forms';
import {Location} from '@angular/common';
import { TranslateService } from '@ngx-translate/core';
import {UtilsService} from '../_helpers/services/utils.service';
@Component({
selector: 'app-settings',
templateUrl: './settings.component.html',
styleUrls: ['./settings.component.scss']
styleUrls: ['./settings.component.scss'],
providers: [UtilsService]
})
export class SettingsComponent implements OnInit {
@ -103,7 +105,8 @@ export class SettingsComponent implements OnInit {
private backend: BackendService,
private location: Location,
public translate: TranslateService,
private ngZone: NgZone
private ngZone: NgZone,
private utilsService: UtilsService
) {
this.theme = this.variablesService.settings.theme;
this.scale = this.variablesService.settings.scale;
@ -147,6 +150,9 @@ export class SettingsComponent implements OnInit {
setScale(scale) {
this.scale = scale;
this.variablesService.settings.scale = this.scale;
const width = this.utilsService.getMinWidthByScale(this.scale);
const app = document.documentElement.querySelector('app-root');
this.renderer.setStyle(app, 'min-width', width + 'px');
this.renderer.setStyle(document.documentElement, 'font-size', this.scale + 'px');
this.backend.storeAppData();
}

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="icons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 384 384" style="enable-background:new 0 0 384 384;" xml:space="preserve">
<style type="text/css">
.st0{fill:#5cda9d;}
</style>
<path id="receive" class="st0" d="M64.2,309.6l58.2-210.4l48.1,71.6L178,182l12.7,4.7l81.9,30.4L64.2,309.6 M0,384l384-170.3
l-178.7-66.4L106.3,0L0,384L0,384z"/>
</svg>

After

Width:  |  Height:  |  Size: 573 B

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="icons" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 384 384" style="enable-background:new 0 0 384 384;" xml:space="preserve">
<style type="text/css">
.st0{fill:#ff5252;}
</style>
<path id="send" class="st0" d="M319.8,74.4l-58.2,210.4l-48.1-71.6L206,202l-12.7-4.7l-81.9-30.4L319.8,74.4 M384,0L0,170.3
l178.7,66.4L277.7,384L384,0L384,0z"/>
</svg>

After

Width:  |  Height:  |  Size: 573 B