mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-25 18:06:15 -04:00
Added metrics to Etherpad
This commit is contained in:
parent
4891243c27
commit
0722a7ed7c
4 changed files with 40 additions and 3 deletions
|
@ -6,7 +6,7 @@ import {NavLink, Outlet, useNavigate} from "react-router-dom";
|
|||
import {useStore} from "./store/store.ts";
|
||||
import {LoadingScreen} from "./utils/LoadingScreen.tsx";
|
||||
import {Trans, useTranslation} from "react-i18next";
|
||||
import {Cable, Construction, Crown, NotepadText, Wrench, PhoneCall} from "lucide-react";
|
||||
import {Cable, Construction, Crown, NotepadText, Wrench, PhoneCall, Box} from "lucide-react";
|
||||
|
||||
const WS_URL = import.meta.env.DEV? 'http://localhost:9001' : ''
|
||||
export const App = ()=> {
|
||||
|
@ -100,6 +100,7 @@ export const App = ()=> {
|
|||
<li><NavLink to={"/pads"}><NotepadText/><Trans
|
||||
i18nKey="ep_admin_pads:ep_adminpads2_manage-pads"/></NavLink></li>
|
||||
<li><NavLink to={"/shout"}><PhoneCall/>Communication</NavLink></li>
|
||||
<li><NavLink to={"/metrics"}><Box/>Metrics</NavLink></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -13,6 +13,7 @@ import i18n from "./localization/i18n.ts";
|
|||
import {PadPage} from "./pages/PadPage.tsx";
|
||||
import {ToastDialog} from "./utils/Toast.tsx";
|
||||
import {ShoutPage} from "./pages/ShoutPage.tsx";
|
||||
import {MetricsPage} from "./pages/MetricsPage.tsx";
|
||||
|
||||
const router = createBrowserRouter(createRoutesFromElements(
|
||||
<><Route element={<App/>}>
|
||||
|
@ -22,6 +23,7 @@ const router = createBrowserRouter(createRoutesFromElements(
|
|||
<Route path="/help" element={<HelpPage/>}/>
|
||||
<Route path="/pads" element={<PadPage/>}/>
|
||||
<Route path="/shout" element={<ShoutPage/>}/>
|
||||
<Route path="metrics" element={<MetricsPage/>}/>
|
||||
</Route><Route path="/login">
|
||||
<Route index element={<LoginScreen/>}/>
|
||||
</Route></>
|
||||
|
|
22
admin/src/pages/MetricsPage.tsx
Normal file
22
admin/src/pages/MetricsPage.tsx
Normal file
|
@ -0,0 +1,22 @@
|
|||
import {useEffect} from "react";
|
||||
import {useStore} from "../store/store.ts";
|
||||
|
||||
export const MetricsPage = ()=> {
|
||||
const socket = useStore(state=>state.settingsSocket)
|
||||
|
||||
useEffect(() => {
|
||||
if (socket === undefined) return
|
||||
|
||||
socket?.on('metrics:result', (d)=>{
|
||||
console.log(d)
|
||||
})
|
||||
|
||||
socket?.emit('metrics')
|
||||
}, [socket]);
|
||||
|
||||
|
||||
return <>
|
||||
<h1>Metrics</h1>
|
||||
|
||||
</>
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue