Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename debug to system #4447

Merged
merged 1 commit into from
Nov 20, 2022
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
2 changes: 1 addition & 1 deletion web/src/Sidebar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function Sidebar() {
</Match>
{birdseye?.enabled ? <Destination href="/birdseye" text="Birdseye" /> : null}
<Destination href="/events" text="Events" />
<Destination href="/debug" text="Debug" />
<Destination href="/system" text="System" />
<Separator />
<div className="flex flex-grow" />
{ENV !== 'production' ? (
Expand Down
2 changes: 1 addition & 1 deletion web/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function App() {
path="/recording/:camera/:date?/:hour?/:minute?/:second?"
getComponent={Routes.getRecording}
/>
<AsyncRoute path="/debug" getComponent={Routes.getDebug} />
<AsyncRoute path="/system" getComponent={Routes.getSystem} />
<AsyncRoute path="/styleguide" getComponent={Routes.getStyleGuide} />
<Cameras default path="/" />
</Router>
Expand Down
6 changes: 3 additions & 3 deletions web/src/routes/Debug.jsx → web/src/routes/System.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import Dialog from '../components/Dialog';

const emptyObject = Object.freeze({});

export default function Debug() {
export default function System() {
const [state, setState] = useState({ showFfprobe: false, ffprobe: '' });
const { data: config } = useSWR('config');

Expand Down Expand Up @@ -69,7 +69,7 @@ export default function Debug() {
return (
<div className="space-y-4 p-2 px-4">
<Heading>
Debug <span className="text-sm">{service.version}</span>
System <span className="text-sm">{service.version}</span>
</Heading>
{state.showFfprobe && (
<Dialog>
Expand Down Expand Up @@ -175,7 +175,7 @@ export default function Debug() {
))}
</div>

<p>Debug stats update automatically every {config.mqtt.stats_interval} seconds.</p>
<p>System stats update automatically every {config.mqtt.stats_interval} seconds.</p>
</Fragment>
)}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { h } from 'preact';
import Debug from '../Debug';
import System from '../System';
import { render, screen, waitForElementToBeRemoved } from 'testing-library';

describe('Debug Route', () => {
describe('System Route', () => {
beforeEach(() => {});

test('shows an ActivityIndicator if stats are null', async () => {
render(<Debug />);
render(<System />);
expect(screen.queryByLabelText('Loading…')).toBeInTheDocument();
});

// eslint-disable-next-line jest/no-disabled-tests
test.skip('shows stats and config', async () => {
render(<Debug />);
render(<System />);

await waitForElementToBeRemoved(() => screen.queryByLabelText('Loading…'));

Expand Down
4 changes: 2 additions & 2 deletions web/src/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export async function getRecording(_url, _cb, _props) {
return module.default;
}

export async function getDebug(_url, _cb, _props) {
const module = await import('./Debug.jsx');
export async function getSystem(_url, _cb, _props) {
const module = await import('./System.jsx');
return module.default;
}

Expand Down