trusted-setup-server/pages/index.vue

153 lines
4.4 KiB
Vue
Raw Normal View History

2020-01-29 11:54:03 +01:00
<template>
2020-01-30 09:38:32 +01:00
<div class="ceremony">
<h1 class="title is-size-1 is-size-2-mobile is-spaced">
Tornado.cash <span>Trusted Setup Ceremony</span>
</h1>
2020-02-05 19:43:56 +01:00
<p class="p is-size-6">
zk-SNARKs require a pre-existing setup between the prover and verifier. A set of public
parameters define the rules of the game for the construction of zk-SNARKs. Please contribute
with your source of entropy, so that tornado.cash can be trustless.
2020-01-30 09:38:32 +01:00
</p>
2020-01-29 14:13:06 +01:00
<div class="buttons is-centered">
<b-button type="is-primary" outlined tag="router-link" to="/make-contribution">
2020-01-30 09:55:40 +01:00
Make the contribution
</b-button>
2020-01-30 09:38:32 +01:00
</div>
2020-02-05 16:02:34 +01:00
<div class="currently">
Currently there are <span>{{ contributions.length }}</span> contributions
</div>
<b-table
:data="filteredContributions"
:hoverable="true"
:mobile-cards="false"
:per-page="rowsPerPage"
paginated
pagination-position="both"
>
<template slot-scope="props">
<b-table-column field="id" label="#" width="40" numeric>
{{ props.row.id }}
</b-table-column>
<b-table-column label="Account">
2020-02-05 14:31:37 +01:00
<a
2020-02-05 16:02:34 +01:00
v-if="props.row.handle"
:href="`https://${props.row.socialType}.com/${props.row.handle}`"
2020-02-05 14:31:37 +01:00
class="social-link"
target="_blank"
>
<span :class="`icon-${props.row.socialType}`" class="icon"></span>
2020-02-05 16:02:34 +01:00
@{{ props.row.handle }}
2020-02-05 14:31:37 +01:00
</a>
<div v-else class="social-link">
<span :class="`icon-${props.row.socialType}`" class="icon"></span>
2020-02-05 16:02:34 +01:00
Anonymous
2020-02-05 14:31:37 +01:00
</div>
</b-table-column>
<b-table-column field="name" label="Name">
{{ props.row.name }}
</b-table-column>
<b-table-column field="company" label="Company">
{{ props.row.company }}
</b-table-column>
2020-02-05 16:02:34 +01:00
<b-table-column :centered="true" label="Attestation">
2020-02-06 12:40:46 +01:00
<a
v-if="props.row.attestation"
:href="props.row.attestation"
target="_blank"
class="button is-icon"
>
<span class="icon icon-link"></span>
</a>
</b-table-column>
</template>
<template slot="empty">
<section class="section">
<div class="content has-text-centered">
<p>
<span class="icon icon-emoticon-sad icon-48px"></span>
</p>
<p>Nothing here.</p>
</div>
</section>
</template>
<template slot="top-left">
<b-field class="table-search">
<b-input
v-model="contributionSearch"
placeholder="Search..."
type="search"
icon="magnify"
></b-input>
</b-field>
</template>
<template slot="bottom-left">
<b-field horizontal label="Show">
<b-dropdown v-model="rowsPerPage" expanded aria-role="list" position="is-top-right">
<div slot="trigger" class="control">
<div class="input">
<span>{{ rowsPerPage }}</span>
</div>
</div>
<b-dropdown-item
2020-02-05 11:53:45 +01:00
v-for="(rows, index) in [3, 10, 15, 20, 50]"
:key="index"
:value="rows"
aria-role="listitem"
>
{{ rows }}
</b-dropdown-item>
</b-dropdown>
</b-field>
</template>
</b-table>
2020-01-29 14:13:06 +01:00
</div>
2020-01-29 11:54:03 +01:00
</template>
2020-01-29 14:48:42 +01:00
<script>
export default {
data() {
return {
2020-02-05 16:02:34 +01:00
contributions: [],
// contributions: [
// {
// id: 1,
// socialType: 'twitter',
// account: '@VitalikButerin',
// name: 'Vitalik Buterin',
// company: 'Ethereum',
// attestation: 'https://twitter.com/VitalikButerin/status/1220158987456237568',
// contribution: '#'
// }
// ],
rowsPerPage: 10,
contributionSearch: ''
2020-01-30 13:15:42 +01:00
}
},
computed: {
filteredContributions() {
return this.contributions.filter((contribution) => {
2020-02-05 16:02:34 +01:00
const name = contribution.name || 'anonymous'
return name.toLowerCase().includes(this.contributionSearch.toLowerCase())
})
2020-01-29 14:48:42 +01:00
}
2020-02-05 16:02:34 +01:00
},
async mounted() {
try {
const response = await fetch('/api/contributions')
const data = await response.json()
this.contributions = data
} catch (e) {
console.error('e', e)
}
2020-01-29 14:48:42 +01:00
}
}
</script>