Skip to content

Commit

Permalink
minor changes and Loader
Browse files Browse the repository at this point in the history
  • Loading branch information
dulajsan committed Jan 20, 2019
1 parent d767ff6 commit ae89890
Show file tree
Hide file tree
Showing 53 changed files with 5,834 additions and 114 deletions.
37 changes: 37 additions & 0 deletions build_webpack/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"fonts/Open-Sans-regular.eot": "fonts/Open-Sans-regular.c35ad7c76819575781c833319c13711b.eot",
"fonts/Open-Sans-regular.ttf": "fonts/Open-Sans-regular.953de7bafd9fdbf41ea443aacabe2706.ttf",
"fonts/Open-Sans-regular.woff": "fonts/Open-Sans-regular.d0bad741aefb909e4be56d188b6f02b9.woff",
"fonts/Open-Sans-regular.woff2": "fonts/Open-Sans-regular.4124088fdd8c315a6d096b65b6cbf428.woff2",
"fonts/Oswald-300.eot": "fonts/Oswald-300.d6069ae58a6b125b1da3f6bd32ec4a12.eot",
"fonts/Oswald-300.ttf": "fonts/Oswald-300.6d9515af2c14dcad1a6dcaac59ab6363.ttf",
"fonts/Oswald-300.woff": "fonts/Oswald-300.55bb45b64b791d306a39e3af9791216a.woff",
"fonts/Oswald-300.woff2": "fonts/Oswald-300.1cd1aa124ab22433a697eea7e91cdcb2.woff2",
"fonts/Oswald-regular.eot": "fonts/Oswald-regular.31adcb0ebce77e9bf3fb797cf2fa65b4.eot",
"fonts/Oswald-regular.ttf": "fonts/Oswald-regular.8573096c5e435cde244a0483601020a2.ttf",
"fonts/Oswald-regular.woff": "fonts/Oswald-regular.4cd42bac8ebc77f27c60ce7ffe3bb975.woff",
"fonts/Oswald-regular.woff2": "fonts/Oswald-regular.29b3a057ac523422b12afa8f7cf692f7.woff2",
"fonts/brand-icons.eot": "fonts/brand-icons.13db00b7a34fee4d819ab7f9838cc428.eot",
"fonts/brand-icons.ttf": "fonts/brand-icons.c5ebe0b32dc1b5cc449a76c4204d13bb.ttf",
"fonts/brand-icons.woff": "fonts/brand-icons.a046592bac8f2fd96e994733faf3858c.woff",
"fonts/brand-icons.woff2": "fonts/brand-icons.e8c322de9658cbeb8a774b6624167c2c.woff2",
"fonts/icons.eot": "fonts/icons.8e3c7f5520f5ae906c6cf6d7f3ddcd19.eot",
"fonts/icons.ttf": "fonts/icons.b87b9ba532ace76ae9f6edfe9f72ded2.ttf",
"fonts/icons.woff": "fonts/icons.faff92145777a3cbaf8e7367b4807987.woff",
"fonts/icons.woff2": "fonts/icons.0ab54153eeeca0ce03978cc463b257f7.woff2",
"fonts/outline-icons.eot": "fonts/outline-icons.701ae6abd4719e9c2ada3535a497b341.eot",
"fonts/outline-icons.ttf": "fonts/outline-icons.ad97afd3337e8cda302d10ff5a4026b8.ttf",
"fonts/outline-icons.woff": "fonts/outline-icons.ef60a4f6c25ef7f39f2d25a748dbecfe.woff",
"fonts/outline-icons.woff2": "fonts/outline-icons.cd6c777f1945164224dee082abaea03a.woff2",
"main.css": "static/css/main.b725e89f.css",
"main.css.map": "static/css/main.b725e89f.css.map",
"main.js": "static/js/main.60526f44.js",
"main.js.map": "static/js/main.60526f44.js.map",
"static/media/Open-Sans-regular.svg": "static/media/Open-Sans-regular.7e735d7a.svg",
"static/media/Oswald-300.svg": "static/media/Oswald-300.fe401aad.svg",
"static/media/Oswald-regular.svg": "static/media/Oswald-regular.48b6c164.svg",
"static/media/brand-icons.svg": "static/media/brand-icons.a1a749e8.svg",
"static/media/flags.png": "static/media/flags.9c74e172.png",
"static/media/icons.svg": "static/media/icons.962a1bf3.svg",
"static/media/outline-icons.svg": "static/media/outline-icons.82f60bd0.svg"
}
Binary file added build_webpack/favicon.ico
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added build_webpack/images/avatar/large/matthew.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 build_webpack/images/avatar/small/matthew.jpg
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 build_webpack/images/avatar/small/prof.jpg
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 build_webpack/images/avatar/small/prof.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 build_webpack/images/avatar/small/user.jpeg
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 build_webpack/images/voting/voting.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 build_webpack/images/wireframe/wire.jpeg
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 build_webpack/images/wireframe/wire.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions build_webpack/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="shortcut icon" href="/favicon.ico"><title>Truffle Box</title><link href="/static/css/main.b725e89f.css" rel="stylesheet"></head><body><div id="root"></div><script type="text/javascript" src="/static/js/main.60526f44.js"></script></body></html>
419 changes: 419 additions & 0 deletions build_webpack/static/css/main.b725e89f.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build_webpack/static/css/main.b725e89f.css.map

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

29 changes: 29 additions & 0 deletions build_webpack/static/js/main.60526f44.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build_webpack/static/js/main.60526f44.js.map

Large diffs are not rendered by default.

1,637 changes: 1,637 additions & 0 deletions build_webpack/static/media/Open-Sans-regular.7e735d7a.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
335 changes: 335 additions & 0 deletions build_webpack/static/media/Oswald-300.fe401aad.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
347 changes: 347 additions & 0 deletions build_webpack/static/media/Oswald-regular.48b6c164.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,008 changes: 1,008 additions & 0 deletions build_webpack/static/media/brand-icons.a1a749e8.svg
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 build_webpack/static/media/flags.9c74e172.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,518 changes: 1,518 additions & 0 deletions build_webpack/static/media/icons.962a1bf3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
366 changes: 366 additions & 0 deletions build_webpack/static/media/outline-icons.82f60bd0.svg
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 public/images/wireframe/short-paragraph.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
180 changes: 90 additions & 90 deletions src/abi/ElectionContract.js
Original file line number Diff line number Diff line change
@@ -1,94 +1,94 @@
const ElectionContract=[
{
"constant": true,
"inputs": [
{
"name": "candidate",
"type": "uint256"
}
],
"name": "validCandidate",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "candidate",
"type": "uint256"
}
],
"name": "voteForCandidate",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "candidate",
"type": "uint256"
}
],
"name": "totalVotesFor",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "candidateList",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "votesReceived",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
{
"constant": true,
"inputs": [
{
"name": "candidate",
"type": "uint256"
}
],
"name": "validCandidate",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "candidate",
"type": "uint256"
}
],
"name": "voteForCandidate",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "candidate",
"type": "uint256"
}
],
"name": "totalVotesFor",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "candidateList",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "votesReceived",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
]

export { ElectionContract };
2 changes: 1 addition & 1 deletion src/voter/ui/electionForm/ElectionForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class ElectionForm extends Component {
}
]

ElectioncontractInstance = web3.eth.contract(abi).at('0x1716ce1d1A782A1591152156fE978F4aFe6878FD')
ElectioncontractInstance = web3.eth.contract(abi).at('0xB0110635A904588BaCC1DA6Ac1c8dd651f323864')
const { voteForCandidate } = ElectioncontractInstance

web3.eth.getCoinbase((error, coinbase) => {
Expand Down
10 changes: 9 additions & 1 deletion src/voter/ui/proof/ProofForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ render(){
return(

<div>

<a href='/sha256hashgenerate.code' download>
<Button> Download Arithmatic circuit </Button>
</a>
<a href='/sha256hashgenerate.code' download>
<Button> Download Proving Key </Button>
</a>
<br/><br/>
<div className="files">
<Files

Expand All @@ -54,7 +62,7 @@ render(){

<Header icon>
<Icon name='file code' />
Drop files here or click to upload
Drop Proof file here or click to upload
</Header>

</Segment>
Expand Down
2 changes: 1 addition & 1 deletion src/voter/ui/results/Results.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ queryNumofCandidates (){
var candidateContractInstance;
var ElectioncontractInstance
candidateContractInstance=web3.eth.contract(candidateContract).at('0x8B74F1C1235f2dC2821338bcA739cD70306D394F')
ElectioncontractInstance = web3.eth.contract(ElectionContract).at('0x1716ce1d1A782A1591152156fE978F4aFe6878FD')
ElectioncontractInstance = web3.eth.contract(ElectionContract).at('0xB0110635A904588BaCC1DA6Ac1c8dd651f323864')
const { getNumOfCandidates } = candidateContractInstance;
const { totalVotesFor } = ElectioncontractInstance;
getNumOfCandidates((err,num)=>{
Expand Down
41 changes: 23 additions & 18 deletions src/voter/ui/voterList/voterList.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react'
import { VoterContract } from './../../../abi/voterContract'
import store from '../../../store'
import { Form,Input,Grid,Icon,Card,Image, Loader,Button } from "semantic-ui-react";
import { Form,Input,Grid,Icon,Card,Image, Loader,Button, Container } from "semantic-ui-react";

class VoterList extends Component {

Expand Down Expand Up @@ -226,19 +226,23 @@ class VoterList extends Component {

return(
<div>
<Container>
<Grid>
<Grid.Row centered>
<Grid.Column width={6}>
<Form>
<Form.Group widths="equal">
<Input focus label="voter id" placeholder='Search...' name="voterid" onChange={this.handleChange}/>
</Form.Group>
<Form.Group inline>
<Form.Button onClick={this.queryVoterDetails.bind(this)} primary>Search</Form.Button>
<Form.Button onClick={this.clearGrid.bind(this)}>Reset</Form.Button>
</Form.Group>
</Form>
</Grid.Column>
</Grid.Row>
</Grid>

<Form>
<Form.Group widths="equal">
<Input focus label="voter id" placeholder='Search...' name="voterid" onChange={this.handleChange}/>
</Form.Group>
<Form.Group inline>
<Form.Button onClick={this.queryVoterDetails.bind(this)} primary>Search</Form.Button>
<Form.Button onClick={this.clearGrid.bind(this)}>Reset</Form.Button>
</Form.Group>
</Form>


<br/><br/>
<Grid celled className={this.state.is_grid_visible? "visible" : "hidden"}>
<Grid.Row>
<Grid.Column width={3}>
Expand Down Expand Up @@ -283,17 +287,18 @@ class VoterList extends Component {
</Form.Field>
</Form>
<br/>
<Button positive onClick={this.to_be_added_list}>To be Added List</Button>
<Button negative onClick={this.to_be_deleted_list}>To be Deleted List</Button>
<Button onClick={this.to_be_added_list}>To be Accepted List</Button>
<Button onClick={this.to_be_deleted_list}>To be Rejected List</Button>
<br/><br/><br/>
<Button positive onClick={this.deleteVoter}>Delete</Button>
<Button negative onClick={this.verifyVoter}>Verify</Button>
<Button negative onClick={this.resetVoter}>Reset</Button>
<Button onClick={this.deleteVoter}>Reject</Button>
<Button onClick={this.verifyVoter}>Accept</Button>
<Button onClick={this.resetVoter}>Reset</Button>
<br/><br/><br/>
<Button primary>View Documents</Button>
</Grid.Column>
</Grid.Row>
</Grid>
</Container>
</div>
)
}
Expand Down
14 changes: 11 additions & 3 deletions src/voter/ui/voterRegistration/VoterRegForm.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react'
import store from '../../../store'
import { VoterContract } from './../../../abi/voterContract'
import { Form } from "semantic-ui-react";
import { Form, Loader, Dimmer, Image } from "semantic-ui-react";



Expand All @@ -13,6 +13,7 @@ class VoterRegForm extends Component {
this.handleChange=this.handleChange.bind(this)
this.handleSubmit=this.handleSubmit.bind(this)
this.getTransactionReceiptMined=this.getTransactionReceiptMined.bind(this);
this.state = { loaderstate: false}

}

Expand Down Expand Up @@ -81,14 +82,15 @@ getTransactionReceiptMined = function getTransactionReceiptMined(txHash, interva
console.error(error);
}


that.setState({ loaderstate: true})
voterContractInstance=voterCon;
voterContractInstance.addVoter(fullname,nic,secret0,secret1,{from: coinbase}, (error, txHash) => {
if (error) { throw error }
// console.log(txHash)
txhash = txHash;
return this.getTransactionReceiptMined(txhash).then(function (receipt) {
if(receipt.status = '0x1'){
that.setState = { loaderstate: false}
that.props.onClickNextUi();
}
});
Expand All @@ -104,9 +106,15 @@ getTransactionReceiptMined = function getTransactionReceiptMined(txHash, interva

render() {


return(
<div>
<Form onSubmit={this.handleSubmit.bind(this)}>

<Form onSubmit={this.handleSubmit.bind(this)} >
<Dimmer active={this.state.loaderstate} inverted>
<Loader inverted />
</Dimmer>

<Form.Group widths="equal">
<Form.Input fluid label="First name" id="name" placeholder="Full Name" onChange={this.handleChange}/>
<Form.Input fluid label="NIC" id="nic" placeholder="NIC No" onChange={this.handleChange}/>
Expand Down

0 comments on commit ae89890

Please sign in to comment.