aboutsummaryrefslogtreecommitdiff
path: root/src/debug/Repl.tsx
diff options
context:
space:
mode:
authorMohammad Amoush <mohammad_amoush@brown.edu>2019-07-16 18:03:12 -0400
committerMohammad Amoush <mohammad_amoush@brown.edu>2019-07-16 18:03:12 -0400
commit1cedadbdf01c392ca9910e3ca18f3875d9a86fed (patch)
tree602608ba06b997cd3144395640e404a01f666291 /src/debug/Repl.tsx
parentf70b95879e87a6bb61aaae5de29747d9474623a7 (diff)
parentf18be9418b9237acd847eaf71adc034226c54695 (diff)
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into youtube-api-muhammed
Diffstat (limited to 'src/debug/Repl.tsx')
-rw-r--r--src/debug/Repl.tsx11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/debug/Repl.tsx b/src/debug/Repl.tsx
index c2db3bdcb..4f4db13d2 100644
--- a/src/debug/Repl.tsx
+++ b/src/debug/Repl.tsx
@@ -4,6 +4,9 @@ import { observer } from 'mobx-react';
import { observable, computed } from 'mobx';
import { CompileScript } from '../client/util/Scripting';
import { makeInterface } from '../new_fields/Schema';
+import { ObjectField } from '../new_fields/ObjectField';
+import { RefField } from '../new_fields/RefField';
+import { DocServer } from '../client/DocServer';
@observer
class Repl extends React.Component {
@@ -42,7 +45,8 @@ class Repl extends React.Component {
return (
<div style={{ marginTop: "5px" }}>
<p>{command.command}</p>
- <pre>{JSON.stringify(command.result, null, 2)}</pre>
+ {/* <pre>{JSON.stringify(command.result, null, 2)}</pre> */}
+ <pre>{command.result instanceof RefField || command.result instanceof ObjectField ? "object" : String(command.result)}</pre>
</div>
);
});
@@ -60,4 +64,7 @@ class Repl extends React.Component {
}
}
-ReactDOM.render(<Repl />, document.getElementById("root")); \ No newline at end of file
+(async function () {
+ DocServer.init(window.location.protocol, window.location.hostname, 4321, "repl");
+ ReactDOM.render(<Repl />, document.getElementById("root"));
+})(); \ No newline at end of file