1 line
11 KiB
JSON
1 line
11 KiB
JSON
{"remainingRequest":"/var/www/html/payroll_manager/front-end/node_modules/thread-loader/dist/cjs.js??ref--4-2!/var/www/html/payroll_manager/front-end/node_modules/ts-loader/index.js??ref--4-3!/var/www/html/payroll_manager/front-end/node_modules/tslint-loader/index.js!/var/www/html/payroll_manager/front-end/src/main/webapp/app/modules/administration/health/health.tsx","dependencies":[{"path":"/var/www/html/payroll_manager/front-end/src/main/webapp/app/modules/administration/health/health.tsx","mtime":1533613272361},{"path":"/var/www/html/payroll_manager/front-end/node_modules/react-hot-loader/webpack.js","mtime":1505850161000},{"path":"/var/www/html/payroll_manager/front-end/node_modules/cache-loader/dist/cjs.js","mtime":0},{"path":"/var/www/html/payroll_manager/front-end/node_modules/thread-loader/dist/cjs.js","mtime":0},{"path":"/var/www/html/payroll_manager/front-end/node_modules/ts-loader/index.js","mtime":1530127508000},{"path":"/var/www/html/payroll_manager/front-end/node_modules/tslint-loader/index.js","mtime":1519899048000}],"contextDependencies":[],"result":["import * as tslib_1 from \"tslib\";\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport { Table, Badge, Col, Row, Button } from 'reactstrap';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { systemHealth } from '../administration.reducer';\nimport HealthModal from './health-modal';\nvar HealthPage = /** @class */ (function (_super) {\n tslib_1.__extends(HealthPage, _super);\n function HealthPage() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.state = {\n healthObject: {},\n showModal: false\n };\n _this.getSystemHealth = function () {\n if (!_this.props.isFetching) {\n _this.props.systemHealth();\n }\n };\n _this.getSystemHealthInfo = function (name, healthObject) { return function () {\n _this.setState({\n showModal: true,\n healthObject: tslib_1.__assign({}, healthObject, { name: name })\n });\n }; };\n _this.handleClose = function () {\n _this.setState({\n showModal: false\n });\n };\n _this.renderModal = function () {\n var healthObject = _this.state.healthObject;\n return React.createElement(HealthModal, { healthObject: healthObject, handleClose: _this.handleClose, showModal: _this.state.showModal });\n };\n return _this;\n }\n HealthPage.prototype.componentDidMount = function () {\n this.props.systemHealth();\n };\n HealthPage.prototype.render = function () {\n var _this = this;\n var _a = this.props, health = _a.health, isFetching = _a.isFetching;\n var data = (health || {}).details || {};\n return (React.createElement(\"div\", null,\n React.createElement(\"h2\", { className: \"health-page-heading\" }, \"Health Checks\"),\n React.createElement(\"p\", null,\n React.createElement(Button, { onClick: this.getSystemHealth, color: isFetching ? 'btn btn-danger' : 'btn btn-primary', disabled: isFetching },\n React.createElement(FontAwesomeIcon, { icon: \"sync\" }),\n \"\\u00A0 Refresh\")),\n React.createElement(Row, null,\n React.createElement(Col, { md: \"12\" },\n React.createElement(Table, { bordered: true },\n React.createElement(\"thead\", null,\n React.createElement(\"tr\", null,\n React.createElement(\"th\", null, \"Service Name\"),\n React.createElement(\"th\", null, \"Status\"),\n React.createElement(\"th\", null, \"Details\"))),\n React.createElement(\"tbody\", null, Object.keys(data).map(function (configPropKey, configPropIndex) {\n return configPropKey !== 'status' ? (React.createElement(\"tr\", { key: configPropIndex },\n React.createElement(\"td\", null, configPropKey),\n React.createElement(\"td\", null,\n React.createElement(Badge, { color: data[configPropKey].status !== 'UP' ? 'danger' : 'success' }, data[configPropKey].status)),\n React.createElement(\"td\", null, data[configPropKey].details ? (React.createElement(\"a\", { onClick: _this.getSystemHealthInfo(configPropKey, data[configPropKey]) },\n React.createElement(FontAwesomeIcon, { icon: \"eye\" }))) : null))) : null;\n }))))),\n this.renderModal()));\n };\n return HealthPage;\n}(React.Component));\nexport { HealthPage };\nvar mapStateToProps = function (storeState) { return ({\n health: storeState.administration.health,\n isFetching: storeState.administration.loading\n}); };\nvar mapDispatchToProps = { systemHealth: systemHealth };\nexport default connect(mapStateToProps, mapDispatchToProps)(HealthPage);\n",{"version":3,"file":"/var/www/html/payroll_manager/front-end/src/main/webapp/app/modules/administration/health/health.tsx","sourceRoot":"","sources":["/var/www/html/payroll_manager/front-end/node_modules/tslint-loader/index.js!/var/www/html/payroll_manager/front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,eAAe,IAAC,IAAI,EAAC,KAAK,GAAG,CAC5B,CACL,CAAC,CAAC,CAAC,IAAI,CACL,CACF,CACN,CAAC,CAAC,CAAC,IAAI;wBAdR,CAcQ,CACX,CACK,CACF,CACJ,CACF;YACL,IAAI,CAAC,WAAW,EAAE,CACf,CACP,CAAC;IACJ,CAAC;IACH,iBAAC;AAAD,CAAC,AArFD,CAAgC,KAAK,CAAC,SAAS,GAqF9C;;AAED,IAAM,eAAe,GAAG,UAAC,UAAsB,IAAK,OAAA,CAAC;IACnD,MAAM,EAAE,UAAU,CAAC,cAAc,CAAC,MAAM;IACxC,UAAU,EAAE,UAAU,CAAC,cAAc,CAAC,OAAO;CAC9C,CAAC,EAHkD,CAGlD,CAAC;AAEH,IAAM,kBAAkB,GAAG,EAAE,YAAY,cAAA,EAAE,CAAC;AAK5C,eAAe,OAAO,CACpB,eAAe,EACf,kBAAkB,CACnB,CAAC,UAAU,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { connect } from 'react-redux';\n\nimport { Table, Badge, Col, Row, Button } from 'reactstrap';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\n\nimport { IRootState } from 'app/shared/reducers';\nimport { systemHealth } from '../administration.reducer';\nimport HealthModal from './health-modal';\n\nexport interface IHealthPageProps extends StateProps, DispatchProps {}\n\nexport interface IHealthPageState {\n healthObject: any;\n showModal: boolean;\n}\n\nexport class HealthPage extends React.Component<IHealthPageProps, IHealthPageState> {\n state: IHealthPageState = {\n healthObject: {},\n showModal: false\n };\n\n componentDidMount() {\n this.props.systemHealth();\n }\n\n getSystemHealth = () => {\n if (!this.props.isFetching) {\n this.props.systemHealth();\n }\n };\n\n getSystemHealthInfo = (name, healthObject) => () => {\n this.setState({\n showModal: true,\n healthObject: {\n ...healthObject,\n name\n }\n });\n };\n\n handleClose = () => {\n this.setState({\n showModal: false\n });\n };\n\n renderModal = () => {\n const { healthObject } = this.state;\n return <HealthModal healthObject={healthObject} handleClose={this.handleClose} showModal={this.state.showModal} />;\n };\n\n render() {\n const { health, isFetching } = this.props;\n const data = (health || {}).details || {};\n return (\n <div>\n <h2 className=\"health-page-heading\">Health Checks</h2>\n <p>\n <Button onClick={this.getSystemHealth} color={isFetching ? 'btn btn-danger' : 'btn btn-primary'} disabled={isFetching}>\n <FontAwesomeIcon icon=\"sync\" /> Refresh\n </Button>\n </p>\n <Row>\n <Col md=\"12\">\n <Table bordered>\n <thead>\n <tr>\n <th>Service Name</th>\n <th>Status</th>\n <th>Details</th>\n </tr>\n </thead>\n <tbody>\n {Object.keys(data).map(\n (configPropKey, configPropIndex) =>\n configPropKey !== 'status' ? (\n <tr key={configPropIndex}>\n <td>{configPropKey}</td>\n <td>\n <Badge color={data[configPropKey].status !== 'UP' ? 'danger' : 'success'}>{data[configPropKey].status}</Badge>\n </td>\n <td>\n {data[configPropKey].details ? (\n <a onClick={this.getSystemHealthInfo(configPropKey, data[configPropKey])}>\n <FontAwesomeIcon icon=\"eye\" />\n </a>\n ) : null}\n </td>\n </tr>\n ) : null\n )}\n </tbody>\n </Table>\n </Col>\n </Row>\n {this.renderModal()}\n </div>\n );\n }\n}\n\nconst mapStateToProps = (storeState: IRootState) => ({\n health: storeState.administration.health,\n isFetching: storeState.administration.loading\n});\n\nconst mapDispatchToProps = { systemHealth };\n\ntype StateProps = ReturnType<typeof mapStateToProps>;\ntype DispatchProps = typeof mapDispatchToProps;\n\nexport default connect(\n mapStateToProps,\n mapDispatchToProps\n)(HealthPage);\n"]}]} |