diff --git a/plugins/plugins/core/components/qdn-action-types.js b/plugins/plugins/core/components/qdn-action-types.js
index 1c359e06..cd795600 100644
--- a/plugins/plugins/core/components/qdn-action-types.js
+++ b/plugins/plugins/core/components/qdn-action-types.js
@@ -112,5 +112,5 @@ export const GET_FRIENDS_LIST = 'GET_FRIENDS_LIST'
// OPEN_PROFILE
export const OPEN_PROFILE = 'OPEN_PROFILE'
-// GET_API_KEY
-export const GET_API_KEY = 'GET_API_KEY'
+// ADMIN_ACTION
+export const ADMIN_ACTION = 'ADMIN_ACTION'
diff --git a/plugins/plugins/core/qdn/browser/browser.src.js b/plugins/plugins/core/qdn/browser/browser.src.js
index f794fdb1..acce1221 100644
--- a/plugins/plugins/core/qdn/browser/browser.src.js
+++ b/plugins/plugins/core/qdn/browser/browser.src.js
@@ -180,36 +180,36 @@ class WebBrowser extends LitElement {
render() {
return html`
-
-
-
-
this.goBack()} title="${translate('general.back')}" class="address-bar-button">
+
+ ${this.renderBlockUnblockButton()}
+ ${this.renderFollowUnfollowButton()}
+
+
+
+
+
+
`
}
@@ -286,24 +286,50 @@ class WebBrowser extends LitElement {
}
}
- case actions.GET_API_KEY: {
- let res1 = await showModalAndWait(
- actions.GET_API_KEY,
- {
- service: this.service,
- name: this.name
- }
- );
- if (res1 && res1.action === 'accept') {
- let apiKey = this.getApiKey();
- response = JSON.stringify({ apiKey });
- break;
- } else {
- const data = {};
- data['error'] = "User declined to share API key";
- response = JSON.stringify(data);
- break;
- }
+ case actions.ADMIN_ACTION: {
+ let type = data.type;
+ let res1 = await showModalAndWait(
+ actions.ADMIN_ACTION,
+ {
+ service: this.service,
+ name: this.name,
+ type: type
+ }
+ );
+ if (res1 && res1.action === 'accept') {
+ try {
+ // Determine the API endpoint based on the type
+ let apiEndpoint = '';
+ switch (type.toLowerCase()) {
+ case 'stop':
+ apiEndpoint = '/admin/stop';
+ break;
+ case 'restart':
+ apiEndpoint = '/admin/restart';
+ break;
+ case 'bootstrap':
+ apiEndpoint = '/admin/bootstrap';
+ break;
+ default:
+ throw new Error(`Unknown admin action type: ${type}`);
+ }
+ // Send the API request
+ let apiResponse = await parentEpml.request('apiCall', {
+ type: 'api',
+ url: `${apiEndpoint}?apiKey=${this.getApiKey()}`
+ });
+ response = JSON.stringify(apiResponse);
+ } catch (error) {
+ const data = {};
+ data['error'] = `Error performing admin action: ${error.message}`;
+ response = JSON.stringify(data);
+ }
+ } else {
+ const data = {};
+ data['error'] = `User declined admin action: ${type}`;
+ response = JSON.stringify(data);
+ }
+ break;
}
case actions.ENCRYPT_DATA: {
@@ -1918,13 +1944,13 @@ class WebBrowser extends LitElement {
const requiredFields = ['coin','type']
const missingFields = []
- requiredFields.forEach((field) => {
+ requiredFields.forEach((field) => {
if (!data[field]) {
missingFields.push(field)
}
})
- if (missingFields.length > 0) {
+ if (missingFields.length > 0) {
const missingFieldsString = missingFields.join(', ')
const errorMsg = `Missing fields: ${missingFieldsString}`
let data = {}
@@ -3821,12 +3847,12 @@ async function showModalAndWait(type, data) {
` : ''}
- ${type === actions.GET_API_KEY ? `
-
-
${`${data.service.toLowerCase()} wants to access your API key.`}
-
Allow ${data.service.toLowerCase()} to access your API key?
-
Please confirm your approval.
-
+ ${type === actions.ADMIN_ACTION ? `
+
+
${`${data.service.toLowerCase()} wants to perform an admin action.`}
+
Allow ${data.service.toLowerCase()} to ${data.type} your node?
+
Please confirm your approval.
+
` : ''}
${type === actions.PUBLISH_MULTIPLE_QDN_RESOURCES ? `