using prettier for more files. also, client app is built on merge to master (#141)

This commit is contained in:
Ethan Weber authored and GitHub committed 2022-07-14 11:33:56 -07:00
1 parent e0fb77bf1a
commit d52c11c04c
6 files changed
+52 -48

No files matched your search

+2 -2
View File
@@ -1,4 +1,4 @@
name: Prettier
name: Run prettier for viewer client app.
on:
pull_request:
@@ -18,4 +18,4 @@ jobs:
uses: creyD/prettier_action@v4.2
with:
# This part is also where you can pass other options, for example:
prettier_options: --write ./pyrad/**/*.js
prettier_options: --write ./pyrad/viewer/app/*
+1 -1
View File
@@ -41,7 +41,7 @@ jobs:
name: Deploy
needs: build
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/master'
if: github.ref == 'refs/heads/master'
steps:
- name: Download artifact
+1 -1
View File
@@ -52,4 +52,4 @@
"typescript": "^4.7.3",
"wait-on": "^6.0.1"
}
}
}
+9 -8
View File
@@ -1,12 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
@@ -23,9 +25,9 @@
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>PyRad Viewer</title>
</head>
</head>
<body>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
@@ -38,6 +40,5 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
</body>
</html>
+14 -14
View File
@@ -115,7 +115,6 @@ export class Viewer extends Component {
}
set_object(path, object) {
if (!(object instanceof THREE.Camera)) {
this.state.scene_tree.find(path.concat(["<object>"])).set_object(object);
}
@@ -164,17 +163,18 @@ export class Viewer extends Component {
set_output_options(object) {
if (this.created_controls === false) {
let output_options_control = new function () {
this.output_options = 'default';
}
let output_options_control = new (function () {
this.output_options = "default";
})();
// add controls
this.state.gui.add(output_options_control, 'output_options', object).listen().onChange(
(value) => {
this.state.gui
.add(output_options_control, "output_options", object)
.listen()
.onChange((value) => {
this.send_output_type_over_websocket(value);
}
)
});
}
this.created_controls = true
this.created_controls = true;
}
handle_command(cmd) {
@@ -195,7 +195,7 @@ export class Viewer extends Component {
} else if (cmd.type === "set_property") {
let path = split_path(cmd.path);
this.set_property(path, cmd.property, cmd.value);
} else if(cmd.type == 'set_output_options') {
} else if (cmd.type == "set_output_options") {
this.set_output_options(cmd.output_options);
}
// web rtc commands
@@ -366,8 +366,9 @@ export class Viewer extends Component {
this.state.controls_main.update();
let path = ["Cameras", "Main Camera"];
this.state.scene_tree.find(path.concat(["<object>"])).set_object(this.state.camera_main);
this.state.scene_tree
.find(path.concat(["<object>"]))
.set_object(this.state.camera_main);
// Axes display
let axes = new THREE.AxesHelper(5);
@@ -396,8 +397,7 @@ export class Viewer extends Component {
return (
<div>
<div className="WebRTCVideo">
<video id="WebRTCVideo-video" autoPlay playsInline muted>
</video>
<video id="WebRTCVideo-video" autoPlay playsInline muted></video>
</div>
<div id="canvas-container-main"> </div>
<div id="stats-container"> </div>
+25 -22
View File
@@ -1,40 +1,43 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
}
.BackgroundDiv,
.WebRTCVideo {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
}
#BackgroundDiv-video,
#WebRTCVideo-video {
width: 100%;
height: 100%;
object-fit: fill;
width: 100%;
height: 100%;
object-fit: fill;
}
#canvas-container-main {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
}
#canvas-container-main canvas {
position: relative;
height: 100%;
width: 100%;
}
position: relative;
height: 100%;
width: 100%;
}