Skip to content

Commit

Permalink
home button update
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianciu committed Oct 15, 2024
1 parent 53b1c53 commit 4d0b07a
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 8 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"@jupyterlab/application": "^4.0.0",
"@jupyterlab/launcher": "^4.2.5",
"@jupyterlab/ui-components": "^4.2.5",
"dotenv": "^16.4.5",
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
Expand All @@ -84,7 +85,10 @@
"stylelint-config-standard": "^34.0.0",
"stylelint-csstree-validator": "^3.0.0",
"stylelint-prettier": "^4.0.0",
"ts-loader": "^9.5.1",
"typescript": "~5.0.2",
"webpack": "^5.95.0",
"webpack-cli": "^5.1.4",
"yjs": "^13.5.0"
},
"sideEffects": [
Expand Down
9 changes: 7 additions & 2 deletions src/IframeWidget.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import {ReactWidget} from '@jupyterlab/ui-components';
import {useState} from "react";
import {useEffect, useState} from "react";
import '../style/IframeWidget.css';

type IframeWidgetProps = {
Expand All @@ -11,9 +11,14 @@ const IframeWidgetComponent = ({initialUrl}: IframeWidgetProps) => {
const [url, setUrl] = useState<string>(initialUrl);

const handleClick = () => {
setUrl(`${initialUrl}?t=${new Date().getTime()}`);
setUrl('')
};

useEffect(() => {
setUrl(initialUrl);
}, [url]);


return (
<div className="iframe-widget" style={{height: '100%', width: '100%'}}>
<div style={{marginBottom: '10px'}}>
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const extension: JupyterFrontEndPlugin<void> = {
app.commands.addCommand(commandId, {
label: 'Guacamole',
execute: () => {
const iframe = new IframeWidget('http://localhost:8080/guacamole/');
const iframe = new IframeWidget(process.env.REACT_APP_GUAC_URL!);
const widget = new MainAreaWidget({content: iframe});
widget.title.label = 'Guacamole';
widget.title.closable = true;
Expand Down
44 changes: 39 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ __metadata:
languageName: node
linkType: hard

"chalk@npm:^4.0.0":
"chalk@npm:^4.0.0, chalk@npm:^4.1.0":
version: 4.1.2
resolution: "chalk@npm:4.1.2"
dependencies:
Expand Down Expand Up @@ -2038,6 +2038,13 @@ __metadata:
languageName: node
linkType: hard

"dotenv@npm:^16.4.5":
version: 16.4.5
resolution: "dotenv@npm:16.4.5"
checksum: 301a12c3d44fd49888b74eb9ccf9f07a1f5df43f489e7fcb89647a2edcd84c42d6bc349dc8df099cd18f07c35c7b04685c1a4f3e6a6a9e6b30f8d48c15b7f49c
languageName: node
linkType: hard

"duplicate-package-checker-webpack-plugin@npm:^3.0.0":
version: 3.0.0
resolution: "duplicate-package-checker-webpack-plugin@npm:3.0.0"
Expand Down Expand Up @@ -2085,7 +2092,7 @@ __metadata:
languageName: node
linkType: hard

"enhanced-resolve@npm:^5.17.1":
"enhanced-resolve@npm:^5.0.0, enhanced-resolve@npm:^5.17.1":
version: 5.17.1
resolution: "enhanced-resolve@npm:5.17.1"
dependencies:
Expand Down Expand Up @@ -3640,7 +3647,7 @@ __metadata:
languageName: node
linkType: hard

"micromatch@npm:^4.0.4, micromatch@npm:^4.0.5":
"micromatch@npm:^4.0.0, micromatch@npm:^4.0.4, micromatch@npm:^4.0.5":
version: 4.0.8
resolution: "micromatch@npm:4.0.8"
dependencies:
Expand Down Expand Up @@ -4787,6 +4794,13 @@ __metadata:
languageName: node
linkType: hard

"source-map@npm:^0.7.4":
version: 0.7.4
resolution: "source-map@npm:0.7.4"
checksum: 01cc5a74b1f0e1d626a58d36ad6898ea820567e87f18dfc9d24a9843a351aaa2ec09b87422589906d6ff1deed29693e176194dc88bcae7c9a852dc74b311dbf5
languageName: node
linkType: hard

"spdx-correct@npm:^3.0.0":
version: 3.2.0
resolution: "spdx-correct@npm:3.2.0"
Expand Down Expand Up @@ -5204,6 +5218,22 @@ __metadata:
languageName: node
linkType: hard

"ts-loader@npm:^9.5.1":
version: 9.5.1
resolution: "ts-loader@npm:9.5.1"
dependencies:
chalk: ^4.1.0
enhanced-resolve: ^5.0.0
micromatch: ^4.0.0
semver: ^7.3.4
source-map: ^0.7.4
peerDependencies:
typescript: "*"
webpack: ^5.0.0
checksum: 7cf396e656d905388ea2a9b5e82f16d3c955fda8d3df2fbf219f4bee16ff50a3c995c44ae3e584634e9443f056cec70bb3151add3917ffb4588ecd7394bac0ec
languageName: node
linkType: hard

"tslib@npm:^1.13.0":
version: 1.14.1
resolution: "tslib@npm:1.14.1"
Expand Down Expand Up @@ -5233,6 +5263,7 @@ __metadata:
"@typescript-eslint/eslint-plugin": ^6.1.0
"@typescript-eslint/parser": ^6.1.0
css-loader: ^6.7.1
dotenv: ^16.4.5
eslint: ^8.36.0
eslint-config-prettier: ^8.8.0
eslint-plugin-prettier: ^5.0.0
Expand All @@ -5249,7 +5280,10 @@ __metadata:
stylelint-config-standard: ^34.0.0
stylelint-csstree-validator: ^3.0.0
stylelint-prettier: ^4.0.0
ts-loader: ^9.5.1
typescript: ~5.0.2
webpack: ^5.95.0
webpack-cli: ^5.1.4
yjs: ^13.5.0
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -5492,7 +5526,7 @@ __metadata:
languageName: node
linkType: hard

"webpack-cli@npm:^5.0.1":
"webpack-cli@npm:^5.0.1, webpack-cli@npm:^5.1.4":
version: 5.1.4
resolution: "webpack-cli@npm:5.1.4"
dependencies:
Expand Down Expand Up @@ -5552,7 +5586,7 @@ __metadata:
languageName: node
linkType: hard

"webpack@npm:^5.76.1":
"webpack@npm:^5.76.1, webpack@npm:^5.95.0":
version: 5.95.0
resolution: "webpack@npm:5.95.0"
dependencies:
Expand Down

0 comments on commit 4d0b07a

Please sign in to comment.