这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions console/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"deep-equal": "^1.0.1",
"graphiql": "^0.11.11",
"graphql": "^0.13.2",
"hasura-console-graphiql": "0.0.5",
"hasura-console-graphiql": "0.0.6",
"history": "^3.0.0",
"hoist-non-react-statics": "^1.0.3",
"invariant": "^2.2.0",
Expand Down
19 changes: 19 additions & 0 deletions console/src/Globals.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { SERVER_CONSOLE_MODE } from './constants';

/* helper tools to format explain json */

/* eslint-disable */
import sqlFormatter from './helpers/sql-formatter.min';
import hljs from './helpers/highlight.min';
/* eslint-enable */

/* */

const checkExtraSlashes = url => {
if (!url) {
return url;
Expand Down Expand Up @@ -42,6 +51,16 @@ if (!window.__env.isAccessKeySet) {
globals.isAccessKeySet = false;
}

if (
window &&
typeof window === 'object' &&
!window.sqlFormatter &&
!window.hljs
) {
window.sqlFormatter = sqlFormatter;
window.hljs = hljs;
}

if (globals.consoleMode === SERVER_CONSOLE_MODE) {
if (globals.nodeEnv !== 'development') {
const windowUrl = window.location.protocol + '//' + window.location.host;
Expand Down
7 changes: 2 additions & 5 deletions console/src/helpers/Html.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ export default class Html extends Component {
<html lang="en-us">
<head>
<link rel="icon" type="image/png" href="/rstatic/favicon.png" />
<link
rel="stylesheet"
href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.13.1/build/styles/default.min.css"
/>

{Object.keys(assets.styles).map((style, key) => (
<link
href={assets.styles[style]}
Expand Down Expand Up @@ -98,8 +93,10 @@ export default class Html extends Component {

<div id="content" className="content" />
<script src={assets.javascript.main} charSet="UTF-8" />
{/*
<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.13.1/build/highlight.min.js" />
<script type="text/javascript" src="https://unpkg.com/sql-formatter@latest/dist/sql-formatter.min.js" />
*/}
</body>
</html>
);
Expand Down
Loading