How to use memory2 method in wpt

Best JavaScript code snippet using wpt

奥体资源池2.js

Source:奥体资源池2.js Github

copy

Full Screen

1let testData = {2 msg: '请求成功',3 data: {4 资源池1: [5 {6 name: '集中交易中间件集群1',7 two: [8 {9 cpuUtilization: '2.377',10 memory2Max: '1000',11 memUtilizationMax: '100',12 memory1: '-',13 memory1Max: '1000',14 memory2: '-',15 ip: '168.16.32.151',16 memUtilization: '50.575',17 cpuUtilizationMax: '100',18 status: '0',19 network: '5000'20 },21 {22 cpuUtilization: '2.675',23 memory2Max: '1000',24 memUtilizationMax: '100',25 memory1: '-',26 memory1Max: '1000',27 memory2: '-',28 ip: '168.16.32.153',29 memUtilization: '49.95',30 cpuUtilizationMax: '100',31 status: '0',32 network: '5000'33 },34 {35 cpuUtilization: '2.007',36 memory2Max: '1000',37 memUtilizationMax: '100',38 memory1: '-',39 memory1Max: '1000',40 memory2: '-',41 ip: '168.16.32.155',42 memUtilization: '49.863',43 cpuUtilizationMax: '100',44 status: '0',45 network: '5000'46 },47 {48 cpuUtilization: '1.297',49 memory2Max: '1000',50 memUtilizationMax: '100',51 memory1: '-',52 memory1Max: '1000',53 memory2: '-',54 ip: '168.16.32.157',55 memUtilization: '57.83',56 cpuUtilizationMax: '100',57 status: '0',58 network: '5000'59 },60 {61 cpuUtilization: '1.657',62 memory2Max: '1000',63 memUtilizationMax: '100',64 memory1: '-',65 memory1Max: '1000',66 memory2: '-',67 ip: '168.16.32.159',68 memUtilization: '29.705',69 cpuUtilizationMax: '100',70 status: '0',71 network: '5000'72 },73 {74 cpuUtilization: '1.896',75 memory2Max: '1000',76 memUtilizationMax: '100',77 memory1: '-',78 memory1Max: '1000',79 memory2: '-',80 ip: '168.16.32.161',81 memUtilization: '42.605',82 cpuUtilizationMax: '100',83 status: '0',84 network: '5000'85 },86 {87 cpuUtilization: '1.938',88 memory2Max: '1000',89 memUtilizationMax: '100',90 memory1: '-',91 memory1Max: '1000',92 memory2: '-',93 ip: '168.16.32.163',94 memUtilization: '57.923',95 cpuUtilizationMax: '100',96 status: '0',97 network: '5000'98 },99 {100 cpuUtilization: '1.182',101 memory2Max: '1000',102 memUtilizationMax: '100',103 memory1: '-',104 memory1Max: '1000',105 memory2: '-',106 ip: '168.16.32.165',107 memUtilization: '57.893',108 cpuUtilizationMax: '100',109 status: '0',110 network: '5000'111 },112 {113 cpuUtilization: '1.894',114 memory2Max: '1000',115 memUtilizationMax: '100',116 memory1: '-',117 memory1Max: '1000',118 memory2: '-',119 ip: '168.16.32.167',120 memUtilization: '51.827',121 cpuUtilizationMax: '100',122 status: '0',123 network: '5000'124 },125 {126 cpuUtilization: '9.232',127 memory2Max: '1000',128 memUtilizationMax: '100',129 memory1: '-',130 memory1Max: '1000',131 memory2: '-',132 ip: '168.16.32.169',133 memUtilization: '60.742',134 cpuUtilizationMax: '100',135 status: '0',136 network: '5000'137 },138 {139 cpuUtilization: '1.252',140 memory2Max: '1000',141 memUtilizationMax: '100',142 memory1: '-',143 memory1Max: '1000',144 memory2: '-',145 ip: '168.16.32.171',146 memUtilization: '50.68',147 cpuUtilizationMax: '100',148 status: '0',149 network: '5000'150 },151 {152 cpuUtilization: '1.51',153 memory2Max: '1000',154 memUtilizationMax: '100',155 memory1: '-',156 memory1Max: '1000',157 memory2: '-',158 ip: '168.16.32.173',159 memUtilization: '50.57',160 cpuUtilizationMax: '100',161 status: '0',162 network: '5000'163 },164 {165 cpuUtilization: '1.034',166 memory2Max: '1000',167 memUtilizationMax: '100',168 memory1: '-',169 memory1Max: '1000',170 memory2: '-',171 ip: '168.16.32.175',172 memUtilization: '41.747',173 cpuUtilizationMax: '100',174 status: '0',175 network: '5000'176 },177 {178 cpuUtilization: '1.429',179 memory2Max: '1000',180 memUtilizationMax: '100',181 memory1: '-',182 memory1Max: '1000',183 memory2: '-',184 ip: '168.16.32.177',185 memUtilization: '44.243',186 cpuUtilizationMax: '100',187 status: '0',188 network: '5000'189 },190 {191 cpuUtilization: '0.997',192 memory2Max: '1000',193 memUtilizationMax: '100',194 memory1: '-',195 memory1Max: '1000',196 memory2: '-',197 ip: '168.16.32.179',198 memUtilization: '38.321',199 cpuUtilizationMax: '100',200 status: '0',201 network: '5000'202 },203 {204 cpuUtilization: '1.547',205 memory2Max: '1000',206 memUtilizationMax: '100',207 memory1: '-',208 memory1Max: '1000',209 memory2: '-',210 ip: '168.16.32.181',211 memUtilization: '42.318',212 cpuUtilizationMax: '100',213 status: '0',214 network: '5000'215 },216 {217 cpuUtilization: '0.926',218 memory2Max: '1000',219 memUtilizationMax: '100',220 memory1: '-',221 memory1Max: '1000',222 memory2: '-',223 ip: '168.16.32.183',224 memUtilization: '33.087',225 cpuUtilizationMax: '100',226 status: '0',227 network: '5000'228 },229 {230 cpuUtilization: '1.025',231 memory2Max: '1000',232 memUtilizationMax: '100',233 memory1: '-',234 memory1Max: '1000',235 memory2: '-',236 ip: '168.16.32.185',237 memUtilization: '38.465',238 cpuUtilizationMax: '100',239 status: '0',240 network: '5000'241 },242 {243 cpuUtilization: '1.425',244 memory2Max: '1000',245 memUtilizationMax: '100',246 memory1: '-',247 memory1Max: '1000',248 memory2: '-',249 ip: '168.16.32.187',250 memUtilization: '47.481',251 cpuUtilizationMax: '100',252 status: '0',253 network: '5000'254 }255 ]256 },257 {258 name: '集中交易中间件集群2',259 two: [260 {261 cpuUtilization: '2.59',262 memory2Max: '1000',263 memUtilizationMax: '100',264 memory1: '-',265 memory1Max: '1000',266 memory2: '-',267 ip: '168.16.32.150',268 memUtilization: '25.467',269 cpuUtilizationMax: '100',270 status: '0',271 network: '5000'272 },273 {274 cpuUtilization: '4.412',275 memory2Max: '1000',276 memUtilizationMax: '100',277 memory1: '-',278 memory1Max: '1000',279 memory2: '-',280 ip: '168.16.32.152',281 memUtilization: '22.116',282 cpuUtilizationMax: '100',283 status: '0',284 network: '5000'285 },286 {287 cpuUtilization: '2.841',288 memory2Max: '1000',289 memUtilizationMax: '100',290 memory1: '-',291 memory1Max: '1000',292 memory2: '-',293 ip: '168.16.32.154',294 memUtilization: '30.403',295 cpuUtilizationMax: '100',296 status: '0',297 network: '5000'298 },299 {300 cpuUtilization: '2.847',301 memory2Max: '1000',302 memUtilizationMax: '100',303 memory1: '-',304 memory1Max: '1000',305 memory2: '-',306 ip: '168.16.32.156',307 memUtilization: '32.231',308 cpuUtilizationMax: '100',309 status: '0',310 network: '5000'311 },312 {313 cpuUtilization: '9.385',314 memory2Max: '1000',315 memUtilizationMax: '100',316 memory1: '-',317 memory1Max: '1000',318 memory2: '-',319 ip: '168.16.32.158',320 memUtilization: '36.509',321 cpuUtilizationMax: '100',322 status: '0',323 network: '5000'324 },325 {326 cpuUtilization: '10.935',327 memory2Max: '1000',328 memUtilizationMax: '100',329 memory1: '-',330 memory1Max: '1000',331 memory2: '-',332 ip: '168.16.32.160',333 memUtilization: '35.273',334 cpuUtilizationMax: '100',335 status: '0',336 network: '5000'337 },338 {339 cpuUtilization: '2.222',340 memory2Max: '1000',341 memUtilizationMax: '100',342 memory1: '-',343 memory1Max: '1000',344 memory2: '-',345 ip: '168.16.32.162',346 memUtilization: '41.388',347 cpuUtilizationMax: '100',348 status: '0',349 network: '5000'350 },351 {352 cpuUtilization: '1.867',353 memory2Max: '1000',354 memUtilizationMax: '100',355 memory1: '-',356 memory1Max: '1000',357 memory2: '-',358 ip: '168.16.32.164',359 memUtilization: '54.448',360 cpuUtilizationMax: '100',361 status: '0',362 network: '5000'363 },364 {365 cpuUtilization: '1.598',366 memory2Max: '1000',367 memUtilizationMax: '100',368 memory1: '-',369 memory1Max: '1000',370 memory2: '-',371 ip: '168.16.32.166',372 memUtilization: '27.332',373 cpuUtilizationMax: '100',374 status: '0',375 network: '5000'376 },377 {378 cpuUtilization: '14.492',379 memory2Max: '1000',380 memUtilizationMax: '100',381 memory1: '-',382 memory1Max: '1000',383 memory2: '-',384 ip: '168.16.32.168',385 memUtilization: '41.579',386 cpuUtilizationMax: '100',387 status: '0',388 network: '5000'389 },390 {391 cpuUtilization: '1.227',392 memory2Max: '1000',393 memUtilizationMax: '100',394 memory1: '-',395 memory1Max: '1000',396 memory2: '-',397 ip: '168.16.32.170',398 memUtilization: '25.804',399 cpuUtilizationMax: '100',400 status: '0',401 network: '5000'402 },403 {404 cpuUtilization: '1.543',405 memory2Max: '1000',406 memUtilizationMax: '100',407 memory1: '-',408 memory1Max: '1000',409 memory2: '-',410 ip: '168.16.32.172',411 memUtilization: '26.692',412 cpuUtilizationMax: '100',413 status: '0',414 network: '5000'415 },416 {417 cpuUtilization: '2.687',418 memory2Max: '1000',419 memUtilizationMax: '100',420 memory1: '-',421 memory1Max: '1000',422 memory2: '-',423 ip: '168.16.32.174',424 memUtilization: '28.99',425 cpuUtilizationMax: '100',426 status: '0',427 network: '5000'428 },429 {430 cpuUtilization: '1.947',431 memory2Max: '1000',432 memUtilizationMax: '100',433 memory1: '-',434 memory1Max: '1000',435 memory2: '-',436 ip: '168.16.32.176',437 memUtilization: '37.822',438 cpuUtilizationMax: '100',439 status: '0',440 network: '5000'441 },442 {443 cpuUtilization: '1.03',444 memory2Max: '1000',445 memUtilizationMax: '100',446 memory1: '-',447 memory1Max: '1000',448 memory2: '-',449 ip: '168.16.32.178',450 memUtilization: '32.689',451 cpuUtilizationMax: '100',452 status: '0',453 network: '5000'454 },455 {456 cpuUtilization: '0.777',457 memory2Max: '1000',458 memUtilizationMax: '100',459 memory1: '-',460 memory1Max: '1000',461 memory2: '-',462 ip: '168.16.32.180',463 memUtilization: '23.665',464 cpuUtilizationMax: '100',465 status: '0',466 network: '5000'467 },468 {469 cpuUtilization: '0.77',470 memory2Max: '1000',471 memUtilizationMax: '100',472 memory1: '-',473 memory1Max: '1000',474 memory2: '-',475 ip: '168.16.32.182',476 memUtilization: '27.076',477 cpuUtilizationMax: '100',478 status: '0',479 network: '5000'480 },481 {482 cpuUtilization: '2.106',483 memory2Max: '1000',484 memUtilizationMax: '100',485 memory1: '-',486 memory1Max: '1000',487 memory2: '-',488 ip: '168.16.32.184',489 memUtilization: '26.69',490 cpuUtilizationMax: '100',491 status: '0',492 network: '5000'493 }494 ]495 }496 ],497 资源池2: [498 {499 name: '集中交易中间件集群3',500 two: [501 {502 cpuUtilization: '2.564',503 memory2Max: '1000',504 memUtilizationMax: '100',505 memory1: '-',506 memory1Max: '1000',507 memory2: '-',508 ip: '168.16.32.141',509 memUtilization: '46.113',510 cpuUtilizationMax: '100',511 status: '0',512 network: '5000'513 },514 {515 cpuUtilization: '2.03',516 memory2Max: '1000',517 memUtilizationMax: '100',518 memory1: '-',519 memory1Max: '1000',520 memory2: '-',521 ip: '168.16.32.143',522 memUtilization: '57.555',523 cpuUtilizationMax: '100',524 status: '0',525 network: '5000'526 },527 {528 cpuUtilization: '2.135',529 memory2Max: '1000',530 memUtilizationMax: '100',531 memory1: '-',532 memory1Max: '1000',533 memory2: '-',534 ip: '168.16.32.145',535 memUtilization: '53.671',536 cpuUtilizationMax: '100',537 status: '0',538 network: '5000'539 },540 {541 cpuUtilization: '2.45',542 memory2Max: '1000',543 memUtilizationMax: '100',544 memory1: '-',545 memory1Max: '1000',546 memory2: '-',547 ip: '168.16.32.147',548 memUtilization: '52.063',549 cpuUtilizationMax: '100',550 status: '0',551 network: '5000'552 },553 {554 cpuUtilization: '2.179',555 memory2Max: '1000',556 memUtilizationMax: '100',557 memory1: '-',558 memory1Max: '1000',559 memory2: '-',560 ip: '168.16.32.149',561 memUtilization: '43.939',562 cpuUtilizationMax: '100',563 status: '0',564 network: '5000'565 },566 {567 cpuUtilization: '1.877',568 memory2Max: '1000',569 memUtilizationMax: '100',570 memory1: '-',571 memory1Max: '1000',572 memory2: '-',573 ip: '168.16.32.5',574 memUtilization: '50.058',575 cpuUtilizationMax: '100',576 status: '0',577 network: '5000'578 },579 {580 cpuUtilization: '1.555',581 memory2Max: '1000',582 memUtilizationMax: '100',583 memory1: '-',584 memory1Max: '1000',585 memory2: '-',586 ip: '168.16.32.73',587 memUtilization: '43.908',588 cpuUtilizationMax: '100',589 status: '0',590 network: '5000'591 },592 {593 cpuUtilization: '3.3',594 memory2Max: '1000',595 memUtilizationMax: '100',596 memory1: '-',597 memory1Max: '1000',598 memory2: '-',599 ip: '168.16.32.75',600 memUtilization: '45.387',601 cpuUtilizationMax: '100',602 status: '0',603 network: '5000'604 },605 {606 cpuUtilization: '2.911',607 memory2Max: '1000',608 memUtilizationMax: '100',609 memory1: '-',610 memory1Max: '1000',611 memory2: '-',612 ip: '168.16.32.77',613 memUtilization: '58.541',614 cpuUtilizationMax: '100',615 status: '0',616 network: '5000'617 },618 {619 cpuUtilization: '2.606',620 memory2Max: '1000',621 memUtilizationMax: '100',622 memory1: '-',623 memory1Max: '1000',624 memory2: '-',625 ip: '168.16.32.79',626 memUtilization: '45.777',627 cpuUtilizationMax: '100',628 status: '0',629 network: '5000'630 },631 {632 cpuUtilization: '1.084',633 memory2Max: '1000',634 memUtilizationMax: '100',635 memory1: '-',636 memory1Max: '1000',637 memory2: '-',638 ip: '168.16.32.81',639 memUtilization: '47.346',640 cpuUtilizationMax: '100',641 status: '0',642 network: '5000'643 },644 {645 cpuUtilization: '1.112',646 memory2Max: '1000',647 memUtilizationMax: '100',648 memory1: '-',649 memory1Max: '1000',650 memory2: '-',651 ip: '168.16.32.83',652 memUtilization: '55.422',653 cpuUtilizationMax: '100',654 status: '0',655 network: '5000'656 },657 {658 cpuUtilization: '2.232',659 memory2Max: '1000',660 memUtilizationMax: '100',661 memory1: '-',662 memory1Max: '1000',663 memory2: '-',664 ip: '168.16.32.85',665 memUtilization: '53.985',666 cpuUtilizationMax: '100',667 status: '0',668 network: '5000'669 },670 {671 cpuUtilization: '1.753',672 memory2Max: '1000',673 memUtilizationMax: '100',674 memory1: '-',675 memory1Max: '1000',676 memory2: '-',677 ip: '168.16.32.87',678 memUtilization: '48.288',679 cpuUtilizationMax: '100',680 status: '0',681 network: '5000'682 },683 {684 cpuUtilization: '1.349',685 memory2Max: '1000',686 memUtilizationMax: '100',687 memory1: '-',688 memory1Max: '1000',689 memory2: '-',690 ip: '168.16.32.89',691 memUtilization: '47.311',692 cpuUtilizationMax: '100',693 status: '0',694 network: '5000'695 },696 {697 cpuUtilization: '1.845',698 memory2Max: '1000',699 memUtilizationMax: '100',700 memory1: '-',701 memory1Max: '1000',702 memory2: '-',703 ip: '168.16.32.91',704 memUtilization: '55.703',705 cpuUtilizationMax: '100',706 status: '0',707 network: '5000'708 },709 {710 cpuUtilization: '1.14',711 memory2Max: '1000',712 memUtilizationMax: '100',713 memory1: '-',714 memory1Max: '1000',715 memory2: '-',716 ip: '168.16.32.93',717 memUtilization: '46.5',718 cpuUtilizationMax: '100',719 status: '0',720 network: '5000'721 },722 {723 cpuUtilization: '2.547',724 memory2Max: '1000',725 memUtilizationMax: '100',726 memory1: '-',727 memory1Max: '1000',728 memory2: '-',729 ip: '168.16.32.95',730 memUtilization: '45.721',731 cpuUtilizationMax: '100',732 status: '0',733 network: '5000'734 },735 {736 cpuUtilization: '3.161',737 memory2Max: '1000',738 memUtilizationMax: '100',739 memory1: '-',740 memory1Max: '1000',741 memory2: '-',742 ip: '168.16.32.97',743 memUtilization: '44.363',744 cpuUtilizationMax: '100',745 status: '0',746 network: '5000'747 }748 ]749 },750 {751 name: '集中交易中间件集群4',752 two: [753 {754 cpuUtilization: '1.697',755 memory2Max: '1000',756 memUtilizationMax: '100',757 memory1: '-',758 memory1Max: '1000',759 memory2: '-',760 ip: '168.16.32.100',761 memUtilization: '34.842',762 cpuUtilizationMax: '100',763 status: '0',764 network: '5000'765 },766 {767 cpuUtilization: '1.662',768 memory2Max: '1000',769 memUtilizationMax: '100',770 memory1: '-',771 memory1Max: '1000',772 memory2: '-',773 ip: '168.16.32.142',774 memUtilization: '36.386',775 cpuUtilizationMax: '100',776 status: '0',777 network: '5000'778 },779 {780 cpuUtilization: '1.596',781 memory2Max: '1000',782 memUtilizationMax: '100',783 memory1: '-',784 memory1Max: '1000',785 memory2: '-',786 ip: '168.16.32.146',787 memUtilization: '31.299',788 cpuUtilizationMax: '100',789 status: '0',790 network: '5000'791 },792 {793 cpuUtilization: '1.613',794 memory2Max: '1000',795 memUtilizationMax: '100',796 memory1: '-',797 memory1Max: '1000',798 memory2: '-',799 ip: '168.16.32.148',800 memUtilization: '40.62',801 cpuUtilizationMax: '100',802 status: '0',803 network: '5000'804 },805 {806 cpuUtilization: '1.75',807 memory2Max: '1000',808 memUtilizationMax: '100',809 memory1: '-',810 memory1Max: '1000',811 memory2: '-',812 ip: '168.16.32.4',813 memUtilization: '37.506',814 cpuUtilizationMax: '100',815 status: '0',816 network: '5000'817 },818 {819 cpuUtilization: '2.511',820 memory2Max: '1000',821 memUtilizationMax: '100',822 memory1: '-',823 memory1Max: '1000',824 memory2: '-',825 ip: '168.16.32.72',826 memUtilization: '42.095',827 cpuUtilizationMax: '100',828 status: '0',829 network: '5000'830 },831 {832 cpuUtilization: '2.816',833 memory2Max: '1000',834 memUtilizationMax: '100',835 memory1: '-',836 memory1Max: '1000',837 memory2: '-',838 ip: '168.16.32.74',839 memUtilization: '31.522',840 cpuUtilizationMax: '100',841 status: '0',842 network: '5000'843 },844 {845 cpuUtilization: '2.454',846 memory2Max: '1000',847 memUtilizationMax: '100',848 memory1: '-',849 memory1Max: '1000',850 memory2: '-',851 ip: '168.16.32.76',852 memUtilization: '36.426',853 cpuUtilizationMax: '100',854 status: '0',855 network: '5000'856 },857 {858 cpuUtilization: '2.384',859 memory2Max: '1000',860 memUtilizationMax: '100',861 memory1: '-',862 memory1Max: '1000',863 memory2: '-',864 ip: '168.16.32.78',865 memUtilization: '24.811',866 cpuUtilizationMax: '100',867 status: '0',868 network: '5000'869 },870 {871 cpuUtilization: '1.258',872 memory2Max: '1000',873 memUtilizationMax: '100',874 memory1: '-',875 memory1Max: '1000',876 memory2: '-',877 ip: '168.16.32.80',878 memUtilization: '38.31',879 cpuUtilizationMax: '100',880 status: '0',881 network: '5000'882 },883 {884 cpuUtilization: '1.133',885 memory2Max: '1000',886 memUtilizationMax: '100',887 memory1: '-',888 memory1Max: '1000',889 memory2: '-',890 ip: '168.16.32.82',891 memUtilization: '38.47',892 cpuUtilizationMax: '100',893 status: '0',894 network: '5000'895 },896 {897 cpuUtilization: '1.176',898 memory2Max: '1000',899 memUtilizationMax: '100',900 memory1: '-',901 memory1Max: '1000',902 memory2: '-',903 ip: '168.16.32.84',904 memUtilization: '21.771',905 cpuUtilizationMax: '100',906 status: '0',907 network: '5000'908 },909 {910 cpuUtilization: '1.33',911 memory2Max: '1000',912 memUtilizationMax: '100',913 memory1: '-',914 memory1Max: '1000',915 memory2: '-',916 ip: '168.16.32.86',917 memUtilization: '18.127',918 cpuUtilizationMax: '100',919 status: '0',920 network: '5000'921 },922 {923 cpuUtilization: '0.899',924 memory2Max: '1000',925 memUtilizationMax: '100',926 memory1: '-',927 memory1Max: '1000',928 memory2: '-',929 ip: '168.16.32.88',930 memUtilization: '32.103',931 cpuUtilizationMax: '100',932 status: '0',933 network: '5000'934 },935 {936 cpuUtilization: '1.409',937 memory2Max: '1000',938 memUtilizationMax: '100',939 memory1: '-',940 memory1Max: '1000',941 memory2: '-',942 ip: '168.16.32.90',943 memUtilization: '39.526',944 cpuUtilizationMax: '100',945 status: '0',946 network: '5000'947 },948 {949 cpuUtilization: '0.788',950 memory2Max: '1000',951 memUtilizationMax: '100',952 memory1: '-',953 memory1Max: '1000',954 memory2: '-',955 ip: '168.16.32.92',956 memUtilization: '23.31',957 cpuUtilizationMax: '100',958 status: '0',959 network: '5000'960 },961 {962 cpuUtilization: '1.099',963 memory2Max: '1000',964 memUtilizationMax: '100',965 memory1: '-',966 memory1Max: '1000',967 memory2: '-',968 ip: '168.16.32.94',969 memUtilization: '39.989',970 cpuUtilizationMax: '100',971 status: '0',972 network: '5000'973 },974 {975 cpuUtilization: '1.075',976 memory2Max: '1000',977 memUtilizationMax: '100',978 memory1: '-',979 memory1Max: '1000',980 memory2: '-',981 ip: '168.16.32.98',982 memUtilization: '31.938',983 cpuUtilizationMax: '100',984 status: '0',985 network: '5000'986 }987 ]988 }989 ]990 },991 status: 0...

Full Screen

Full Screen

App.js

Source:App.js Github

copy

Full Screen

1import {BrowserRouter, Routes, Route, Navigate} from 'react-router-dom'2import axios from 'axios'3import { useEffect } from 'react'4import Home from './eduwork/homepage/home'5import Register from './eduwork/register/register'6import Login from './eduwork/login/login'7// import Profile from './eduwork/userProfile/userProfile'8import Cart from './eduwork/cart/cartPage'9import Alamat from './eduwork/alamat/alamat'10import './App.css';11import { useState } from 'react';12import SelectAlamat from './eduwork/selectalamat/selectalamat'13import Confirmation from './eduwork/confirmation/confirmation'14import Invoice from './eduwork/invoice/invoice'15import OrderList from './eduwork/orderList/orderList'16import Profile from './eduwork/profile/profile'17import Verify from './eduwork/verifyuser/verifyuser'18function App() {19 const [memory2, setMemory2] = useState({20 loggedIn: false,21 toBuy: false,22 selectedAlamat: false,23 confirmedBuy: false,24 toEditProfile: {25 allowed: false,26 email: false27 }28 })29 const topMemoryEdit = (key, value) => {30 setMemory2(prev => {31 const clone = {...prev}32 clone[key] = value33 return clone34 })35 }36 useEffect(() => {37 console.log('authenticate useeffect ran...');38 if (localStorage.getItem('token')) {39 axios.get(`${process.env.REACT_APP_SERVER_URL || 'http://localhost:3001'}/auth`, {40 headers: { authorization: `Bearer ${localStorage.getItem('token')}` }41 })42 .then(fulfil => fulfil.data, err => {43 console.log('this error: ');44 console.log(err.message)45 })46 .then(data => {47 if (data.loggedIn) {48 setMemory2(prev => {49 return { ...prev, loggedIn: 'token accepted' }50 })51 } else {52 console.log(data);53 setMemory2(prev => {54 return { ...prev, loggedIn: 'token rejected' }55 })56 }57 }, err => {58 console.log('that error:');59 console.log(err.message)60 })61 } else {62 alert('no token found, need to login')63 setMemory2(prev => {64 return { ...prev, loggedIn: 'token rejected' }65 })66 }67 }, [])68 console.log({message: 'app render...', data: memory2});69 return (70 <BrowserRouter>71 {72 memory2.loggedIn ?73 <Routes>74 <Route path='/' element={75 <Home topMemoryEdit={topMemoryEdit} topMemory={memory2} setMemory2={setMemory2} />76 }/>77 <Route path='register' element={78 memory2.loggedIn === 'token accepted' ?79 <Navigate to={'/'} /> :80 <Register topMemoryEdit={topMemoryEdit} topMemory={memory2} />81 }/>82 <Route path='login' element={83 memory2.loggedIn === 'token accepted' ?84 <Navigate to={'/'} /> :85 <Login topMemoryEdit={topMemoryEdit} topMemory={memory2} />86 }/>87 <Route path='profile' element={88 memory2.loggedIn === 'token accepted' ?89 <Profile setMemory={setMemory2} topMemory={memory2} /> :90 <Navigate to={'/'} />91 }/>92 <Route path='cart' element={93 memory2.loggedIn === 'token accepted' ?94 <Cart topMemoryEdit={topMemoryEdit} setMemory={setMemory2} topMemory={memory2} /> :95 <Navigate to={'/'} />96 }/>97 <Route path='alamat' element={98 memory2.loggedIn === 'token accepted' ?99 <Alamat topMemoryEdit={topMemoryEdit} topMemory={memory2} /> :100 <Navigate to={'/'} />101 }/>102 <Route path='selectalamat' element={103 memory2.loggedIn === 'token accepted' ?104 <SelectAlamat setMemory={setMemory2} topMemory={memory2} /> :105 <Navigate to={'/'} />106 }/>107 <Route path='confirmation' element={108 memory2.loggedIn === 'token accepted' && memory2.selectedAlamat !== false ?109 <Confirmation setMemory={setMemory2} topMemory={memory2} /> :110 <Navigate to={'/'} />111 }/>112 <Route path='invoice' element={113 memory2.confirmedBuy ?114 <Invoice setMemory={setMemory2} topMemory={memory2} /> :115 <Navigate to={'/'} />116 }/>117 <Route path='orderlist' element={118 memory2.loggedIn === 'token accepted' ?119 <OrderList setMemory={setMemory2} topMemory={memory2} /> :120 <Navigate to={'/'} />121 }/>122 <Route path='verifyuser' element={123 memory2.loggedIn === 'token accepted' ?124 <Verify setMemory={setMemory2} topMemory={memory2} /> :125 <Navigate to={'/'} />126 }/>127 <Route path='*' element={128 <Navigate to={'/'} />129 }/>130 </Routes> :131 <h1>Loading...</h1>132 }133 </BrowserRouter>134 );135}...

Full Screen

Full Screen

2.js

Source:2.js Github

copy

Full Screen

1/**2 * @param {number} memory13 * @param {number} memory24 * @return {number[]}5 */6 var memLeak = function(memory1, memory2) {7 let base=18 while(memory1>=base || memory2>=base){9 if (memory1>=memory2) {10 memory1-=base;11 }else{12 memory2-=base;13 }14 base++; 15 }16 return [base,memory1,memory2];17};18// memory1 = 2, memory2 = 219memory1 = 8, memory2 = 1120ans=memLeak(memory1,memory2)...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3}, function(err, data) {4 if (err) return console.error(err);5 var testId = data.data.testId;6 console.log('Test ID: ' + testId);7 wpt.getTestResults(testId, function(err, data) {8 if (err) return console.error(err);9 console.log(data.data.average.firstView);10 console.log(data.data.average.firstView.SpeedIndex);11 });12});13var wpt = require('webpagetest');14var wpt = new WebPageTest('www.webpagetest.org');15}, function(err, data) {16 if (err) return console.error(err);17 var testId = data.data.testId;18 console.log('Test ID: ' + testId);19 wpt.getTestResults(testId, function(err, data) {20 if (err) return console.error(err);21 console.log(data.data.average.firstView);22 console.log(data.data.average.firstView.SpeedIndex);23 });24});25var wpt = require('webpagetest');26var wpt = new WebPageTest('www.webpagetest.org');27}, function(err, data) {28 if (err) return console.error(err);29 var testId = data.data.testId;30 console.log('Test ID: ' + testId);31 wpt.getTestResults(testId, function(err, data)

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptoolkit = require('wptoolkit');2var data = wptoolkit.memory2();3var wptoolkit = require('wptoolkit');4var data = wptoolkit.memory2();5var wptoolkit = require('wptoolkit');6var data = wptoolkit.memory2();7var wptoolkit = require('wptoolkit');8var data = wptoolkit.memory2();9var wptoolkit = require('wptoolkit');10var data = wptoolkit.memory2();11var wptoolkit = require('wptoolkit');12var data = wptoolkit.memory2();13var wptoolkit = require('wptoolkit');14var data = wptoolkit.memory2();15var wptoolkit = require('wptoolkit');16var data = wptoolkit.memory2();17var wptoolkit = require('wptoolkit');18var data = wptoolkit.memory2();19var wptoolkit = require('wptoolkit');20var data = wptoolkit.memory2();21var wptoolkit = require('wptoolkit');22var data = wptoolkit.memory2();23var wptoolkit = require('wptoolkit');24var data = wptoolkit.memory2();

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('wpt');2var wpt2 = new wpt('API_KEY');3var options = {4};5wpt2.runTest(options, function(err, data) {6 if (err) {7 console.log('There was an error: ' + err);8 } else {9 console.log('Test ID: ' + data.data.testId);10 wpt2.getTestResults(data.data.testId, function(err, data) {11 if (err) {12 console.log('There was an error: ' + err);13 } else {14 console.log('Test results: ' + data);15 }16 });17 }18});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('wptools');2var wp = wptools.page('Barack Obama');3wp.memory2(function(err, resp) {4 if (!err) {5 console.log(resp);6 }7});8var wptools = require('wptools');9var wp = wptools.page('Barack Obama');10wp.memory(function(err, resp) {11 if (!err) {12 console.log(resp);13 }14});15var wptools = require('wptools');16var wp = wptools.page('Barack Obama');17wp.memory(function(err, resp) {18 if (!err) {19 console.log(resp);20 }21});22var wptools = require('wptools');23var wp = wptools.page('Barack Obama');24wp.memory(function(err, resp) {25 if (!err) {26 console.log(resp);27 }28});29var wptools = require('wptools');30var wp = wptools.page('Barack Obama');31wp.memory(function(err, resp) {32 if (!err) {33 console.log(resp);34 }35});36var wptools = require('wptools');37var wp = wptools.page('Barack Obama');38wp.memory(function(err, resp) {39 if (!err) {40 console.log(resp);41 }42});43var wptools = require('wptools');44var wp = wptools.page('Barack Obama');45wp.memory(function(err, resp) {46 if (!err) {47 console.log(resp);48 }49});50var wptools = require('wptools');51var wp = wptools.page('Barack Obama');52wp.memory(function(err, resp) {53 if (!err) {54 console.log(resp);55 }56});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var api = new wpt('www.webpagetest.org');3var testId;4api.runTest(testUrl, {5 videoParams: {6 }7}, function(err, data) {8 if (err) {9 console.log('Error: ', err);10 } else {11 testId = data.data.testId;12 console.log('Test ID: ' + testId);13 api.getTestResults(testId, function(err, data) {14 if (err) {15 console.log('Error: ', err);16 } else {17 console.log('Test results: ', data);18 }19 });20 }21});22var wpt = require('webpagetest');23var api = new wpt('www.webpagetest.org');24var testId;25api.runTest(testUrl, {26 videoParams: {27 }28}, function(err, data) {29 if (err) {30 console.log('Error: ', err);31 } else {32 testId = data.data.testId;33 console.log('Test ID: ' + testId);34 api.getTestResults(testId, function(err, data) {35 if (err) {36 console.log('Error: ', err);37 } else {38 console.log('Test results: ',

Full Screen

Using AI Code Generation

copy

Full Screen

1wptools.memory2( 'Barack Obama' ).then( function( response ) {2} );3wptools.memory2( 'Barack Obama', function( error, response ) {4} );5wptools.memory2( 'Barack Obama', { lang: 'fr' } ).then( function( response ) {6} );7wptools.memory2( 'Barack Obama', { lang: 'fr' }, function( error, response ) {8} );9wptools.memory2( { page: 'Barack Obama' } ).then( function( response ) {10} );11wptools.memory2( { page: 'Barack Obama' }, function( error, response ) {12} );13wptools.memory2( { page: 'Barack Obama' }, { lang: 'fr' } ).then( function( response ) {14} );15wptools.memory2( { page: 'Barack Obama' }, { lang: 'fr' }, function( error, response ) {16} );17wptools.memory2( { page: 'Barack Obama', lang: 'fr' } ).then( function( response ) {18} );19wptools.memory2( { page: 'Barack Obama', lang: 'fr' }, function( error, response ) {

Full Screen

Using AI Code Generation

copy

Full Screen

1var wptools = require('./index.js');2var wp = new wptools.wptools('Barack Obama');3wp.memory2(function(err, data){4 if (err){5 console.log(err);6 }7 else{8 console.log(data);9 }10});11var wptools = require('wptools');12var wp = new wptools.wptools('Barack Obama');13wp.memory2(function(err, data){14 if (err){15 console.log(err);16 }17 else{18 console.log(data);19 }20});21var wptools = require('./index.js');22var wp = new wptools.wptools('Barack Obama');23wp.memory2(function(err, data){24 if (err){25 console.log(err);26 }27 else{28 console.log(data);29 }30});31var wptools = require('wptools');32var wp = new wptools.wptools('Barack Obama');33wp.memory2(function(err, data){34 if (err){35 console.log(err);36 }37 else{38 console.log(data);39 }40});41memory2(callback)42getArticle(callback)43getArticleList(callback)44getArticleListFromFile(filename, callback)45getArticleListFromURL(url, callback)

Full Screen

Using AI Code Generation

copy

Full Screen

1const wptools = require('wptools');2const wiki = wptools.page('Albert_Einstein');3wiki.memory2().then(function (data) {4 console.log(data);5});6{ query: { pages: [Object] },7 { main: { '*': 'Unrecognized parameter: redirects.' },8 query: { '*': 'Unrecognized parameter: prop.' } } }9 {name: 'item1', category: 'cat1'},10 {name: 'item2', category: 'cat1'},11 {name: 'item3', category: 'cat2'},12 {name: 'item4', category: 'cat2'},13 {name: 'item5', category: 'cat2'},14 {name: 'item6', category: 'cat3'},15 {name: 'item7', category: 'cat3'},16 {name: 'item8', category: 'cat3'},17 {name: 'item9', category: 'cat3'},18 {name: 'item10', category: 'cat3'},19];20 {category: 'cat1', num_items: 2},21 {category: 'cat2', num_items: 3},22 {category: 'cat3', num_items: 5},23];24 {name: 'item1', category: 'cat1'},25 {name: 'item2', category: 'cat1'},26 {name: 'item3', category: 'cat2'},27 {name: 'item4', category: 'cat2'},28 {name: 'item5', category: 'cat2'},29 {name: 'item6', category: 'cat3'},30 {name: 'item7', category: 'cat3'},31 {name: 'item8', category: 'cat3'},32 {name: 'item9', category: 'cat

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful