forked from Qortal/qortal-ui
Merge pull request #243 from Philreact/feature/node-bootstrap-button
add bootstrap button to node and added new request
This commit is contained in:
commit
581257163e
@ -1274,7 +1274,7 @@
|
|||||||
"tour16": "Checklist",
|
"tour16": "Checklist",
|
||||||
"tour17": "Please start the Core to access the Qortal blockchain.",
|
"tour17": "Please start the Core to access the Qortal blockchain.",
|
||||||
"tour18": "Refresh (bootstrap)",
|
"tour18": "Refresh (bootstrap)",
|
||||||
"tour19": "Currently syncing... you must be fully synchronized to use Qortal",
|
"tour19": "Currently syncing... you must be fully synchronized to use Qortal.",
|
||||||
"tour20": "blocks behind. Would you like to refresh (bootstrap) to speed up the syncing process?",
|
"tour20": "blocks behind. Would you like to refresh (bootstrap) to speed up the syncing process?",
|
||||||
"tour21": "blocks remaining.",
|
"tour21": "blocks remaining.",
|
||||||
"tour22": "Refresh (bootstrap) requested. Please wait."
|
"tour22": "Refresh (bootstrap) requested. Please wait."
|
||||||
|
@ -150,6 +150,7 @@ class NodeManagement extends LitElement {
|
|||||||
<div id="node-management-page">
|
<div id="node-management-page">
|
||||||
<div class="node-card">
|
<div class="node-card">
|
||||||
<h2>${translate("nodepage.nchange1")} ${this.nodeDomain}</h2>
|
<h2>${translate("nodepage.nchange1")} ${this.nodeDomain}</h2>
|
||||||
|
<mwc-button style="float:right;" ?hidden="${(this.upTime === "offline")}" @click=${() => this.bootstrap()}><mwc-icon>restart_alt</mwc-icon> ${translate("tour.tour18")}</mwc-button>
|
||||||
<mwc-button style="float:right;" class="red" ?hidden="${(this.upTime === "offline")}" @click=${() => this.stopNode()}><mwc-icon>dangerous</mwc-icon> ${translate("nodepage.nchange31")}</mwc-button>
|
<mwc-button style="float:right;" class="red" ?hidden="${(this.upTime === "offline")}" @click=${() => this.stopNode()}><mwc-icon>dangerous</mwc-icon> ${translate("nodepage.nchange31")}</mwc-button>
|
||||||
<mwc-button style="float:right;" ?hidden="${(this.upTime === "offline")}" @click=${() => this.restartNode()}><mwc-icon>360</mwc-icon> ${translate("nodepage.nchange33")}</mwc-button>
|
<mwc-button style="float:right;" ?hidden="${(this.upTime === "offline")}" @click=${() => this.restartNode()}><mwc-icon>360</mwc-icon> ${translate("nodepage.nchange33")}</mwc-button>
|
||||||
<span class="sblack"><br>${translate("nodepage.nchange2")} ${this.upTime}</span>
|
<span class="sblack"><br>${translate("nodepage.nchange2")} ${this.upTime}</span>
|
||||||
@ -425,16 +426,29 @@ class NodeManagement extends LitElement {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bootstrap() {
|
||||||
|
parentEpml
|
||||||
|
.request("apiCall", {
|
||||||
|
url: `/admin/bootstrap/?apiKey=${this.getApiKey()}`,
|
||||||
|
method: "GET"
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
if (res === true) {
|
||||||
|
let snackString = get("tour.tour22")
|
||||||
|
parentEpml.request('showSnackBar', `${snackString}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
async addPeer() {
|
async addPeer() {
|
||||||
this.addPeerLoading = true
|
this.addPeerLoading = true
|
||||||
const addPeerAddress = this.shadowRoot.getElementById('addPeerAddress').value
|
const addPeerAddress = this.shadowRoot.getElementById('addPeerAddress').value
|
||||||
console.log("ADDRESS", addPeerAddress)
|
|
||||||
await parentEpml.request("apiCall", {
|
await parentEpml.request("apiCall", {
|
||||||
url: `/peers?apiKey=${this.getApiKey()}`,
|
url: `/peers?apiKey=${this.getApiKey()}`,
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: addPeerAddress
|
body: addPeerAddress
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log("RES", res)
|
|
||||||
if (res === true) {
|
if (res === true) {
|
||||||
let trueString = get("walletpage.wchange52")
|
let trueString = get("walletpage.wchange52")
|
||||||
parentEpml.request('showSnackBar', `${trueString}`)
|
parentEpml.request('showSnackBar', `${trueString}`)
|
||||||
|
@ -836,6 +836,45 @@ class WebBrowser extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case actions.ENCRYPT_DATA: {
|
||||||
|
try {
|
||||||
|
let dataSentBack = {}
|
||||||
|
let data64 = data.data64
|
||||||
|
let publicKeys = data.publicKeys || []
|
||||||
|
if (data.file) {
|
||||||
|
data64 = await fileToBase64(data.file)
|
||||||
|
}
|
||||||
|
if (!data64) {
|
||||||
|
|
||||||
|
dataSentBack['error'] = "Please include data to encrypt"
|
||||||
|
response = JSON.stringify(dataSentBack)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
const encryptDataResponse = encryptDataGroup({
|
||||||
|
data64, publicKeys: publicKeys
|
||||||
|
})
|
||||||
|
if (encryptDataResponse) {
|
||||||
|
data64 = encryptDataResponse
|
||||||
|
response = JSON.stringify(encryptDataResponse)
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
dataSentBack['error'] = "Unable to encrypt"
|
||||||
|
response = JSON.stringify(dataSentBack)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
const data = {}
|
||||||
|
const errorMsg = error.message || "Error in encrypting data"
|
||||||
|
data['error'] = errorMsg
|
||||||
|
response = JSON.stringify(data)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
case actions.DECRYPT_DATA: {
|
case actions.DECRYPT_DATA: {
|
||||||
|
|
||||||
const { encryptedData, publicKey } = data
|
const { encryptedData, publicKey } = data
|
||||||
|
Loading…
x
Reference in New Issue
Block a user