Skip to content

Commit

Permalink
v0.5.2
Browse files Browse the repository at this point in the history
fix for multi account action history
  • Loading branch information
igorls committed Jun 18, 2018
1 parent 2d14d28 commit 4f0cc29
Show file tree
Hide file tree
Showing 8 changed files with 305 additions and 345 deletions.
56 changes: 28 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simpleos",
"version": "0.5.1",
"version": "0.5.2",
"productName": "simpleos",
"description": "EOS Blockchain Interface & Wallet",
"author": {
Expand Down Expand Up @@ -82,9 +82,9 @@
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.6.8",
"@angular/cli": "^6.0.8",
"@angular/compiler": "^6.0.4",
"@angular/compiler-cli": "^6.0.4",
"@angular/cli":"^6.0.8",
"@angular/compiler": "^6.0.5",
"@angular/compiler-cli": "^6.0.5",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "10.1.2",
Expand All @@ -94,20 +94,20 @@
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"bootstrap": "^4.1.1",
"bootstrap":"^4.1.1",
"codelyzer": "~4.2.1",
"core-js": "^2.5.4",
"electron": "2.0.2",
"electron-builder": "^20.15.1",
"electron-reload": "^1.2.2",
"eosjs": "^14.0.0",
"electron":"^2.0.2",
"electron-builder":"20.14.7",
"electron-reload":"^1.2.2",
"eosjs":"^15.0.0",
"hammerjs": "^2.0.8",
"jquery": "^3.3.1",
"moment": "^2.22.2",
"ng-lottie": "^0.3.1",
"ng-lottie":"^0.3.1",
"npm-run-all": "^4.1.3",
"popper.js": "^1.14.3",
"primeng": "^5.2.6",
"primeng":"^6.0.0-rc.1",
"protractor": "~5.3.0",
"rxjs": "^6.2.0",
"rxjs-compat": "^6.2.0",
Expand All @@ -119,20 +119,20 @@
"zone.js": "^0.8.26"
},
"dependencies": {
"@angular/animations": "^6.0.4",
"@angular/cdk": "^6.0.4",
"@angular/common": "^6.0.4",
"@angular/core": "^6.0.4",
"@angular/forms": "^6.0.4",
"@angular/http": "^6.0.4",
"@angular/language-service": "^6.0.4",
"@angular/material": "^6.0.4",
"@angular/platform-browser": "^6.0.4",
"@angular/platform-browser-dynamic": "^6.0.4",
"@angular/router": "^6.0.4",
"@clr/angular": "^0.12.0-rc.2",
"@clr/icons": "^0.12.0-rc.2",
"@clr/ui": "^0.12.0-rc.2",
"@angular/animations":"^6.0.5",
"@angular/cdk": "^6.0.5",
"@angular/common": "^6.0.5",
"@angular/core": "^6.0.5",
"@angular/forms": "^6.0.5",
"@angular/http": "^6.0.5",
"@angular/language-service": "^6.0.5",
"@angular/material": "^6.0.5",
"@angular/platform-browser": "^6.0.5",
"@angular/platform-browser-dynamic": "^6.0.5",
"@angular/router": "^6.0.5",
"@clr/angular": "^0.12.0",
"@clr/icons": "^0.12.0",
"@clr/ui": "^0.12.0",
"@fortawesome/angular-fontawesome": "^0.1.0-10",
"@fortawesome/fontawesome-pro-webfonts": "^1.0.9",
"@fortawesome/fontawesome-svg-core": "^1.2.0-11",
Expand All @@ -141,9 +141,9 @@
"@fortawesome/pro-regular-svg-icons": "^5.1.0-8",
"@fortawesome/pro-solid-svg-icons": "^5.1.0-8",
"electron-builder-squirrel-windows": "^20.15.0",
"electron-updater": "^2.21.10",
"electron-webpack": "^2.1.2",
"electron-updater":"^2.21.11",
"electron-webpack":"^2.1.2",
"menu": "^0.2.5",
"opn": "^5.3.0"
"opn":"^5.3.0"
}
}
66 changes: 33 additions & 33 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,42 @@ import {ConfigComponent} from './dashboard/config/config.component';
import {AboutComponent} from './dashboard/about/about.component';

const routes: Routes = [
{path: '', component: LandingComponent},
{
path: 'dashboard',
component: DashboardComponent,
children: [
{
path: 'wallet',
component: WalletComponent,
},
{
path: 'send',
component: SendComponent,
},
{
path: 'history',
component: HistoryComponent,
},
{
path: 'vote',
component: VoteComponent,
},
{
path: 'config',
component: ConfigComponent,
},
{
path: 'about',
component: AboutComponent,
}
]
}
{path: '', component: LandingComponent},
{
path: 'dashboard',
component: DashboardComponent,
children: [
{
path: 'wallet',
component: WalletComponent,
},
{
path: 'send',
component: SendComponent,
},
{
path: 'history',
component: HistoryComponent,
},
{
path: 'vote',
component: VoteComponent,
},
{
path: 'config',
component: ConfigComponent,
},
{
path: 'about',
component: AboutComponent,
}
]
}
];

@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule]
imports: [RouterModule.forRoot(routes, {useHash: true})],
exports: [RouterModule]
})
export class AppRoutingModule {
}
16 changes: 12 additions & 4 deletions src/app/dashboard/vote/vote.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<a role="tooltip" aria-haspopup="true" class="tooltip tooltip-lg tooltip-right">
<i class="far fa-question-circle blue"></i>
<span class="tooltip-content">Think of EOS as a farm. <br>
You need eos tokens to rent land on the farm. <br>
You need eos tokens to rent land on the farm and use its resources. <br>
In order to rent, you <strong>stake</strong> your tokens. <br>
When you stake, you also have power to vote, as a “resident” on the farm, but <strong>those tokens will be locked</strong> for use in transactions. <br>
When you unstake, your tokens will only be free for transfers after 3 days.
Expand All @@ -37,7 +37,7 @@
<div class="row">
<div class="col-lg-6">
<mat-form-field class="input-width">
<input matInput type="text" [min]="1/totalBalance" max="100" placeholder="Value (%)" (blur)="updateStakeValue(); checkPercent();"
<input matInput type="text" placeholder="Value (%)" (blur)="updateStakeValue(); checkPercent();"
[ngModel]="percenttoStake" (ngModelChange)="percenttoStake=$event" [textMask]="{mask: percentMask}">
<span class="suffix" matSuffix>%</span>
</mat-form-field>
Expand All @@ -60,6 +60,14 @@
style="margin-top: 14px" [disabled]="stakedisabled">Set Stake
</button>
<span class="error" *ngIf="this.stakerr !== ''">{{this.stakerr}}</span>
<a role="tooltip" aria-haspopup="true" class="tooltip tooltip-lg tooltip-right" *ngIf="minstake">
<i class="far fa-exclamation-circle error"></i>
<span class="tooltip-content">
Please, be careful when staking the minimum. <br>
This is not recommended if you want to do a lot of transactions, as you will have little CPU bandwidth and may have to wait long hours to stake again. <br>
However, if you just want to remove the tokens to an exchange, that is fine.
</span>
</a>
</div>
</div>
</div>
Expand Down Expand Up @@ -280,15 +288,15 @@ <h5 class="subtitle mt-0">You can vote for up to 30</h5>
<h3 *ngIf="stakingDiff > 0" class="modal-title text-white">Stake <span class="blue">+{{stakingHRV}}</span> ?</h3>
<h3 *ngIf="stakingDiff < 0" class="modal-title text-white">Unstake <span class="blue">{{stakingHRV}}</span> ?</h3>
<div class="modal-body">
<h4 class="text-white">Total staked will be: <span class="blue">{{valuetoStake | number}}</span></h4>
<h4 class="text-white">Total staked will be: <span class="blue">{{valuetoStake | number: '1.4-4'}}</span></h4>
<h4 class="text-white mt-0">Voting power will be: <span class="blue">{{percenttoStake | number}}%</span></h4>
<h5 *ngIf="stakingDiff > 0" class="mt-0">After staking, this tokens will be locked for at least 3 days.</h5>
<h5 *ngIf="stakingDiff < 0" class="mt-0">Your tokens will be free for transfers after 3 days.</h5>
</div>
<div class="modal-footer">
<form [formGroup]="passFormStake" class="modal-footer">
<mat-form-field>
<input #passtake matInput type="password" formControlName="pass" placeholder="Password">
<input #passtake matInput type="password" formControlName="pass" placeholder="Password" (keyup.enter)="callSetStake(passtake.value)">
<mat-hint class="error" align="start" *ngIf="wrongpass !== ''">
{{wrongpass}}
</mat-hint>
Expand Down
28 changes: 21 additions & 7 deletions src/app/dashboard/vote/vote.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {CryptoService} from '../../services/crypto.service';
export class VoteComponent implements OnInit, AfterViewInit {
max: number;
min: number;
minstake: boolean;
valuetoStake: string;
percenttoStake: string;
stakeModal: boolean;
Expand All @@ -38,9 +39,8 @@ export class VoteComponent implements OnInit, AfterViewInit {
percentMask = createNumberMask({
prefix: '',
allowDecimal: true,
decimalSymbol: '',
includeThousandsSeparator: false,
decimalLimit: 0,
decimalLimit: 1,
integerLimit: 3,
});
stakingDiff: number;
Expand All @@ -56,6 +56,7 @@ export class VoteComponent implements OnInit, AfterViewInit {
private toaster: ToasterService) {
this.max = 100;
this.min = 0;
this.minstake = false;
this.valuetoStake = '';
this.percenttoStake = '';
this.stakeModal = false;
Expand Down Expand Up @@ -120,12 +121,17 @@ export class VoteComponent implements OnInit, AfterViewInit {
this.showToast('success', 'Action broadcasted', 'Check your history for confirmation.');
this.aService.refreshFromChain();
}).catch((error) => {
console.log('Catch', error);
this.wrongpass = 'Something went wrong!';
console.log(JSON.parse(error));
if (JSON.parse(error).error.name === 'leeway_deadline_exception') {
this.wrongpass = 'Not enough CPU bandwidth to perform transaction. Try again later.';
} else {
this.wrongpass = JSON.parse(error).error.what;
}
this.busy = false;
});
} else {
this.wrongpass = 'Something went wrong!';
console.dir(data);
this.wrongpass = 'Catch2!';
this.busy = false;
}
}).catch(() => {
Expand Down Expand Up @@ -172,7 +178,11 @@ export class VoteComponent implements OnInit, AfterViewInit {

updateStakeValue() {
this.stakedisabled = false;
this.minstake = false;
this.valuetoStake = (this.totalBalance * (parseFloat(this.percenttoStake) / 100)).toString();
if (this.valuetoStake === '1') {
this.minstake = true;
}
}

updateStakePercent() {
Expand All @@ -181,10 +191,12 @@ export class VoteComponent implements OnInit, AfterViewInit {
}

checkPercent() {
this.minstake = false;
const min = 100 / this.totalBalance;
if (parseFloat(this.percenttoStake) < min) {
if (parseFloat(this.percenttoStake) <= min) {
this.percenttoStake = min.toString();
this.updateStakeValue();
this.minstake = true;
}
if (parseFloat(this.percenttoStake) > 100) {
this.percenttoStake = '100';
Expand All @@ -193,9 +205,11 @@ export class VoteComponent implements OnInit, AfterViewInit {
}

checkValue() {
if (parseFloat(this.valuetoStake) < 1) {
this.minstake = false;
if (parseFloat(this.valuetoStake) <= 1) {
this.valuetoStake = '1';
this.updateStakePercent();
this.minstake = true;
}
if (parseFloat(this.valuetoStake) > this.totalBalance) {
this.valuetoStake = this.totalBalance.toString();
Expand Down
Loading

0 comments on commit 4f0cc29

Please sign in to comment.