Skip to content
This repository was archived by the owner on Dec 13, 2022. It is now read-only.
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
11,304 changes: 6,954 additions & 4,350 deletions package-lock.json

Large diffs are not rendered by default.

103 changes: 53 additions & 50 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,88 +13,91 @@
"start:dev": "npm run build:dev -- --watch"
},
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-transform-arrow-functions": "^7.2.0",
"@babel/plugin-transform-regenerator": "^7.4.5",
"@babel/plugin-transform-shorthand-properties": "^7.2.0",
"@babel/polyfill": "^7.4.4",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.7.7",
"@babel/core": "^7.8.4",
"@babel/plugin-proposal-class-properties": "^7.8.3",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-arrow-functions": "^7.8.3",
"@babel/plugin-transform-regenerator": "^7.8.3",
"@babel/plugin-transform-shorthand-properties": "^7.8.3",
"@babel/polyfill": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"@babel/preset-react": "^7.8.3",
"@babel/preset-typescript": "^7.8.3",
"@centreon/frontend-core": "centreon/frontend-core",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^8.0.6",
"@svgr/webpack": "^5.2.0",
"@testing-library/jest-dom": "^5.1.1",
"@testing-library/react": "^9.4.1",
"@testing-library/user-event": "^10.0.0",
"@types/react-router": "^5.1.4",
"awesome-typescript-loader": "^5.2.1",
"babel-jest": "^24.8.0",
"axios-mock-adapter": "^1.17.0",
"babel-jest": "^25.1.0",
"babel-loader": "^8.0.6",
"babel-merge": "^3.0.0",
"clean-webpack-plugin": "^3.0.0",
"css-loader": "^3.1.0",
"css-loader": "^3.4.2",
"eslint-config-airbnb": "^18.0.1",
"eslint-config-prettier": "^6.9.0",
"eslint-config-prettier": "^6.10.0",
"eslint-import-resolver-alias": "1.1.2",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-jest": "^23.6.0",
"eslint-plugin-jest": "^23.8.0",
"eslint-plugin-prefer-arrow-functions": "^3.0.1",
"eslint-plugin-prettier": "^3.1.0",
"file-loader": "^4.1.0",
"eslint-plugin-prettier": "^3.1.2",
"file-loader": "^5.1.0",
"html-webpack-plugin": "^3.2.0",
"html-webpack-tags-plugin": "^2.0.13",
"jest": "^24.8.0",
"html-webpack-tags-plugin": "^2.0.17",
"jest": "^25.1.0",
"jest-junit": "^10.0.0",
"lodash": "^4.17.15",
"mini-css-extract-plugin": "^0.8.0",
"node-sass": "^4.12.0",
"mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.13.1",
"postcss-loader": "^3.0.0",
"postcss-safe-parser": "^4.0.1",
"prettier": "^1.18.2",
"postcss-safe-parser": "^4.0.2",
"prettier": "^1.19.1",
"react-mock-router": "^1.0.15",
"react-testing-library": "^8.0.1",
"redux-mock-store": "^1.5.3",
"resolve-url-loader": "^3.1.0",
"sass-loader": "^7.1.0",
"terser-webpack-plugin": "^1.4.2",
"typescript": "^3.7.4",
"url-loader": "^2.1.0",
"webpack": "^4.36.1",
"webpack-cli": "^3.3.6",
"webpack-livereload-plugin": "^2.2.0",
"redux-mock-store": "^1.5.4",
"resolve-url-loader": "^3.1.1",
"sass-loader": "^8.0.2",
"terser-webpack-plugin": "^2.3.5",
"typescript": "^3.8.2",
"url-loader": "^3.0.0",
"webpack": "^4.41.6",
"webpack-cli": "^3.3.11",
"webpack-livereload-plugin": "^2.3.0",
"webpack-merge": "^4.2.2"
},
"dependencies": {
"@centreon/ui": "centreon/centreon-ui",
"@material-ui/core": "^4.9.2",
"axios": "^0.19.0",
"@material-ui/core": "^4.9.4",
"@material-ui/icons": "^4.9.1",
"axios": "^0.19.2",
"classnames": "^2.2.6",
"connected-react-router": "^6.6.1",
"dom-serializer": "^0.1.1",
"connected-react-router": "^6.7.0",
"dom-serializer": "^0.2.2",
"install": "^0.13.0",
"loaders.css": "^0.1.2",
"moment-timezone": "^0.5.26",
"moment-timezone": "^0.5.28",
"numeral": "^2.0.6",
"query-string": "^5.1.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"query-string": "^6.11.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-full-screen": "^0.2.4",
"react-fullscreen-crossbrowser": "^1.0.9",
"react-redux": "^7.1.0",
"react-redux": "^7.2.0",
"react-redux-i18n": "^1.9.3",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.3.0",
"react-select": "^3.0.4",
"redux": "^4.0.4",
"react-scripts": "^3.4.0",
"react-select": "^3.0.8",
"redux": "^4.0.5",
"redux-batched-actions": "^0.4.1",
"redux-form": "^8.2.4",
"redux-form": "^8.3.0",
"redux-logger": "^3.0.6",
"redux-saga": "^1.0.5",
"redux-saga": "^1.1.3",
"redux-thunk": "^2.3.0",
"reselect": "^4.0.0",
"systemjs": "^6.1.3",
"systemjs": "^6.2.4",
"systemjs-plugin-css": "^0.1.37",
"yup": "^0.27.0"
"yup": "^0.28.1"
},
"jest": {
"testResultsProcessor": "jest-junit",
Expand Down
10 changes: 6 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{
"compilerOptions": {
"target": "es5",
Expand All @@ -8,13 +7,16 @@
"noImplicitAny": false,
"skipLibCheck": true,
"baseUrl": "./",
"typeRoots": ["./types", "./node_modules/@types"],
"esModuleInterop": true,
"typeRoots": [
"./types",
"./node_modules/@types"
],
"esModuleInterop": true
},
"include": [
"./www/front_src/src"
],
"exclude": [
"node_modules"
]
],
}
1 change: 1 addition & 0 deletions webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = merge(baseConfig, devConfig, {
alias: {
react: path.resolve('./node_modules/react'),
'react-router-dom': path.resolve('./node_modules/react-router-dom'),
'@material-ui/core': path.resolve('./node_modules/@material-ui/core'),
},
},
plugins: [
Expand Down
7 changes: 7 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ module.exports = merge(baseConfig, extractCssConfig, {
filename: '../index.html',
}),
],
resolve: {
extensions: ['.svg'],
},
module: {
rules: [
{ parser: { system: false } },
Expand All @@ -39,6 +42,10 @@ module.exports = merge(baseConfig, extractCssConfig, {
},
],
},
{
test: /\.icon.svg$/,
use: ['@svgr/webpack'],
},
{
test: /\.(bmp|png|jpg|jpeg|gif|svg)$/,
use: [
Expand Down
55 changes: 31 additions & 24 deletions www/front_src/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,21 @@
/* eslint-disable react/jsx-filename-extension */

import React, { Component, ReactNode } from 'react';

import { connect } from 'react-redux';
import { ConnectedRouter } from 'connected-react-router';
import Fullscreen from 'react-fullscreen-crossbrowser';
import queryString from 'query-string';

import { ThemeProvider } from '@centreon/ui';

import Header from './components/header';
import { history } from './store';

import NavigationComponent from './components/navigation';
import Tooltip from './components/tooltip';
import Footer from './components/footer';
import MainRouter from './components/mainRouter';
import axios from './axios';

import { fetchExternalComponents } from './redux/actions/externalComponentsActions';

import styles from './App.scss';
Expand Down Expand Up @@ -115,31 +117,36 @@ class App extends Component<Props, State> {

return (
<ConnectedRouter history={history}>
<div className={styles.wrapper}>
{!min && <NavigationComponent />}
<Tooltip />
<div id="content" className={contentStyles.content}>
{!min && <Header />}
<div
id="fullscreen-wrapper"
className={contentStyles['fullscreen-wrapper']}
>
<Fullscreen
enabled={this.state.isFullscreenEnabled}
onClose={this.removeFullscreenParams}
onChange={(isFullscreenEnabled): void => {
this.setState({ isFullscreenEnabled });
}}
<ThemeProvider>
<div className={styles.wrapper}>
{!min && <NavigationComponent />}
<Tooltip />
<div id="content" className={contentStyles.content}>
{!min && <Header />}
<div
id="fullscreen-wrapper"
className={contentStyles['fullscreen-wrapper']}
>
<div className={styles['main-content']}>
<MainRouter />
</div>
</Fullscreen>
<Fullscreen
enabled={this.state.isFullscreenEnabled}
onClose={this.removeFullscreenParams}
onChange={(isFullscreenEnabled): void => {
this.setState({ isFullscreenEnabled });
}}
>
<div className={styles['main-content']}>
<MainRouter />
</div>
</Fullscreen>
</div>
{!min && <Footer />}
</div>
{!min && <Footer />}
<span
className={footerStyles['full-screen']}
onClick={this.goFull}
/>
</div>
<span className={footerStyles['full-screen']} onClick={this.goFull} />
</div>
</ThemeProvider>
</ConnectedRouter>
);
}
Expand Down
24 changes: 24 additions & 0 deletions www/front_src/src/Resources/api/endpoint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const resourcesEndpoint = 'monitoring/resources';

const buildParam = ({ name, value }): string => {
return `${name}=${JSON.stringify(value)}`;
};

const buildResourcesEndpoint = ({ state, sort, page, limit }): string => {
const params = [
{
name: 'state',
value: state,
},
{ name: 'sort_by', value: sort },
{ name: 'page', value: page },
{ name: 'limit', value: limit },
]
.filter(({ value }) => value !== undefined)
.map(buildParam)
.join('&');

return `${resourcesEndpoint}?${params}`;
};

export { buildResourcesEndpoint };
19 changes: 19 additions & 0 deletions www/front_src/src/Resources/api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import axios, { AxiosRequestConfig } from 'axios';

import { buildResourcesEndpoint } from './endpoint';
import { ResourceListing } from '../models';

const api = axios.create({
baseURL: './api/beta/',
});

const getData = ({ endpoint, requestParams }): Promise<ResourceListing> =>
api.get(endpoint, requestParams).then(({ data }) => data);

const listResources = (
endpointParams,
requestParams: AxiosRequestConfig = {},
): Promise<ResourceListing> =>
getData({ endpoint: buildResourcesEndpoint(endpointParams), requestParams });

export { listResources };
9 changes: 9 additions & 0 deletions www/front_src/src/Resources/columns/icons/Downtime.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

import { SvgIcon } from '@material-ui/core';

import { ReactComponent as IconDowntime } from './downtime.icon.svg';

const Downtime = (): JSX.Element => <SvgIcon component={IconDowntime} />;

export default Downtime;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading