-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
135 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta | ||
http-equiv="Content-Security-Policy" | ||
content="script-src 'self' blob:" | ||
/> | ||
<meta content="width=device-width, initial-scale=1.0" name="viewport" /> | ||
<title>Sail Desktop Agent</title> | ||
|
||
</head> | ||
<body> | ||
<div id="sessionView"></div> | ||
<script src="./sessionView/src/index.tsx" type="module"></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import React from 'react'; | ||
import { Paper } from '@mui/material'; | ||
import { SessionState } from '../../../main/src/types/SessionState'; | ||
|
||
export class SessionView extends React.Component< | ||
{}, | ||
{ session: SessionState } | ||
> { | ||
constructor(props) { | ||
super(props); | ||
this.state = { session: props.session }; | ||
} | ||
|
||
componentDidMount() { | ||
const onFDC3Ready = async () => { | ||
//fetch apps from the directory, using system API (only available to system apps) | ||
|
||
const session = await globalThis.sail.getSessionState(); | ||
|
||
this.setState({ session: session }); | ||
}; | ||
if (window.fdc3) { | ||
onFDC3Ready(); | ||
} else { | ||
document.addEventListener('fdc3Ready', onFDC3Ready); | ||
} | ||
} | ||
|
||
render() { | ||
return ( | ||
<Paper | ||
sx={{ | ||
padding: '1rem', | ||
margin: '1rem', | ||
backgroundColor: '#ccc', | ||
}} | ||
> | ||
{JSON.stringify(this.state.session)} | ||
</Paper> | ||
); | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { SessionView } from './SessionView'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
import './index.css'; | ||
|
||
ReactDOM.render( | ||
<React.StrictMode> | ||
<SessionView /> | ||
</React.StrictMode>, | ||
document.getElementById('sessionView'), | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters