diff --git a/React_Full_Project/package.json b/React_Full_Project/package.json
index dd11fd026..d313a72d7 100644
--- a/React_Full_Project/package.json
+++ b/React_Full_Project/package.json
@@ -45,7 +45,7 @@
},
"scripts": {
"dev": "webpack -d --progress --watch --profile --json > compilation-stats.json --env.dev",
- "start": "webpack-dev-server --progress --colors --inline --env.dev",
+ "start": "webpack-dev-server --progress --colors --inline --env.dev --host lgc-sandbox-dev --port 8080",
"build": "webpack -p --progress --env.prod",
"clean": "rimraf ./build"
},
diff --git a/React_Starter/package.json b/React_Starter/package.json
index dd11fd026..d313a72d7 100644
--- a/React_Starter/package.json
+++ b/React_Starter/package.json
@@ -45,7 +45,7 @@
},
"scripts": {
"dev": "webpack -d --progress --watch --profile --json > compilation-stats.json --env.dev",
- "start": "webpack-dev-server --progress --colors --inline --env.dev",
+ "start": "webpack-dev-server --progress --colors --inline --env.dev --host lgc-sandbox-dev --port 8080",
"build": "webpack -p --progress --env.prod",
"clean": "rimraf ./build"
},
diff --git a/React_Starter/public/favicon.ico b/React_Starter/public/favicon.ico
index 5c125de5d..5c8edcd00 100644
Binary files a/React_Starter/public/favicon.ico and b/React_Starter/public/favicon.ico differ
diff --git a/React_Starter/public/img/favicon.png b/React_Starter/public/img/favicon.png
index 7f62affe0..a594da449 100644
Binary files a/React_Starter/public/img/favicon.png and b/React_Starter/public/img/favicon.png differ
diff --git a/React_Starter/public/img/logo-symbol.png b/React_Starter/public/img/logo-symbol.png
index 7f62affe0..a594da449 100644
Binary files a/React_Starter/public/img/logo-symbol.png and b/React_Starter/public/img/logo-symbol.png differ
diff --git a/React_Starter/public/img/logo.png b/React_Starter/public/img/logo.png
index 98a194634..df1dbcc99 100644
Binary files a/React_Starter/public/img/logo.png and b/React_Starter/public/img/logo.png differ
diff --git a/React_Starter/scss/core/_buttons.scss b/React_Starter/scss/core/_buttons.scss
index 7ab4953b9..1eacee359 100644
--- a/React_Starter/scss/core/_buttons.scss
+++ b/React_Starter/scss/core/_buttons.scss
@@ -23,6 +23,7 @@ button {
margin-top: -2px;
vertical-align: middle;
}
+ margin-right: 4px;
}
.btn-facebook,
diff --git a/React_Starter/src/components/Footer/Footer.js b/React_Starter/src/components/Footer/Footer.js
index 6dfaf74f7..17c7e9a11 100644
--- a/React_Starter/src/components/Footer/Footer.js
+++ b/React_Starter/src/components/Footer/Footer.js
@@ -4,8 +4,7 @@ class Footer extends Component {
render() {
return (
)
}
diff --git a/React_Starter/src/components/Header/Header.js b/React_Starter/src/components/Header/Header.js
index cf93eb2e1..aae5b2c0f 100644
--- a/React_Starter/src/components/Header/Header.js
+++ b/React_Starter/src/components/Header/Header.js
@@ -38,9 +38,6 @@ class Header extends Component {
-
-
-
);
}
diff --git a/React_Starter/src/components/Sidebar/_nav.js b/React_Starter/src/components/Sidebar/_nav.js
index e2f448167..7a22fe7c1 100644
--- a/React_Starter/src/components/Sidebar/_nav.js
+++ b/React_Starter/src/components/Sidebar/_nav.js
@@ -1,13 +1,9 @@
export default {
items: [
{
- name: 'Dashboard',
+ name: 'Console',
url: '/dashboard',
- icon: 'icon-speedometer',
- badge: {
- variant: 'info',
- text: 'NEW'
- }
+ icon: 'icon-list',
}
]
};
diff --git a/React_Starter/src/routes.js b/React_Starter/src/routes.js
index a941ecc25..4367ba483 100644
--- a/React_Starter/src/routes.js
+++ b/React_Starter/src/routes.js
@@ -1,5 +1,5 @@
const routes = {
'/': 'Home',
- '/dashboard': 'Dashboard'
+ '/dashboard': 'Console'
};
export default routes;
diff --git a/React_Starter/src/views/Dashboard/Dashboard.js b/React_Starter/src/views/Dashboard/Dashboard.js
index a4777481f..de1804d1d 100644
--- a/React_Starter/src/views/Dashboard/Dashboard.js
+++ b/React_Starter/src/views/Dashboard/Dashboard.js
@@ -1,14 +1,318 @@
-import React, { Component } from 'react';
+import React, {
+ Component
+} from 'react';
+import {
+ Badge,
+ Row,
+ Col,
+ Card,
+ CardHeader,
+ CardBody,
+ CardFooter,
+ Table,
+ Pagination,
+ PaginationItem,
+ PaginationLink,
+ Button,
+ ButtonDropdown,
+ DropdownToggle,
+ DropdownMenu,
+ DropdownItem,
+ Form,
+ FormGroup,
+ FormText,
+ Label,
+ Input,
+ InputGroup,
+ InputGroupAddon,
+ InputGroupButton
+} from 'reactstrap';
+
+import axios from 'axios';
+import LastProcess from './LastProcess';
+import Loading from 'react-loading-bar';
class Dashboard extends Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ results: [],
+ nb_result: "",
+ searchFieldValue: "",
+ errorCheck:true,
+ warningCheck:true,
+ successCheck:true,
+ };
+ }
+
+ onShow() {
+ this.setState({ show: true })
+ }
+
+ onHide() {
+ this.setState({ show: false })
+ }
+
+ performElasticQuery(query) {
+ this.onShow()
+ console.log(query)
+ if (query != '') {
+ axios.post(`http://lgc-sandbox-dev:9200/console/_search`, {
+ version: true,
+ size: 50,
+ sort: [{
+ ts_cre: {
+ order: 'desc',
+ unmapped_type: 'boolean'
+ }
+ }],
+ query: {
+ bool: {
+ must: [{
+ query_string: {
+ query: 'type:flux AND ' + query,
+ analyze_wildcard: true,
+ default_field: '*'
+ }
+ }
+ ],
+ }
+ }
+ })
+ .then(res => {
+ // Je met des commentaire pour tester l'edit :D
+
+ const results = res.data.hits.hits.map(obj => obj._source);
+ this.setState({
+ results : results,
+ nb_result : res.data.hits.total
+ });
+ this.onHide()
+ });
+ } else {
+ axios.post(`http://lgc-sandbox-dev:9200/console/_search`, {
+ version: true,
+ size: 50,
+ sort: [{
+ ts_cre: {
+ order: 'desc',
+ unmapped_type: 'boolean'
+ }
+ }],
+ query: {
+ bool: {
+ must: [{
+ query_string: {
+ query: 'type:flux',
+ analyze_wildcard: true,
+ default_field: '*'
+ }
+ }
+ ],
+ }
+ }
+ })
+ .then(res => {
+ const results = res.data.hits.hits.map(obj => obj._source);
+ this.setState({
+ results : results,
+ nb_result : res.data.hits.total
+ });
+ this.onHide()
+ });
+ }
+ }
+
+ updateWarningCheck() {
+ this.setState({
+ warningCheck: !this.state.warningCheck,
+ }, function () {
+ this.buildAndPerformElasticQuery()
+ });
+ }
+
+ updateSuccessCheck() {
+ console.log(this.state.successCheck)
+ this.setState({
+ successCheck: !this.state.successCheck,
+ }, function () {
+ this.buildAndPerformElasticQuery()
+ });
+ }
+
+ updateErrorCheck() {
+ this.setState({
+ errorCheck: !this.state.errorCheck,
+ }, function () {
+ this.buildAndPerformElasticQuery()
+ });
+ }
+
+ updateSearchFieldValue(value) {
+ if (value != '') {
+ this.setState({searchFieldValue:value})
+ }
+ }
+
+ buildAndPerformElasticQuery() {
+ var addToQuery = ''
+ var addToQueryPrefixString = '('
+ var successCheckString = 'sta_flu:S OR '
+ var warningCheckString = 'sta_flu:A OR '
+ var errorCheckString = 'sta_flu:E'
+ var addToQuerySuffixString = ')'
+
+ console.log("Success : " + this.state.successCheck + " Warning : " + this.state.warningCheck + " Error : " + this.state.errorCheck)
+
+
+ if (this.state.successCheck == false) {
+ successCheckString = 'NOT ' + successCheckString
+ }
+ if (this.state.warningCheck == false) {
+ warningCheckString = 'NOT ' + warningCheckString
+ }
+ if (this.state.errorCheck == false) {
+ errorCheckString = 'NOT ' + errorCheckString
+ }
+
+ addToQuery = addToQueryPrefixString + successCheckString + warningCheckString + errorCheckString + addToQuerySuffixString
+
+ console.log(addToQuery)
+ this.performElasticQuery(this.state.searchFieldValue + addToQuery)
+ }
+
+ componentDidMount() {
+ this.buildAndPerformElasticQuery();
+ }
+
+ renderStaFlu(sta_flu) {
+ if (sta_flu == 'S') {
+ return (
{ "Succes" } | )
+ } else if (sta_flu == 'A') {
+ return ({ "Avertissement" } | )
+ } else {
+ return ({ "Erreur" } | )
+ }
+ }
+
+ renderRAIColumn(gln_flu, rai_soc) {
+ if (rai_soc != null) {
+ return (rai_soc)
+ } else {
+ return (gln_flu)
+ }
+ }
- render() {
- return (
+ render() {
+ return (
- )
- }
+ )
+ }
}
-export default Dashboard;
+export default Dashboard;
\ No newline at end of file
diff --git a/React_Starter/src/views/Dashboard/LastProcess.js b/React_Starter/src/views/Dashboard/LastProcess.js
new file mode 100644
index 000000000..fde255758
--- /dev/null
+++ b/React_Starter/src/views/Dashboard/LastProcess.js
@@ -0,0 +1,62 @@
+import React, { Component } from 'react';
+import axios from 'axios';
+
+class LastProcess extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ fluKey: props.flux,
+ results: []
+ };
+ }
+
+ componentDidMount() {
+ axios.post(`http://remove_leclerc_interne_uri:9200/console/_search`, {
+ version: true,
+ size: 1,
+ sort: [
+ {
+ ts_cre: {
+ order: 'desc',
+ unmapped_type: 'boolean'
+ }
+ }
+ ],
+ query: {
+ bool: {
+ must: [
+ {
+ query_string: {
+ query: 'type:traitement AND num_flu:' + this.state.fluKey,
+ analyze_wildcard: true,
+ default_field: '*'
+ }
+ }
+ ],
+ }
+ }
+ })
+ .then(res => {
+ const results = res.data.hits.hits.map(obj => obj._source);
+ this.setState({ results });
+ });
+ }
+
+ render() {
+ return (
+
+ {
+ this.state.results.map(result =>
+
+ { result.typ_tra } - { result.lib_tra } - { new Date(result.ts_cre).toLocaleString() }
+
+ )
+ }
+
+ )
+ }
+}
+
+
+
+export default LastProcess;