pemeriksaan.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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 Sparkline from "@/components/Common/Sparklines";
  6. import Scrollable from "@/components/Common/Scrollable";
  7. import Datatable from "@/components/Tables/Datatable";
  8. import moment from "moment";
  9. class BugTracker extends Component {
  10. constructor(props) {
  11. super(props);
  12. }
  13. static getInitialProps = async () => {
  14. const res = await fetch("http://localhost:1880/pelaporan");
  15. let data = await res.json();
  16. data = data.filter((e) => e.penjadwalan);
  17. return { data };
  18. };
  19. renderTable = () => {
  20. console.log(this.props.data);
  21. return this.props.data.map((value) => {
  22. return (
  23. <tr>
  24. <td>BI:{value._number}</td>
  25. <td className="text-nowrap">
  26. <div className="media align-items-center">
  27. <a className="mr-3" href="">
  28. <img className="img-fluid rounded thumb64" src="/static/img/dummy-search.png" alt="Dummy" />
  29. </a>
  30. <div className="media-body d-flex">
  31. <div>
  32. <h4 className="m-0">Universitas Satyagama</h4>
  33. <small className="text-muted">0742/O/1990 - www.satyagama.ac.id - info@satyagama.ac.id</small>
  34. <p>Jalan Kamal Raya No 2-A Cengkareng</p>
  35. <p> </p>
  36. </div>
  37. </div>
  38. </div>
  39. </td>
  40. <td>{moment(value.created_at).fromNow()}</td>
  41. <td>
  42. <div className="ml-auto">
  43. <button class="btn-oval btn btn-primary" size="sm" onClick={(e) => this.newProcessClick(e, value.pt_id, value._number)}>
  44. Update Data
  45. </button>
  46. </div>
  47. </td>
  48. </tr>
  49. );
  50. });
  51. };
  52. newProcessClick = (e, PT_ID, number) => {
  53. //router = useRouter();
  54. //const query = { ptId: PT_ID };
  55. // '/app/profile'
  56. e.preventDefault();
  57. Router.push({
  58. pathname: "/app/pemeriksaan.new",
  59. query: { ptId: PT_ID, number: number },
  60. });
  61. };
  62. render() {
  63. return (
  64. <ContentWrapper>
  65. <div className="content-heading">Evaluasi</div>
  66. <Row>
  67. <Col lg="4">
  68. {/* Aside card */}
  69. <div className="card b">
  70. <div className="card-body bb">
  71. <p>Overvall progress</p>
  72. <div className="d-flex align-items-center mb-2">
  73. <div className="w-100">
  74. <Progress className="progress-xs m0" color="info" value={20} />
  75. </div>
  76. <div className="ml-auto">
  77. <div className="col wd-xxs text-right">
  78. <div className="text-bold text-muted">20%</div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. <div className="card-body">
  84. <p>Metrics</p>
  85. <div className="row text-center">
  86. <div className="col-6 col-lg-6 col-xl-6">
  87. <Sparkline
  88. values={[20, 80]}
  89. options={{
  90. type: "pie",
  91. height: "50",
  92. sliceColors: ["#edf1f2", "#23b7e5"],
  93. }}
  94. className="sparkline"
  95. />
  96. <p className="mt-3">Open Case</p>
  97. </div>
  98. <div className="col-6 col-lg-6 col-xl-6">
  99. <Sparkline
  100. values={[80, 20]}
  101. options={{
  102. type: "pie",
  103. height: "50",
  104. sliceColors: ["#edf1f2", "#27c24c"],
  105. }}
  106. className="sparkline"
  107. />
  108. <p className="mt-3">Close Case</p>
  109. </div>
  110. {/* <div className="col-3 col-lg-6 col-xl-3">
  111. <Sparkline values={[20,80]}
  112. options={{
  113. type:"pie",
  114. height:"50",
  115. sliceColors:["#edf1f2", "#ff902b"]
  116. }}
  117. className="sparkline"/>
  118. <p className="mt-3">Hours</p>
  119. </div>
  120. <div className="col-3 col-lg-6 col-xl-3">
  121. <Sparkline values={[30,70]}
  122. options={{
  123. type:"pie",
  124. height:"50",
  125. sliceColors:["#edf1f2", "#f05050"]
  126. }}
  127. className="sparkline"/>
  128. <p className="mt-3">Assigned</p>
  129. </div> */}
  130. </div>
  131. </div>
  132. <table className="table bb">
  133. <tbody>
  134. {/* <tr>
  135. <td>
  136. <strong>Assigned Hours</strong>
  137. </td>
  138. <td>68 hs</td>
  139. </tr>
  140. <tr>
  141. <td>
  142. <strong>Time Consumed</strong>
  143. </td>
  144. <td>32 hs</td>
  145. </tr> */}
  146. <tr>
  147. <td>
  148. <strong>Open Case</strong>
  149. </td>
  150. <td>80</td>
  151. </tr>
  152. <tr>
  153. <td>
  154. <strong>Close Case</strong>
  155. </td>
  156. <td>20</td>
  157. </tr>
  158. <tr>
  159. <td>
  160. <strong>Performance</strong>
  161. </td>
  162. <td>
  163. <em className="far fa-smile fa-lg text-warning"></em>
  164. </td>
  165. </tr>
  166. {/* <tr>
  167. <td>
  168. <strong>Commits</strong>
  169. </td>
  170. <td>140</td>
  171. </tr> */}
  172. {/* <tr>
  173. <td>
  174. <strong>Last Case Closed</strong>
  175. </td>
  176. <td>
  177. <Scrollable height="120px" className="list-group">
  178. <table className="table table-bordered bg-transparent">
  179. <tbody>
  180. <tr>
  181. <td>
  182. <a className="text-muted" href="">BI:54678</a>
  183. </td>
  184. </tr>
  185. <tr>
  186. <td>
  187. <a className="text-muted" href="">BI:55778</a>
  188. </td>
  189. </tr>
  190. <tr>
  191. <td>
  192. <a className="text-muted" href="">BI:56878</a>
  193. </td>
  194. </tr>
  195. <tr>
  196. <td>
  197. <a className="text-muted" href="">BI:57978</a>
  198. </td>
  199. </tr>
  200. <tr>
  201. <td>
  202. <a className="text-muted" href="">BI:1107</a>
  203. </td>
  204. </tr>
  205. </tbody>
  206. </table>
  207. </Scrollable>
  208. </td>
  209. </tr> */}
  210. <tr>
  211. <td>
  212. <strong>Last Case Closed</strong>
  213. </td>
  214. <td>BI:1107 - 12/01/2016</td>
  215. </tr>
  216. </tbody>
  217. </table>
  218. </div>
  219. {/* end Aside card */}
  220. </Col>
  221. <Col lg="8">
  222. {/* <div className="mb-3 d-flex"> */}
  223. {/* <div> */}
  224. {/* <button className="btn btn-sm btn-info" type="button" onClick={(e) => this.newReportClick(e)}>Laporan Baru</button> */}
  225. {/* <Button color="info" size="sm" onClick={(e) => this.handleClick(e, pt.id)}>View</Button> */}
  226. {/* <button className="btn btn-sm btn-secondary" type="button">
  227. <em className="fa fa-user-plus"></em>
  228. </button>
  229. <button className="btn btn-sm btn-secondary" type="button">
  230. <em className="fas fa-pencil-alt"></em>
  231. </button>
  232. <button className="btn btn-sm btn-secondary" type="button">
  233. <em className="fas fa-share"></em>
  234. </button>
  235. <button className="btn btn-sm btn-secondary" type="button">
  236. <em className="fa fa-print"></em>
  237. </button> */}
  238. {/* </div> */}
  239. {/* <div className="ml-auto">
  240. <p className="mb-0 mt-1">19 bugs / 16 issues</p>
  241. </div> */}
  242. {/* </div> */}
  243. <div className="card b">
  244. <div className="card-body">
  245. <Datatable options={{ responsive: true }}>
  246. <table className="table w-100">
  247. <thead>
  248. <tr>
  249. {/* <th>Type</th> */}
  250. <th>#ID</th>
  251. <th>Description</th>
  252. <th>Created</th>
  253. {/* <th>Priority</th>
  254. <th>Asigned</th> */}
  255. <th>Status</th>
  256. {/* <th>Action</th> */}
  257. </tr>
  258. </thead>
  259. <tbody>
  260. {this.renderTable()}
  261. {/* <tr>
  262. <td>BI:54678</td>
  263. <td className="text-nowrap">
  264. <div className="media align-items-center">
  265. <a className="mr-3" href="">
  266. <img className="img-fluid rounded thumb64" src="/static/img/dummy-search.png" alt="Dummy" />
  267. </a>
  268. <div className="media-body d-flex">
  269. <div>
  270. <h4 className="m-0">Universitas Satyagama</h4>
  271. <small className="text-muted">0742/O/1990 - www.satyagama.ac.id - info@satyagama.ac.id</small>
  272. <p>Jalan Kamal Raya No 2-A Cengkareng</p>
  273. <p> </p>
  274. </div>
  275. </div>
  276. </div>
  277. </td>
  278. <td>{moment("2020-04-04 11:45:26.123").fromNow()}</td>
  279. <td>
  280. <div className="ml-auto">
  281. <button class="btn-oval btn btn-primary" size="sm" onClick={(e) => this.newProcessClick(e)}>
  282. Update Data
  283. </button>
  284. </div>
  285. </td>
  286. </tr> */}
  287. </tbody>
  288. </table>
  289. </Datatable>
  290. </div>
  291. </div>
  292. </Col>
  293. </Row>
  294. </ContentWrapper>
  295. );
  296. }
  297. }
  298. export default BugTracker;