forked from Qortal/qortal-ui
add bootstrap button to node and added new request
This commit is contained in:
parent
fee90d4934
commit
02c378687b
@ -1274,7 +1274,7 @@
|
||||
"tour16": "Checklist",
|
||||
"tour17": "Please start the Core to access the Qortal blockchain.",
|
||||
"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?",
|
||||
"tour21": "blocks remaining.",
|
||||
"tour22": "Refresh (bootstrap) requested. Please wait."
|
||||
|
@ -150,6 +150,7 @@ class NodeManagement extends LitElement {
|
||||
<div id="node-management-page">
|
||||
<div class="node-card">
|
||||
<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;" ?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>
|
||||
@ -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() {
|
||||
this.addPeerLoading = true
|
||||
const addPeerAddress = this.shadowRoot.getElementById('addPeerAddress').value
|
||||
console.log("ADDRESS", addPeerAddress)
|
||||
await parentEpml.request("apiCall", {
|
||||
url: `/peers?apiKey=${this.getApiKey()}`,
|
||||
method: "POST",
|
||||
body: addPeerAddress
|
||||
}).then((res) => {
|
||||
console.log("RES", res)
|
||||
if (res === true) {
|
||||
let trueString = get("walletpage.wchange52")
|
||||
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: {
|
||||
|
||||
const { encryptedData, publicKey } = data
|
||||
|
Loading…
x
Reference in New Issue
Block a user