timeline.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. import React, { Component } from "react";
  2. import ContentWrapper from "@/components/Layout/ContentWrapper";
  3. import {
  4. Row,
  5. Col,
  6. Card,
  7. Button,
  8. CardHeader,
  9. CardFooter,
  10. Table,
  11. Nav,
  12. NavItem,
  13. NavLink,
  14. TabContent,
  15. TabPane,
  16. Pagination,
  17. PaginationItem,
  18. PaginationLink,
  19. ListGroup,
  20. ListGroupItem,
  21. Dropdown,
  22. DropdownMenu,
  23. DropdownToggle,
  24. DropdownItem,
  25. } from "reactstrap";
  26. //import { Row, Col, Card, CardHeader, CardFooter, Table, Pagination, PaginationItem, PaginationLink } from 'reactstrap';
  27. // import { Row, Col, Dropdown, DropdownMenu, DropdownToggle, DropdownItem } from 'reactstrap';
  28. import Select from "react-select";
  29. import { GoogleMap, LoadScript, Marker } from "@react-google-maps/api";
  30. import { GetServerSideProps, NextPage } from "next";
  31. import ErrorPage from "next/error";
  32. import fetch from "node-fetch";
  33. import https from "https";
  34. const containerStyle = {
  35. width: "100%",
  36. height: "155px",
  37. };
  38. var jenisPelanggaran = [];
  39. //const qpt_id = {};
  40. //http://localhost:3000/app/profile?ptId=0BCE4DB7-B207-445D-8D03-0C54B7688252
  41. // Demo with custom style
  42. const DemoMapCustomStyle = (props) => (
  43. <GoogleMap mapContainerStyle={containerStyle} zoom={14} center={props.location} options={{ styles: props.mapStyles }}>
  44. <Marker position={props.location} />
  45. </GoogleMap>
  46. );
  47. const styleHeaderText = {
  48. color: "brown",
  49. };
  50. class Profile extends Component {
  51. toggleTab = (tab) => {
  52. if (this.state.activeTab !== tab) {
  53. this.setState({
  54. activeTab: tab,
  55. });
  56. }
  57. };
  58. static async getInitialProps({ query }) {
  59. const httpsAgent = new https.Agent({
  60. rejectUnauthorized: false,
  61. });
  62. const json = [
  63. {
  64. id: "0BCE4DB7-B207-445D-8D03-0C54B7688252",
  65. kode: "031031",
  66. kode_satker: null,
  67. nama: "Universitas Satyagama",
  68. nama_singkat: "USG",
  69. sk_pendirian: "0742/O/1990",
  70. tgl_sk_pendirian: "1990-12-22",
  71. sk_operasional: null,
  72. tgl_sk_operasional: null,
  73. status: "A",
  74. alamat: {
  75. jalan: "Jalan Kamal Raya No 2-A Cengkareng",
  76. rt: null,
  77. rw: null,
  78. dusun: null,
  79. kelurahan: "-",
  80. kode_pos: "11730",
  81. kab_kota: {
  82. id: "016200",
  83. nama: "Kota Jakarta Barat",
  84. },
  85. },
  86. propinsi: {
  87. id: "010000",
  88. nama: "Prov. D.K.I. Jakarta",
  89. },
  90. telepon: "(021) 5452377-78",
  91. faksimile: "(021) 54391325",
  92. website: "www.satyagama.ac.id",
  93. email: "info@satyagama.ac.id",
  94. status_milik: {
  95. id: "3",
  96. nama: "Yayasan",
  97. },
  98. pembina: {
  99. id: "728989DD-251E-4516-BE2C-BA17A93A5C51",
  100. nama: "LLDIKTI III",
  101. },
  102. bentuk_pendidikan: {
  103. id: "23",
  104. nama: "Universitas",
  105. },
  106. last_update: "2021-12-08",
  107. negara: {
  108. id: "ID",
  109. nama: "Indonesia",
  110. },
  111. pimpinan: {
  112. id: "D3D20B3D-0FBE-4706-8A70-67C4C09C8FBE",
  113. nama: "DEWI SULISTYANI",
  114. tmt_sk_pengangkatan: "2021-03-17",
  115. tst_sk_pengangkatan: "2025-03-17",
  116. },
  117. },
  118. ];
  119. console.log("json : ", json);
  120. return { data: json[0] };
  121. }
  122. state = {
  123. dropdownOpen: false,
  124. dropdownOpenUpload: false,
  125. timelineAlt: false,
  126. location: { lat: 33.7906731, lng: -117.8357194 },
  127. customStyle: [
  128. { featureType: "water", stylers: [{ visibility: "on" }, { color: "#bdd1f9" }] },
  129. { featureType: "all", elementType: "labels.text.fill", stylers: [{ color: "#334165" }] },
  130. { featureType: "landscape", stylers: [{ color: "#e9ebf1" }] },
  131. { featureType: "road.highway", elementType: "geometry", stylers: [{ color: "#c5c6c6" }] },
  132. { featureType: "road.arterial", elementType: "geometry", stylers: [{ color: "#fff" }] },
  133. { featureType: "road.local", elementType: "geometry", stylers: [{ color: "#fff" }] },
  134. { featureType: "transit", elementType: "geometry", stylers: [{ color: "#d8dbe0" }] },
  135. { featureType: "poi", elementType: "geometry", stylers: [{ color: "#cfd5e0" }] },
  136. { featureType: "administrative", stylers: [{ visibility: "on" }, { lightness: 33 }] },
  137. { featureType: "poi.park", elementType: "labels", stylers: [{ visibility: "on" }, { lightness: 20 }] },
  138. { featureType: "road", stylers: [{ color: "#d8dbe0", lightness: 20 }] },
  139. ],
  140. listA: [],
  141. selectedOptionMulti: [],
  142. activeTab: "tasks",
  143. };
  144. toggleDD = () =>
  145. this.setState({
  146. dropdownOpen: !this.state.dropdownOpen,
  147. });
  148. toggleDDUpload = () =>
  149. this.setState({
  150. dropdownOpenUpload: !this.state.dropdownOpenUpload,
  151. });
  152. toggleTimeline = (e) => {
  153. this.setState({
  154. timelineAlt: e.target.checked,
  155. });
  156. };
  157. render() {
  158. const { selectedOptionMulti } = this.state;
  159. return (
  160. <ContentWrapper unwrap>
  161. <div className="bg-cover" style={{ backgroundImage: "url(/static/img/profile-bg.png)" }}>
  162. <div className="p-4 text-center" style={styleHeaderText}>
  163. <img className="img-thumbnail rounded-circle thumb128" src="/static/img/univ-avatar.png" alt="Avatar" />
  164. <h3 className="m-0">{this.props.data.nama}</h3>
  165. <p>{this.props.data.sk_pendirian}</p>
  166. <p>{this.props.data.alamat.jalan}</p>
  167. </div>
  168. </div>
  169. <div className="p-3">
  170. <Row>
  171. <Col xl="9">
  172. <ul className="timeline">
  173. <li className="timeline-separator" data-datetime="Today"></li>
  174. <li className="timeline-inverted">
  175. <div className="timeline-badge info">
  176. <em className="far fa-file"></em>
  177. </div>
  178. <div className="timeline-card">
  179. <div className="popover right">
  180. <div className="arrow"></div>
  181. <div className="popover-body">
  182. <div className="d-flex align-items-center mb-3">
  183. <img className="mr-3 rounded-circle thumb48" src="/static/img/user/admin.png" alt="Avatar" />
  184. <p className="m-0">
  185. {/* <a className="text-muted" href=""> */}
  186. <strong>Admin</strong>
  187. {/* </a> */}
  188. <br />
  189. Upload Bukti Perbaikan
  190. {/* <em className="fa fa-paperclip"></em> */}
  191. <Dropdown isOpen={this.state.dropdownOpenUpload} toggle={this.toggleDDUpload}>
  192. {/* <em className="fa fa-graduation-cap fa-fw mr-3"></em>Status */}
  193. {/* <p className="m-0"><br/> Upload Bukti Perbaikan </p> */}
  194. <DropdownToggle caret color="link">
  195. <em className="fa fa-paperclip"></em>
  196. </DropdownToggle>
  197. <DropdownMenu className="animated fadeInUpShort">
  198. <DropdownItem>
  199. <em className="fa fa-lock mr-2"></em>Upload
  200. </DropdownItem>
  201. </DropdownMenu>
  202. </Dropdown>
  203. </p>
  204. {/* <li> */}
  205. {/* </li> */}
  206. </div>
  207. {/* <a href="">
  208. <img className="img-fluid img-thumbnail" src="/static/img/mockup.png" alt="Img"/>
  209. </a> */}
  210. <p className="text-muted my-2">3 Logs</p>
  211. <div className="media bb p-2">
  212. <img className="mr-2 rounded-circle thumb32" src="/static/img/user/user.png" alt="Avatar" />
  213. <div className="media-body">
  214. <p className="m-0">
  215. <a href="">
  216. <strong>Universitas Username</strong>
  217. </a>
  218. </p>
  219. <div className="text-sm text-muted">Uploaded Document File BBB.pdf</div>
  220. </div>
  221. <small className="ml-auto text-muted">12m ago</small>
  222. </div>
  223. <div className="media bb p-2">
  224. <img className="mr-2 rounded-circle thumb32" src="/static/img/user/user.png" alt="Avatar" />
  225. <div className="media-body">
  226. <p className="m-0">
  227. <a href="">
  228. <strong>Universitas Username</strong>
  229. </a>
  230. </p>
  231. <div className="text-sm text-muted">Uploaded Document File CCC.pdf</div>
  232. </div>
  233. <small className="ml-auto text-muted">30m ago</small>
  234. </div>
  235. <div className="media bb p-2">
  236. <img className="mr-2 rounded-circle thumb32" src="/static/img/user/user.png" alt="Avatar" />
  237. <div className="media-body">
  238. <p className="m-0">
  239. <a href="">
  240. <strong>Universitas Username</strong>
  241. </a>
  242. </p>
  243. <div className="text-sm text-muted">Uploaded Document File AAA.pdf</div>
  244. </div>
  245. <small className="ml-auto text-muted">30m ago</small>
  246. </div>
  247. {/* <form className="mt-2" method="post" action="#">
  248. <textarea className="form-control no-resize" placeholder="Comment..." rows="1"></textarea>
  249. </form> */}
  250. </div>
  251. </div>
  252. </div>
  253. </li>
  254. <li>
  255. <div className="timeline-badge danger">
  256. <em className="fas fa-ticket-alt"></em>
  257. </div>
  258. <div className="timeline-card">
  259. <div className="popover left">
  260. <div className="arrow"></div>
  261. <div className="popover-body">
  262. <div className="d-flex align-items-center mb-3">
  263. <img className="mr-3 rounded-circle thumb48" src="/static/img/user/admin.png" alt="Avatar" />
  264. <p className="m-0">
  265. {/* <a className="text-muted" href=""> */}
  266. <strong>Admin</strong>
  267. {/* </a> */}
  268. <br />
  269. opened project
  270. <a className="ml-2" href="">
  271. #548795
  272. </a>
  273. </p>
  274. </div>
  275. <p>
  276. <em>&mdash; Project description sample</em>
  277. </p>
  278. </div>
  279. </div>
  280. </div>
  281. </li>
  282. <li className="timeline-end">
  283. <a className="timeline-badge">
  284. <em className="fa fa-plus"></em>
  285. </a>
  286. </li>
  287. </ul>
  288. </Col>
  289. <Col xl="3">
  290. <div className="card card-default">
  291. <div className="card-body">
  292. <div className="text-center">
  293. <h3 className="mt-0">{this.props.data.nama}</h3>
  294. <p>{this.props.data.sk_pendirian}</p>
  295. </div>
  296. <hr />
  297. <ul className="list-unstyled px-4">
  298. <li>
  299. <em className="fa fa-globe fa-fw mr-3"></em>
  300. {this.props.data.website}
  301. </li>
  302. <li>
  303. <em className="fa fa-graduation-cap fa-fw mr-3"></em>Status Pelanggaran : Tidak Ada
  304. </li>
  305. </ul>
  306. </div>
  307. </div>
  308. </Col>
  309. </Row>
  310. </div>
  311. </ContentWrapper>
  312. );
  313. }
  314. }
  315. export default Profile;