Skip to content

Commit

Permalink
Merge pull request #4 from rstgroup/newVersion
Browse files Browse the repository at this point in the history
New version
  • Loading branch information
mprzodala authored Sep 27, 2023
2 parents 5ccdd65 + e814071 commit f8201f3
Show file tree
Hide file tree
Showing 75 changed files with 1,099 additions and 1,529 deletions.
11 changes: 0 additions & 11 deletions .babelrc

This file was deleted.

13 changes: 7 additions & 6 deletions chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"version": "1.0.0",
"version": "2.0.0",
"name": "Eventrix devtools",
"short_name": "Eventrix devtools",
"description": "Extension for Eventrix",
"permissions": [],
"permissions": ["activeTab", "scripting"],
"host_permissions": ["<all_urls>"],
"devtools_page": "devtools.html",
"browser_action": {
"default_icon": {
"action": {
"default_assets/icon": {
"16": "images/eventrix_16x16.png",
"32": "images/eventrix_32x32.png",
"48": "images/eventrix_48x48.png",
Expand All @@ -21,5 +22,5 @@
"64": "images/eventrix_64x64.png",
"128": "images/eventrix_128x128.png"
},
"manifest_version": 2
}
"manifest_version": 3
}
2 changes: 1 addition & 1 deletion chrome/panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
<div id="root"></div>
<script src="panel.js"></script>
</body>
</html>
</html>
14 changes: 9 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
<html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/assets/eventrix_16x16.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Eventrix</title>
</head>
<body>
<div id="root"></div>
<script type="text/javascript" src="panel.js" charset="utf-8"></script>
<div id="root"></div>
<script type="module" src="/src/index.jsx"></script>
</body>
</html>
</html>
64 changes: 25 additions & 39 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,26 @@
{
"name": "eventrix-tools",
"version": "1.0.1",
"description": "React project manager",
"version": "2.0.0",
"description": "Eventrix devtools",
"main": "index.js",
"private": true,
"scripts": {
"test": "jest",
"start": "webpack-dev-server --config webpack.config.js",
"build": "webpack --config webpack.config.js"
"start": "vite",
"build": "vite build"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/cli": "^7.7.0",
"@babel/core": "^7.7.4",
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-proposal-decorators": "^7.12.12",
"@babel/plugin-syntax-decorators": "^7.12.1",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/polyfill": "^7.0.0",
"@babel/preset-env": "^7.7.4",
"@babel/preset-react": "^7.0.0",
"babel-loader": "^8.0.6",
"babel-plugin-inline-react-svg": "^1.0.1",
"classnames": "^2.2.6",
"css-loader": "^2.1.0",
"directory-named-webpack-plugin": "^4.0.1",
"file-loader": "^6.2.0",
"node-sass": "^4.11.0",
"resolve-url-loader": "^3.1.2",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"url-loader": "^4.1.1",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10",
"webpack-dev-server": "^3.7.2"
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@vitejs/plugin-react-swc": "^3.3.2",
"eslint": "^8.45.0",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"sass": "^1.68.0",
"vite": "^4.4.5"
},
"jest": {
"verbose": true,
Expand All @@ -53,18 +39,18 @@
]
},
"dependencies": {
"@material-ui/core": "^4.11.3",
"@material-ui/icons": "^4.11.2",
"@material-ui/lab": "^4.0.0-alpha.39",
"axios": "^0.19.0",
"browser-storage-db": "^1.0.0",
"eventrix": "^2.0.1",
"form-schema-validation": "^1.17.4",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@iconify/react": "^4.1.1",
"@mui/material": "^5.14.3",
"classnames": "^2.3.2",
"eventrix": "^2.9.1",
"lodash": "^4.17.21",
"moment": "^2.29.1",
"react": "^16.13.1",
"react-components-form": "^3.8.1",
"react-dom": "^16.13.1",
"react-object-inspector": "^0.2.1",
"react-router-dom": "^4.3.1"
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-inspector": "^6.0.2",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0"
}
}
Binary file added public/assets/eventrix_128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/eventrix_16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/eventrix_32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/eventrix_48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/eventrix_64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/assets/logo_devtools.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions public/devtools.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Eventrix devtools</title>
</head>
<body>
<script src="devtools.js"></script>
</body>
</html>
5 changes: 5 additions & 0 deletions public/devtools.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
chrome.devtools.panels.create('Eventrix',
'assets/eventrix_16x16.png',
'index.html',
null
);
25 changes: 25 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"version": "2.0.1",
"name": "Eventrix devtools",
"short_name": "Eventrix devtools",
"description": "Extension for Eventrix",
"permissions": ["activeTab", "scripting"],
"devtools_page": "devtools.html",
"action": {
"default_assets/icon": {
"16": "assets/eventrix_16x16.png",
"32": "assets/eventrix_32x32.png",
"48": "assets/eventrix_48x48.png",
"64": "assets/eventrix_64x64.png",
"128": "assets/eventrix_128x128.png"
}
},
"icons": {
"16": "assets/eventrix_16x16.png",
"32": "assets/eventrix_32x32.png",
"48": "assets/eventrix_48x48.png",
"64": "assets/eventrix_64x64.png",
"128": "assets/eventrix_128x128.png"
},
"manifest_version": 3
}
3 changes: 3 additions & 0 deletions src/DevtoolsPanel/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
margin: 0;
}
128 changes: 93 additions & 35 deletions src/DevtoolsPanel/App.jsx
Original file line number Diff line number Diff line change
@@ -1,54 +1,112 @@
import React from 'react';
import StorageIcon from '@material-ui/icons/Storage';
import DateRangeIcon from '@material-ui/icons/DateRange';
import HistoryIcon from '@material-ui/icons/History';
import ReceiverIcon from '@material-ui/icons/SettingsInputAntenna';
import ListenerIcon from '@material-ui/icons/WifiTethering';
import React, {useCallback} from 'react';

import CurrentState from "./modules/CurrentState";
import StateHistory from "./modules/StateHistory";
import EventsHistory from "./modules/EventsHistory";
import Receivers from "./modules/Receivers";
import Listeners from "./modules/Listeners";

import Route from "./components/Route";
import RouteLink from "./components/RouteLink/RouteLink";
import { ROUTES } from "./constants/routes";

import styles from './App.scss';
import {Stack} from "@mui/material";
import Menu from "./modules/Menu";
import Divider from "@mui/material/Divider";
import StateListenersStats from "./modules/StateListenersStats";
import StatsBox from "./components/StatsBox";
import './App.css';
import {DateRangeIcon, EmitIcon, HistoryIcon, StorageIcon} from "./components/icons";
import Header from "./components/Header";
import {useEmit} from "eventrix";
import {
EVENTS_HISTORY_FETCH,
RESET_EMITTER,
STATE_FETCH,
STATE_HISTORY_FETCH,
STATE_HISTORY_RESET,
EVENTS_HISTORY_RESET
} from "./events";
import StateHistoryPreview from "./modules/StateHistory/StateHistoryPreview";
import StateStats from "./modules/StateHistory/StateStats";
import EventsHistory from "./modules/EventsHistory";
import EventsStats from "./modules/EventsHistory/EventsStats";
import EventsHistoryPreview from "./modules/EventsHistory/EventsHistoryPreview";
import Emitter from "./modules/Emitter";

const App = () => {
const emit = useEmit();
const fetchState = useCallback(() => { emit(STATE_FETCH) }, [emit]);
const fetchStateHistory = useCallback(() => { emit(STATE_HISTORY_FETCH) }, [emit]);
const fetchEventsHistory = useCallback(() => { emit(EVENTS_HISTORY_FETCH) }, [emit]);

const resetStateHistory = useCallback(() => { emit(STATE_HISTORY_RESET) }, [emit]);
const resetEventsHistory = useCallback(() => { emit(EVENTS_HISTORY_RESET) }, [emit]);
const resetEmitter = useCallback(() => { emit(RESET_EMITTER) }, [emit]);

return (
<div className={styles.container}>
<div className={styles.navigation}>
<div className={styles.title}>
<h1>Eventrix</h1>
<div>devtools</div>
</div>
<RouteLink to={ROUTES.CURRENT_STATE} activeClassName={styles.activeMenuItem} className={styles.menuItem}><StorageIcon fontSize="small" /> CURRENT STATE</RouteLink>
<RouteLink to={ROUTES.STATE_HISTORY} activeClassName={styles.activeMenuItem} className={styles.menuItem}><HistoryIcon fontSize="small" /> STATE HISTORY</RouteLink>
<RouteLink to={ROUTES.EVENTS_HISTORY} activeClassName={styles.activeMenuItem} className={styles.menuItem}><DateRangeIcon fontSize="small" /> EVENTS HISTORY</RouteLink>
<RouteLink to={ROUTES.RECEIVERS} activeClassName={styles.activeMenuItem} className={styles.menuItem}><ReceiverIcon fontSize="small" /> RECEIVERS</RouteLink>
<RouteLink to={ROUTES.LISTENERS} activeClassName={styles.activeMenuItem} className={styles.menuItem}><ListenerIcon fontSize="small" /> LISTENERS</RouteLink>
</div>
<div className={styles.content}>
<Stack direction="row">
<Menu />
<Divider orientation="vertical" flexItem />
<Stack sx={{ width: '100%', height: '100%' }}>
<Route name={ROUTES.CURRENT_STATE}>
<CurrentState />
<Header
title="Current state"
icon={<StorageIcon width="26px" />}
refreshAction={fetchState}
/>
<Divider />
<Stack direction="row" padding={2} spacing={1}>
<CurrentState />
<StatsBox title="States use stats">
<StateListenersStats />
</StatsBox>
</Stack>
</Route>
<Route name={ROUTES.STATE_HISTORY}>
<StateHistory />
<Header
title="State history"
icon={<DateRangeIcon width="26px" />}
resetAction={resetStateHistory}
refreshAction={fetchStateHistory}
/>
<Divider />
<Stack direction="row" padding={2} spacing={1}>
<StateHistory fetchStateHistory={fetchStateHistory} />
<Stack>
<StatsBox title="State update stats">
<StateStats />
</StatsBox>
<StateHistoryPreview />
</Stack>
</Stack>
</Route>
<Route name={ROUTES.EVENTS_HISTORY}>
<EventsHistory />
</Route>
<Route name={ROUTES.RECEIVERS}>
<Receivers />
<Header
title="Events history"
icon={<HistoryIcon width="26px" />}
resetAction={resetEventsHistory}
refreshAction={fetchEventsHistory}
/>
<Divider />
<Stack direction="row" padding={2} spacing={1}>
<EventsHistory fetchEventsHistory={fetchEventsHistory} />
<Stack>
<StatsBox title="State update stats">
<EventsStats />
</StatsBox>
<EventsHistoryPreview />
</Stack>
</Stack>
</Route>
<Route name={ROUTES.LISTENERS}>
<Listeners />
<Route name={ROUTES.EMITTER}>
<Header
title="Emitter"
icon={<EmitIcon width="26px" />}
resetAction={resetEmitter}
/>
<Divider />
<Stack direction="row" padding={2} spacing={1}>
<Emitter fetchEventsHistory={fetchEventsHistory} />
</Stack>
</Route>
</div>
</div>
</Stack>
</Stack>
)
};

Expand Down
Loading

0 comments on commit f8201f3

Please sign in to comment.