├── .editorconfig ├── .gitignore ├── .hintrc ├── LICENSE ├── README-development.md ├── README.md ├── config-overrides.js ├── create-tar-for-github.sh ├── index.html ├── node ├── README.txt ├── app.js ├── package-lock.json ├── package.json ├── settings-nagios.dist.js ├── settings.dist.js └── start.sh ├── package-lock.json ├── package.json ├── proxy.js ├── public ├── apple-touch-icon.png ├── auto-version-switch.php ├── autoupdate.sh ├── connectors │ ├── livestatus-settings.ini.sample │ └── livestatus.php ├── favicon.ico ├── favicon.png ├── icon-1024.png ├── icon-180.png ├── icon-256.png ├── js │ └── polyfill.min.js ├── manifest.json ├── multi-nagios-server-example.html ├── sample-audio │ ├── critical.mp3 │ ├── ok.mp3 │ └── warning.mp3 ├── sample-data │ ├── alertlist.json │ ├── commentlist.json │ ├── hostcount.json │ ├── hostlist.json │ ├── programstatus.json │ ├── servicecount.json │ └── servicelist.json ├── sample-image │ ├── nagios.png │ └── resedit.png └── save-client-settings.php ├── src ├── App.css ├── App.test.tsx ├── App.tsx ├── atoms │ ├── alertAtom.ts │ ├── commentlistAtom.ts │ ├── hostAtom.ts │ ├── hostgroupAtom.js │ ├── programAtom.ts │ ├── serviceAtom.ts │ ├── settingsState.ts │ └── skipVersionAtom.ts ├── components │ ├── AppContext.tsx │ ├── Base.css │ ├── Base.tsx │ ├── Dashboard.css │ ├── Dashboard.tsx │ ├── DashboardFetch.tsx │ ├── Demo.css │ ├── Demo.tsx │ ├── Doomguy │ │ ├── Doomguy.css │ │ ├── Doomguy.png │ │ └── Doomguy.tsx │ ├── Help.css │ ├── Help.tsx │ ├── Settings.css │ ├── Settings.tsx │ ├── SettingsFakeData.tsx │ ├── SettingsLoad.tsx │ ├── Update.css │ ├── Update.tsx │ ├── alerts │ │ ├── AlertFilters.css │ │ ├── AlertFilters.tsx │ │ ├── AlertItem.css │ │ ├── AlertItem.tsx │ │ ├── AlertItems.css │ │ ├── AlertItems.tsx │ │ ├── AlertSection.css │ │ ├── AlertSection.tsx │ │ ├── QuietFor.css │ │ └── QuietFor.tsx │ ├── animation.css │ ├── hosts │ │ ├── HostFilters.css │ │ ├── HostFilters.tsx │ │ ├── HostGroupFilter.css │ │ ├── HostGroupFilter.tsx │ │ ├── HostItem.css │ │ ├── HostItem.tsx │ │ ├── HostItems.css │ │ ├── HostItems.tsx │ │ ├── HostSection.tsx │ │ └── host-functions.ts │ ├── panels │ │ ├── BottomPanel.css │ │ ├── BottomPanel.tsx │ │ ├── LeftPanel.css │ │ ├── LeftPanel.tsx │ │ ├── RightPanel.css │ │ ├── RightPanel.tsx │ │ ├── TopPanel.css │ │ └── TopPanel.tsx │ ├── services │ │ ├── ServiceFilters.css │ │ ├── ServiceFilters.tsx │ │ ├── ServiceGroupFilter.css │ │ ├── ServiceGroupFilter.tsx │ │ ├── ServiceItem.css │ │ ├── ServiceItem.tsx │ │ ├── ServiceItems.css │ │ ├── ServiceItems.tsx │ │ ├── ServiceSection.tsx │ │ └── service-functions.ts │ ├── summary │ │ ├── MostRecentAlert.tsx │ │ ├── Summary.css │ │ └── Summary.tsx │ └── widgets │ │ ├── Clock.css │ │ ├── Clock.tsx │ │ ├── CustomLogo.css │ │ ├── CustomLogo.tsx │ │ ├── FilterCheckbox.css │ │ ├── FilterCheckbox.tsx │ │ ├── HistoryChart.css │ │ ├── HistoryChart.tsx │ │ ├── HowMany.css │ │ ├── HowMany.tsx │ │ ├── HowManyEmoji.css │ │ ├── HowManyEmoji.tsx │ │ ├── MiniMapCanvas.css │ │ ├── MiniMapCanvas.tsx │ │ ├── MiniMapWrap.tsx │ │ ├── PollingSpinner.css │ │ ├── PollingSpinner.tsx │ │ ├── Progress.css │ │ ├── Progress.tsx │ │ ├── ScrollToSection.tsx │ │ ├── ScrollToTop.css │ │ └── ScrollToTop.tsx ├── helpers │ ├── audio.ts │ ├── axios.ts │ ├── colors.ts │ ├── date-math.ts │ ├── dates.tsx │ ├── language.ts │ ├── languages │ │ ├── french.ts │ │ └── spanish.ts │ ├── nagios.ts │ └── nagiostv.ts ├── index.css ├── index.tsx ├── logo.svg ├── settingsLoader.js ├── types │ ├── commentTypes.ts │ ├── hostAndServiceTypes.ts │ └── settings.ts └── vite-env.d.ts ├── tsconfig.json └── vite.config.ts /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | indent_style = tab 8 | indent_size = 4 9 | end_of_line = lf 10 | charset = utf-8 11 | trim_trailing_whitespace = false 12 | insert_final_newline = false -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | /releases 4 | /public/autoupdate 5 | /public/client-settings.json 6 | 7 | # dependencies 8 | /node_modules 9 | 10 | # testing 11 | /coverage 12 | 13 | # production 14 | /build 15 | 16 | # misc 17 | .DS_Store 18 | .env.local 19 | .env.development.local 20 | .env.test.local 21 | .env.production.local 22 | 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | 27 | # Node.js server 28 | /node/node_modules 29 | /node/settings.js 30 | /node/settings-nagios.js 31 | 32 | # some of my scripts 33 | deploy-to-bigwood.sh 34 | deploy-to-nagiostv-demo.sh -------------------------------------------------------------------------------- /.hintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "development" 4 | ], 5 | "hints": { 6 | "axe/forms": "off" 7 | } 8 | } -------------------------------------------------------------------------------- /README-development.md: -------------------------------------------------------------------------------- 1 | ## Development - Setup 2 | ------------ 3 | 4 | ### Requirements 5 | - Git 6 | - Node.js 7 | 8 | 9 | ### Setup Instruxtions 10 | ```console 11 | $ git clone https://github.com/chriscareycode/nagiostv-react.git 12 | $ cd nagiostv-react 13 | $ npm install 14 | $ npm start 15 | ``` 16 | 17 | Make sure you can access your web server on the hostname and port shown, and you can start editing files. 18 | 19 | **However**, you _probably_ see error messages since you _likely_ don't have a Nagios data source. 20 | You'll either want to use the provided _Mock Data_ or _proxy server_. 21 | 22 | 23 | 24 | ### Using Mock data 25 | As of version 0.3.2, mock data is included for doing local development. Without connecting to a real Nagios server, the UI will simulate one of each type of outage. This eliminates the need for the proxy if you just want to make some quick changes. To turn this on: 26 | - add `?fakedata=true` to the URL 27 | - _-or-_ set **useFakeSampleData = true** in `Base.jsx` 28 | 29 | ### Using Live Data 30 | To use Live Data from your actual Nagios server, edit and run the included **proxy server** like this: 31 | - Edit `proxy.js` using the instructions there 32 | - Run `npm run proxy` in a terminal 33 | - Change your NagiosTV development **Nagios cgi-bin path** setting to use whatever that says. That path will probably be `http://localhost:8080/nagios/cgi-bin/` 34 | 35 | Voila! You should see live data populate soon (or refresh it) 36 | 37 | #### More info on proxying (if you want to roll your own) 38 | The scripts will not be able to access the Nagios CGIs since, by default, Nagios does not enable CORS headers on those scripts, and the Nagios cgi-bin path may also 39 | have authentication enabled. You will need to either modify 40 | your Apache install to add CORS headers there, or to run a simple Node.js server or Apache config that will proxy the request and add the CORS headers and auth. 41 | 42 | ### Demo Mode 43 | Demo Mode uses the fakes/mock data and simulates events happening, just as used on the [demo site](https://nagiostv.com/demo/). 44 | 45 | You can also enable "Demo Mode" by adding `?demo=true` to the URL. 46 | 47 | Development - Committing your changes to this project 48 | ------------ 49 | - Fork the project 50 | - Create a feature branch and do your changes there 51 | - Push your feature branch up to origin 52 | - Submit a Pull Request 53 | 54 | ## Memory profiling 55 | 56 | More recently we are moving from React Classes to React Functional (with Hooks) 57 | and switching some state management to Recoil. 58 | As of the time of writing 2021-10-03, when in development mode, Recoil will leak memory 59 | into `window.$recoilDebugStates`. You can set window.$recoilDebugStates = [] before memory profiling to try to get around this 60 | https://github.com/facebookexperimental/Recoil/issues/471#issuecomment-685217406 -------------------------------------------------------------------------------- /config-overrides.js: -------------------------------------------------------------------------------- 1 | /* config-overrides.js */ 2 | 3 | // for react fast refresh 4 | const { override } = require('customize-cra') 5 | const { addReactRefresh } = require('customize-cra-react-refresh') 6 | 7 | module.exports = override(addReactRefresh()) 8 | -------------------------------------------------------------------------------- /create-tar-for-github.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | npm run build 3 | 4 | # remove settings that should not be in the build 5 | rm build/client-settings.json 6 | rm build/connectors/livestatus-settings.ini 7 | rm build/node/settings-nagios.js 8 | 9 | mkdir -p releases/nagiostv 10 | rm releases/nagiostv-0.0.0.tar.gz 11 | rm -rf releases/nagiostv/* 12 | rsync -av --delete build/* releases/nagiostv 13 | cd releases 14 | tar -zcvf nagiostv-0.0.0.tar.gz nagiostv 15 | cd .. 16 | echo . 17 | echo Now rename releases/nagiostv-0.0.0.tar.gz to the new version name 18 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |