mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-07-23 04:36:52 +00:00
added admin action qortal request
This commit is contained in:
@@ -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(()=> {
|
||||
|
@@ -39,6 +39,9 @@ const officialAppList = [
|
||||
"qombo",
|
||||
"q-fund",
|
||||
"q-shop",
|
||||
"q-trade",
|
||||
"q-support",
|
||||
"NodeInfo"
|
||||
];
|
||||
|
||||
const ScrollerStyled = styled('div')({
|
||||
|
@@ -47,7 +47,9 @@ const officialAppList = [
|
||||
"qombo",
|
||||
"q-fund",
|
||||
"q-shop",
|
||||
"q-trade"
|
||||
"q-trade",
|
||||
"q-support",
|
||||
"NodeInfo"
|
||||
];
|
||||
|
||||
const ScrollerStyled = styled("div")({
|
||||
|
@@ -41,7 +41,9 @@ const officialAppList = [
|
||||
"qombo",
|
||||
"q-fund",
|
||||
"q-shop",
|
||||
"q-trade"
|
||||
"q-trade",
|
||||
"q-support",
|
||||
"NodeInfo"
|
||||
];
|
||||
|
||||
const ScrollerStyled = styled('div')({
|
||||
|
@@ -56,7 +56,9 @@ const officialAppList = [
|
||||
"qombo",
|
||||
"q-fund",
|
||||
"q-shop",
|
||||
"q-trade"
|
||||
"q-trade",
|
||||
"q-support",
|
||||
"NodeInfo"
|
||||
];
|
||||
|
||||
const ScrollerStyled = styled("div")({
|
||||
|
@@ -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
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user