Skip to content

Commit

Permalink
Refine controller status view
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Jun 18, 2017
1 parent 4becbed commit 2011554
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 24 deletions.
34 changes: 25 additions & 9 deletions src/web/widgets/Grbl/Controller.jsx
@@ -1,7 +1,9 @@
import PropTypes from 'prop-types';
import React from 'react';
import { Button } from '../../components/Buttons';
import Modal from '../../components/Modal';
import { Nav, NavItem } from '../../components/Navs';
import controller from '../../lib/controller';
import i18n from '../../lib/i18n';
import styles from './index.styl';

Expand Down Expand Up @@ -34,20 +36,34 @@ const Controller = (props) => {
</pre>
}
{activeTab === 'settings' &&
<pre className={styles.pre}>
<code>{JSON.stringify(state.controller.settings, null, 4)}</code>
</pre>
<div>
<Button
btnSize="xs"
btnStyle="flat"
style={{
position: 'absolute',
right: 10,
top: 10
}}
onClick={event => {
controller.writeln('$#'); // Parameters
controller.writeln('$$'); // Settings
}}
>
<i className="fa fa-refresh" />
{i18n._('Refresh')}
</Button>
<pre className={styles.pre}>
<code>{JSON.stringify(state.controller.settings, null, 4)}</code>
</pre>
</div>
}
</div>
</Modal.Body>
<Modal.Footer>
<button
type="button"
className="btn btn-default"
onClick={actions.closeModal}
>
<Button onClick={actions.closeModal}>
{i18n._('Close')}
</button>
</Button>
</Modal.Footer>
</Modal>
);
Expand Down
2 changes: 2 additions & 0 deletions src/web/widgets/Grbl/index.styl
Expand Up @@ -78,6 +78,7 @@
}

.nav-content {
position: relative;
overflow-y: auto;
background: #000;
color: #fff;
Expand All @@ -91,5 +92,6 @@
border: 0;
border-radius: 0;
margin: 0;
padding: 10px;
}
}
33 changes: 24 additions & 9 deletions src/web/widgets/Smoothie/Controller.jsx
@@ -1,7 +1,9 @@
import PropTypes from 'prop-types';
import React from 'react';
import { Button } from '../../components/Buttons';
import Modal from '../../components/Modal';
import { Nav, NavItem } from '../../components/Navs';
import controller from '../../lib/controller';
import i18n from '../../lib/i18n';
import styles from './index.styl';

Expand Down Expand Up @@ -34,20 +36,33 @@ const Controller = (props) => {
</pre>
}
{activeTab === 'settings' &&
<pre className={styles.pre}>
<code>{JSON.stringify(state.controller.settings, null, 4)}</code>
</pre>
<div>
<Button
btnSize="xs"
btnStyle="flat"
style={{
position: 'absolute',
right: 10,
top: 10
}}
onClick={event => {
controller.writeln('$#'); // Settings
}}
>
<i className="fa fa-refresh" />
{i18n._('Refresh')}
</Button>
<pre className={styles.pre}>
<code>{JSON.stringify(state.controller.settings, null, 4)}</code>
</pre>
</div>
}
</div>
</Modal.Body>
<Modal.Footer>
<button
type="button"
className="btn btn-default"
onClick={actions.closeModal}
>
<Button onClick={actions.closeModal}>
{i18n._('Close')}
</button>
</Button>
</Modal.Footer>
</Modal>
);
Expand Down
2 changes: 2 additions & 0 deletions src/web/widgets/Smoothie/index.styl
Expand Up @@ -78,6 +78,7 @@
}

.nav-content {
position: relative;
overflow-y: auto;
background: #000;
color: #fff;
Expand All @@ -91,5 +92,6 @@
border: 0;
border-radius: 0;
margin: 0;
padding: 10px;
}
}
9 changes: 3 additions & 6 deletions src/web/widgets/TinyG/Controller.jsx
@@ -1,5 +1,6 @@
import PropTypes from 'prop-types';
import React from 'react';
import { Button } from '../../components/Buttons';
import Modal from '../../components/Modal';
import { Nav, NavItem } from '../../components/Navs';
import i18n from '../../lib/i18n';
Expand Down Expand Up @@ -41,13 +42,9 @@ const Controller = (props) => {
</div>
</Modal.Body>
<Modal.Footer>
<button
type="button"
className="btn btn-default"
onClick={actions.closeModal}
>
<Button onClick={actions.closeModal}>
{i18n._('Close')}
</button>
</Button>
</Modal.Footer>
</Modal>
);
Expand Down
2 changes: 2 additions & 0 deletions src/web/widgets/TinyG/index.styl
Expand Up @@ -78,6 +78,7 @@
}

.nav-content {
position: relative;
overflow-y: auto;
background: #000;
color: #fff;
Expand All @@ -91,5 +92,6 @@
border: 0;
border-radius: 0;
margin: 0;
padding: 10px;
}
}

0 comments on commit 2011554

Please sign in to comment.