@platformatic/ui-components 0.1.16 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index.d77cda9b.js +797 -0
- package/dist/assets/index.f6d5761c.css +1 -0
- package/dist/index.html +2 -2
- package/dist/main.css +46 -27
- package/index.js +4 -0
- package/package.json +2 -1
- package/src/components/ApiDetail.jsx +0 -69
- package/src/components/Button.jsx +6 -2
- package/src/components/DetailedMetric.jsx +32 -0
- package/src/components/DetailedMetric.module.css +3 -0
- package/src/components/Input.jsx +1 -0
- package/src/components/MetricValue.jsx +15 -0
- package/src/components/MetricValue.module.css +8 -0
- package/src/components/SimpleMetric.jsx +32 -0
- package/src/components/SimpleMetric.module.css +7 -0
- package/src/stories/DetailedMetric.stories.jsx +33 -0
- package/src/stories/SimpleMetric.stories.jsx +41 -0
- package/dist/assets/index.fcbe6de7.js +0 -797
- package/dist/platformatic-ui.css +0 -1
- package/src/components/StatValue.jsx +0 -16
- package/src/components/StatsView.jsx +0 -47
- package/src/components/StatsView.module.css +0 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._input_1v03r_1{box-sizing:border-box;display:flex;height:2.5rem;width:100%;justify-content:space-between;border-radius:.375rem;border-width:1px;border-style:solid;--tw-border-opacity: 1;border-color:rgb(33 250 144 / var(--tw-border-opacity));--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}._input_1v03r_1>input:focus{outline:2px solid transparent;outline-offset:2px}._padded_650jz_1{padding:.625rem .5rem}._bordered_650jz_5{box-sizing:border-box;border-radius:.375rem;border-width:1px;border-style:solid}._bordered_1ece3_1{border-radius:.375rem;border-width:1px;border-style:solid;--tw-border-opacity: 1;border-color:rgb(255 255 255 / var(--tw-border-opacity));padding:.25rem .5rem;letter-spacing:.25rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}._borderedBox_1fd0d_1{margin-bottom:1rem;flex:1 1 0%;row-gap:1rem;border-radius:.375rem;--tw-bg-opacity: 1;background-color:rgb(0 52 79 / var(--tw-bg-opacity));padding:1.25rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}._container_pqngl_1{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}._label_pqngl_4{margin-right:.5rem;font-weight:100}._text_pqngl_7{font-weight:600}._main_172rv_1{display:flex;flex-direction:column;row-gap:1rem}._footer_kawbk_1{margin-left:2.25rem;display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.5rem .5rem .5rem 1.25rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}._main_1uwu5_1{display:flex;align-items:center;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}._data_1uwu5_5{display:flex;width:100%;flex-direction:column}._status_1uwu5_9{justify-self:end}._tabbed-container_1r9tv_1{--tw-bg-opacity: 1;background-color:rgb(0 40 61 / var(--tw-bg-opacity))}._tabs-header_1r9tv_5{margin-bottom:1rem;display:flex;height:2rem;justify-content:flex-start;text-transform:uppercase;letter-spacing:.25rem;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}._tabs-header_1r9tv_5:hover{cursor:pointer}._tab_1r9tv_1{margin-right:1rem;min-width:105px;text-align:center}._selected-tab_1r9tv_11{font-weight:700;--tw-text-opacity: 1;color:rgb(33 250 144 / var(--tw-text-opacity));text-decoration-line:underline;text-underline-offset:8px}._tabs-content_1r9tv_15{height:100vh}._container_sn6pf_1{display:flex;flex-direction:column}._id_sn6pf_4{font-size:1.25rem;line-height:1.75rem;font-weight:600;--tw-text-opacity: 1;color:rgb(33 250 144 / var(--tw-text-opacity))}._header_sn6pf_7{margin-bottom:1rem;display:flex;align-items:center;justify-content:space-between}._title_sn6pf_10{display:flex;align-items:center;-moz-column-gap:1rem;column-gap:1rem}._footer_sn6pf_13,._status_sn6pf_16{display:flex;align-items:center}._unavailable_sn6pf_19{opacity:.3}._icons_sn6pf_22{display:flex;justify-content:space-between;-moz-column-gap:.5rem;column-gap:.5rem}._icons_sn6pf_22>*:hover{cursor:pointer}*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:currentColor}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Montserrat}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%;margin-right:auto;margin-left:auto}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.static{position:static}.m-3{margin:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.my-8{margin-top:2rem;margin-bottom:2rem}.mx-auto{margin-left:auto;margin-right:auto}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.mr-2{margin-right:.5rem}.mr-5{margin-right:1.25rem}.ml-4{margin-left:1rem}.mt-24{margin-top:6rem}.mb-16{margin-bottom:4rem}.flex{display:flex}.grid{display:grid}.h-screen{height:100vh}.w-full{width:100%}.w-9{width:2.25rem}.w-80{width:20rem}.grow{flex-grow:1}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.place-items-center{place-items:center}.items-center{align-items:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-10{gap:2.5rem}.gap-x-4{-moz-column-gap:1rem;column-gap:1rem}.border{border-width:1px}.border-error-red{--tw-border-opacity: 1;border-color:rgb(250 33 33 / var(--tw-border-opacity))}.border-main-green{--tw-border-opacity: 1;border-color:rgb(33 250 144 / var(--tw-border-opacity))}.px-4{padding-left:1rem;padding-right:1rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-6xl{font-size:3.75rem;line-height:1}.text-2xl{font-size:1.5rem;line-height:2rem}.font-semibold{font-weight:600}.font-bold{font-weight:700}.font-light{font-weight:300}.text-main-green{--tw-text-opacity: 1;color:rgb(33 250 144 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-dark-green{--tw-text-opacity: 1;color:rgb(2 120 63 / var(--tw-text-opacity))}.text-error-red{--tw-text-opacity: 1;color:rgb(250 33 33 / var(--tw-text-opacity))}@font-face{font-family:Montserrat;src:local("Montserrat"),url(./fonts/Montserrat/Montserrat-VariableFont_wght.ttf) format("truetype");font-weight:100 900}:root{--tw-bg-opacity: 1;background-color:rgb(0 40 61 / var(--tw-bg-opacity));font-family:Montserrat}a{--tw-text-opacity: 1;color:rgb(37 136 228 / var(--tw-text-opacity))}input{background-color:transparent}.hover\:cursor-pointer:hover{cursor:pointer}
|
package/dist/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Platformatic UI Components</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index.
|
|
8
|
-
<link rel="stylesheet" href="/
|
|
7
|
+
<script type="module" crossorigin src="/assets/index.d77cda9b.js"></script>
|
|
8
|
+
<link rel="stylesheet" href="/assets/index.f6d5761c.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
package/dist/main.css
CHANGED
|
@@ -540,6 +540,10 @@ video {
|
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
542
|
|
|
543
|
+
.static {
|
|
544
|
+
position: static;
|
|
545
|
+
}
|
|
546
|
+
|
|
543
547
|
.m-3 {
|
|
544
548
|
margin: 0.75rem;
|
|
545
549
|
}
|
|
@@ -549,6 +553,11 @@ video {
|
|
|
549
553
|
margin-bottom: 1rem;
|
|
550
554
|
}
|
|
551
555
|
|
|
556
|
+
.my-8 {
|
|
557
|
+
margin-top: 2rem;
|
|
558
|
+
margin-bottom: 2rem;
|
|
559
|
+
}
|
|
560
|
+
|
|
552
561
|
.mx-auto {
|
|
553
562
|
margin-left: auto;
|
|
554
563
|
margin-right: auto;
|
|
@@ -559,6 +568,10 @@ video {
|
|
|
559
568
|
margin-bottom: 1.25rem;
|
|
560
569
|
}
|
|
561
570
|
|
|
571
|
+
.mr-2 {
|
|
572
|
+
margin-right: 0.5rem;
|
|
573
|
+
}
|
|
574
|
+
|
|
562
575
|
.mr-5 {
|
|
563
576
|
margin-right: 1.25rem;
|
|
564
577
|
}
|
|
@@ -567,12 +580,12 @@ video {
|
|
|
567
580
|
margin-left: 1rem;
|
|
568
581
|
}
|
|
569
582
|
|
|
570
|
-
.
|
|
571
|
-
margin-
|
|
583
|
+
.mt-24 {
|
|
584
|
+
margin-top: 6rem;
|
|
572
585
|
}
|
|
573
586
|
|
|
574
|
-
.
|
|
575
|
-
margin-
|
|
587
|
+
.mb-16 {
|
|
588
|
+
margin-bottom: 4rem;
|
|
576
589
|
}
|
|
577
590
|
|
|
578
591
|
.flex {
|
|
@@ -583,8 +596,8 @@ video {
|
|
|
583
596
|
display: grid;
|
|
584
597
|
}
|
|
585
598
|
|
|
586
|
-
.
|
|
587
|
-
|
|
599
|
+
.h-screen {
|
|
600
|
+
height: 100vh;
|
|
588
601
|
}
|
|
589
602
|
|
|
590
603
|
.w-full {
|
|
@@ -595,6 +608,10 @@ video {
|
|
|
595
608
|
width: 2.25rem;
|
|
596
609
|
}
|
|
597
610
|
|
|
611
|
+
.w-80 {
|
|
612
|
+
width: 20rem;
|
|
613
|
+
}
|
|
614
|
+
|
|
598
615
|
.grow {
|
|
599
616
|
flex-grow: 1;
|
|
600
617
|
}
|
|
@@ -607,6 +624,10 @@ video {
|
|
|
607
624
|
flex-direction: column;
|
|
608
625
|
}
|
|
609
626
|
|
|
627
|
+
.place-items-center {
|
|
628
|
+
place-items: center;
|
|
629
|
+
}
|
|
630
|
+
|
|
610
631
|
.items-center {
|
|
611
632
|
align-items: center;
|
|
612
633
|
}
|
|
@@ -615,18 +636,14 @@ video {
|
|
|
615
636
|
justify-content: space-between;
|
|
616
637
|
}
|
|
617
638
|
|
|
618
|
-
.
|
|
619
|
-
|
|
639
|
+
.gap-2 {
|
|
640
|
+
gap: 0.5rem;
|
|
620
641
|
}
|
|
621
642
|
|
|
622
643
|
.gap-4 {
|
|
623
644
|
gap: 1rem;
|
|
624
645
|
}
|
|
625
646
|
|
|
626
|
-
.gap-2 {
|
|
627
|
-
gap: 0.5rem;
|
|
628
|
-
}
|
|
629
|
-
|
|
630
647
|
.gap-10 {
|
|
631
648
|
gap: 2.5rem;
|
|
632
649
|
}
|
|
@@ -636,10 +653,6 @@ video {
|
|
|
636
653
|
column-gap: 1rem;
|
|
637
654
|
}
|
|
638
655
|
|
|
639
|
-
.rounded-full {
|
|
640
|
-
border-radius: 9999px;
|
|
641
|
-
}
|
|
642
|
-
|
|
643
656
|
.border {
|
|
644
657
|
border-width: 1px;
|
|
645
658
|
}
|
|
@@ -654,10 +667,6 @@ video {
|
|
|
654
667
|
border-color: rgb(33 250 144 / var(--tw-border-opacity));
|
|
655
668
|
}
|
|
656
669
|
|
|
657
|
-
.p-2 {
|
|
658
|
-
padding: 0.5rem;
|
|
659
|
-
}
|
|
660
|
-
|
|
661
670
|
.px-4 {
|
|
662
671
|
padding-left: 1rem;
|
|
663
672
|
padding-right: 1rem;
|
|
@@ -673,9 +682,19 @@ video {
|
|
|
673
682
|
line-height: 1;
|
|
674
683
|
}
|
|
675
684
|
|
|
676
|
-
.text-
|
|
677
|
-
font-size:
|
|
678
|
-
line-height:
|
|
685
|
+
.text-4xl {
|
|
686
|
+
font-size: 2.25rem;
|
|
687
|
+
line-height: 2.5rem;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
.text-3xl {
|
|
691
|
+
font-size: 1.875rem;
|
|
692
|
+
line-height: 2.25rem;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
.text-6xl {
|
|
696
|
+
font-size: 3.75rem;
|
|
697
|
+
line-height: 1;
|
|
679
698
|
}
|
|
680
699
|
|
|
681
700
|
.font-semibold {
|
|
@@ -695,14 +714,14 @@ video {
|
|
|
695
714
|
color: rgb(33 250 144 / var(--tw-text-opacity));
|
|
696
715
|
}
|
|
697
716
|
|
|
698
|
-
.text-
|
|
717
|
+
.text-white {
|
|
699
718
|
--tw-text-opacity: 1;
|
|
700
|
-
color: rgb(
|
|
719
|
+
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
701
720
|
}
|
|
702
721
|
|
|
703
|
-
.text-
|
|
722
|
+
.text-dark-green {
|
|
704
723
|
--tw-text-opacity: 1;
|
|
705
|
-
color: rgb(
|
|
724
|
+
color: rgb(2 120 63 / var(--tw-text-opacity));
|
|
706
725
|
}
|
|
707
726
|
|
|
708
727
|
.text-error-red {
|
package/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import BorderedBox from './src/components/BorderedBox'
|
|
|
6
6
|
import BorderedText from './src/components/BorderedText'
|
|
7
7
|
import Box from './src/components/Box'
|
|
8
8
|
import Button from './src/components/Button'
|
|
9
|
+
import DetailedMetric from './src/components/DetailedMetric'
|
|
9
10
|
import FollowUs from './src/components/FollowUs'
|
|
10
11
|
import FrontpageBackground from './src/components/FrontpageBackground'
|
|
11
12
|
import GHLoginButton from './src/components/GHLoginButton'
|
|
@@ -19,6 +20,7 @@ import Logo from './src/components/Logo'
|
|
|
19
20
|
import Playground from './src/components/Playground'
|
|
20
21
|
import PullRequest from './src/components/PullRequest'
|
|
21
22
|
import SearchBar from './src/components/SearchBar'
|
|
23
|
+
import SimpleMetric from './src/components/SimpleMetric'
|
|
22
24
|
import Status from './src/components/Status'
|
|
23
25
|
import TabbedWindow from './src/components/TabbedWindow'
|
|
24
26
|
import TextWithLabel from './src/components/TextWithLabel'
|
|
@@ -32,6 +34,7 @@ export {
|
|
|
32
34
|
BorderedText,
|
|
33
35
|
Box,
|
|
34
36
|
Button,
|
|
37
|
+
DetailedMetric,
|
|
35
38
|
FollowUs,
|
|
36
39
|
FrontpageBackground,
|
|
37
40
|
HorizontalSeparator,
|
|
@@ -45,6 +48,7 @@ export {
|
|
|
45
48
|
Playground,
|
|
46
49
|
PullRequest,
|
|
47
50
|
SearchBar,
|
|
51
|
+
SimpleMetric,
|
|
48
52
|
Status,
|
|
49
53
|
TabbedWindow,
|
|
50
54
|
TextWithLabel,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/ui-components",
|
|
3
3
|
"description": "Platformatic UI Components",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.18",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"scripts": {
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"postcss": "^8.4.17",
|
|
27
27
|
"react": "^18.2.0",
|
|
28
28
|
"react-dom": "^18.2.0",
|
|
29
|
+
"react-tooltip": "^4.4.3",
|
|
29
30
|
"storybook-tailwind-foundations": "^1.1.2"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
@@ -4,56 +4,12 @@ import Endpoints from './Api/Endpoints'
|
|
|
4
4
|
import BorderedBox from './BorderedBox'
|
|
5
5
|
import BorderedText from './BorderedText'
|
|
6
6
|
import HorizontalSeparator from './HorizontalSeparator'
|
|
7
|
-
import TwoColumnsLayout from './layouts/TwoColumnsLayout'
|
|
8
|
-
import StatsView from './StatsView'
|
|
9
7
|
import TextWithLabel from './TextWithLabel'
|
|
10
8
|
import VerticalSeparator from './VerticalSeparator'
|
|
11
9
|
import React from 'react'
|
|
12
10
|
import styles from './ApiDetail.module.css'
|
|
13
11
|
export default function ApiDetails (props) {
|
|
14
12
|
const { url, repository, version, openapi, graphql, source, lastDeploy } = props
|
|
15
|
-
const requestStats = {
|
|
16
|
-
mainStat: {
|
|
17
|
-
value: 12,
|
|
18
|
-
label: 'Total',
|
|
19
|
-
color: 'green'
|
|
20
|
-
},
|
|
21
|
-
otherStats: [
|
|
22
|
-
{
|
|
23
|
-
value: 8,
|
|
24
|
-
label: 'per minute',
|
|
25
|
-
color: 'green'
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
value: 0.5,
|
|
29
|
-
label: 'per second',
|
|
30
|
-
color: 'green'
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const latencyStats = {
|
|
36
|
-
mainStat: {
|
|
37
|
-
value: 150,
|
|
38
|
-
label: 'ms',
|
|
39
|
-
color: 'green',
|
|
40
|
-
pre: 'P90'
|
|
41
|
-
},
|
|
42
|
-
otherStats: [
|
|
43
|
-
{
|
|
44
|
-
value: 600,
|
|
45
|
-
label: 'ms',
|
|
46
|
-
color: 'green',
|
|
47
|
-
pre: 'P99'
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
value: 4.42,
|
|
51
|
-
label: 's',
|
|
52
|
-
color: 'green',
|
|
53
|
-
pre: 'P95'
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
13
|
return (
|
|
58
14
|
<>
|
|
59
15
|
<BorderedBox classes='api-data'>
|
|
@@ -78,31 +34,6 @@ export default function ApiDetails (props) {
|
|
|
78
34
|
<span className='mr-2'>Endpoints: </span><Endpoints graphql={graphql} openapi={openapi} />
|
|
79
35
|
</div>
|
|
80
36
|
</BorderedBox>
|
|
81
|
-
<TwoColumnsLayout>
|
|
82
|
-
<BorderedBox>
|
|
83
|
-
<StatsView
|
|
84
|
-
title='Requests'
|
|
85
|
-
tooltip='Number of requests'
|
|
86
|
-
stats={requestStats}
|
|
87
|
-
/>
|
|
88
|
-
</BorderedBox>
|
|
89
|
-
<BorderedBox>
|
|
90
|
-
<StatsView
|
|
91
|
-
title='Latency'
|
|
92
|
-
tooltip='Request Latency'
|
|
93
|
-
stats={latencyStats}
|
|
94
|
-
/>
|
|
95
|
-
</BorderedBox>
|
|
96
|
-
</TwoColumnsLayout>
|
|
97
|
-
|
|
98
|
-
<TwoColumnsLayout>
|
|
99
|
-
<BorderedBox>
|
|
100
|
-
Connected Clients
|
|
101
|
-
</BorderedBox>
|
|
102
|
-
<BorderedBox>
|
|
103
|
-
Failure Rate
|
|
104
|
-
</BorderedBox>
|
|
105
|
-
</TwoColumnsLayout>
|
|
106
37
|
</>
|
|
107
38
|
|
|
108
39
|
)
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import React from 'react'
|
|
1
4
|
import styles from './Button.module.css'
|
|
2
5
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
3
|
-
export default function Button (
|
|
6
|
+
export default function Button (props) {
|
|
7
|
+
const { icon, label, primary, color } = props
|
|
4
8
|
let buttonClass = 'primary'
|
|
5
9
|
if (!primary) {
|
|
6
10
|
buttonClass = 'secondary'
|
|
@@ -11,7 +15,7 @@ export default function Button ({ icon, label, onClick, primary, color, ...props
|
|
|
11
15
|
colorClass = 'red'
|
|
12
16
|
}
|
|
13
17
|
return (
|
|
14
|
-
<button className={`${styles.button} ${styles[buttonClass + '-' + colorClass]}`}>
|
|
18
|
+
<button className={`${styles.button} ${styles[buttonClass + '-' + colorClass]}`} {...props}>
|
|
15
19
|
{icon ? <FontAwesomeIcon icon={icon} className='mr-2' data-testid='button-icon' /> : null}
|
|
16
20
|
<span>{label}</span>
|
|
17
21
|
</button>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import SimpleMetric from './SimpleMetric'
|
|
5
|
+
import HorizontalSeparator from './HorizontalSeparator'
|
|
6
|
+
import VerticalSeparator from './VerticalSeparator'
|
|
7
|
+
import styles from './DetailedMetric.module.css'
|
|
8
|
+
import MetricValue from './MetricValue'
|
|
9
|
+
export default function DetailedMetric (props) {
|
|
10
|
+
const { leftDetail, rightDetail } = props
|
|
11
|
+
return (
|
|
12
|
+
<SimpleMetric {...props}>
|
|
13
|
+
<HorizontalSeparator />
|
|
14
|
+
<div className={styles.detailContainer}>
|
|
15
|
+
<MetricValue
|
|
16
|
+
pre={leftDetail.pre}
|
|
17
|
+
unit={leftDetail.unit}
|
|
18
|
+
color={leftDetail.color}
|
|
19
|
+
value={leftDetail.value}
|
|
20
|
+
/>
|
|
21
|
+
<VerticalSeparator />
|
|
22
|
+
<MetricValue
|
|
23
|
+
pre={rightDetail.pre}
|
|
24
|
+
unit={rightDetail.unit}
|
|
25
|
+
color={rightDetail.color}
|
|
26
|
+
value={rightDetail.value}
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
</SimpleMetric>
|
|
30
|
+
|
|
31
|
+
)
|
|
32
|
+
}
|
package/src/components/Input.jsx
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import styles from './MetricValue.module.css'
|
|
4
|
+
import { getColor } from '../lib/utils'
|
|
5
|
+
export default function MetricValue ({ pre, color, value, unit }) {
|
|
6
|
+
return (
|
|
7
|
+
<div className={styles.metric}>
|
|
8
|
+
{pre && <span>{pre}</span>}
|
|
9
|
+
<span className={`${styles.value} ${getColor('text', color)}`}>
|
|
10
|
+
{value}
|
|
11
|
+
</span>
|
|
12
|
+
<span>{unit}</span>
|
|
13
|
+
</div>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
|
5
|
+
// The icon that is in design is not in the free version of fontawesome
|
|
6
|
+
// Temporary using this one
|
|
7
|
+
import { faCircleExclamation } from '@fortawesome/free-solid-svg-icons'
|
|
8
|
+
import ReactTooltip from 'react-tooltip'
|
|
9
|
+
import BorderedBox from './BorderedBox'
|
|
10
|
+
import styles from './SimpleMetric.module.css'
|
|
11
|
+
import MetricValue from './MetricValue'
|
|
12
|
+
|
|
13
|
+
export default function SimpleMetric ({ title, pre, color, unit, value, tooltip, children }) {
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<BorderedBox>
|
|
17
|
+
<div className={styles.header}>
|
|
18
|
+
<span className={styles.title}>{title}</span>
|
|
19
|
+
<FontAwesomeIcon
|
|
20
|
+
icon={faCircleExclamation}
|
|
21
|
+
data-tip={tooltip}
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
<div>
|
|
25
|
+
<MetricValue pre={pre} color={color} unit={unit} value={value} />
|
|
26
|
+
{children}
|
|
27
|
+
</div>
|
|
28
|
+
</BorderedBox>
|
|
29
|
+
<ReactTooltip />
|
|
30
|
+
</>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import DetailedMetric from '../components/DetailedMetric'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Platformatic/DetailedMetric',
|
|
7
|
+
component: DetailedMetric
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const Template = (args) => <DetailedMetric {...args} />
|
|
11
|
+
|
|
12
|
+
export const Default = Template.bind({})
|
|
13
|
+
|
|
14
|
+
Default.args = {
|
|
15
|
+
title: 'Requests',
|
|
16
|
+
color: 'green',
|
|
17
|
+
unit: 'ms',
|
|
18
|
+
value: 120,
|
|
19
|
+
pre: 'P90',
|
|
20
|
+
tooltip: 'This is a tooltip for the metric',
|
|
21
|
+
leftDetail: {
|
|
22
|
+
value: 600,
|
|
23
|
+
unit: 'ms',
|
|
24
|
+
color: 'green',
|
|
25
|
+
pre: 'P99'
|
|
26
|
+
},
|
|
27
|
+
rightDetail: {
|
|
28
|
+
value: 4.42,
|
|
29
|
+
unit: 's',
|
|
30
|
+
color: 'green',
|
|
31
|
+
pre: 'P95'
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import SimpleMetric from '../components/SimpleMetric'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Platformatic/SimpleMetric',
|
|
7
|
+
component: SimpleMetric
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const Template = (args) => <SimpleMetric {...args} />
|
|
11
|
+
|
|
12
|
+
export const Green = Template.bind({})
|
|
13
|
+
|
|
14
|
+
Green.args = {
|
|
15
|
+
title: 'Requests',
|
|
16
|
+
color: 'green',
|
|
17
|
+
unit: 'ms',
|
|
18
|
+
value: 120,
|
|
19
|
+
tooltip: 'This is a tooltip for the metric'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const Red = Template.bind({})
|
|
23
|
+
|
|
24
|
+
Red.args = {
|
|
25
|
+
title: 'Requests',
|
|
26
|
+
color: 'red',
|
|
27
|
+
unit: 'ms',
|
|
28
|
+
value: 120,
|
|
29
|
+
tooltip: 'This is a tooltip for the metric'
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const WithPrefix = Template.bind({})
|
|
33
|
+
|
|
34
|
+
WithPrefix.args = {
|
|
35
|
+
title: 'Requests',
|
|
36
|
+
color: 'green',
|
|
37
|
+
unit: 'ms',
|
|
38
|
+
value: 120,
|
|
39
|
+
pre: 'P90',
|
|
40
|
+
tooltip: 'This is a tooltip for the metric'
|
|
41
|
+
}
|