mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-04-29 22:37:52 +00:00
Update deps and upgrade to latest vaadin. Minor fixes
This commit is contained in:
parent
4f5d3ad138
commit
fcdd4c99ea
@ -15,10 +15,10 @@ const aliases = {
|
|||||||
const generateRollupConfig = (inputFile, outputFile) => {
|
const generateRollupConfig = (inputFile, outputFile) => {
|
||||||
return {
|
return {
|
||||||
inputOptions: {
|
inputOptions: {
|
||||||
onwarn: (warning, rollupWarn) => {
|
onwarn(warning, warn) {
|
||||||
if (warning.code !== "CIRCULAR_DEPENDENCY") {
|
if (warning.code === 'THIS_IS_UNDEFINED') return;
|
||||||
rollupWarn(warning);
|
if (warning.code !== 'CIRCULAR_DEPENDENCY') throw new Error(warning.message);
|
||||||
}
|
warn(warning);
|
||||||
},
|
},
|
||||||
input: inputFile,
|
input: inputFile,
|
||||||
plugins: [
|
plugins: [
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"emoji-picker-js": "https://github.com/Qortal/emoji-picker-js"
|
"emoji-picker-js": "https://github.com/Qortal/emoji-picker-js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.17.2",
|
"@babel/core": "^7.17.5",
|
||||||
"@github/time-elements": "^3.1.2",
|
"@github/time-elements": "^3.1.2",
|
||||||
"@material/mwc-button": "^0.25.3",
|
"@material/mwc-button": "^0.25.3",
|
||||||
"@material/mwc-dialog": "^0.25.3",
|
"@material/mwc-dialog": "^0.25.3",
|
||||||
@ -39,11 +39,11 @@
|
|||||||
"@rollup/plugin-commonjs": "^21.0.1",
|
"@rollup/plugin-commonjs": "^21.0.1",
|
||||||
"@rollup/plugin-node-resolve": "^13.1.3",
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
||||||
"@rollup/plugin-replace": "^3.1.0",
|
"@rollup/plugin-replace": "^3.1.0",
|
||||||
"@vaadin/vaadin-grid": "^5.9.3",
|
"@vaadin/grid": "^22.0.5",
|
||||||
"epml": "^0.3.3",
|
"epml": "^0.3.3",
|
||||||
"html-escaper": "^3.0.3",
|
"html-escaper": "^3.0.3",
|
||||||
"lit": "^2.1.3",
|
"lit": "^2.2.0",
|
||||||
"rollup": "^2.67.2",
|
"rollup": "^2.67.3",
|
||||||
"rollup-plugin-node-globals": "^1.4.0",
|
"rollup-plugin-node-globals": "^1.4.0",
|
||||||
"rollup-plugin-progress": "^1.1.2",
|
"rollup-plugin-progress": "^1.1.2",
|
||||||
"rollup-plugin-terser": "^7.0.2"
|
"rollup-plugin-terser": "^7.0.2"
|
||||||
|
@ -2,11 +2,9 @@ import { LitElement, html, css } from 'lit'
|
|||||||
import { Epml } from '../../../epml.js'
|
import { Epml } from '../../../epml.js'
|
||||||
|
|
||||||
import { escape, unescape } from 'html-escaper';
|
import { escape, unescape } from 'html-escaper';
|
||||||
import { inputKeyCodes } from '../../utils/keyCodes.js';
|
import { inputKeyCodes } from '../../utils/keyCodes.js'
|
||||||
|
|
||||||
import './ChatScroller.js'
|
import './ChatScroller.js'
|
||||||
import './TimeAgo.js'
|
import './TimeAgo.js'
|
||||||
|
|
||||||
import { EmojiPicker } from 'emoji-picker-js';
|
import { EmojiPicker } from 'emoji-picker-js';
|
||||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||||
|
|
||||||
|
@ -46,7 +46,6 @@ class TimeAgo extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
firstUpdated() {
|
firstUpdated() {
|
||||||
// ...
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
import { LitElement, html, css } from 'lit'
|
||||||
import { Epml } from '../../../epml.js'
|
import { Epml } from '../../../epml.js'
|
||||||
|
|
||||||
|
|
||||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||||
|
|
||||||
class ToolTip extends LitElement {
|
class ToolTip extends LitElement {
|
||||||
@ -92,7 +91,6 @@ class ToolTip extends LitElement {
|
|||||||
})
|
})
|
||||||
parentEpml.subscribe('config', c => {
|
parentEpml.subscribe('config', c => {
|
||||||
if (!configLoaded) {
|
if (!configLoaded) {
|
||||||
// setTimeout(getGroupIdFromURL, 1)
|
|
||||||
configLoaded = true
|
configLoaded = true
|
||||||
}
|
}
|
||||||
this.config = JSON.parse(c)
|
this.config = JSON.parse(c)
|
||||||
|
@ -6,11 +6,9 @@ import '@material/mwc-icon'
|
|||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
import '@material/mwc-textfield'
|
import '@material/mwc-textfield'
|
||||||
import '@material/mwc-dialog'
|
import '@material/mwc-dialog'
|
||||||
|
|
||||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||||
import '@vaadin/vaadin-grid/vaadin-grid.js'
|
import '@vaadin/grid/vaadin-grid.js'
|
||||||
import '@vaadin/vaadin-grid/theme/material/all-imports.js'
|
import '@vaadin/grid/theme/material/all-imports.js'
|
||||||
|
|
||||||
import '@github/time-elements'
|
import '@github/time-elements'
|
||||||
|
|
||||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||||
@ -143,7 +141,7 @@ class GroupManagement extends LitElement {
|
|||||||
|
|
||||||
<div class="divCard">
|
<div class="divCard">
|
||||||
<h3 style="margin: 0; margin-bottom: 1em; text-align: center;">Your Joined Groups</h3>
|
<h3 style="margin: 0; margin-bottom: 1em; text-align: center;">Your Joined Groups</h3>
|
||||||
<vaadin-grid id="joinedGroupsGrid" style="height:auto;" ?hidden="${this.isEmptyArray(this.joinedGroups)}" aria-label="Joined Groups" .items="${this.joinedGroups}" height-by-rows>
|
<vaadin-grid theme="compact" id="joinedGroupsGrid" ?hidden="${this.isEmptyArray(this.joinedGroups)}" .items="${this.joinedGroups}" aria-label="Joined Groups" all-rows-visible>
|
||||||
<vaadin-grid-column header="Name" path="groupName"></vaadin-grid-column>
|
<vaadin-grid-column header="Name" path="groupName"></vaadin-grid-column>
|
||||||
<vaadin-grid-column header="Description" path="description"></vaadin-grid-column>
|
<vaadin-grid-column header="Description" path="description"></vaadin-grid-column>
|
||||||
<vaadin-grid-column width="9.8rem" flex-grow="0" header="Role" .renderer=${(root, column, data) => {
|
<vaadin-grid-column width="9.8rem" flex-grow="0" header="Role" .renderer=${(root, column, data) => {
|
||||||
@ -160,7 +158,7 @@ class GroupManagement extends LitElement {
|
|||||||
|
|
||||||
<div class="divCard">
|
<div class="divCard">
|
||||||
<h3 style="margin: 0; margin-bottom: 1em; text-align: center;">Public Groups</h3>
|
<h3 style="margin: 0; margin-bottom: 1em; text-align: center;">Public Groups</h3>
|
||||||
<vaadin-grid id="publicGroupsGrid" style="height:auto;" ?hidden="${this.isEmptyArray(this.publicGroups)}" aria-label="Public Open Groups" .items="${this.publicGroups}" height-by-rows>
|
<vaadin-grid theme="compact" id="publicGroupsGrid" ?hidden="${this.isEmptyArray(this.publicGroups)}" .items="${this.publicGroups}" aria-label="Public Open Groups" all-rows-visible>
|
||||||
<vaadin-grid-column path="groupName"></vaadin-grid-column>
|
<vaadin-grid-column path="groupName"></vaadin-grid-column>
|
||||||
<vaadin-grid-column header="Description" path="description"></vaadin-grid-column>
|
<vaadin-grid-column header="Description" path="description"></vaadin-grid-column>
|
||||||
<vaadin-grid-column path="owner"></vaadin-grid-column>
|
<vaadin-grid-column path="owner"></vaadin-grid-column>
|
||||||
|
@ -1,19 +1,8 @@
|
|||||||
import { LitElement, html, css } from 'lit'
|
import { LitElement, html, css } from 'lit'
|
||||||
// import { render } from 'lit/html.js'
|
|
||||||
// import { Epml } from '../../../src/epml.js'
|
|
||||||
import { Epml } from '../../../../epml.js'
|
import { Epml } from '../../../../epml.js'
|
||||||
|
|
||||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||||
|
|
||||||
// import * as thing from 'time-elements'
|
|
||||||
// import '@vaadin/vaadin-grid/vaadin-grid.js'
|
|
||||||
// import '@vaadin/vaadin-grid/theme/material/all-imports.js'
|
|
||||||
|
|
||||||
// import '@material/mwc-icon'
|
|
||||||
// import '@material/mwc-textfield'
|
|
||||||
// import '@material/mwc-button'
|
|
||||||
// import '@material/mwc-dialog'
|
|
||||||
|
|
||||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||||
|
|
||||||
class GroupTransaction extends LitElement {
|
class GroupTransaction extends LitElement {
|
||||||
@ -75,7 +64,6 @@ class GroupTransaction extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.group-transaction-card {
|
.group-transaction-card {
|
||||||
/* margin:12px; */
|
|
||||||
padding:12px 24px;
|
padding:12px 24px;
|
||||||
background:#fff;
|
background:#fff;
|
||||||
border-radius:2px;
|
border-radius:2px;
|
||||||
@ -132,121 +120,16 @@ class GroupTransaction extends LitElement {
|
|||||||
render() {
|
render() {
|
||||||
return html`
|
return html`
|
||||||
<div id="group-transaction-page">
|
<div id="group-transaction-page">
|
||||||
|
|
||||||
<div class="group-transaction-card">
|
<div class="group-transaction-card">
|
||||||
<h2>Group Transaction</h2>
|
<h2>Group Transaction</h2>
|
||||||
|
|
||||||
<p>${this.addMintingAccountMessage}</p>
|
<p>${this.addMintingAccountMessage}</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
|
|
||||||
// getMintingAccountGrid() {
|
|
||||||
|
|
||||||
// const myGrid = this.shadowRoot.querySelector('#mintingAccountsGrid')
|
|
||||||
|
|
||||||
// myGrid.addEventListener('click', (e) => {
|
|
||||||
// this.tempMintingAccount = myGrid.getEventContext(e).item
|
|
||||||
|
|
||||||
// this.shadowRoot.querySelector('#removeMintingAccountDialog').show()
|
|
||||||
// })
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// addPeer(e) {
|
|
||||||
// this.addPeerLoading = true
|
|
||||||
// const addPeerAddress = this.shadowRoot.querySelector('#addPeerAddress').value
|
|
||||||
|
|
||||||
// parentEpml.request('apiCall', {
|
|
||||||
// url: `/peers`,
|
|
||||||
// method: 'POST',
|
|
||||||
// body: addPeerAddress
|
|
||||||
// }).then(res => {
|
|
||||||
// this.addPeerMessage = res.message
|
|
||||||
|
|
||||||
// this.addPeerLoading = false
|
|
||||||
// })
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// addMintingAccount(e) {
|
|
||||||
// this.addMintingAccountLoading = true
|
|
||||||
// this.addMintingAccountMessage = "Loading..."
|
|
||||||
|
|
||||||
// this.addMintingAccountKey = this.shadowRoot.querySelector('#addMintingAccountKey').value
|
|
||||||
|
|
||||||
// parentEpml.request('apiCall', {
|
|
||||||
// url: `/admin/mintingaccounts`,
|
|
||||||
// method: 'POST',
|
|
||||||
// body: this.addMintingAccountKey
|
|
||||||
// }).then(res => {
|
|
||||||
// if (res === true) {
|
|
||||||
// this.updateMintingAccounts()
|
|
||||||
// this.addMintingAccountKey = ''
|
|
||||||
// this.addMintingAccountMessage = 'Minting Node Added Successfully!'
|
|
||||||
// this.addMintingAccountLoading = false
|
|
||||||
// } else {
|
|
||||||
// this.addMintingAccountKey = ''
|
|
||||||
// this.addMintingAccountMessage = 'Failed to Add Minting Node!' // Corrected an error here thanks to crow (-_-)
|
|
||||||
// this.addMintingAccountLoading = false
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
|
|
||||||
// updateMintingAccounts() {
|
|
||||||
// parentEpml.request('apiCall', {
|
|
||||||
// url: `/admin/mintingaccounts`
|
|
||||||
// }).then(res => {
|
|
||||||
|
|
||||||
// this.mintingAccounts = []
|
|
||||||
// setTimeout(() => { this.mintingAccounts = res }, 1)
|
|
||||||
// })
|
|
||||||
|
|
||||||
// // setTimeout(updateMintingAccounts, this.config.user.nodeSettings.pingInterval) // Perhaps should be slower...?
|
|
||||||
// }
|
|
||||||
|
|
||||||
// removeMintingAccount(e) {
|
|
||||||
// this.removeMintingAccountLoading = true
|
|
||||||
// this.removeMintingAccountMessage = "Loading..."
|
|
||||||
|
|
||||||
// this.removeMintingAccountKey = this.shadowRoot.querySelector('#removeMintingAccountKey').value
|
|
||||||
|
|
||||||
// this.mintingAccounts.forEach(mintingAccount => {
|
|
||||||
// if (this.tempMintingAccount.recipientAccount === mintingAccount.recipientAccount) {
|
|
||||||
|
|
||||||
// parentEpml.request('apiCall', {
|
|
||||||
// url: `/admin/mintingaccounts`,
|
|
||||||
// method: 'DELETE',
|
|
||||||
// body: this.removeMintingAccountKey
|
|
||||||
// }).then(res => {
|
|
||||||
// if (res === true) {
|
|
||||||
// this.updateMintingAccounts()
|
|
||||||
// this.removeMintingAccountKey = ''
|
|
||||||
// this.removeMintingAccountMessage = 'Minting Node Removed Successfully!'
|
|
||||||
// this.removeMintingAccountLoading = false
|
|
||||||
// } else {
|
|
||||||
// this.removeMintingAccountKey = ''
|
|
||||||
// this.removeMintingAccountMessage = 'Failed to Remove Minting Node!'
|
|
||||||
// this.removeMintingAccountLoading = false
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
|
|
||||||
// }
|
|
||||||
|
|
||||||
firstUpdated() {
|
firstUpdated() {
|
||||||
|
|
||||||
// Call getMintingAccountGrid
|
|
||||||
// this.getMintingAccountGrid()
|
|
||||||
|
|
||||||
// Call updateMintingAccounts
|
|
||||||
// this.updateMintingAccounts()
|
|
||||||
|
|
||||||
const getGroupIdFromURL = () => {
|
const getGroupIdFromURL = () => {
|
||||||
let tempUrl = document.location.href
|
let tempUrl = document.location.href
|
||||||
let decodeTempUrl = decodeURI(tempUrl)
|
let decodeTempUrl = decodeURI(tempUrl)
|
||||||
@ -276,7 +159,6 @@ class GroupTransaction extends LitElement {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
parentEpml.imReady()
|
parentEpml.imReady()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,30 @@
|
|||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="/font/material-icons.css">
|
<link rel="stylesheet" href="/font/material-icons.css">
|
||||||
<style>
|
<style>
|
||||||
|
html {
|
||||||
|
--scrollbarBG: #a1a1a1;
|
||||||
|
--thumbBG: #6a6c75;
|
||||||
|
}
|
||||||
|
|
||||||
|
*::-webkit-scrollbar {
|
||||||
|
width: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
* {
|
||||||
|
scrollbar-width: thin;
|
||||||
|
scrollbar-color: var(--thumbBG) var(--scrollbarBG);
|
||||||
|
}
|
||||||
|
|
||||||
|
*::-webkit-scrollbar-track {
|
||||||
|
background: var(--scrollbarBG);
|
||||||
|
}
|
||||||
|
|
||||||
|
*::-webkit-scrollbar-thumb {
|
||||||
|
background-color: var(--thumbBG);
|
||||||
|
border-radius: 6px;
|
||||||
|
border: 3px solid var(--scrollbarBG);
|
||||||
|
}
|
||||||
|
|
||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@ -15,7 +39,6 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<group-transaction></group-transaction>
|
<group-transaction></group-transaction>
|
||||||
|
|
||||||
<script src="group-transaction.js"></script>
|
<script src="group-transaction.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<group-management></group-management>
|
<group-management></group-management>
|
||||||
|
|
||||||
<script src="group-management.js"></script>
|
<script src="group-management.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -3,7 +3,7 @@ import { LitElement, html, css } from 'lit'
|
|||||||
class ChainMessaging extends LitElement {
|
class ChainMessaging extends LitElement {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
return {
|
return {
|
||||||
loading: { type: Boolean },
|
loading: { type: Boolean }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,13 +30,11 @@ class ChainMessaging extends LitElement {
|
|||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super()
|
super()
|
||||||
// ...
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return html`
|
return html`
|
||||||
<div id="chain-messaging-page">
|
<div id="chain-messaging-page">
|
||||||
|
|
||||||
<h2 style="text-align: center; margin-top: 3rem;">Coming Soon!</h2>
|
<h2 style="text-align: center; margin-top: 3rem;">Coming Soon!</h2>
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
border: 3px solid var(--scrollbarBG);
|
border: 3px solid var(--scrollbarBG);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html,
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
@ -38,7 +39,6 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<q-messaging></q-messaging>
|
<q-messaging></q-messaging>
|
||||||
|
|
||||||
<script src="messaging.js"></script>
|
<script src="messaging.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@ class Messaging extends LitElement {
|
|||||||
color: rgb(3, 169, 244);
|
color: rgb(3, 169, 244);
|
||||||
margin-top: .5rem;
|
margin-top: .5rem;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
/* font-size: 19px; */
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,7 +59,6 @@ class Messaging extends LitElement {
|
|||||||
.divCard {
|
.divCard {
|
||||||
border: 1px solid #eee;
|
border: 1px solid #eee;
|
||||||
padding: 1em;
|
padding: 1em;
|
||||||
/** box-shadow: 0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 2px 0 rgba(0,0,0,0.20); **/
|
|
||||||
box-shadow: 0 .3px 1px 0 rgba(0,0,0,0.14), 0 1px 1px -1px rgba(0,0,0,0.12), 0 1px 2px 0 rgba(0,0,0,0.20);
|
box-shadow: 0 .3px 1px 0 rgba(0,0,0,0.14), 0 1px 1px -1px rgba(0,0,0,0.12), 0 1px 2px 0 rgba(0,0,0,0.20);
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
}
|
}
|
||||||
|
@ -33,14 +33,13 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<q-chat></q-chat>
|
<q-chat></q-chat>
|
||||||
<script type="module" src="q-chat.js"></script>
|
<script src="q-chat.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -2,13 +2,10 @@ import { LitElement, html, css } from 'lit'
|
|||||||
import { render } from 'lit/html.js'
|
import { render } from 'lit/html.js'
|
||||||
import { Epml } from '../../../../epml.js'
|
import { Epml } from '../../../../epml.js'
|
||||||
|
|
||||||
// Components
|
|
||||||
import '../../components/ChatWelcomePage.js'
|
import '../../components/ChatWelcomePage.js'
|
||||||
import '../../components/ChatHead.js'
|
import '../../components/ChatHead.js'
|
||||||
import '../../components/ChatPage.js'
|
import '../../components/ChatPage.js'
|
||||||
|
|
||||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||||
|
|
||||||
import '@material/mwc-icon'
|
import '@material/mwc-icon'
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
import '@material/mwc-dialog'
|
import '@material/mwc-dialog'
|
||||||
@ -296,11 +293,10 @@ class Chat extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="chat">
|
<div class="chat">
|
||||||
<div id="newMessageBar" class="new-message-bar hide-new-message-bar clearfix" @click=${ () => this.scrollToBottom()}>
|
<div id="newMessageBar" class="new-message-bar hide-new-message-bar clearfix" @click=${() => this.scrollToBottom()}>
|
||||||
<span style="flex: 1;">New Message</span>
|
<span style="flex: 1;">New Message</span>
|
||||||
<span>(Click to scroll down) <mwc-icon style="font-size: 16px; vertical-align: bottom;">keyboard_arrow_down</mwc-icon></span>
|
<span>(Click to scroll down) <mwc-icon style="font-size: 16px; vertical-align: bottom;">keyboard_arrow_down</mwc-icon></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="chat-history">
|
<div class="chat-history">
|
||||||
${window.parent.location.pathname !== "/app/q-chat" ? html`${this.renderChatPage(this.chatId)}` : html`${this.renderChatWelcomePage()}`}
|
${window.parent.location.pathname !== "/app/q-chat" ? html`${this.renderChatPage(this.chatId)}` : html`${this.renderChatWelcomePage()}`}
|
||||||
</div>
|
</div>
|
||||||
@ -474,9 +470,7 @@ class Chat extends LitElement {
|
|||||||
})
|
})
|
||||||
parentEpml.subscribe('chat_heads', chatHeads => {
|
parentEpml.subscribe('chat_heads', chatHeads => {
|
||||||
chatHeads = JSON.parse(chatHeads)
|
chatHeads = JSON.parse(chatHeads)
|
||||||
// setTimeout(() => {
|
|
||||||
this.getChatHeadFromState(chatHeads)
|
this.getChatHeadFromState(chatHeads)
|
||||||
// }, 5000)
|
|
||||||
})
|
})
|
||||||
parentEpml.request('apiCall', {
|
parentEpml.request('apiCall', {
|
||||||
url: `/addresses/balance/${window.parent.reduxStore.getState().app.selectedAddress.address}`
|
url: `/addresses/balance/${window.parent.reduxStore.getState().app.selectedAddress.address}`
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
background: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { LitElement, html, css } from "lit";
|
import { LitElement, html, css } from 'lit'
|
||||||
import { render } from "lit/html.js";
|
import { render } from 'lit/html.js'
|
||||||
import { Epml } from "../../../epml.js";
|
import { Epml } from '../../../epml.js'
|
||||||
|
|
||||||
import "@material/mwc-icon";
|
import '@material/mwc-icon'
|
||||||
import "@material/mwc-button";
|
import '@material/mwc-button'
|
||||||
import "@material/mwc-dialog";
|
import '@material/mwc-dialog'
|
||||||
import "@material/mwc-textfield";
|
import '@material/mwc-textfield'
|
||||||
|
|
||||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent });
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||||
|
|
||||||
class MintingInfo extends LitElement {
|
class MintingInfo extends LitElement {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
@ -18,7 +18,7 @@ class MintingInfo extends LitElement {
|
|||||||
nodeInfo: { type: Array },
|
nodeInfo: { type: Array },
|
||||||
sampleBlock: { type: Array },
|
sampleBlock: { type: Array },
|
||||||
addressInfo: { type: Array },
|
addressInfo: { type: Array },
|
||||||
addressLevel: { type: Array },
|
addressLevel: { type: Array }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,14 +356,14 @@ class MintingInfo extends LitElement {
|
|||||||
|
|
||||||
firstUpdated() {
|
firstUpdated() {
|
||||||
const getAdminInfo = () => {
|
const getAdminInfo = () => {
|
||||||
parentEpml.request("apiCall", {url: `/admin/info`}).then((res) => {
|
parentEpml.request("apiCall", { url: `/admin/info` }).then((res) => {
|
||||||
setTimeout(() => {this.adminInfo = res;}, 1);
|
setTimeout(() => { this.adminInfo = res; }, 1);
|
||||||
});
|
});
|
||||||
setTimeout(getAdminInfo, 30000);
|
setTimeout(getAdminInfo, 30000);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getNodeInfo = () => {
|
const getNodeInfo = () => {
|
||||||
parentEpml.request("apiCall", {url: `/admin/status`}).then((res) => {
|
parentEpml.request("apiCall", { url: `/admin/status` }).then((res) => {
|
||||||
this.nodeInfo = res;
|
this.nodeInfo = res;
|
||||||
// Now look up the sample block
|
// Now look up the sample block
|
||||||
getSampleBlock()
|
getSampleBlock()
|
||||||
@ -373,21 +373,21 @@ class MintingInfo extends LitElement {
|
|||||||
|
|
||||||
const getSampleBlock = () => {
|
const getSampleBlock = () => {
|
||||||
let callBlock = parseFloat(this.nodeInfo.height) - 10000;
|
let callBlock = parseFloat(this.nodeInfo.height) - 10000;
|
||||||
parentEpml.request("apiCall", {url: `/blocks/byheight/${callBlock}`}).then((res) => {
|
parentEpml.request("apiCall", { url: `/blocks/byheight/${callBlock}` }).then((res) => {
|
||||||
setTimeout(() => {this.sampleBlock = res;}, 1);
|
setTimeout(() => { this.sampleBlock = res; }, 1);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getAddressInfo = () => {
|
const getAddressInfo = () => {
|
||||||
parentEpml.request('apiCall', {url: `/addresses/${window.parent.reduxStore.getState().app.selectedAddress.address}`}).then((res) => {
|
parentEpml.request('apiCall', { url: `/addresses/${window.parent.reduxStore.getState().app.selectedAddress.address}` }).then((res) => {
|
||||||
setTimeout(() => {this.addressInfo = res;}, 1);
|
setTimeout(() => { this.addressInfo = res; }, 1);
|
||||||
});
|
});
|
||||||
setTimeout(getAddressInfo, 30000);
|
setTimeout(getAddressInfo, 30000);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getAddressLevel = () => {
|
const getAddressLevel = () => {
|
||||||
parentEpml.request('apiCall', {url: `/addresses/online/levels`}).then((res) => {
|
parentEpml.request('apiCall', { url: `/addresses/online/levels` }).then((res) => {
|
||||||
setTimeout(() => {this.addressLevel = res;}, 1);
|
setTimeout(() => { this.addressLevel = res; }, 1);
|
||||||
});
|
});
|
||||||
setTimeout(getAddressLevel, 30000);
|
setTimeout(getAddressLevel, 30000);
|
||||||
};
|
};
|
||||||
@ -432,7 +432,7 @@ class MintingInfo extends LitElement {
|
|||||||
|
|
||||||
renderActivateHelp() {
|
renderActivateHelp() {
|
||||||
if (this.renderMintingPage() === "false") {
|
if (this.renderMintingPage() === "false") {
|
||||||
return html `Activate Account Details <div class="level-blue">==></div> Not Activated<br><mwc-button class="red-button" @click=${() => this.shadowRoot.querySelector("#activateAccountDialog").show()}><mwc-icon class="help-icon">help_outline</mwc-icon> Press For Help</mwc-button>`;
|
return html`Activate Account Details <div class="level-blue">==></div> Not Activated<br><mwc-button class="red-button" @click=${() => this.shadowRoot.querySelector("#activateAccountDialog").show()}><mwc-icon class="help-icon">help_outline</mwc-icon> Press For Help</mwc-button>`;
|
||||||
} else {
|
} else {
|
||||||
return "No Details";
|
return "No Details";
|
||||||
}
|
}
|
||||||
@ -455,7 +455,7 @@ class MintingInfo extends LitElement {
|
|||||||
_dayReward() {
|
_dayReward() {
|
||||||
let rewardString = (this._timeCalc() * this._blockReward()).toFixed(2);
|
let rewardString = (this._timeCalc() * this._blockReward()).toFixed(2);
|
||||||
let rewardDayString = (rewardString).toString();
|
let rewardDayString = (rewardString).toString();
|
||||||
return "" + rewardDayString ;
|
return "" + rewardDayString;
|
||||||
}
|
}
|
||||||
|
|
||||||
_mintingStatus() {
|
_mintingStatus() {
|
||||||
@ -478,7 +478,7 @@ class MintingInfo extends LitElement {
|
|||||||
|
|
||||||
renderMintingHelp() {
|
renderMintingHelp() {
|
||||||
if (this._mintingStatus() === "Not Minting") {
|
if (this._mintingStatus() === "Not Minting") {
|
||||||
return html `Minting Account Details <div class="level-blue">==></div> Not A Minter<br><mwc-button class="red-button" @click=${() => this.shadowRoot.querySelector("#becomeMinterDialog").show()}><mwc-icon class="help-icon">help_outline</mwc-icon> Press For Help</mwc-button>`;
|
return html`Minting Account Details <div class="level-blue">==></div> Not A Minter<br><mwc-button class="red-button" @click=${() => this.shadowRoot.querySelector("#becomeMinterDialog").show()}><mwc-icon class="help-icon">help_outline</mwc-icon> Press For Help</mwc-button>`;
|
||||||
} else {
|
} else {
|
||||||
return "Minting Account Details";
|
return "Minting Account Details";
|
||||||
}
|
}
|
||||||
|
@ -32,14 +32,14 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
background: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<name-registration></name-registration>
|
<name-registration></name-registration>
|
||||||
<script type="module" src="name-registration.js"></script>
|
<script src="name-registration.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -6,10 +6,9 @@ import '@material/mwc-icon'
|
|||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
import '@material/mwc-textfield'
|
import '@material/mwc-textfield'
|
||||||
import '@material/mwc-dialog'
|
import '@material/mwc-dialog'
|
||||||
|
|
||||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||||
import '@vaadin/vaadin-grid/vaadin-grid.js'
|
import '@vaadin/grid/vaadin-grid.js'
|
||||||
import '@vaadin/vaadin-grid/theme/material/all-imports.js'
|
import '@vaadin/grid/theme/material/all-imports.js'
|
||||||
|
|
||||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||||
|
|
||||||
@ -86,7 +85,7 @@ class NameRegistration extends LitElement {
|
|||||||
|
|
||||||
<div class="divCard">
|
<div class="divCard">
|
||||||
<h3 style="margin: 0; margin-bottom: 1em; text-align: center;">Registered Names</h3>
|
<h3 style="margin: 0; margin-bottom: 1em; text-align: center;">Registered Names</h3>
|
||||||
<vaadin-grid id="namesGrid" style="height:auto;" ?hidden="${this.isEmptyArray(this.names)}" aria-label="Names" .items="${this.names}" height-by-rows>
|
<vaadin-grid theme="compact" id="namesGrid" ?hidden="${this.isEmptyArray(this.names)}" aria-label="Names" .items="${this.names}" all-rows-visible>
|
||||||
<vaadin-grid-column width="5rem" flex-grow="0" header="Avatar" .renderer=${(root, column, data) => {
|
<vaadin-grid-column width="5rem" flex-grow="0" header="Avatar" .renderer=${(root, column, data) => {
|
||||||
render(html`${this.renderAvatar(data.item)}`, root)
|
render(html`${this.renderAvatar(data.item)}`, root)
|
||||||
}}></vaadin-grid-column>
|
}}></vaadin-grid-column>
|
||||||
@ -248,7 +247,7 @@ class NameRegistration extends LitElement {
|
|||||||
const nameInput = this.shadowRoot.getElementById("nameInput").value
|
const nameInput = this.shadowRoot.getElementById("nameInput").value
|
||||||
const descInput = this.shadowRoot.getElementById("descInput").value
|
const descInput = this.shadowRoot.getElementById("descInput").value
|
||||||
|
|
||||||
// Check for valid...^
|
// Check for valid...
|
||||||
this.registerNameLoading = true
|
this.registerNameLoading = true
|
||||||
|
|
||||||
// Get Last Ref
|
// Get Last Ref
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { LitElement, html, css } from "lit";
|
import { LitElement, html, css } from 'lit'
|
||||||
import { render } from 'lit/html.js'
|
import { render } from 'lit/html.js'
|
||||||
import { Epml } from "../../../epml.js";
|
import { Epml } from '../../../epml.js'
|
||||||
|
|
||||||
import "@polymer/paper-spinner/paper-spinner-lite.js";
|
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||||
import "@vaadin/vaadin-grid/vaadin-grid.js";
|
import '@material/mwc-icon'
|
||||||
import "@vaadin/vaadin-grid/theme/material/all-imports.js";
|
import '@material/mwc-textfield'
|
||||||
import "@material/mwc-icon";
|
import '@material/mwc-button'
|
||||||
import "@material/mwc-textfield";
|
import '@material/mwc-dialog'
|
||||||
import "@material/mwc-button";
|
import '@vaadin/grid/vaadin-grid.js'
|
||||||
import "@material/mwc-dialog";
|
import '@vaadin/grid/theme/material/all-imports.js'
|
||||||
|
|
||||||
const parentEpml = new Epml({ type: "WINDOW", source: window.parent });
|
const parentEpml = new Epml({ type: "WINDOW", source: window.parent })
|
||||||
|
|
||||||
class NodeManagement extends LitElement {
|
class NodeManagement extends LitElement {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
@ -31,7 +31,7 @@ class NodeManagement extends LitElement {
|
|||||||
removeMintingAccountMessage: { type: String },
|
removeMintingAccountMessage: { type: String },
|
||||||
tempMintingAccount: { type: Object },
|
tempMintingAccount: { type: Object },
|
||||||
nodeConfig: { type: Object },
|
nodeConfig: { type: Object },
|
||||||
nodeDomain: { type: String },
|
nodeDomain: { type: String }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,7 +72,6 @@ class NodeManagement extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.node-card {
|
.node-card {
|
||||||
/* margin:12px; */
|
|
||||||
padding: 12px 24px;
|
padding: 12px 24px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
@ -95,6 +94,7 @@ class NodeManagement extends LitElement {
|
|||||||
display: hidden !important;
|
display: hidden !important;
|
||||||
visibility: none !important;
|
visibility: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.details {
|
.details {
|
||||||
display: flex;
|
display: flex;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
@ -201,7 +201,7 @@ class NodeManagement extends LitElement {
|
|||||||
</mwc-button>
|
</mwc-button>
|
||||||
</mwc-dialog>
|
</mwc-dialog>
|
||||||
|
|
||||||
<vaadin-grid id="mintingAccountsGrid" style="height:auto;" ?hidden="${this.isEmptyArray(this.mintingAccounts)}" aria-label="Minting Accounts" .items="${this.mintingAccounts}" height-by-rows>
|
<vaadin-grid theme="compact" id="mintingAccountsGrid" ?hidden="${this.isEmptyArray(this.mintingAccounts)}" .items="${this.mintingAccounts}" aria-label="Minting Accounts" all-rows-visible>
|
||||||
<vaadin-grid-column auto-width header="Minting Account" path="mintingAccount"></vaadin-grid-column>
|
<vaadin-grid-column auto-width header="Minting Account" path="mintingAccount"></vaadin-grid-column>
|
||||||
<vaadin-grid-column auto-width header="Recipient Account" path="recipientAccount"></vaadin-grid-column>
|
<vaadin-grid-column auto-width header="Recipient Account" path="recipientAccount"></vaadin-grid-column>
|
||||||
<vaadin-grid-column width="12em" header="Action" .renderer=${(root, column, data) => {
|
<vaadin-grid-column width="12em" header="Action" .renderer=${(root, column, data) => {
|
||||||
@ -253,7 +253,7 @@ class NodeManagement extends LitElement {
|
|||||||
</mwc-button>
|
</mwc-button>
|
||||||
</mwc-dialog>
|
</mwc-dialog>
|
||||||
|
|
||||||
<vaadin-grid id="peersGrid" style="height:auto;" ?hidden="${this.isEmptyArray(this.peers)}" aria-label="Peers" .items="${this.peers}" height-by-rows>
|
<vaadin-grid theme="compact" id="peersGrid" ?hidden="${this.isEmptyArray(this.peers)}" .items="${this.peers}" aria-label="Peers" all-rows-visible>
|
||||||
<vaadin-grid-column path="address"></vaadin-grid-column>
|
<vaadin-grid-column path="address"></vaadin-grid-column>
|
||||||
<vaadin-grid-column path="lastHeight"></vaadin-grid-column>
|
<vaadin-grid-column path="lastHeight"></vaadin-grid-column>
|
||||||
<vaadin-grid-column path="version" header="Build Version"></vaadin-grid-column>
|
<vaadin-grid-column path="version" header="Build Version"></vaadin-grid-column>
|
||||||
@ -271,7 +271,7 @@ class NodeManagement extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
forceSyncPeer (peerAddress, rowIndex) {
|
forceSyncPeer(peerAddress, rowIndex) {
|
||||||
parentEpml
|
parentEpml
|
||||||
.request("apiCall", {
|
.request("apiCall", {
|
||||||
url: `/admin/forcesync?apiKey=${this.getApiKey()}`,
|
url: `/admin/forcesync?apiKey=${this.getApiKey()}`,
|
||||||
@ -279,7 +279,7 @@ class NodeManagement extends LitElement {
|
|||||||
body: peerAddress,
|
body: peerAddress,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
parentEpml.request('showSnackBar', "Starting Sync with Peer: " + peerAddress );
|
parentEpml.request('showSnackBar', "Starting Sync with Peer: " + peerAddress);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,7 +291,7 @@ class NodeManagement extends LitElement {
|
|||||||
body: peerAddress,
|
body: peerAddress,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
parentEpml.request('showSnackBar', "Successfully removed Peer: " + peerAddress );
|
parentEpml.request('showSnackBar', "Successfully removed Peer: " + peerAddress);
|
||||||
this.peers.splice(rowIndex, 1);
|
this.peers.splice(rowIndex, 1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -32,14 +32,14 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
background: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<puzzles-info></puzzles-info>
|
<puzzles-info></puzzles-info>
|
||||||
<script type="module" src="puzzles.js"></script>
|
<script src="puzzles.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -6,18 +6,17 @@ import { Epml } from '../../../epml.js'
|
|||||||
import nacl from '../../../../qortal-ui-crypto/api/deps/nacl-fast.js'
|
import nacl from '../../../../qortal-ui-crypto/api/deps/nacl-fast.js'
|
||||||
import Base58 from '../../../../qortal-ui-crypto/api/deps/Base58.js'
|
import Base58 from '../../../../qortal-ui-crypto/api/deps/Base58.js'
|
||||||
import publicKeyToAddress from '../../../../qortal-ui-crypto/api/wallet/publicKeyToAddress.js'
|
import publicKeyToAddress from '../../../../qortal-ui-crypto/api/wallet/publicKeyToAddress.js'
|
||||||
|
|
||||||
import '@material/mwc-icon'
|
import '@material/mwc-icon'
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
import '@material/mwc-textfield'
|
import '@material/mwc-textfield'
|
||||||
import '@material/mwc-dialog'
|
import '@material/mwc-dialog'
|
||||||
import '@material/mwc-slider'
|
import '@material/mwc-slider'
|
||||||
|
|
||||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||||
import '@vaadin/vaadin-grid/vaadin-grid.js'
|
import '@vaadin/grid/vaadin-grid.js'
|
||||||
import '@vaadin/vaadin-grid/theme/material/all-imports.js'
|
import '@vaadin/grid/theme/material/all-imports.js'
|
||||||
|
|
||||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||||
|
|
||||||
const DEFAULT_FEE = 0.001
|
const DEFAULT_FEE = 0.001
|
||||||
const PAYMENT_TX_TYPE = 2
|
const PAYMENT_TX_TYPE = 2
|
||||||
|
|
||||||
@ -85,8 +84,8 @@ class Puzzles extends LitElement {
|
|||||||
<div style="min-height:48px; display: flex; padding-bottom: 6px;">
|
<div style="min-height:48px; display: flex; padding-bottom: 6px;">
|
||||||
<h3 style="margin: 0; flex: 1; padding-top: 8px; display: inline;">Puzzles</h3>
|
<h3 style="margin: 0; flex: 1; padding-top: 8px; display: inline;">Puzzles</h3>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="divCard">
|
||||||
<vaadin-grid id="puzzlesGrid" style="height:auto;" ?hidden="${this.isEmptyArray(this.puzzles)}" .items="${this.puzzles}" height-by-rows>
|
<vaadin-grid theme="compact" id="puzzlesGrid" ?hidden="${this.isEmptyArray(this.puzzles)}" .items="${this.puzzles}" aria-label="Puzzles" all-rows-visible>
|
||||||
<vaadin-grid-column auto-width header="Reward" .renderer=${(root, column, data) => {
|
<vaadin-grid-column auto-width header="Reward" .renderer=${(root, column, data) => {
|
||||||
if (data.item.isSolved) {
|
if (data.item.isSolved) {
|
||||||
render(html`<span style="font-size: smaller;">SOLVED by ${data.item.winner}</span>`, root)
|
render(html`<span style="font-size: smaller;">SOLVED by ${data.item.winner}</span>`, root)
|
||||||
@ -122,7 +121,8 @@ class Puzzles extends LitElement {
|
|||||||
<paper-spinner-lite
|
<paper-spinner-lite
|
||||||
style="margin-top:12px;"
|
style="margin-top:12px;"
|
||||||
?active="${this.loading}"
|
?active="${this.loading}"
|
||||||
alt="Claiming puzzle reward"></paper-spinner-lite>
|
alt="Claiming puzzle reward">
|
||||||
|
</paper-spinner-lite>
|
||||||
</span>
|
</span>
|
||||||
<span ?hidden=${this.message === ''} style="${this.error ? 'color:red;' : ''}">
|
<span ?hidden=${this.message === ''} style="${this.error ? 'color:red;' : ''}">
|
||||||
${this.message}
|
${this.message}
|
||||||
@ -177,13 +177,13 @@ class Puzzles extends LitElement {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const getBalance = async(address) => {
|
const getBalance = async (address) => {
|
||||||
return await parentEpml.request('apiCall', {
|
return await parentEpml.request('apiCall', {
|
||||||
url: `/addresses/balance/${address}`
|
url: `/addresses/balance/${address}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const getName = async(memberAddress) => {
|
const getName = async (memberAddress) => {
|
||||||
let _names = await parentEpml.request('apiCall', {
|
let _names = await parentEpml.request('apiCall', {
|
||||||
url: `/names/address/${memberAddress}`
|
url: `/names/address/${memberAddress}`
|
||||||
})
|
})
|
||||||
@ -193,7 +193,7 @@ class Puzzles extends LitElement {
|
|||||||
return _names[0].name
|
return _names[0].name
|
||||||
}
|
}
|
||||||
|
|
||||||
const getNameInfo = async(name) => {
|
const getNameInfo = async (name) => {
|
||||||
// We have to explicitly encode '#' to stop them being interpreted as in-page references
|
// We have to explicitly encode '#' to stop them being interpreted as in-page references
|
||||||
name = name.replaceAll('#', '%23')
|
name = name.replaceAll('#', '%23')
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ class Puzzles extends LitElement {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const getFirstOutgoingPayment = async(sender) => {
|
const getFirstOutgoingPayment = async (sender) => {
|
||||||
let _payments = await parentEpml.request('apiCall', {
|
let _payments = await parentEpml.request('apiCall', {
|
||||||
url: `/transactions/search?confirmationStatus=CONFIRMED&limit=20&txType=PAYMENT&address=${sender}`
|
url: `/transactions/search?confirmationStatus=CONFIRMED&limit=20&txType=PAYMENT&address=${sender}`
|
||||||
})
|
})
|
||||||
|
@ -19,7 +19,7 @@ class WebBrowser extends LitElement {
|
|||||||
service: { type: String },
|
service: { type: String },
|
||||||
identifier: { type: String },
|
identifier: { type: String },
|
||||||
followedNames: { type: Array },
|
followedNames: { type: Array },
|
||||||
blockedNames: { type: Array },
|
blockedNames: { type: Array }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -40,8 +40,6 @@ class WebBrowser extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#websitesWrapper .buttons {
|
#websitesWrapper .buttons {
|
||||||
/* --paper-button-ink-color: var(--paper-green-500);
|
|
||||||
color: var(--paper-green-500); */
|
|
||||||
width: auto !important;
|
width: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +166,7 @@ class WebBrowser extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
goBackToList() {
|
goBackToList() {
|
||||||
window.location="../index.html";
|
window.location = "../index.html";
|
||||||
}
|
}
|
||||||
|
|
||||||
follow() {
|
follow() {
|
||||||
@ -196,7 +194,7 @@ class WebBrowser extends LitElement {
|
|||||||
let items = [
|
let items = [
|
||||||
name
|
name
|
||||||
]
|
]
|
||||||
let namesJsonString = JSON.stringify({"items": items})
|
let namesJsonString = JSON.stringify({ "items": items })
|
||||||
|
|
||||||
let ret = await parentEpml.request('apiCall', {
|
let ret = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
||||||
@ -225,7 +223,7 @@ class WebBrowser extends LitElement {
|
|||||||
let items = [
|
let items = [
|
||||||
name
|
name
|
||||||
]
|
]
|
||||||
let namesJsonString = JSON.stringify({"items": items})
|
let namesJsonString = JSON.stringify({ "items": items })
|
||||||
|
|
||||||
let ret = await parentEpml.request('apiCall', {
|
let ret = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
||||||
@ -251,7 +249,7 @@ class WebBrowser extends LitElement {
|
|||||||
let items = [
|
let items = [
|
||||||
name
|
name
|
||||||
]
|
]
|
||||||
let namesJsonString = JSON.stringify({"items": items})
|
let namesJsonString = JSON.stringify({ "items": items })
|
||||||
|
|
||||||
let ret = await parentEpml.request('apiCall', {
|
let ret = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`,
|
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`,
|
||||||
@ -280,7 +278,7 @@ class WebBrowser extends LitElement {
|
|||||||
let items = [
|
let items = [
|
||||||
name
|
name
|
||||||
]
|
]
|
||||||
let namesJsonString = JSON.stringify({"items": items})
|
let namesJsonString = JSON.stringify({ "items": items })
|
||||||
|
|
||||||
let ret = await parentEpml.request('apiCall', {
|
let ret = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`,
|
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`,
|
||||||
@ -366,14 +364,13 @@ class WebBrowser extends LitElement {
|
|||||||
const urlParams = new URLSearchParams(window.location.search);
|
const urlParams = new URLSearchParams(window.location.search);
|
||||||
this.name = urlParams.get('name');
|
this.name = urlParams.get('name');
|
||||||
this.service = urlParams.get('service');
|
this.service = urlParams.get('service');
|
||||||
this.identifier = null; // FUTURE: add support for identifiers
|
// FUTURE: add support for identifiers
|
||||||
|
this.identifier = null;
|
||||||
this.followedNames = []
|
this.followedNames = []
|
||||||
this.blockedNames = []
|
this.blockedNames = []
|
||||||
|
|
||||||
|
|
||||||
const getFollowedNames = async () => {
|
const getFollowedNames = async () => {
|
||||||
// this.followedNames = []
|
|
||||||
|
|
||||||
let followedNames = await parentEpml.request('apiCall', {
|
let followedNames = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
url: `/lists/followedNames?apiKey=${this.getApiKey()}`
|
||||||
@ -384,7 +381,6 @@ class WebBrowser extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getBlockedNames = async () => {
|
const getBlockedNames = async () => {
|
||||||
// this.blockedNames = []
|
|
||||||
|
|
||||||
let blockedNames = await parentEpml.request('apiCall', {
|
let blockedNames = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
|
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
@ -4,9 +4,8 @@ import { Epml } from '../../../../epml'
|
|||||||
|
|
||||||
import '@material/mwc-icon'
|
import '@material/mwc-icon'
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
|
import '@vaadin/grid/vaadin-grid.js'
|
||||||
import '@vaadin/vaadin-grid/vaadin-grid.js'
|
import '@vaadin/grid/theme/material/all-imports.js'
|
||||||
import '@vaadin/vaadin-grid/theme/material/all-imports.js'
|
|
||||||
|
|
||||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||||
|
|
||||||
@ -147,7 +146,7 @@ class DataManagement extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
<div class="divCard">
|
<div class="divCard">
|
||||||
<h3 style="margin: 0; margin-bottom: 1em; text-align: center;">Data hosted by this node</h3>
|
<h3 style="margin: 0; margin-bottom: 1em; text-align: center;">Data hosted by this node</h3>
|
||||||
<vaadin-grid id="resourcesGrid" style="height:auto;" ?hidden="${this.isEmptyArray(this.datres)}" page-size="20" height-by-rows>
|
<vaadin-grid theme="compact" id="resourcesGrid" ?hidden="${this.isEmptyArray(this.datres)}" aria-label="Data Hosted" page-size="20" all-rows-visible>
|
||||||
<vaadin-grid-column header="Registered Name" path="name"></vaadin-grid-column>
|
<vaadin-grid-column header="Registered Name" path="name"></vaadin-grid-column>
|
||||||
<vaadin-grid-column header="Service" path="service"></vaadin-grid-column>
|
<vaadin-grid-column header="Service" path="service"></vaadin-grid-column>
|
||||||
<vaadin-grid-column header="Identifier" .renderer=${(root, column, data) => {
|
<vaadin-grid-column header="Identifier" .renderer=${(root, column, data) => {
|
||||||
|
@ -39,7 +39,6 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<websites-list></websites-list>
|
<websites-list></websites-list>
|
||||||
|
|
||||||
<script src="websites.js"></script>
|
<script src="websites.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
@ -28,14 +28,12 @@ class PublishData extends LitElement {
|
|||||||
selectedName: { type: String },
|
selectedName: { type: String },
|
||||||
path: { type: String },
|
path: { type: String },
|
||||||
portForwardingEnabled: { type: Boolean },
|
portForwardingEnabled: { type: Boolean },
|
||||||
//selectedAddress: { type: Object },
|
|
||||||
|
|
||||||
amount: { type: Number },
|
amount: { type: Number },
|
||||||
generalMessage: { type: String },
|
generalMessage: { type: String },
|
||||||
successMessage: { type: String },
|
successMessage: { type: String },
|
||||||
errorMessage: { type: String },
|
errorMessage: { type: String },
|
||||||
loading: { type: Boolean },
|
loading: { type: Boolean },
|
||||||
btnDisable: { type: Boolean },
|
btnDisable: { type: Boolean }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,8 +54,6 @@ class PublishData extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#publishWrapper .buttons {
|
#publishWrapper .buttons {
|
||||||
/* --paper-button-ink-color: var(--paper-green-500);
|
|
||||||
color: var(--paper-green-500); */
|
|
||||||
width: auto !important;
|
width: auto !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,12 +413,12 @@ class PublishData extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.portForwardingEnabled = true // Default to true so the message doesn't appear and disappear quickly
|
// Default to true so the message doesn't appear and disappear quickly
|
||||||
|
this.portForwardingEnabled = true
|
||||||
this.names = []
|
this.names = []
|
||||||
this.registeredName = ''
|
this.registeredName = ''
|
||||||
this.selectedName = 'invalid'
|
this.selectedName = 'invalid'
|
||||||
this.path = ''
|
this.path = ''
|
||||||
//this.selectedAddress = {}
|
|
||||||
this.successMessage = ''
|
this.successMessage = ''
|
||||||
this.generalMessage = ''
|
this.generalMessage = ''
|
||||||
this.errorMessage = ''
|
this.errorMessage = ''
|
||||||
|
@ -5,9 +5,8 @@ import { Epml } from '../../../epml.js'
|
|||||||
import '@material/mwc-icon'
|
import '@material/mwc-icon'
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
import '@material/mwc-textfield'
|
import '@material/mwc-textfield'
|
||||||
|
import '@vaadin/grid/vaadin-grid.js'
|
||||||
import '@vaadin/vaadin-grid/vaadin-grid.js'
|
import '@vaadin/grid/theme/material/all-imports.js'
|
||||||
import '@vaadin/vaadin-grid/theme/material/all-imports.js'
|
|
||||||
|
|
||||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||||
|
|
||||||
@ -185,7 +184,7 @@ class Websites extends LitElement {
|
|||||||
<mwc-textfield outlined label="Name To Search" id="searchName" type="text" value="${this.searchName}"></mwc-textfield> <br>
|
<mwc-textfield outlined label="Name To Search" id="searchName" type="text" value="${this.searchName}"></mwc-textfield> <br>
|
||||||
<mwc-button raised icon="search" @click="${(e) => this.doSearch(e)}">Search</mwc-button>
|
<mwc-button raised icon="search" @click="${(e) => this.doSearch(e)}">Search</mwc-button>
|
||||||
</div><br />
|
</div><br />
|
||||||
<vaadin-grid id="searchResourcesGrid" style="height:auto;" ?hidden="${this.isEmptyArray(this.searchResources)}" .items="${this.searchResources}" height-by-rows>
|
<vaadin-grid theme="compact" id="searchResourcesGrid" ?hidden="${this.isEmptyArray(this.searchResources)}" .items="${this.searchResources}" aria-label="Search Websites" all-rows-visible>
|
||||||
<vaadin-grid-column width="5rem" flex-grow="0" header="Avatar" .renderer=${(root, column, data) => {
|
<vaadin-grid-column width="5rem" flex-grow="0" header="Avatar" .renderer=${(root, column, data) => {
|
||||||
render(html`${this.renderSearchAvatar(data.item)}`, root)
|
render(html`${this.renderSearchAvatar(data.item)}`, root)
|
||||||
}}></vaadin-grid-column>
|
}}></vaadin-grid-column>
|
||||||
@ -205,8 +204,10 @@ class Websites extends LitElement {
|
|||||||
render(html`${this.renderSearchBlockUnblockButton(data.item)}`, root);
|
render(html`${this.renderSearchBlockUnblockButton(data.item)}`, root);
|
||||||
}}></vaadin-grid-column>
|
}}></vaadin-grid-column>
|
||||||
</vaadin-grid><br />
|
</vaadin-grid><br />
|
||||||
|
</div>
|
||||||
|
<div class="divCard">
|
||||||
<h3 style="margin: 0; margin-bottom: 1em; text-align: center;">Websites</h3>
|
<h3 style="margin: 0; margin-bottom: 1em; text-align: center;">Websites</h3>
|
||||||
<vaadin-grid id="resourcesGrid" style="height:auto;" ?hidden="${this.isEmptyArray(this.resources)}" page-size="20" height-by-rows>
|
<vaadin-grid theme="compact" id="resourcesGrid" ?hidden="${this.isEmptyArray(this.resources)}" aria-label="Websites" page-size="20" all-rows-visible>
|
||||||
<vaadin-grid-column width="5rem" flex-grow="0" header="Avatar" .renderer=${(root, column, data) => {
|
<vaadin-grid-column width="5rem" flex-grow="0" header="Avatar" .renderer=${(root, column, data) => {
|
||||||
render(html`${this.renderAvatar(data.item)}`, root)
|
render(html`${this.renderAvatar(data.item)}`, root)
|
||||||
}}></vaadin-grid-column>
|
}}></vaadin-grid-column>
|
||||||
@ -246,7 +247,7 @@ class Websites extends LitElement {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.followedNames = followedNames
|
this.followedNames = followedNames
|
||||||
setTimeout(getFollowedNames, this.config.user.nodeSettings.pingInterval)
|
setTimeout(getFollowedNames, 60000)
|
||||||
}
|
}
|
||||||
|
|
||||||
const getBlockedNames = async () => {
|
const getBlockedNames = async () => {
|
||||||
@ -255,7 +256,7 @@ class Websites extends LitElement {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.blockedNames = blockedNames
|
this.blockedNames = blockedNames
|
||||||
setTimeout(getBlockedNames, this.config.user.nodeSettings.pingInterval)
|
setTimeout(getBlockedNames, 60000)
|
||||||
}
|
}
|
||||||
|
|
||||||
const getSearchFollowedNames = async () => {
|
const getSearchFollowedNames = async () => {
|
||||||
@ -264,7 +265,7 @@ class Websites extends LitElement {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.searchFollowedNames = searchFollowedNames
|
this.searchFollowedNames = searchFollowedNames
|
||||||
setTimeout(getSearchFollowedNames, this.config.user.nodeSettings.pingInterval)
|
setTimeout(getSearchFollowedNames, 60000)
|
||||||
}
|
}
|
||||||
|
|
||||||
const getSearchBlockedNames = async () => {
|
const getSearchBlockedNames = async () => {
|
||||||
@ -273,7 +274,7 @@ class Websites extends LitElement {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.searchBlockedNames = searchBlockedNames
|
this.searchBlockedNames = searchBlockedNames
|
||||||
setTimeout(getSearchBlockedNames, this.config.user.nodeSettings.pingInterval)
|
setTimeout(getSearchBlockedNames, 60000)
|
||||||
}
|
}
|
||||||
|
|
||||||
const getRelayMode = async () => {
|
const getRelayMode = async () => {
|
||||||
@ -282,7 +283,7 @@ class Websites extends LitElement {
|
|||||||
})
|
})
|
||||||
|
|
||||||
this.relayMode = relayMode;
|
this.relayMode = relayMode;
|
||||||
setTimeout(getRelayMode, this.config.user.nodeSettings.pingInterval)
|
setTimeout(getRelayMode, 60000)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -318,7 +319,7 @@ class Websites extends LitElement {
|
|||||||
setTimeout(getSearchFollowedNames, 1)
|
setTimeout(getSearchFollowedNames, 1)
|
||||||
setTimeout(getSearchBlockedNames, 1)
|
setTimeout(getSearchBlockedNames, 1)
|
||||||
setTimeout(getRelayMode, 1)
|
setTimeout(getRelayMode, 1)
|
||||||
setInterval(this.getArbitraryResources, 120 * 1000)
|
setInterval(this.getArbitraryResources, 120000)
|
||||||
configLoaded = true
|
configLoaded = true
|
||||||
}
|
}
|
||||||
this.config = JSON.parse(c)
|
this.config = JSON.parse(c)
|
||||||
@ -481,7 +482,7 @@ class Websites extends LitElement {
|
|||||||
let items = [
|
let items = [
|
||||||
name
|
name
|
||||||
]
|
]
|
||||||
let namesJsonString = JSON.stringify({"items": items})
|
let namesJsonString = JSON.stringify({ "items": items })
|
||||||
let ret = await parentEpml.request('apiCall', {
|
let ret = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -505,7 +506,7 @@ class Websites extends LitElement {
|
|||||||
let items = [
|
let items = [
|
||||||
name
|
name
|
||||||
]
|
]
|
||||||
let namesJsonString = JSON.stringify({"items": items})
|
let namesJsonString = JSON.stringify({ "items": items })
|
||||||
let ret = await parentEpml.request('apiCall', {
|
let ret = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
@ -541,7 +542,7 @@ class Websites extends LitElement {
|
|||||||
let items = [
|
let items = [
|
||||||
name
|
name
|
||||||
]
|
]
|
||||||
let namesJsonString = JSON.stringify({"items": items})
|
let namesJsonString = JSON.stringify({ "items": items })
|
||||||
let ret = await parentEpml.request('apiCall', {
|
let ret = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`,
|
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -565,7 +566,7 @@ class Websites extends LitElement {
|
|||||||
let items = [
|
let items = [
|
||||||
name
|
name
|
||||||
]
|
]
|
||||||
let namesJsonString = JSON.stringify({"items": items})
|
let namesJsonString = JSON.stringify({ "items": items })
|
||||||
let ret = await parentEpml.request('apiCall', {
|
let ret = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`,
|
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`,
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
@ -619,7 +620,7 @@ class Websites extends LitElement {
|
|||||||
let items = [
|
let items = [
|
||||||
name
|
name
|
||||||
]
|
]
|
||||||
let namesJsonString = JSON.stringify({"items": items})
|
let namesJsonString = JSON.stringify({ "items": items })
|
||||||
|
|
||||||
let ret = await parentEpml.request('apiCall', {
|
let ret = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
||||||
@ -649,7 +650,7 @@ class Websites extends LitElement {
|
|||||||
let items = [
|
let items = [
|
||||||
name
|
name
|
||||||
]
|
]
|
||||||
let namesJsonString = JSON.stringify({"items": items})
|
let namesJsonString = JSON.stringify({ "items": items })
|
||||||
|
|
||||||
let ret = await parentEpml.request('apiCall', {
|
let ret = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
url: `/lists/followedNames?apiKey=${this.getApiKey()}`,
|
||||||
@ -676,7 +677,7 @@ class Websites extends LitElement {
|
|||||||
let items = [
|
let items = [
|
||||||
name
|
name
|
||||||
]
|
]
|
||||||
let namesJsonString = JSON.stringify({"items": items})
|
let namesJsonString = JSON.stringify({ "items": items })
|
||||||
|
|
||||||
let ret = await parentEpml.request('apiCall', {
|
let ret = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`,
|
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`,
|
||||||
@ -706,7 +707,7 @@ class Websites extends LitElement {
|
|||||||
let items = [
|
let items = [
|
||||||
name
|
name
|
||||||
]
|
]
|
||||||
let namesJsonString = JSON.stringify({"items": items})
|
let namesJsonString = JSON.stringify({ "items": items })
|
||||||
|
|
||||||
let ret = await parentEpml.request('apiCall', {
|
let ret = await parentEpml.request('apiCall', {
|
||||||
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`,
|
url: `/lists/blockedNames?apiKey=${this.getApiKey()}`,
|
||||||
|
@ -32,14 +32,14 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
background: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<reward-share></reward-share>
|
<reward-share></reward-share>
|
||||||
<script type="module" src="reward-share.js"></script>
|
<script src="reward-share.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -7,10 +7,9 @@ import '@material/mwc-button'
|
|||||||
import '@material/mwc-textfield'
|
import '@material/mwc-textfield'
|
||||||
import '@material/mwc-dialog'
|
import '@material/mwc-dialog'
|
||||||
import '@material/mwc-slider'
|
import '@material/mwc-slider'
|
||||||
|
|
||||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||||
import '@vaadin/vaadin-grid/vaadin-grid.js'
|
import '@vaadin/grid/vaadin-grid.js'
|
||||||
import '@vaadin/vaadin-grid/theme/material/all-imports.js'
|
import '@vaadin/grid/theme/material/all-imports.js'
|
||||||
|
|
||||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||||
|
|
||||||
@ -43,6 +42,12 @@ class RewardShare extends LitElement {
|
|||||||
padding: 12px 24px;
|
padding: 12px 24px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.divCard {
|
||||||
|
border: 1px solid #eee;
|
||||||
|
padding: 1em;
|
||||||
|
box-shadow: 0 .3px 1px 0 rgba(0,0,0,0.14), 0 1px 1px -1px rgba(0,0,0,0.12), 0 1px 2px 0 rgba(0,0,0,0.20);
|
||||||
|
}
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
margin:0;
|
margin:0;
|
||||||
}
|
}
|
||||||
@ -73,11 +78,13 @@ class RewardShare extends LitElement {
|
|||||||
return html`
|
return html`
|
||||||
<div id="reward-share-page">
|
<div id="reward-share-page">
|
||||||
<div style="min-height:48px; display: flex; padding-bottom: 6px;">
|
<div style="min-height:48px; display: flex; padding-bottom: 6px;">
|
||||||
<h3 style="margin: 0; flex: 1; padding-top: 8px; display: inline;">Rewardshares involving this account</h3>
|
<h3 style="margin: 0; flex: 1; padding-top: 8px; display: inline;">Rewardshares</h3>
|
||||||
<mwc-button style="float:right;" @click=${() => this.shadowRoot.querySelector('#createRewardShareDialog').show()}><mwc-icon>add</mwc-icon>Create reward share</mwc-button>
|
<mwc-button style="float:right;" @click=${() => this.shadowRoot.querySelector('#createRewardShareDialog').show()}><mwc-icon>add</mwc-icon>Create reward share</mwc-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<vaadin-grid id="accountRewardSharesGrid" style="height:auto;" ?hidden="${this.isEmptyArray(this.rewardShares)}" .items="${this.rewardShares}" height-by-rows>
|
<div class="divCard">
|
||||||
|
<h3 style="margin: 0; margin-bottom: 1em; text-align: center;">Rewardshares Involving In This Account</h3>
|
||||||
|
<vaadin-grid theme="compact" id="accountRewardSharesGrid" ?hidden="${this.isEmptyArray(this.rewardShares)}" .items="${this.rewardShares}" all-rows-visible>
|
||||||
<vaadin-grid-column auto-width path="mintingAccount"></vaadin-grid-column>
|
<vaadin-grid-column auto-width path="mintingAccount"></vaadin-grid-column>
|
||||||
<vaadin-grid-column auto-width path="sharePercent"></vaadin-grid-column>
|
<vaadin-grid-column auto-width path="sharePercent"></vaadin-grid-column>
|
||||||
<vaadin-grid-column auto-width path="recipient"></vaadin-grid-column>
|
<vaadin-grid-column auto-width path="recipient"></vaadin-grid-column>
|
||||||
@ -85,6 +92,7 @@ class RewardShare extends LitElement {
|
|||||||
render(html`${this.renderRemoveRewardShareButton(data.item)}`, root)
|
render(html`${this.renderRemoveRewardShareButton(data.item)}`, root)
|
||||||
}}></vaadin-grid-column>
|
}}></vaadin-grid-column>
|
||||||
</vaadin-grid>
|
</vaadin-grid>
|
||||||
|
</div>
|
||||||
|
|
||||||
<mwc-dialog id="createRewardShareDialog" scrimClickAction="${this.createRewardShareLoading ? '' : 'close'}">
|
<mwc-dialog id="createRewardShareDialog" scrimClickAction="${this.createRewardShareLoading ? '' : 'close'}">
|
||||||
<div>Level 1 - 4 can create a Self Share and Level 5 or above can create a Reward Share!</div>
|
<div>Level 1 - 4 can create a Self Share and Level 5 or above can create a Reward Share!</div>
|
||||||
@ -248,7 +256,7 @@ class RewardShare extends LitElement {
|
|||||||
const recipientPublicKey = this.shadowRoot.getElementById("recipientPublicKey").value
|
const recipientPublicKey = this.shadowRoot.getElementById("recipientPublicKey").value
|
||||||
const percentageShare = this.shadowRoot.getElementById("rewardSharePercentageSlider").value
|
const percentageShare = this.shadowRoot.getElementById("rewardSharePercentageSlider").value
|
||||||
|
|
||||||
// Check for valid...^
|
// Check for valid...
|
||||||
this.createRewardShareLoading = true
|
this.createRewardShareLoading = true
|
||||||
|
|
||||||
let recipientAddress = window.parent.base58PublicKeyToAddress(recipientPublicKey)
|
let recipientAddress = window.parent.base58PublicKeyToAddress(recipientPublicKey)
|
||||||
@ -339,8 +347,8 @@ class RewardShare extends LitElement {
|
|||||||
this.error = true
|
this.error = true
|
||||||
this.message = `CANNOT CREATE SELF SHARE! at level ${accountDetails.level}`
|
this.message = `CANNOT CREATE SELF SHARE! at level ${accountDetails.level}`
|
||||||
}
|
}
|
||||||
} else { //Check for creating reward shares
|
} else {
|
||||||
|
//Check for creating reward shares
|
||||||
if (accountDetails.level >= 5) {
|
if (accountDetails.level >= 5) {
|
||||||
|
|
||||||
this.error = false
|
this.error = false
|
||||||
@ -402,7 +410,7 @@ class RewardShare extends LitElement {
|
|||||||
async removeRewardShare(rewardShareObject) {
|
async removeRewardShare(rewardShareObject) {
|
||||||
const myPercentageShare = -1
|
const myPercentageShare = -1
|
||||||
|
|
||||||
// Check for valid...^
|
// Check for valid...
|
||||||
this.removeRewardShareLoading = true
|
this.removeRewardShareLoading = true
|
||||||
|
|
||||||
// Get Last Ref
|
// Get Last Ref
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
@ -77,7 +77,6 @@ class SendMoneyPage extends LitElement {
|
|||||||
.address-icon {
|
.address-icon {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
border: 5px solid;
|
border: 5px solid;
|
||||||
/*border-left: 4px solid;*/
|
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,7 +219,7 @@ class SendMoneyPage extends LitElement {
|
|||||||
id="amountInput"
|
id="amountInput"
|
||||||
required
|
required
|
||||||
label="Amount (QORT)"
|
label="Amount (QORT)"
|
||||||
@input="${(e) => {this._checkAmount(e)}}"
|
@input="${(e) => { this._checkAmount(e) }}"
|
||||||
type="number"
|
type="number"
|
||||||
auto-validate="false"
|
auto-validate="false"
|
||||||
value="${this.amount}"
|
value="${this.amount}"
|
||||||
|
@ -15,20 +15,20 @@ blockTests.push((block, addr) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
export class AddressWatcher {
|
export class AddressWatcher {
|
||||||
constructor (addresses) {
|
constructor(addresses) {
|
||||||
addresses = addresses || []
|
addresses = addresses || []
|
||||||
this.reset()
|
this.reset()
|
||||||
|
|
||||||
addresses.forEach(addr => this.addAddress(addr))
|
addresses.forEach(addr => this.addAddress(addr))
|
||||||
}
|
}
|
||||||
|
|
||||||
reset () {
|
reset() {
|
||||||
this._addresses = {}
|
this._addresses = {}
|
||||||
this._addressStreams = {}
|
this._addressStreams = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds an address to watch
|
// Adds an address to watch
|
||||||
addAddress (address) {
|
addAddress(address) {
|
||||||
const addr = address.address
|
const addr = address.address
|
||||||
this._addresses[addr] = address
|
this._addresses[addr] = address
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ export class AddressWatcher {
|
|||||||
this.updateAddress(addr)
|
this.updateAddress(addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
async testBlock (block) {
|
async testBlock(block) {
|
||||||
const pendingUpdateAddresses = []
|
const pendingUpdateAddresses = []
|
||||||
const transactions = await parentEpml.request('apiCall', { url: `/transactions/block/${block.signature}` })
|
const transactions = await parentEpml.request('apiCall', { url: `/transactions/block/${block.signature}` })
|
||||||
transactions.forEach(transaction => {
|
transactions.forEach(transaction => {
|
||||||
@ -57,7 +57,7 @@ export class AddressWatcher {
|
|||||||
pendingUpdateAddresses.forEach(addr => this.updateAddress(addr))
|
pendingUpdateAddresses.forEach(addr => this.updateAddress(addr))
|
||||||
}
|
}
|
||||||
|
|
||||||
async updateAddress (addr) {
|
async updateAddress(addr) {
|
||||||
let addressRequest = await parentEpml.request('apiCall', {
|
let addressRequest = await parentEpml.request('apiCall', {
|
||||||
type: 'explorer',
|
type: 'explorer',
|
||||||
data: {
|
data: {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { parentEpml } from '../connect.js'
|
import { parentEpml } from '../connect.js'
|
||||||
|
|
||||||
export class UnconfirmedTransactionWatcher {
|
export class UnconfirmedTransactionWatcher {
|
||||||
constructor () {
|
constructor() {
|
||||||
this._unconfirmedTransactionStreams = {}
|
this._unconfirmedTransactionStreams = {}
|
||||||
this.reset() // Sets defaults
|
this.reset() // Sets defaults
|
||||||
|
|
||||||
@ -10,13 +10,13 @@ export class UnconfirmedTransactionWatcher {
|
|||||||
}, 10 * 1000)
|
}, 10 * 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
reset () {
|
reset() {
|
||||||
this._addresses = {}
|
this._addresses = {}
|
||||||
this._addressesUnconfirmedTransactions = {}
|
this._addressesUnconfirmedTransactions = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds an address to watch
|
// Adds an address to watch
|
||||||
addAddress (address) {
|
addAddress(address) {
|
||||||
const addr = address.address
|
const addr = address.address
|
||||||
this._addresses[addr] = address
|
this._addresses[addr] = address
|
||||||
this._addressesUnconfirmedTransactions[addr] = []
|
this._addressesUnconfirmedTransactions[addr] = []
|
||||||
@ -24,13 +24,13 @@ export class UnconfirmedTransactionWatcher {
|
|||||||
this._unconfirmedTransactionStreams[addr] = new EpmlStream(`unconfirmedOfAddress/${addr}`, () => this._addressesUnconfirmedTransactions[addr])
|
this._unconfirmedTransactionStreams[addr] = new EpmlStream(`unconfirmedOfAddress/${addr}`, () => this._addressesUnconfirmedTransactions[addr])
|
||||||
}
|
}
|
||||||
|
|
||||||
check () {
|
check() {
|
||||||
const c = this._addressTransactionCheck()
|
const c = this._addressTransactionCheck()
|
||||||
.then(() => setTimeout(() => this.check(), 5000))
|
.then(() => setTimeout(() => this.check(), 5000))
|
||||||
.catch(() => setTimeout(() => this.check(), 5000))
|
.catch(() => setTimeout(() => this.check(), 5000))
|
||||||
}
|
}
|
||||||
|
|
||||||
async _addressTransactionCheck () {
|
async _addressTransactionCheck() {
|
||||||
return Promise.all(Object.keys(this._addresses).map(addr => {
|
return Promise.all(Object.keys(this._addresses).map(addr => {
|
||||||
return parentEpml.request('apiCall', {
|
return parentEpml.request('apiCall', {
|
||||||
type: 'api',
|
type: 'api',
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" href="/font/material-icons.css">
|
<link rel="stylesheet" href="/font/material-icons.css">
|
||||||
<meta charset="UTF-8">
|
|
||||||
<style>
|
<style>
|
||||||
html {
|
html {
|
||||||
--scrollbarBG: #a1a1a1;
|
--scrollbarBG: #a1a1a1;
|
||||||
@ -33,14 +32,14 @@
|
|||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-family: "Roboto", sans-serif;
|
font-family: "Roboto", sans-serif;
|
||||||
background: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<trade-portal></trade-portal>
|
<trade-portal></trade-portal>
|
||||||
<script type="module" src="trade-portal.js"></script>
|
<script src="trade-portal.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -1,21 +1,21 @@
|
|||||||
import { LitElement, html, css } from 'lit';
|
import { LitElement, html, css } from 'lit'
|
||||||
import { render } from 'lit/html.js';
|
import { render } from 'lit/html.js'
|
||||||
import { Epml } from '../../../epml.js';
|
import { Epml } from '../../../epml.js'
|
||||||
|
|
||||||
import '@material/mwc-button';
|
import '@material/mwc-button'
|
||||||
import '@material/mwc-textfield';
|
import '@material/mwc-textfield'
|
||||||
import '@material/mwc-icon-button';
|
import '@material/mwc-icon-button'
|
||||||
import '@material/mwc-dialog';
|
import '@material/mwc-dialog'
|
||||||
import '@material/mwc-tab-bar';
|
import '@material/mwc-tab-bar'
|
||||||
import '@material/mwc-tab';
|
import '@material/mwc-tab'
|
||||||
import '@material/mwc-list/mwc-list-item';
|
import '@material/mwc-list/mwc-list-item'
|
||||||
import '@material/mwc-select';
|
import '@material/mwc-select'
|
||||||
import '@polymer/paper-spinner/paper-spinner-lite.js';
|
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||||
import '@vaadin/vaadin-grid/vaadin-grid.js';
|
import '@vaadin/grid/vaadin-grid.js'
|
||||||
import '@vaadin/vaadin-grid/vaadin-grid-sorter';
|
import '@vaadin/grid/vaadin-grid-sorter'
|
||||||
import '@vaadin/vaadin-grid/theme/material/all-imports.js';
|
import '@vaadin/grid/theme/material/all-imports.js'
|
||||||
|
|
||||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent });
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||||
|
|
||||||
let workers = new Map();
|
let workers = new Map();
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ class TradePortal extends LitElement {
|
|||||||
selectedCoin: { type: String },
|
selectedCoin: { type: String },
|
||||||
isLoadingHistoricTrades: { type: Boolean },
|
isLoadingHistoricTrades: { type: Boolean },
|
||||||
isLoadingOpenTrades: { type: Boolean },
|
isLoadingOpenTrades: { type: Boolean },
|
||||||
isLoadingMyOpenOrders: { type: Boolean },
|
isLoadingMyOpenOrders: { type: Boolean }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -610,7 +610,7 @@ class TradePortal extends LitElement {
|
|||||||
id="sellAmountInput"
|
id="sellAmountInput"
|
||||||
required label="Amount (QORT)"
|
required label="Amount (QORT)"
|
||||||
placeholder="0.0000"
|
placeholder="0.0000"
|
||||||
@input="${(e) => {this._checkSellAmount(e)}}"
|
@input="${(e) => { this._checkSellAmount(e) }}"
|
||||||
type="number"
|
type="number"
|
||||||
auto-validate="false"
|
auto-validate="false"
|
||||||
outlined value="${this.initialAmount}"
|
outlined value="${this.initialAmount}"
|
||||||
@ -623,7 +623,7 @@ class TradePortal extends LitElement {
|
|||||||
id="sellPriceInput"
|
id="sellPriceInput"
|
||||||
required label="Price Ea. (${this.listedCoins.get(this.selectedCoin).coinCode})"
|
required label="Price Ea. (${this.listedCoins.get(this.selectedCoin).coinCode})"
|
||||||
placeholder="0.0000"
|
placeholder="0.0000"
|
||||||
@input="${(e) => {this._checkSellAmount(e)}}"
|
@input="${(e) => { this._checkSellAmount(e) }}"
|
||||||
type="number"
|
type="number"
|
||||||
auto-validate="false"
|
auto-validate="false"
|
||||||
outlined value="${this.initialAmount}"
|
outlined value="${this.initialAmount}"
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="/font/material-icons.css" />
|
<head>
|
||||||
|
<link rel="stylesheet" href="/font/material-icons.css">
|
||||||
<style>
|
<style>
|
||||||
html {
|
html {
|
||||||
--scrollbarBG: #a1a1a1;
|
--scrollbarBG: #a1a1a1;
|
||||||
@ -30,14 +31,15 @@
|
|||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
background: white;
|
font-family: "Roboto", sans-serif;
|
||||||
font-family: 'Roboto', sans-serif;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<multi-wallet></multi-wallet>
|
<multi-wallet></multi-wallet>
|
||||||
<script src="wallet-app.js"></script>
|
<script src="wallet-app.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -3,19 +3,17 @@ import { render } from 'lit/html.js'
|
|||||||
import { Epml } from '../../../epml.js'
|
import { Epml } from '../../../epml.js'
|
||||||
|
|
||||||
import '../components/ButtonIconCopy'
|
import '../components/ButtonIconCopy'
|
||||||
|
|
||||||
import '@material/mwc-icon'
|
import '@material/mwc-icon'
|
||||||
import '@material/mwc-button'
|
import '@material/mwc-button'
|
||||||
import '@material/mwc-dialog'
|
import '@material/mwc-dialog'
|
||||||
|
|
||||||
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
import '@polymer/paper-spinner/paper-spinner-lite.js'
|
||||||
import '@vaadin/vaadin-grid/vaadin-grid.js'
|
import '@vaadin/grid/vaadin-grid.js'
|
||||||
import '@vaadin/vaadin-grid/theme/material/all-imports.js'
|
import '@vaadin/grid/theme/material/all-imports.js'
|
||||||
|
|
||||||
import '@github/time-elements'
|
import '@github/time-elements'
|
||||||
|
|
||||||
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
const parentEpml = new Epml({ type: 'WINDOW', source: window.parent })
|
||||||
const coinsNames=['qort','btc','ltc','doge']
|
|
||||||
|
const coinsNames = ['qort', 'btc', 'ltc', 'doge']
|
||||||
|
|
||||||
class MultiWallet extends LitElement {
|
class MultiWallet extends LitElement {
|
||||||
static get properties() {
|
static get properties() {
|
||||||
@ -25,9 +23,9 @@ class MultiWallet extends LitElement {
|
|||||||
lastBlock: { type: Object },
|
lastBlock: { type: Object },
|
||||||
selectedTransaction: { type: Object },
|
selectedTransaction: { type: Object },
|
||||||
isTextMenuOpen: { type: Boolean },
|
isTextMenuOpen: { type: Boolean },
|
||||||
wallets:{type : Map},
|
wallets: { type: Map },
|
||||||
_selectedWallet:'qort',
|
_selectedWallet: 'qort',
|
||||||
balanceString:'Fetching balance ...'
|
balanceString: 'Fetching balance ...'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +112,6 @@ class MultiWallet extends LitElement {
|
|||||||
table td,
|
table td,
|
||||||
th {
|
th {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
/* padding:10px; */
|
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
padding: 0 12px;
|
padding: 0 12px;
|
||||||
@ -151,8 +148,6 @@ class MultiWallet extends LitElement {
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
#transactionList > * {
|
#transactionList > * {
|
||||||
/* padding-left:24px;
|
|
||||||
padding-right:24px; */
|
|
||||||
}
|
}
|
||||||
.color-in {
|
.color-in {
|
||||||
color: #02977e;
|
color: #02977e;
|
||||||
@ -254,7 +249,6 @@ class MultiWallet extends LitElement {
|
|||||||
border-top: 1px solid #e5e5e5;
|
border-top: 1px solid #e5e5e5;
|
||||||
padding-top: 0px;
|
padding-top: 0px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
/* overflow: auto; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.show {
|
.show {
|
||||||
@ -490,24 +484,24 @@ class MultiWallet extends LitElement {
|
|||||||
|
|
||||||
this.selectWallet = this.selectWallet.bind(this)
|
this.selectWallet = this.selectWallet.bind(this)
|
||||||
|
|
||||||
this.wallets=new Map()
|
this.wallets = new Map()
|
||||||
let coinProp={
|
let coinProp = {
|
||||||
balance:0,
|
balance: 0,
|
||||||
wallet:null,
|
wallet: null,
|
||||||
transactions:[],
|
transactions: [],
|
||||||
fetchingWalletBalance:false,
|
fetchingWalletBalance: false,
|
||||||
fetchingWalletTransactions:false
|
fetchingWalletTransactions: false
|
||||||
}
|
}
|
||||||
coinsNames.forEach((c,i)=>{//reset fetching status, c:coin, i:index
|
coinsNames.forEach((c, i) => {
|
||||||
this.wallets.set(c,{...coinProp})
|
this.wallets.set(c, { ...coinProp })
|
||||||
},this)//thisArg=this
|
}, this)
|
||||||
|
|
||||||
this.wallets.get('qort').wallet = window.parent.reduxStore.getState().app.selectedAddress
|
this.wallets.get('qort').wallet = window.parent.reduxStore.getState().app.selectedAddress
|
||||||
this.wallets.get('btc').wallet = window.parent.reduxStore.getState().app.selectedAddress.btcWallet
|
this.wallets.get('btc').wallet = window.parent.reduxStore.getState().app.selectedAddress.btcWallet
|
||||||
this.wallets.get('ltc').wallet = window.parent.reduxStore.getState().app.selectedAddress.ltcWallet
|
this.wallets.get('ltc').wallet = window.parent.reduxStore.getState().app.selectedAddress.ltcWallet
|
||||||
this.wallets.get('doge').wallet = window.parent.reduxStore.getState().app.selectedAddress.dogeWallet
|
this.wallets.get('doge').wallet = window.parent.reduxStore.getState().app.selectedAddress.dogeWallet
|
||||||
|
|
||||||
this._selectedWallet='qort'
|
this._selectedWallet = 'qort'
|
||||||
|
|
||||||
parentEpml.ready().then(() => {
|
parentEpml.ready().then(() => {
|
||||||
parentEpml.subscribe('selected_address', async (selectedAddress) => {
|
parentEpml.subscribe('selected_address', async (selectedAddress) => {
|
||||||
@ -518,7 +512,6 @@ class MultiWallet extends LitElement {
|
|||||||
this.wallets.get('btc').wallet = window.parent.reduxStore.getState().app.selectedAddress.btcWallet
|
this.wallets.get('btc').wallet = window.parent.reduxStore.getState().app.selectedAddress.btcWallet
|
||||||
this.wallets.get('ltc').wallet = window.parent.reduxStore.getState().app.selectedAddress.ltcWallet
|
this.wallets.get('ltc').wallet = window.parent.reduxStore.getState().app.selectedAddress.ltcWallet
|
||||||
this.wallets.get('doge').wallet = window.parent.reduxStore.getState().app.selectedAddress.dogeWallet
|
this.wallets.get('doge').wallet = window.parent.reduxStore.getState().app.selectedAddress.dogeWallet
|
||||||
// this.updateAccountTransactions();
|
|
||||||
})
|
})
|
||||||
|
|
||||||
parentEpml.subscribe('copy_menu_switch', async (value) => {
|
parentEpml.subscribe('copy_menu_switch', async (value) => {
|
||||||
@ -599,9 +592,7 @@ class MultiWallet extends LitElement {
|
|||||||
<span class="title">Receiver</span>
|
<span class="title">Receiver</span>
|
||||||
<br />
|
<br />
|
||||||
<div><span class="">${this.selectedTransaction.recipient}</span></div>
|
<div><span class="">${this.selectedTransaction.recipient}</span></div>
|
||||||
${!this.selectedTransaction.amount
|
${!this.selectedTransaction.amount ? '' : html`
|
||||||
? ''
|
|
||||||
: html`
|
|
||||||
<span class="title">Amount</span>
|
<span class="title">Amount</span>
|
||||||
<br />
|
<br />
|
||||||
<div><span class="">${this.selectedTransaction.amount} QORT</span></div>
|
<div><span class="">${this.selectedTransaction.amount} QORT</span></div>
|
||||||
@ -685,7 +676,7 @@ class MultiWallet extends LitElement {
|
|||||||
</template>
|
</template>
|
||||||
</dom-module>
|
</dom-module>
|
||||||
<div style="padding-left:12px;" ?hidden="${!this.isEmptyArray(transactions)}">Address has no transactions yet.</div>
|
<div style="padding-left:12px;" ?hidden="${!this.isEmptyArray(transactions)}">Address has no transactions yet.</div>
|
||||||
<vaadin-grid theme="${coin}" id="${coin}TransactionsGrid" ?hidden="${this.isEmptyArray(this.wallets.get(this._selectedWallet).transactions)}" page-size="20" height-by-rows>
|
<vaadin-grid theme="${coin}" id="${coin}TransactionsGrid" ?hidden="${this.isEmptyArray(this.wallets.get(this._selectedWallet).transactions)}" page-size="20" all-rows-visible>
|
||||||
<vaadin-grid-column
|
<vaadin-grid-column
|
||||||
auto-width
|
auto-width
|
||||||
.renderer=${(root, column, data) => {
|
.renderer=${(root, column, data) => {
|
||||||
@ -694,9 +685,9 @@ class MultiWallet extends LitElement {
|
|||||||
}
|
}
|
||||||
const confirmed = data.item.confirmations >= requiredConfirmations
|
const confirmed = data.item.confirmations >= requiredConfirmations
|
||||||
if (confirmed) {
|
if (confirmed) {
|
||||||
render(html`<mwc-icon title="${ data.item.confirmations } Confirmations" style="color: #00C851">check</mwc-icon>`, root)
|
render(html`<mwc-icon title="${data.item.confirmations} Confirmations" style="color: #00C851">check</mwc-icon>`, root)
|
||||||
} else {
|
} else {
|
||||||
render(html`<mwc-icon title="${ data.item.confirmations || 0 }/${ requiredConfirmations } Confirmations" style="color: #777">schedule</mwc-icon>`, root)
|
render(html`<mwc-icon title="${data.item.confirmations || 0}/${requiredConfirmations} Confirmations" style="color: #777">schedule</mwc-icon>`, root)
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -732,7 +723,7 @@ class MultiWallet extends LitElement {
|
|||||||
renderBTCLikeTransactions(transactions, coin) {
|
renderBTCLikeTransactions(transactions, coin) {
|
||||||
return html`
|
return html`
|
||||||
<div style="padding-left:12px;" ?hidden="${!this.isEmptyArray(transactions)}">Address has no transactions yet.</div>
|
<div style="padding-left:12px;" ?hidden="${!this.isEmptyArray(transactions)}">Address has no transactions yet.</div>
|
||||||
<vaadin-grid id="${coin}TransactionsGrid" ?hidden="${this.isEmptyArray(this.wallets.get(this._selectedWallet).transactions)}" page-size="20" height-by-rows>
|
<vaadin-grid id="${coin}TransactionsGrid" ?hidden="${this.isEmptyArray(this.wallets.get(this._selectedWallet).transactions)}" page-size="20" all-rows-visible>
|
||||||
<vaadin-grid-column auto-width resizable header="Transaction Hash" path="txHash"></vaadin-grid-column>
|
<vaadin-grid-column auto-width resizable header="Transaction Hash" path="txHash"></vaadin-grid-column>
|
||||||
<vaadin-grid-column
|
<vaadin-grid-column
|
||||||
auto-width
|
auto-width
|
||||||
@ -920,33 +911,35 @@ class MultiWallet extends LitElement {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
target.classList.add('active')
|
target.classList.add('active')
|
||||||
this._selectedWallet=target.attributes.coin.value
|
this._selectedWallet = target.attributes.coin.value
|
||||||
this.showWallet()
|
this.showWallet()
|
||||||
}
|
}
|
||||||
|
|
||||||
async showWallet(){
|
async showWallet() {
|
||||||
this.transactionsDOM.hidden = true
|
this.transactionsDOM.hidden = true
|
||||||
this.loading = true
|
this.loading = true
|
||||||
|
|
||||||
if (this._selectedWallet=='qort') {
|
if (this._selectedWallet == 'qort') {
|
||||||
if (!window.parent.reduxStore.getState().app.blockInfo.height) {
|
if (!window.parent.reduxStore.getState().app.blockInfo.height) {
|
||||||
// we make sure that `blockHeight` is set before rendering QORT transactions
|
// we make sure that `blockHeight` is set before rendering QORT transactions
|
||||||
await parentEpml.request('apiCall', { url: `/blocks/height`, type: 'api' })
|
await parentEpml.request('apiCall', { url: `/blocks/height`, type: 'api' })
|
||||||
.then(height => parentEpml.request('updateBlockInfo', { height }))
|
.then(height => parentEpml.request('updateBlockInfo', { height }))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const coin=this._selectedWallet
|
const coin = this._selectedWallet
|
||||||
await this.fetchWalletDetails(this._selectedWallet)
|
await this.fetchWalletDetails(this._selectedWallet)
|
||||||
if(this._selectedWallet == coin){//if the wallet didn't switch
|
if (this._selectedWallet == coin) {
|
||||||
|
//if the wallet didn't switch
|
||||||
await this.renderTransactions()
|
await this.renderTransactions()
|
||||||
await this.getTransactionGrid(this._selectedWallet)
|
await this.getTransactionGrid(this._selectedWallet)
|
||||||
await this.updateItemsFromPage(1, true)
|
await this.updateItemsFromPage(1, true)
|
||||||
this.loading = false
|
this.loading = false
|
||||||
this.transactionsDOM.hidden = false
|
this.transactionsDOM.hidden = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
async fetchWalletDetails(coin){//this function will fetch the balance and transactions of the given wallet
|
async fetchWalletDetails(coin) {
|
||||||
this.balanceString="Fetching balance ..."
|
//this function will fetch the balance and transactions of the given wallet
|
||||||
|
this.balanceString = "Fetching balance ..."
|
||||||
switch (coin) {
|
switch (coin) {
|
||||||
case 'qort':
|
case 'qort':
|
||||||
//fetching the qort balance
|
//fetching the qort balance
|
||||||
@ -958,9 +951,10 @@ async showWallet(){
|
|||||||
if (isNaN(Number(res))) {
|
if (isNaN(Number(res))) {
|
||||||
parentEpml.request('showSnackBar', `Failed to Fetch QORT Balance. Try again!`)
|
parentEpml.request('showSnackBar', `Failed to Fetch QORT Balance. Try again!`)
|
||||||
} else {
|
} else {
|
||||||
if(this._selectedWallet==coin){//check if we are still fetching wallet balance ...
|
if (this._selectedWallet == coin) {
|
||||||
|
//check if we are still fetching wallet balance ...
|
||||||
this.wallets.get(coin).balance = res
|
this.wallets.get(coin).balance = res
|
||||||
this.balanceString=this.wallets.get(this._selectedWallet).balance+" "+this._selectedWallet.toLocaleUpperCase()
|
this.balanceString = this.wallets.get(this._selectedWallet).balance + " " + this._selectedWallet.toLocaleUpperCase()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -968,7 +962,7 @@ async showWallet(){
|
|||||||
const txsQort = await parentEpml.request('apiCall', {
|
const txsQort = await parentEpml.request('apiCall', {
|
||||||
url: `/transactions/search?address=${this.wallets.get('qort').wallet.address}&confirmationStatus=CONFIRMED&reverse=true`,
|
url: `/transactions/search?address=${this.wallets.get('qort').wallet.address}&confirmationStatus=CONFIRMED&reverse=true`,
|
||||||
})
|
})
|
||||||
if(this._selectedWallet==coin)
|
if (this._selectedWallet == coin)
|
||||||
this.wallets.get(coin).transactions = txsQort
|
this.wallets.get(coin).transactions = txsQort
|
||||||
|
|
||||||
break
|
break
|
||||||
@ -987,9 +981,10 @@ async showWallet(){
|
|||||||
if (isNaN(Number(res))) {
|
if (isNaN(Number(res))) {
|
||||||
parentEpml.request('showSnackBar', `Failed to Fetch ${coin.toLocaleUpperCase()} Balance. Try again!`)
|
parentEpml.request('showSnackBar', `Failed to Fetch ${coin.toLocaleUpperCase()} Balance. Try again!`)
|
||||||
} else {
|
} else {
|
||||||
if(this._selectedWallet==coin){//check if we are still fetching wallet balance ...
|
if (this._selectedWallet == coin) {
|
||||||
|
//check if we are still fetching wallet balance ...
|
||||||
this.wallets.get(this._selectedWallet).balance = (Number(res) / 1e8).toFixed(8)
|
this.wallets.get(this._selectedWallet).balance = (Number(res) / 1e8).toFixed(8)
|
||||||
this.balanceString=this.wallets.get(this._selectedWallet).balance+" "+this._selectedWallet.toLocaleUpperCase()
|
this.balanceString = this.wallets.get(this._selectedWallet).balance + " " + this._selectedWallet.toLocaleUpperCase()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -1004,7 +999,7 @@ async showWallet(){
|
|||||||
}
|
}
|
||||||
const sortedTransactions = txs.sort(compareFn)
|
const sortedTransactions = txs.sort(compareFn)
|
||||||
|
|
||||||
if(this._selectedWallet==coin){
|
if (this._selectedWallet == coin) {
|
||||||
this.wallets.get(this._selectedWallet).transactions = sortedTransactions
|
this.wallets.get(this._selectedWallet).transactions = sortedTransactions
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
@ -1039,8 +1034,8 @@ async showWallet(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
decimals(num) {
|
decimals(num) {
|
||||||
num = parseFloat(num) // So that conversion to string can get rid of insignificant zeros
|
num = parseFloat(num)
|
||||||
// return isNaN(num) ? 0 : (num + "").split(".")[1]
|
// So that conversion to string can get rid of insignificant zeros
|
||||||
return num % 1 > 0 ? (num + '').split('.')[1] : '0'
|
return num % 1 > 0 ? (num + '').split('.')[1] : '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user