forgeplus-react/src/forge/iframe.jsx

36 lines
1.1 KiB
JavaScript

import React, { useEffect, useState, useCallback } from 'react';
import { withRouter } from "react-router";
import { SnackbarHOC } from "educoder";
import { CNotificationHOC } from "../modules/courses/common/CNotificationHOC";
import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
const Iframe = (props) => {
const history = props.history
const location = history.location
// if (!location.state.url) {
// history.push("/404");
// }
function iframeLoad() {
let myIframe = document.getElementById("iframe");
myIframe.height = `${document.documentElement.clientHeight - 473 + 86}px`
// if (myIframe.contentWindow.location && myIfram e.contentWindow.location.href) {
// window.location.href = 'http://118.145.132.196:3000/product/llm/llm-chat'
// //myIframe.contentWindow.location.href
// }
}
return <iframe
id="iframe"
width="100%"
height="800px"
className="test-iframe"
src={ 'http://118.145.132.196:3000/product/llm/llm-chat' }
onLoad={iframeLoad}
></iframe>
}
export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Iframe))));