Skip to content

Commit

Permalink
Merge pull request #320 from GetScatter/ridl
Browse files Browse the repository at this point in the history
Ridl basic integration and various other fixes (see comment)
  • Loading branch information
nsjames authored Apr 22, 2019
2 parents 920a626 + b080c91 commit 537a645
Show file tree
Hide file tree
Showing 52 changed files with 1,631 additions and 545 deletions.
4 changes: 3 additions & 1 deletion electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ class NotificationService {
}
}

require("babel-polyfill")
const Transport = require('@ledgerhq/hw-transport-node-hid');

const NodeMachineId = require('node-machine-id');
Expand All @@ -251,13 +252,14 @@ const ecc = require("eosjs-ecc");
let seed, key;
ipcMain.on('key', (event, arg) => {
if(event.sender.history[0].indexOf('popout') > -1) return;
if(arg === null) key = null;
if(key) return;
key = arg;
});
ipcMain.on('seeding', (event, arg) => seed = arg);
ipcMain.on('seed', (event, arg) => {
const {data, sig} = arg;
if(!isDev && ecc.recover(sig, 'seed') !== key) return event.sender.send('seed', null);
if(!isDev && ecc.recover(sig, data) !== key) return event.sender.send('seed', null);
event.sender.send('seed', seed);
});

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "scatter",
"version": "10.1.2",
"version": "10.2.0",
"description": "Scatter Desktop Companion",
"private": true,
"main": "electron.js",
Expand Down Expand Up @@ -41,7 +41,7 @@
},
"dependencies": {
"@ledgerhq/hw-app-eth": "^4.23.0",
"@ledgerhq/hw-transport-node-hid": "^4.22.0",
"@ledgerhq/hw-transport-node-hid": "^4.54.0",
"aes-oop": "^1.0.4",
"animate.css": "^3.7.0",
"asn1-ber": "^1.0.9",
Expand All @@ -63,6 +63,7 @@
"node-notifier": "^5.3.0",
"scrypt-async": "^2.0.1",
"socket.io": "^2.1.1",
"tweetnacl": "^1.0.1",
"vue-markdown": "^2.2.4"
},
"devDependencies": {
Expand Down Expand Up @@ -120,7 +121,7 @@
"postcss-loader": "^2.1.6",
"postcss-url": "^7.2.1",
"qrcode": "^1.2.2",
"ridl": "^1.1.1",
"ridl": "^2.0.47",
"rimraf": "^2.6.0",
"sass-loader": "^7.1.0",
"selenium-server": "^3.14.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/Processes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<section :key="process.id" class="process" v-for="process in processes">
<figure class="kill icon-cancel" @click="process.kill()"></figure>
<figure class="title">
<span key="title" v-if="process.progress < 100">{{process.title}}</span>
<b key="done" v-else>Done!</b>
<span key="title">{{process.title}}</span>
<b key="done" v-if="process.progress === 100">Done!</b>
</figure>
<transition name="delayed-fade" mode="out-in">
<figure class="sub-title" v-if="process.subTitle && process.progress < 100">{{process.subTitle}}</figure>
Expand Down
5 changes: 4 additions & 1 deletion src/components/UserBar.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
<template>
<section class="user-bar" v-if="keypairs.length">
<section class="actions">
<router-link :to="{name:RouteNames.IDENTITY}" class="action">
<router-link :to="{name:RouteNames.IDENTITY, query:{ridl:false}}" class="action">
{{locale(langKeys.USER_BAR.ManageIdentity)}}
</router-link>
<router-link :to="{name:RouteNames.IDENTITY, query:{ridl:true}}" class="action">
RIDL
</router-link>

</section>

Expand Down
4 changes: 4 additions & 0 deletions src/components/panels/home/Apps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<section class="apps">
<section class="split-inputs">
<SearchBar style="flex:1; margin-left:-10px;" :placeholder="locale(langKeys.DASHBOARD.APPS.SearchPlaceholder)" v-on:terms="x => searchTerms = x" />
<btn v-if="permissions.length" small="1" borderless="1" v-on:clicked="removeAll" :text="locale(langKeys.GENERIC.RemoveAll)" />
<btn small="1" style="margin-right:30px; font-weight: normal;" v-on:clicked="goToApps" :text="locale(langKeys.GENERIC.Browse)" />
</section>

Expand Down Expand Up @@ -127,6 +128,9 @@
removePermissions(origin){
PermissionService.removeAllPermissionsFor(origin);
},
removeAll(){
PermissionService.removeAllPermissions();
},
goToPermission(origin){
this.$router.push({name:this.RouteNames.PERMISSION, params:{origin}})
},
Expand Down
52 changes: 26 additions & 26 deletions src/components/panels/keypair/KeypairDashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,31 @@

<section style="padding-bottom:20px;">

<section class="action-box top-pad">
<label>{{locale(langKeys.KEYPAIR.DASHBOARD.ADD_ACCOUNT.LinkEosAccountLabel)}}</label>
<p>{{locale(langKeys.KEYPAIR.DASHBOARD.ADD_ACCOUNT.LinkEosAccountDescription)}}</p>
<br>
<br>

<section class="key-val">
<section class="split-inputs">
<sel style="flex:1; margin-left:0;" :label="locale(langKeys.KEYPAIR.DASHBOARD.ADD_ACCOUNT.AccountNetworkLabel)"
:selected="manualAccountNetwork"
:options="eosNetworks"
:parser="network => network.name"
v-on:changed="x => manualAccountNetwork = x"></sel>

<cin style="margin-bottom:0; flex:1;"
:text="newAccountName"
v-on:changed="x => newAccountName = x"
placeholder="your.account@owner"
:label="locale(langKeys.GENERIC.AccountName)" />

<btn :disabled="invalidNewAccountName" :text="locale(langKeys.GENERIC.Add)" style="margin-top:20px; flex:0.2;"
red="1" v-on:clicked="manuallyAddAccount" />
</section>
</section>
</section>
<!--<section class="action-box top-pad">-->
<!--<label>{{locale(langKeys.KEYPAIR.DASHBOARD.ADD_ACCOUNT.LinkEosAccountLabel)}}</label>-->
<!--<p>{{locale(langKeys.KEYPAIR.DASHBOARD.ADD_ACCOUNT.LinkEosAccountDescription)}}</p>-->
<!--<br>-->
<!--<br>-->

<!--<section class="key-val">-->
<!--<section class="split-inputs">-->
<!--<sel style="flex:1; margin-left:0;" :label="locale(langKeys.KEYPAIR.DASHBOARD.ADD_ACCOUNT.AccountNetworkLabel)"-->
<!--:selected="manualAccountNetwork"-->
<!--:options="eosNetworks"-->
<!--:parser="network => network.name"-->
<!--v-on:changed="x => manualAccountNetwork = x"></sel>-->

<!--<cin style="margin-bottom:0; flex:1;"-->
<!--:text="newAccountName"-->
<!--v-on:changed="x => newAccountName = x"-->
<!--placeholder="your.account@owner"-->
<!--:label="locale(langKeys.GENERIC.AccountName)" />-->

<!--<btn :disabled="invalidNewAccountName" :text="locale(langKeys.GENERIC.Add)" style="margin-top:20px; flex:0.2;"-->
<!--red="1" v-on:clicked="manuallyAddAccount" />-->
<!--</section>-->
<!--</section>-->
<!--</section>-->

<section class="action-box top-pad" v-if="canCreateAccounts">
<label>{{locale(langKeys.KEYPAIR.DASHBOARD.ADD_ACCOUNT.CreateEosAccountLabel)}}</label>
Expand Down Expand Up @@ -163,7 +163,7 @@
return false;
},
canCreateAccounts(){
if(!this.keypair.external) return true;
if(this.keypair.external && this.keypair.accounts().length) return true;
if(this.accounts.find(x => x.blockchain() === Blockchains.EOSIO && !x.keypair().external)) return true;
return false;
},
Expand Down
4 changes: 4 additions & 0 deletions src/components/panels/keypair/existing/KeypairExport.vue
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@
.key {
font-size: 11px;
}
.public {
font-size: 11px;
}
}
.types {
Expand Down
12 changes: 9 additions & 3 deletions src/components/panels/settings/SettingsFirewall.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<label>{{locale(langKeys.SETTINGS.FIREWALL.ENABLED.Label)}}</label>
<p>{{locale(langKeys.SETTINGS.FIREWALL.ENABLED.Description)}}</p>

<btn :disabled="true" text="Coming Soon" />
<section class="switch bottomed" @click="toggleFirewall">
<figure class="dot" :class="{'disabled':!scatter.settings.firewall.enabled}"></figure>
</section>
</section>

</section>
Expand All @@ -21,14 +23,18 @@
}},
computed:{
...mapState([
'scatter',
]),
...mapGetters([
]),
},
methods: {
toggleFirewall(){
const scatter = this.scatter.clone();
scatter.settings.firewall.enabled = !scatter.settings.firewall.enabled;
this[Actions.SET_SCATTER](scatter);
},
...mapActions([
Actions.SET_SCATTER
])
Expand Down
2 changes: 1 addition & 1 deletion src/components/popins/fullscreen/ConfirmPassword.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
if(!this.password.length) return;
if(this.returnOnly) return this.returnResult(this.password);
const verified = await PasswordService.verifyPassword(this.password, false);
const verified = await PasswordService.verifyPassword(this.password);
if(!verified) PopupService.push(Popup.snackbarBadPassword());
this.returnResult(verified);
},
Expand Down
55 changes: 28 additions & 27 deletions src/components/popins/fullscreen/UnlinkAccount.vue
Original file line number Diff line number Diff line change
@@ -1,39 +1,40 @@
<template>
<section>
<back-bar v-on:back="returnResult(null)" />
<section class="panel-container limited">
<section class="head">
<figure class="icon icon-trash"></figure>
<figure class="title">{{locale(langKeys.POPINS.FULLSCREEN.UNLINK_ACCOUNT.Title)}}</figure>
<p>{{account.sendable()}}</p>

<br>
<section class="disclaimer less-pad red">
{{locale(langKeys.POPINS.FULLSCREEN.UNLINK_ACCOUNT.Desc)}}

<p v-if="authorities.length">
{{locale(langKeys.POPINS.FULLSCREEN.UNLINK_ACCOUNT.SubDesc)}}
</p>
<section v-if="account">
<section class="panel-container limited">
<section class="head">
<figure class="icon icon-trash"></figure>
<figure class="title">{{locale(langKeys.POPINS.FULLSCREEN.UNLINK_ACCOUNT.Title)}}</figure>
<p>{{account.sendable()}}</p>

<br>
<section class="disclaimer less-pad red">
{{locale(langKeys.POPINS.FULLSCREEN.UNLINK_ACCOUNT.Desc)}}

<p v-if="authorities.length">
{{locale(langKeys.POPINS.FULLSCREEN.UNLINK_ACCOUNT.SubDesc)}}
</p>
</section>
</section>
</section>


<section class="list">
<FlatList :label="locale(langKeys.POPINS.FULLSCREEN.UNLINK_ACCOUNT.AuthoritiesLabel)"
select-blue="1"
:selected="selectedAuthorities"
:items="authorities"
v-on:selected="addOrRemoveAuthority" />
<section class="list">
<FlatList :label="locale(langKeys.POPINS.FULLSCREEN.UNLINK_ACCOUNT.AuthoritiesLabel)"
select-blue="1"
:selected="selectedAuthorities"
:items="authorities"
v-on:selected="addOrRemoveAuthority" />
</section>
</section>



</section>
<section class="action-bar short bottom centered">
<btn :disabled="authorities.length > 1 && !selectedAuthorities.length"
:text="locale(langKeys.GENERIC.Confirm)" blue="1"
v-on:clicked="unlinkAccount" />
<section class="action-bar short bottom centered">
<btn :disabled="authorities.length > 1 && !selectedAuthorities.length"
:text="locale(langKeys.GENERIC.Confirm)" blue="1"
v-on:clicked="unlinkAccount" />
</section>
</section>

</section>
</template>

Expand Down
74 changes: 67 additions & 7 deletions src/components/popouts/PopOutHead.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,32 @@
<template>
<section class="pop-out-head">
<figure class="logo">Scatter</figure>
<section class="pop-out-head" :class="{'danger':reputation && reputation.decimal < 0}">
<section class="details">
<figure class="logo" v-if="!loadingRep && !reputation">Scatter</figure>
<figure class="reputation" v-if="reputation">
<ReputationScore class="score" :class="{'danger':reputation.decimal < 0}" :reputable="reputation" />
<section class="info">
<figure class="tag">RIDL Defender</figure>
<div class="blue" v-if="reputation.decimal > 0">Reported as <b>Trustworthy</b></div>
<div class="red" v-if="reputation.decimal < 0">Reported as <b>Dangerous</b></div>
</section>
</figure>
<figure v-if="loadingRep">
<i class="icon-spin4 animate-spin"></i>
</figure>
</section>
<figure v-if="!hideClose" class="close icon-cancel" @click="$emit('closed')"></figure>
</section>
</template>

<script>
import { mapActions, mapGetters, mapState } from 'vuex'
import ReputationScore from '../../components/reusable/ReputationScore';
export default {
props:['hideClose']
props:['hideClose', 'reputation', 'loadingRep'],
components:{
ReputationScore
},
}
</script>

Expand All @@ -27,12 +44,55 @@
border-bottom:1px solid #dfe0e1;
background:white;
.logo {
&.danger {
animation: danger-box 0.5s ease infinite;
@keyframes danger-box {
0%, 100% {
box-shadow:inset 0 0 0 0 transparent;
}
90% {
box-shadow:inset 0 0 0 3px red;
}
}
}
.details {
-webkit-app-region: drag;
flex:2;
font-family: 'Grand Hotel', sans-serif;
font-size: 30px;
color:$primary;
.logo {
font-family: 'Grand Hotel', sans-serif;
font-size: 30px;
color:$primary;
}
.reputation {
display:flex;
align-items: center;
.score {
}
.info {
padding-left:20px;
.tag {
font-size: 9px;
font-weight: bold;
color:$dark-grey;
}
div {
font-size: 14px;
&.blue { color:$blue; }
&.red { color:red; }
}
}
}
}
.close {
Expand Down
Loading

0 comments on commit 537a645

Please sign in to comment.