index.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. import React, { Component } from "react";
  2. import Router from "next/router";
  3. import ContentWrapper from "@/components/Layout/ContentWrapper";
  4. import { Row, Col, Progress, Button } from "reactstrap";
  5. import { getPelaporan } from "../../../actions/pelaporan";
  6. import Sparkline from "@/components/Common/Sparklines";
  7. import Scrollable from "@/components/Common/Scrollable";
  8. import Datatable from "@/components/Tables/Datatable";
  9. import moment from "moment";
  10. class BugTracker extends Component {
  11. constructor(props) {
  12. super(props);
  13. }
  14. static getInitialProps = async () => {
  15. const pelaporan = await getPelaporan({ penjadwalan: true });
  16. return { pelaporan };
  17. };
  18. newProcessClick = (e, PT_ID, number) => {
  19. e.preventDefault();
  20. Router.push({
  21. pathname: "/app/pemeriksaan/new",
  22. query: { ptId: PT_ID, number: number },
  23. });
  24. };
  25. render() {
  26. const { pelaporan } = this.props;
  27. return (
  28. <ContentWrapper>
  29. <div className="content-heading">Evaluasi</div>
  30. <Row>
  31. <Col lg="4">
  32. <div className="card b">
  33. <div className="card-body bb">
  34. <p>Overvall progress</p>
  35. <div className="d-flex align-items-center mb-2">
  36. <div className="w-100">
  37. <Progress className="progress-xs m0" color="info" value={20} />
  38. </div>
  39. <div className="ml-auto">
  40. <div className="col wd-xxs text-right">
  41. <div className="text-bold text-muted">20%</div>
  42. </div>
  43. </div>
  44. </div>
  45. </div>
  46. <div className="card-body">
  47. <p>Metrics</p>
  48. <div className="row text-center">
  49. <div className="col-6 col-lg-6 col-xl-6">
  50. <Sparkline
  51. values={[20, 80]}
  52. options={{
  53. type: "pie",
  54. height: "50",
  55. sliceColors: ["#edf1f2", "#23b7e5"],
  56. }}
  57. className="sparkline"
  58. />
  59. <p className="mt-3">Open Case</p>
  60. </div>
  61. <div className="col-6 col-lg-6 col-xl-6">
  62. <Sparkline
  63. values={[80, 20]}
  64. options={{
  65. type: "pie",
  66. height: "50",
  67. sliceColors: ["#edf1f2", "#27c24c"],
  68. }}
  69. className="sparkline"
  70. />
  71. <p className="mt-3">Close Case</p>
  72. </div>
  73. </div>
  74. </div>
  75. <table className="table bb">
  76. <tbody>
  77. <tr>
  78. <td>
  79. <strong>Open Case</strong>
  80. </td>
  81. <td>80</td>
  82. </tr>
  83. <tr>
  84. <td>
  85. <strong>Close Case</strong>
  86. </td>
  87. <td>20</td>
  88. </tr>
  89. <tr>
  90. <td>
  91. <strong>Performance</strong>
  92. </td>
  93. <td>
  94. <em className="far fa-smile fa-lg text-warning"></em>
  95. </td>
  96. </tr>
  97. <tr>
  98. <td>
  99. <strong>Last Case Closed</strong>
  100. </td>
  101. <td>BI:1107 - 12/01/2016</td>
  102. </tr>
  103. </tbody>
  104. </table>
  105. </div>
  106. </Col>
  107. <Col lg="8">
  108. <div className="card b">
  109. <div className="card-body">
  110. <Datatable options={{ responsive: true }}>
  111. <table className="table w-100">
  112. <thead>
  113. <tr>
  114. <th>#ID</th>
  115. <th>Description</th>
  116. <th>Created</th>
  117. <th>Status</th>
  118. </tr>
  119. </thead>
  120. <tbody>
  121. {pelaporan.data.map((value) => {
  122. return (
  123. <tr>
  124. <td>BI:{value._number}</td>
  125. <td className="text-nowrap">
  126. <div className="media align-items-center">
  127. <a className="mr-3" href="">
  128. <img className="img-fluid rounded thumb64" src="/static/img/dummy-search.png" alt="Dummy" />
  129. </a>
  130. <div className="media-body d-flex">
  131. <div>
  132. <h4 className="m-0">Universitas Satyagama</h4>
  133. <small className="text-muted">0742/O/1990 - www.satyagama.ac.id - info@satyagama.ac.id</small>
  134. <p>Jalan Kamal Raya No 2-A Cengkareng</p>
  135. <p> </p>
  136. </div>
  137. </div>
  138. </div>
  139. </td>
  140. <td>{moment(value.created_at).fromNow()}</td>
  141. <td>
  142. <div className="ml-auto">
  143. <button class="btn-oval btn btn-primary" size="sm" onClick={(e) => this.newProcessClick(e, value.pt_id, value._number)}>
  144. Update Data
  145. </button>
  146. </div>
  147. </td>
  148. </tr>
  149. );
  150. })}
  151. </tbody>
  152. </table>
  153. </Datatable>
  154. </div>
  155. </div>
  156. </Col>
  157. </Row>
  158. </ContentWrapper>
  159. );
  160. }
  161. }
  162. export default BugTracker;