added admin action qortal request

This commit is contained in:
2024-11-13 05:04:54 +02:00
parent f1eef8da71
commit 93a2071e77
11 changed files with 156 additions and 26 deletions

View File

@@ -15,7 +15,7 @@ export const AppViewer = React.forwardRef(({ app , hide, isDevMode}, iframeRef)
const { rootHeight } = useContext(MyContext);
// const iframeRef = useRef(null);
const { document, window: frameWindow } = useFrame();
const {path, history, changeCurrentIndex} = useQortalMessageListener(frameWindow, iframeRef, app?.tabId, isDevMode)
const {path, history, changeCurrentIndex} = useQortalMessageListener(frameWindow, iframeRef, app?.tabId, isDevMode, app?.name, app?.service)
const [url, setUrl] = useState('')
useEffect(()=> {

View File

@@ -39,6 +39,9 @@ const officialAppList = [
"qombo",
"q-fund",
"q-shop",
"q-trade",
"q-support",
"NodeInfo"
];
const ScrollerStyled = styled('div')({

View File

@@ -47,7 +47,9 @@ const officialAppList = [
"qombo",
"q-fund",
"q-shop",
"q-trade"
"q-trade",
"q-support",
"NodeInfo"
];
const ScrollerStyled = styled("div")({

View File

@@ -41,7 +41,9 @@ const officialAppList = [
"qombo",
"q-fund",
"q-shop",
"q-trade"
"q-trade",
"q-support",
"NodeInfo"
];
const ScrollerStyled = styled('div')({

View File

@@ -56,7 +56,9 @@ const officialAppList = [
"qombo",
"q-fund",
"q-shop",
"q-trade"
"q-trade",
"q-support",
"NodeInfo"
];
const ScrollerStyled = styled("div")({

View File

@@ -182,7 +182,7 @@ const UIQortalRequests = [
'GET_WALLET_BALANCE', 'GET_USER_WALLET_INFO', 'GET_CROSSCHAIN_SERVER_INFO',
'GET_TX_ACTIVITY_SUMMARY', 'GET_FOREIGN_FEE', 'UPDATE_FOREIGN_FEE',
'GET_SERVER_CONNECTION_HISTORY', 'SET_CURRENT_FOREIGN_SERVER',
'ADD_FOREIGN_SERVER', 'REMOVE_FOREIGN_SERVER', 'GET_DAY_SUMMARY', 'CREATE_TRADE_BUY_ORDER', 'CREATE_TRADE_SELL_ORDER', 'CANCEL_TRADE_SELL_ORDER', 'IS_USING_GATEWAY'
'ADD_FOREIGN_SERVER', 'REMOVE_FOREIGN_SERVER', 'GET_DAY_SUMMARY', 'CREATE_TRADE_BUY_ORDER', 'CREATE_TRADE_SELL_ORDER', 'CANCEL_TRADE_SELL_ORDER', 'IS_USING_GATEWAY', 'ADMIN_ACTION'
];
@@ -382,7 +382,7 @@ const UIQortalRequests = [
return obj; // Updated object with references to stored files
}
export const useQortalMessageListener = (frameWindow, iframeRef, tabId, isDevMode) => {
export const useQortalMessageListener = (frameWindow, iframeRef, tabId, isDevMode, appName, appService) => {
const [path, setPath] = useState('')
const [history, setHistory] = useState({
customQDNHistoryPaths: [],
@@ -436,7 +436,9 @@ isDOMContentLoaded: false
if (event?.data?.requestedHandler !== 'UI') return;
const sendMessageToRuntime = (message, eventPort) => {
window.sendMessage(message.action, message.payload, 300000, message.isExtension)
window.sendMessage(message.action, message.payload, 300000, message.isExtension, {
name: appName, service: appService
})
.then((response) => {
if (response.error) {
eventPort.postMessage({
@@ -553,7 +555,7 @@ isDOMContentLoaded: false
};
}, [isDevMode]); // Empty dependency array to run once when the component mounts
}, [isDevMode, appName, appService]); // Empty dependency array to run once when the component mounts