-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from jplomas/main
Bare-bones explorer functionality
- Loading branch information
Showing
9 changed files
with
312 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
let API = 'https://zeus-proxy.automated.theqrl.org' | ||
if (process.env.NODE_ENV === 'development') { | ||
API = 'https://cors-anywhere.herokuapp.com/https://zeus-proxy.automated.theqrl.org' | ||
} | ||
|
||
export default API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<template> | ||
<ion-page> | ||
<ion-header :translucent="true"> | ||
<ion-toolbar> | ||
<ion-buttons slot="start"> | ||
<ion-menu-button></ion-menu-button> | ||
</ion-buttons> | ||
<ion-title>QRL Explorer</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<ion-grid> | ||
<ion-row> | ||
<ion-col> | ||
<div class="ion-text-center"> | ||
Address:<br> | ||
{{id}}<br> | ||
<div v-if="error !== null">Error: {{error.message}}</div> | ||
<div v-if="info !== null"> | ||
Balance: {{info.data.state.balance}} Shor | ||
</div> | ||
<div v-if="info === null && error === null">Loading...</div> | ||
</div> | ||
</ion-col> | ||
</ion-row> | ||
</ion-grid> | ||
</ion-content> | ||
</ion-page> | ||
</template> | ||
|
||
<script lang="js"> | ||
import { IonGrid, IonCol, IonRow, IonButtons, IonButton, IonInput, IonLabel, IonItem, IonContent, IonHeader, IonMenuButton, IonPage, IonTitle, IonToolbar } from '@ionic/vue'; | ||
import { useRouter, useRoute } from 'vue-router'; | ||
import axios from 'axios'; | ||
import API from '../API' | ||
// import { ref, computed, watch } from 'vue'; | ||
export default { | ||
name: 'Address', | ||
components: { | ||
IonGrid, | ||
IonCol, | ||
IonRow, | ||
IonButtons, | ||
// IonButton, | ||
IonContent, | ||
IonHeader, | ||
IonMenuButton, | ||
IonPage, | ||
IonTitle, | ||
IonToolbar, | ||
// IonInput, | ||
// IonLabel, | ||
// IonItem | ||
}, | ||
data() { | ||
const route = useRoute() | ||
return { | ||
id: route.params.id, | ||
info: null, | ||
error: null | ||
} | ||
}, | ||
beforeMount() { | ||
axios | ||
.post(`${API}/grpc/testnet/GetOptimizedAddressState`, { address: this.id }, | ||
) | ||
.then(response => (this.info = response)) | ||
.catch(error => (this.error = error)) | ||
}, | ||
setup() { | ||
const router = useRouter() | ||
return { router }; | ||
}, | ||
methods: { | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
ion-menu-button { | ||
color: var(--ion-color-primary); | ||
} | ||
ion-content{ | ||
--background: #0b181e url('../img/dots.png') no-repeat bottom -250px right -400px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<template> | ||
<ion-page> | ||
<ion-header :translucent="true"> | ||
<ion-toolbar> | ||
<ion-buttons slot="start"> | ||
<ion-menu-button></ion-menu-button> | ||
</ion-buttons> | ||
<ion-title>QRL Explorer</ion-title> | ||
</ion-toolbar> | ||
</ion-header> | ||
<ion-content> | ||
<ion-grid> | ||
<ion-row> | ||
<ion-col> | ||
<div class="ion-text-center"> | ||
Block:<br> | ||
{{id}}<br> | ||
<div v-if="error !== null">Error: {{error.message}}</div> | ||
<div v-if="info !== null"> | ||
{{info.data}} | ||
</div> | ||
<div v-if="info === null && error === null">Loading...</div> | ||
</div> | ||
</ion-col> | ||
</ion-row> | ||
</ion-grid> | ||
</ion-content> | ||
</ion-page> | ||
</template> | ||
|
||
<script lang="js"> | ||
import { IonGrid, IonCol, IonRow, IonButtons, IonButton, IonInput, IonLabel, IonItem, IonContent, IonHeader, IonMenuButton, IonPage, IonTitle, IonToolbar } from '@ionic/vue'; | ||
import { useRouter, useRoute } from 'vue-router'; | ||
import axios from 'axios'; | ||
import API from '../API'; | ||
// import { ref, computed, watch } from 'vue'; | ||
export default { | ||
name: 'Block', | ||
components: { | ||
IonGrid, | ||
IonCol, | ||
IonRow, | ||
IonButtons, | ||
// IonButton, | ||
IonContent, | ||
IonHeader, | ||
IonMenuButton, | ||
IonPage, | ||
IonTitle, | ||
IonToolbar, | ||
// IonInput, | ||
// IonLabel, | ||
// IonItem | ||
}, | ||
data() { | ||
const route = useRoute() | ||
return { | ||
id: route.params.id, | ||
info: null, | ||
error: null | ||
} | ||
}, | ||
setup() { | ||
const router = useRouter() | ||
return { router }; | ||
}, | ||
beforeMount() { | ||
axios | ||
.post(`${API}/grpc/testnet/GetObject`, { query: this.id }, | ||
) | ||
.then(response => (this.info = response)) | ||
.catch(error => (this.error = error)) | ||
}, | ||
methods: { | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
ion-menu-button { | ||
color: var(--ion-color-primary); | ||
} | ||
ion-content{ | ||
--background: #0b181e url('../img/dots.png') no-repeat bottom -250px right -400px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.