timeline.js 10 KB

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