From f039f2352597e6f1e1e0035197003aef1f458ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Fri, 16 Aug 2024 09:19:25 +0800 Subject: [PATCH 1/3] iframe test --- src/App.js | 11 ++++++++ src/forge/iframe.jsx | 36 ++++++++++++++++++++++++ src/index.css | 65 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 112 insertions(+) create mode 100644 src/forge/iframe.jsx diff --git a/src/App.js b/src/App.js index 2ea95ad57..180ecda42 100644 --- a/src/App.js +++ b/src/App.js @@ -159,6 +159,11 @@ const Topic = Loadable({ loading: Loading, }) +const Iframe = Loadable({ + loader: () => import("./forge/iframe"), + loading: Loading, +}); + // 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。 const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin", "softbot","zone"]; @@ -336,6 +341,12 @@ class App extends Component { {/* {!pathName || (pathName && pathName.toLowerCase() !== 'glcc') ? : } */} {/* */} + {/* iframe页面 */} + ( +} + +export default withRouter(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Iframe)))); \ No newline at end of file diff --git a/src/index.css b/src/index.css index 6e1c438bc..ca2ae2b50 100644 --- a/src/index.css +++ b/src/index.css @@ -186,4 +186,69 @@ i.color-orange05:hover { .color-light-green { color: #29bd8b !important; +} + +.AlignTop { + display:flex; + align-items: flex-start +} +.WhiteBack { + background-color:#fff; + border-radius:5px +} +.Box { + display:flex; + align-items:flex-start +} +.LongWidth { + flex:1; + width:0; + border-radius:5px; + margin-bottom:30px +} +.ShortWidth { + width:300px; + border-radius:5px; + margin-bottom:30px +} +.Gap { + padding-left:20px; + box-sizing:border-box; +} +.AlignCenter { + display:flex; + align-items: center +} +.FlexAJ { + display:flex; + align-items: center; + justify-content: space-between +} +.mt25 { + margin-top:25px +} +.User { + display:flex; + font-weight: bold; + align-items: center +} +.User img { + width:30px; + height:30px; + border-radius:50% +} +.User span { + margin-left:8px +} +.latex-error { + border: 1px solid #ff818266; + border-radius: 6px; + background-color: #ffebe9; + padding: 10px 8px; + font-size: 12px; + margin-bottom: 5px; +} + +.test-iframe { + margin-top: -30px; } \ No newline at end of file From 1db5db8a85c70d07b10e54972c8326199f3c02ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Thu, 29 Aug 2024 13:41:02 +0800 Subject: [PATCH 2/3] iframetest --- src/forge/iframe.jsx | 6 +++--- src/index.css | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/forge/iframe.jsx b/src/forge/iframe.jsx index f95108cf1..f7b6ef56e 100644 --- a/src/forge/iframe.jsx +++ b/src/forge/iframe.jsx @@ -15,9 +15,9 @@ const Iframe = (props) => { // } function iframeLoad() { - // let myIframe = document.getElementById("iframe"); - // myIframe.height = `${document.documentElement.clientHeight - 300}px` - // if (myIframe.contentWindow.location && myIframe.contentWindow.location.href) { + 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 // } diff --git a/src/index.css b/src/index.css index ca2ae2b50..ad25c1685 100644 --- a/src/index.css +++ b/src/index.css @@ -250,5 +250,6 @@ i.color-orange05:hover { } .test-iframe { - margin-top: -30px; + margin-top: -48px; + vertical-align:bottom; } \ No newline at end of file From 9d21c2fd838a12efb31312a3276c0de82706f408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=BF=83=E5=AE=87?= Date: Wed, 4 Sep 2024 14:18:52 +0800 Subject: [PATCH 3/3] iframe cont. --- src/App.js | 2 +- src/forge/iframe.jsx | 6 ++---- src/index.css | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/App.js b/src/App.js index 180ecda42..10988cae7 100644 --- a/src/App.js +++ b/src/App.js @@ -165,7 +165,7 @@ const Iframe = Loadable({ }); // 此处仅维护前端可能的一级路由,不用进行项目或者组织判断的字段。 -const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin", "softbot","zone"]; +const keyWord = ["explore", "settings", "setting", "mulan", "wiki", "issues", "setting", "trending", "code", "projects", "pulls", "mine", "login", "register", "email", "export", "nopage", "404", "403", "500", "501", "search", "organize", "login", "register", "resetPassword", "aboutus","educoder", "glcc","bindlogin", "softbot","zone", "hiagent"]; class App extends Component { constructor(props) { diff --git a/src/forge/iframe.jsx b/src/forge/iframe.jsx index f7b6ef56e..26cdd8897 100644 --- a/src/forge/iframe.jsx +++ b/src/forge/iframe.jsx @@ -16,8 +16,7 @@ const Iframe = (props) => { function iframeLoad() { let myIframe = document.getElementById("iframe"); - myIframe.height = `${document.documentElement.clientHeight - 473 + 86}px` - // if (myIframe.contentWindow.location && myIfram e.contentWindow.location.href) { + // if (myIframe.contentWindow.location && myIframe.contentWindow.location.href) { // window.location.href = 'http://118.145.132.196:3000/product/llm/llm-chat' // //myIframe.contentWindow.location.href // } @@ -26,9 +25,8 @@ const Iframe = (props) => { return } diff --git a/src/index.css b/src/index.css index ad25c1685..08045b8f8 100644 --- a/src/index.css +++ b/src/index.css @@ -252,4 +252,5 @@ i.color-orange05:hover { .test-iframe { margin-top: -48px; vertical-align:bottom; + height: 100vh; } \ No newline at end of file