@mongoosejs/studio 0.0.21 → 0.0.23
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/backend/actions/Dashboard/getDashboard.js +18 -0
- package/backend/actions/Dashboard/getDashboards.js +10 -0
- package/backend/actions/Dashboard/index.js +5 -0
- package/backend/actions/Dashboard/updateDashboard.js +25 -0
- package/backend/actions/Model/createDocument.js +28 -0
- package/backend/actions/Model/getDocuments.js +2 -1
- package/backend/actions/Model/index.js +1 -0
- package/backend/actions/Model/listModels.js +3 -1
- package/backend/actions/Model/updateDocument.js +1 -1
- package/backend/actions/index.js +1 -0
- package/backend/db/dashboardSchema.js +16 -0
- package/backend/index.js +9 -1
- package/frontend/public/app.js +1172 -473
- package/frontend/public/images/json.svg +2 -0
- package/frontend/public/images/table.svg +1 -0
- package/frontend/public/index.html +3 -0
- package/frontend/public/tw.css +298 -18
- package/frontend/src/api.js +28 -0
- package/frontend/src/create-document/create-document.css +0 -0
- package/frontend/src/create-document/create-document.html +25 -0
- package/frontend/src/create-document/create-document.js +61 -0
- package/frontend/src/dashboard/dashboard.html +17 -0
- package/frontend/src/dashboard/dashboard.js +36 -0
- package/frontend/src/dashboard/edit-dashboard/edit-dashboard.html +5 -0
- package/frontend/src/dashboard/edit-dashboard/edit-dashboard.js +48 -0
- package/frontend/src/dashboards/dashboards.html +5 -0
- package/frontend/src/dashboards/dashboards.js +20 -0
- package/frontend/src/document/document.html +5 -4
- package/frontend/src/document/document.js +7 -1
- package/frontend/src/edit-array/edit-array.html +1 -7
- package/frontend/src/edit-array/edit-array.js +27 -9
- package/frontend/src/edit-date/edit-date.html +18 -1
- package/frontend/src/edit-date/edit-date.js +12 -0
- package/frontend/src/edit-default/edit-default.html +1 -1
- package/frontend/src/index.js +5 -0
- package/frontend/src/list-json/list-json.css +3 -0
- package/frontend/src/list-json/list-json.html +4 -0
- package/frontend/src/list-json/list-json.js +40 -0
- package/frontend/src/models/models.css +2 -8
- package/frontend/src/models/models.html +42 -10
- package/frontend/src/models/models.js +22 -1
- package/frontend/src/navbar/navbar.css +9 -0
- package/frontend/src/navbar/navbar.html +11 -3
- package/frontend/src/navbar/navbar.js +6 -1
- package/frontend/src/routes.js +10 -0
- package/mongoosejs-studio-0.0.16.tgz +0 -0
- package/package.json +2 -2
- package/tailwind.config.js +27 -1
- package/frontend/dist/app.js +0 -160
- package/frontend/dist/tw.css +0 -595
- package/logs/COUNT_20230524-154120-151469/operation.log +0 -8
- package/logs/COUNT_20230524-154408-077670/operation.log +0 -22
- package/logs/COUNT_20230524-154414-431706/operation.log +0 -8
- package/logs/COUNT_20230524-155000-297076/operation.log +0 -8
- package/logs/LOAD_20230524-155832-351763/checkpoint.csv +0 -1
- package/logs/LOAD_20230524-155832-351763/operation.log +0 -23
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
2
|
+
<svg width="800px" height="800px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="#000000"><path fill-rule="evenodd" clip-rule="evenodd" d="M6 2.984V2h-.09c-.313 0-.616.062-.909.185a2.33 2.33 0 0 0-.775.53 2.23 2.23 0 0 0-.493.753v.001a3.542 3.542 0 0 0-.198.83v.002a6.08 6.08 0 0 0-.024.863c.012.29.018.58.018.869 0 .203-.04.393-.117.572v.001a1.504 1.504 0 0 1-.765.787 1.376 1.376 0 0 1-.558.115H2v.984h.09c.195 0 .38.04.556.121l.001.001c.178.078.329.184.455.318l.002.002c.13.13.233.285.307.465l.001.002c.078.18.117.368.117.566 0 .29-.006.58-.018.869-.012.296-.004.585.024.87v.001c.033.283.099.558.197.824v.001c.106.273.271.524.494.753.223.23.482.407.775.53.293.123.596.185.91.185H6v-.984h-.09c-.2 0-.387-.038-.563-.115a1.613 1.613 0 0 1-.457-.32 1.659 1.659 0 0 1-.309-.467c-.074-.18-.11-.37-.11-.573 0-.228.003-.453.011-.672.008-.228.008-.45 0-.665a4.639 4.639 0 0 0-.055-.64 2.682 2.682 0 0 0-.168-.609A2.284 2.284 0 0 0 3.522 8a2.284 2.284 0 0 0 .738-.955c.08-.192.135-.393.168-.602.033-.21.051-.423.055-.64.008-.22.008-.442 0-.666-.008-.224-.012-.45-.012-.678a1.47 1.47 0 0 1 .877-1.354 1.33 1.33 0 0 1 .563-.121H6zm4 10.032V14h.09c.313 0 .616-.062.909-.185.293-.123.552-.3.775-.53.223-.23.388-.48.493-.753v-.001c.1-.266.165-.543.198-.83v-.002c.028-.28.036-.567.024-.863-.012-.29-.018-.58-.018-.869 0-.203.04-.393.117-.572v-.001a1.502 1.502 0 0 1 .765-.787 1.38 1.38 0 0 1 .558-.115H14v-.984h-.09c-.196 0-.381-.04-.557-.121l-.001-.001a1.376 1.376 0 0 1-.455-.318l-.002-.002a1.415 1.415 0 0 1-.307-.465v-.002a1.405 1.405 0 0 1-.118-.566c0-.29.006-.58.018-.869a6.174 6.174 0 0 0-.024-.87v-.001a3.537 3.537 0 0 0-.197-.824v-.001a2.23 2.23 0 0 0-.494-.753 2.331 2.331 0 0 0-.775-.53 2.325 2.325 0 0 0-.91-.185H10v.984h.09c.2 0 .387.038.562.115.174.082.326.188.457.32.127.134.23.29.309.467.074.18.11.37.11.573 0 .228-.003.452-.011.672-.008.228-.008.45 0 .665.004.222.022.435.055.64.033.214.089.416.168.609a2.285 2.285 0 0 0 .738.955 2.285 2.285 0 0 0-.738.955 2.689 2.689 0 0 0-.168.602c-.033.21-.051.423-.055.64a9.15 9.15 0 0 0 0 .666c.008.224.012.45.012.678a1.471 1.471 0 0 1-.877 1.354 1.33 1.33 0 0 1-.563.121H10z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path d="M120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200q-33 0-56.5-23.5T120-200Zm80-400h560v-160H200v160Zm213 200h134v-120H413v120Zm0 200h134v-120H413v120ZM200-400h133v-120H200v120Zm427 0h133v-120H627v120ZM200-200h133v-120H200v120Zm427 0h133v-120H627v120Z"/></svg>
|
|
@@ -10,9 +10,12 @@
|
|
|
10
10
|
<link rel="stylesheet" href="https://unpkg.com/prismjs@1.29.0/themes/prism.css"/>
|
|
11
11
|
<link rel="stylesheet" href="tw.css">
|
|
12
12
|
<link rel="stylesheet" href="vanillatoasts/vanillatoasts.css">
|
|
13
|
+
<link rel="stylesheet" href="https://unpkg.com/codemirror@5.65.16/lib/codemirror.css">
|
|
13
14
|
<script src="https://unpkg.com/vue@3.x"></script>
|
|
14
15
|
<script src="https://unpkg.com/vue-router@4.0.10"></script>
|
|
15
16
|
<script src="https://unpkg.com/chart.js@4.2.0/dist/chart.umd.js"></script>
|
|
17
|
+
<script src="https://unpkg.com/codemirror@5.65.16/lib/codemirror.js"></script>
|
|
18
|
+
<script src="https://unpkg.com/codemirror@5.65.16/mode/javascript/javascript.js"></script>
|
|
16
19
|
</head>
|
|
17
20
|
|
|
18
21
|
<body>
|
package/frontend/public/tw.css
CHANGED
|
@@ -578,6 +578,26 @@ video {
|
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
|
|
581
|
+
.fixed {
|
|
582
|
+
position: fixed;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.relative {
|
|
586
|
+
position: relative;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.isolate {
|
|
590
|
+
isolation: isolate;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.m-0 {
|
|
594
|
+
margin: 0px;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.-ml-px {
|
|
598
|
+
margin-left: -1px;
|
|
599
|
+
}
|
|
600
|
+
|
|
581
601
|
.mb-1 {
|
|
582
602
|
margin-bottom: 0.25rem;
|
|
583
603
|
}
|
|
@@ -586,8 +606,20 @@ video {
|
|
|
586
606
|
margin-bottom: 0.5rem;
|
|
587
607
|
}
|
|
588
608
|
|
|
589
|
-
.
|
|
590
|
-
margin-
|
|
609
|
+
.mb-\[-1px\] {
|
|
610
|
+
margin-bottom: -1px;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
.ml-3 {
|
|
614
|
+
margin-left: 0.75rem;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
.mt-1 {
|
|
618
|
+
margin-top: 0.25rem;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.mt-2 {
|
|
622
|
+
margin-top: 0.5rem;
|
|
591
623
|
}
|
|
592
624
|
|
|
593
625
|
.mt-4 {
|
|
@@ -606,26 +638,86 @@ video {
|
|
|
606
638
|
display: flex;
|
|
607
639
|
}
|
|
608
640
|
|
|
641
|
+
.inline-flex {
|
|
642
|
+
display: inline-flex;
|
|
643
|
+
}
|
|
644
|
+
|
|
609
645
|
.table {
|
|
610
646
|
display: table;
|
|
611
647
|
}
|
|
612
648
|
|
|
649
|
+
.h-5 {
|
|
650
|
+
height: 1.25rem;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.h-8 {
|
|
654
|
+
height: 2rem;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
.h-\[300px\] {
|
|
658
|
+
height: 300px;
|
|
659
|
+
}
|
|
660
|
+
|
|
613
661
|
.h-\[calc\(100vh-55px\)\] {
|
|
614
662
|
height: calc(100vh - 55px);
|
|
615
663
|
}
|
|
616
664
|
|
|
665
|
+
.h-full {
|
|
666
|
+
height: 100%;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
.w-5 {
|
|
670
|
+
width: 1.25rem;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
.w-64 {
|
|
674
|
+
width: 16rem;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
.w-full {
|
|
678
|
+
width: 100%;
|
|
679
|
+
}
|
|
680
|
+
|
|
617
681
|
.flex-1 {
|
|
618
682
|
flex: 1 1 0%;
|
|
619
683
|
}
|
|
620
684
|
|
|
685
|
+
.flex-shrink-0 {
|
|
686
|
+
flex-shrink: 0;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
.flex-grow {
|
|
690
|
+
flex-grow: 1;
|
|
691
|
+
}
|
|
692
|
+
|
|
621
693
|
.grow {
|
|
622
694
|
flex-grow: 1;
|
|
623
695
|
}
|
|
624
696
|
|
|
697
|
+
.list-disc {
|
|
698
|
+
list-style-type: disc;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
.flex-row {
|
|
702
|
+
flex-direction: row;
|
|
703
|
+
}
|
|
704
|
+
|
|
625
705
|
.flex-col {
|
|
626
706
|
flex-direction: column;
|
|
627
707
|
}
|
|
628
708
|
|
|
709
|
+
.items-center {
|
|
710
|
+
align-items: center;
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
.justify-end {
|
|
714
|
+
justify-content: flex-end;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
.gap-2 {
|
|
718
|
+
gap: 0.5rem;
|
|
719
|
+
}
|
|
720
|
+
|
|
629
721
|
.gap-y-5 {
|
|
630
722
|
row-gap: 1.25rem;
|
|
631
723
|
}
|
|
@@ -634,6 +726,12 @@ video {
|
|
|
634
726
|
row-gap: 1.75rem;
|
|
635
727
|
}
|
|
636
728
|
|
|
729
|
+
.space-y-1 > :not([hidden]) ~ :not([hidden]) {
|
|
730
|
+
--tw-space-y-reverse: 0;
|
|
731
|
+
margin-top: calc(0.25rem * calc(1 - var(--tw-space-y-reverse)));
|
|
732
|
+
margin-bottom: calc(0.25rem * var(--tw-space-y-reverse));
|
|
733
|
+
}
|
|
734
|
+
|
|
637
735
|
.overflow-y-auto {
|
|
638
736
|
overflow-y: auto;
|
|
639
737
|
}
|
|
@@ -646,6 +744,36 @@ video {
|
|
|
646
744
|
border-radius: 0.375rem;
|
|
647
745
|
}
|
|
648
746
|
|
|
747
|
+
.rounded-none {
|
|
748
|
+
border-radius: 0px;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
.rounded-l-md {
|
|
752
|
+
border-top-left-radius: 0.375rem;
|
|
753
|
+
border-bottom-left-radius: 0.375rem;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
.rounded-r-md {
|
|
757
|
+
border-top-right-radius: 0.375rem;
|
|
758
|
+
border-bottom-right-radius: 0.375rem;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
.rounded-tl-md {
|
|
762
|
+
border-top-left-radius: 0.375rem;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
.rounded-tr-md {
|
|
766
|
+
border-top-right-radius: 0.375rem;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
.border {
|
|
770
|
+
border-width: 1px;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
.border-b-2 {
|
|
774
|
+
border-bottom-width: 2px;
|
|
775
|
+
}
|
|
776
|
+
|
|
649
777
|
.border-r {
|
|
650
778
|
border-right-width: 1px;
|
|
651
779
|
}
|
|
@@ -655,19 +783,33 @@ video {
|
|
|
655
783
|
border-color: rgb(229 231 235 / var(--tw-border-opacity));
|
|
656
784
|
}
|
|
657
785
|
|
|
658
|
-
.
|
|
786
|
+
.border-gray-300 {
|
|
787
|
+
--tw-border-opacity: 1;
|
|
788
|
+
border-color: rgb(209 213 219 / var(--tw-border-opacity));
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
.border-teal-500 {
|
|
792
|
+
--tw-border-opacity: 1;
|
|
793
|
+
border-color: rgb(0 208 201 / var(--tw-border-opacity));
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
.border-transparent {
|
|
797
|
+
border-color: transparent;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
.bg-gray-200 {
|
|
659
801
|
--tw-bg-opacity: 1;
|
|
660
|
-
background-color: rgb(
|
|
802
|
+
background-color: rgb(229 231 235 / var(--tw-bg-opacity));
|
|
661
803
|
}
|
|
662
804
|
|
|
663
|
-
.bg-
|
|
805
|
+
.bg-green-600 {
|
|
664
806
|
--tw-bg-opacity: 1;
|
|
665
|
-
background-color: rgb(
|
|
807
|
+
background-color: rgb(22 163 74 / var(--tw-bg-opacity));
|
|
666
808
|
}
|
|
667
809
|
|
|
668
|
-
.bg-
|
|
810
|
+
.bg-red-50 {
|
|
669
811
|
--tw-bg-opacity: 1;
|
|
670
|
-
background-color: rgb(
|
|
812
|
+
background-color: rgb(254 242 242 / var(--tw-bg-opacity));
|
|
671
813
|
}
|
|
672
814
|
|
|
673
815
|
.bg-red-600 {
|
|
@@ -685,6 +827,16 @@ video {
|
|
|
685
827
|
background-color: rgb(71 85 105 / var(--tw-bg-opacity));
|
|
686
828
|
}
|
|
687
829
|
|
|
830
|
+
.bg-teal-100 {
|
|
831
|
+
--tw-bg-opacity: 1;
|
|
832
|
+
background-color: rgb(197 255 250 / var(--tw-bg-opacity));
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
.bg-teal-600 {
|
|
836
|
+
--tw-bg-opacity: 1;
|
|
837
|
+
background-color: rgb(0 168 165 / var(--tw-bg-opacity));
|
|
838
|
+
}
|
|
839
|
+
|
|
688
840
|
.bg-white {
|
|
689
841
|
--tw-bg-opacity: 1;
|
|
690
842
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
|
@@ -694,6 +846,19 @@ video {
|
|
|
694
846
|
padding: 0.25rem;
|
|
695
847
|
}
|
|
696
848
|
|
|
849
|
+
.p-2 {
|
|
850
|
+
padding: 0.5rem;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
.p-4 {
|
|
854
|
+
padding: 1rem;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
.px-1 {
|
|
858
|
+
padding-left: 0.25rem;
|
|
859
|
+
padding-right: 0.25rem;
|
|
860
|
+
}
|
|
861
|
+
|
|
697
862
|
.px-2 {
|
|
698
863
|
padding-left: 0.5rem;
|
|
699
864
|
padding-right: 0.5rem;
|
|
@@ -723,10 +888,23 @@ video {
|
|
|
723
888
|
padding-left: 0.5rem;
|
|
724
889
|
}
|
|
725
890
|
|
|
891
|
+
.pl-5 {
|
|
892
|
+
padding-left: 1.25rem;
|
|
893
|
+
}
|
|
894
|
+
|
|
726
895
|
.pr-2 {
|
|
727
896
|
padding-right: 0.5rem;
|
|
728
897
|
}
|
|
729
898
|
|
|
899
|
+
.pt-1 {
|
|
900
|
+
padding-top: 0.25rem;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
.text-lg {
|
|
904
|
+
font-size: 1.125rem;
|
|
905
|
+
line-height: 1.75rem;
|
|
906
|
+
}
|
|
907
|
+
|
|
730
908
|
.text-sm {
|
|
731
909
|
font-size: 0.875rem;
|
|
732
910
|
line-height: 1.25rem;
|
|
@@ -736,15 +914,54 @@ video {
|
|
|
736
914
|
font-weight: 700;
|
|
737
915
|
}
|
|
738
916
|
|
|
917
|
+
.font-medium {
|
|
918
|
+
font-weight: 500;
|
|
919
|
+
}
|
|
920
|
+
|
|
739
921
|
.font-semibold {
|
|
740
922
|
font-weight: 600;
|
|
741
923
|
}
|
|
742
924
|
|
|
925
|
+
.text-gray-400 {
|
|
926
|
+
--tw-text-opacity: 1;
|
|
927
|
+
color: rgb(156 163 175 / var(--tw-text-opacity));
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
.text-gray-500 {
|
|
931
|
+
--tw-text-opacity: 1;
|
|
932
|
+
color: rgb(107 114 128 / var(--tw-text-opacity));
|
|
933
|
+
}
|
|
934
|
+
|
|
743
935
|
.text-gray-700 {
|
|
744
936
|
--tw-text-opacity: 1;
|
|
745
937
|
color: rgb(55 65 81 / var(--tw-text-opacity));
|
|
746
938
|
}
|
|
747
939
|
|
|
940
|
+
.text-gray-800 {
|
|
941
|
+
--tw-text-opacity: 1;
|
|
942
|
+
color: rgb(31 41 55 / var(--tw-text-opacity));
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
.text-gray-900 {
|
|
946
|
+
--tw-text-opacity: 1;
|
|
947
|
+
color: rgb(17 24 39 / var(--tw-text-opacity));
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
.text-red-400 {
|
|
951
|
+
--tw-text-opacity: 1;
|
|
952
|
+
color: rgb(248 113 113 / var(--tw-text-opacity));
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
.text-red-700 {
|
|
956
|
+
--tw-text-opacity: 1;
|
|
957
|
+
color: rgb(185 28 28 / var(--tw-text-opacity));
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
.text-red-800 {
|
|
961
|
+
--tw-text-opacity: 1;
|
|
962
|
+
color: rgb(153 27 27 / var(--tw-text-opacity));
|
|
963
|
+
}
|
|
964
|
+
|
|
748
965
|
.text-sky-800 {
|
|
749
966
|
--tw-text-opacity: 1;
|
|
750
967
|
color: rgb(7 89 133 / var(--tw-text-opacity));
|
|
@@ -761,6 +978,29 @@ video {
|
|
|
761
978
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
762
979
|
}
|
|
763
980
|
|
|
981
|
+
.outline-0 {
|
|
982
|
+
outline-width: 0px;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
.outline-gray-300 {
|
|
986
|
+
outline-color: #d1d5db;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
.ring-1 {
|
|
990
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
991
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
992
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
.ring-inset {
|
|
996
|
+
--tw-ring-inset: inset;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
.ring-gray-300 {
|
|
1000
|
+
--tw-ring-opacity: 1;
|
|
1001
|
+
--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
|
|
1002
|
+
}
|
|
1003
|
+
|
|
764
1004
|
.filter {
|
|
765
1005
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
766
1006
|
}
|
|
@@ -773,19 +1013,24 @@ video {
|
|
|
773
1013
|
transition-duration: 150ms;
|
|
774
1014
|
}
|
|
775
1015
|
|
|
776
|
-
.hover\:
|
|
1016
|
+
.hover\:border-gray-300:hover {
|
|
1017
|
+
--tw-border-opacity: 1;
|
|
1018
|
+
border-color: rgb(209 213 219 / var(--tw-border-opacity));
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
.hover\:bg-gray-200:hover {
|
|
777
1022
|
--tw-bg-opacity: 1;
|
|
778
|
-
background-color: rgb(
|
|
1023
|
+
background-color: rgb(229 231 235 / var(--tw-bg-opacity));
|
|
779
1024
|
}
|
|
780
1025
|
|
|
781
|
-
.hover\:bg-
|
|
1026
|
+
.hover\:bg-gray-50:hover {
|
|
782
1027
|
--tw-bg-opacity: 1;
|
|
783
|
-
background-color: rgb(
|
|
1028
|
+
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
|
|
784
1029
|
}
|
|
785
1030
|
|
|
786
|
-
.hover\:bg-
|
|
1031
|
+
.hover\:bg-green-500:hover {
|
|
787
1032
|
--tw-bg-opacity: 1;
|
|
788
|
-
background-color: rgb(
|
|
1033
|
+
background-color: rgb(34 197 94 / var(--tw-bg-opacity));
|
|
789
1034
|
}
|
|
790
1035
|
|
|
791
1036
|
.hover\:bg-red-500:hover {
|
|
@@ -798,6 +1043,25 @@ video {
|
|
|
798
1043
|
background-color: rgb(100 116 139 / var(--tw-bg-opacity));
|
|
799
1044
|
}
|
|
800
1045
|
|
|
1046
|
+
.hover\:bg-teal-100:hover {
|
|
1047
|
+
--tw-bg-opacity: 1;
|
|
1048
|
+
background-color: rgb(197 255 250 / var(--tw-bg-opacity));
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
.hover\:bg-teal-500:hover {
|
|
1052
|
+
--tw-bg-opacity: 1;
|
|
1053
|
+
background-color: rgb(0 208 201 / var(--tw-bg-opacity));
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
.hover\:text-gray-700:hover {
|
|
1057
|
+
--tw-text-opacity: 1;
|
|
1058
|
+
color: rgb(55 65 81 / var(--tw-text-opacity));
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
.focus\:z-10:focus {
|
|
1062
|
+
z-index: 10;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
801
1065
|
.focus-visible\:outline:focus-visible {
|
|
802
1066
|
outline-style: solid;
|
|
803
1067
|
}
|
|
@@ -814,14 +1078,30 @@ video {
|
|
|
814
1078
|
outline-color: #16a34a;
|
|
815
1079
|
}
|
|
816
1080
|
|
|
817
|
-
.focus-visible\:outline-puerto-rico-600:focus-visible {
|
|
818
|
-
outline-color: #00a491;
|
|
819
|
-
}
|
|
820
|
-
|
|
821
1081
|
.focus-visible\:outline-red-600:focus-visible {
|
|
822
1082
|
outline-color: #dc2626;
|
|
823
1083
|
}
|
|
824
1084
|
|
|
825
1085
|
.focus-visible\:outline-slate-600:focus-visible {
|
|
826
1086
|
outline-color: #475569;
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
.focus-visible\:outline-teal-600:focus-visible {
|
|
1090
|
+
outline-color: #00a8a5;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
@media (min-width: 640px) {
|
|
1094
|
+
.sm\:ml-6 {
|
|
1095
|
+
margin-left: 1.5rem;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
.sm\:flex {
|
|
1099
|
+
display: flex;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
.sm\:space-x-8 > :not([hidden]) ~ :not([hidden]) {
|
|
1103
|
+
--tw-space-x-reverse: 0;
|
|
1104
|
+
margin-right: calc(2rem * var(--tw-space-x-reverse));
|
|
1105
|
+
margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse)));
|
|
1106
|
+
}
|
|
827
1107
|
}
|
package/frontend/src/api.js
CHANGED
|
@@ -19,10 +19,24 @@ if (typeof config__setAuthorizationHeaderFrom === 'string' && config__setAuthori
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
if (config__isLambda) {
|
|
22
|
+
exports.Dashboard = {
|
|
23
|
+
getDashboard(params) {
|
|
24
|
+
return client.post('', { action: 'Dashboard.getDashboard', ...params }).then(res => res.data);
|
|
25
|
+
},
|
|
26
|
+
getDashboards(params) {
|
|
27
|
+
return client.post('', { action: 'Dashboard.getDashboards', ...params }).then(res => res.data);
|
|
28
|
+
},
|
|
29
|
+
updateDashboard(params) {
|
|
30
|
+
return client.post('', { action: 'Dashboard.updateDashboard', ...params}).then(res => res.data);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
22
33
|
exports.Model = {
|
|
23
34
|
createChart(params) {
|
|
24
35
|
return client.post('', { action: 'Model.createChart', ...params}).then(res => res.data);
|
|
25
36
|
},
|
|
37
|
+
createDocument(params) {
|
|
38
|
+
return client.post('', { action: 'Model.createDocument', ...params}).then(res => res.data);
|
|
39
|
+
},
|
|
26
40
|
deleteDocument(params) {
|
|
27
41
|
return client.post('', { action: 'Model.deleteDocument', ...params}).then(res => res.data);
|
|
28
42
|
},
|
|
@@ -43,10 +57,24 @@ if (config__isLambda) {
|
|
|
43
57
|
}
|
|
44
58
|
};
|
|
45
59
|
} else {
|
|
60
|
+
exports.Dashboard = {
|
|
61
|
+
getDashboard: function getDashboard(params) {
|
|
62
|
+
return client.get('/Dashboard/getDashboard', params).then(res => res.data);
|
|
63
|
+
},
|
|
64
|
+
getDashboards: function getDashboards(params) {
|
|
65
|
+
return client.get('/Dashboard/getDashboards', params).then(res => res.data);
|
|
66
|
+
},
|
|
67
|
+
updateDashboard: function updateDashboard(params) {
|
|
68
|
+
return client.post('/Dashboard/updateDashboard', params).then(res => res.data);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
46
71
|
exports.Model = {
|
|
47
72
|
createChart: function (params) {
|
|
48
73
|
return client.post('/Model/createChart', params).then(res => res.data);
|
|
49
74
|
},
|
|
75
|
+
createDocument: function(params) {
|
|
76
|
+
return client.post('/Model/createDocument', params).then(res => res.data);
|
|
77
|
+
},
|
|
50
78
|
deleteDocument: function (params) {
|
|
51
79
|
return client.post('/Model/deleteDocument', params).then(res => res.data);
|
|
52
80
|
},
|
|
File without changes
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<div class="mb-2">
|
|
3
|
+
<textarea class="border border-gray-200 p-2 h-[300px] w-full" ref="codeEditor"></textarea>
|
|
4
|
+
</div>
|
|
5
|
+
<button @click="createDocument()" class="rounded-md bg-teal-600 px-2.5 py-1.5 text-sm font-semibold text-white shadow-sm hover:bg-teal-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-teal-600">Submit</button>
|
|
6
|
+
<div v-if="errors.length > 0" class="rounded-md bg-red-50 p-4 mt-1">
|
|
7
|
+
<div class="flex">
|
|
8
|
+
<div class="flex-shrink-0">
|
|
9
|
+
<svg class="h-5 w-5 text-red-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
|
10
|
+
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z" clip-rule="evenodd" />
|
|
11
|
+
</svg>
|
|
12
|
+
</div>
|
|
13
|
+
<div class="ml-3">
|
|
14
|
+
<h3 class="text-sm font-medium text-red-800">There were {{errors.length}} errors with your submission</h3>
|
|
15
|
+
<div class="mt-2 text-sm text-red-700">
|
|
16
|
+
<ul role="list" class="list-disc space-y-1 pl-5">
|
|
17
|
+
<li v-for="error in errors">
|
|
18
|
+
{{error}}
|
|
19
|
+
</li>
|
|
20
|
+
</ul>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const api = require('../api');
|
|
4
|
+
|
|
5
|
+
const { BSON, EJSON } = require('bson');
|
|
6
|
+
|
|
7
|
+
const ObjectId = new Proxy(BSON.ObjectId, {
|
|
8
|
+
apply (target, thisArg, argumentsList) {
|
|
9
|
+
return new target(...argumentsList);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const appendCSS = require('../appendCSS');
|
|
14
|
+
|
|
15
|
+
appendCSS(require('./create-document.css'));
|
|
16
|
+
|
|
17
|
+
const template = require('./create-document.html')
|
|
18
|
+
|
|
19
|
+
module.exports = app => app.component('create-document', {
|
|
20
|
+
props: ['currentModel', 'paths'],
|
|
21
|
+
template,
|
|
22
|
+
data: function() {
|
|
23
|
+
return {
|
|
24
|
+
documentData: '',
|
|
25
|
+
editor: null,
|
|
26
|
+
errors: []
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
methods: {
|
|
30
|
+
async createDocument() {
|
|
31
|
+
const data = EJSON.serialize(eval(`(${this.editor.getValue()})`));
|
|
32
|
+
const { doc } = await api.Model.createDocument({ model: this.currentModel, data }).catch(err => {
|
|
33
|
+
if (err.response?.data?.message) {
|
|
34
|
+
console.log(err.response.data);
|
|
35
|
+
const message = err.response.data.message.split(": ").slice(1).join(": ");
|
|
36
|
+
this.errors = message.split(',').map(error => {
|
|
37
|
+
return error.split(': ').slice(1).join(': ').trim();
|
|
38
|
+
})
|
|
39
|
+
throw new Error(err.response?.data?.message);
|
|
40
|
+
}
|
|
41
|
+
throw err;
|
|
42
|
+
});
|
|
43
|
+
this.errors.length = 0;
|
|
44
|
+
this.$emit('close', doc);
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
mounted: function() {
|
|
48
|
+
const requiredPaths = this.paths.filter(x => x.required);
|
|
49
|
+
this.documentData = `{\n`;
|
|
50
|
+
for (let i = 0; i < requiredPaths.length; i++) {
|
|
51
|
+
const isLast = i + 1 >= requiredPaths.length;
|
|
52
|
+
this.documentData += ` ${requiredPaths[i].path}: ${isLast ? '': ','}\n`
|
|
53
|
+
}
|
|
54
|
+
this.documentData += '}';
|
|
55
|
+
this.$refs.codeEditor.value = this.documentData;
|
|
56
|
+
this.editor = CodeMirror.fromTextArea(this.$refs.codeEditor, {
|
|
57
|
+
mode: 'javascript',
|
|
58
|
+
lineNumbers: true
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<div class="dashboard">
|
|
2
|
+
<div v-if="dashboard">
|
|
3
|
+
<div>
|
|
4
|
+
<h2>{{name}}</h2>
|
|
5
|
+
</div>
|
|
6
|
+
<div>
|
|
7
|
+
<pre>{{code}}</pre>
|
|
8
|
+
<button v-if="!showEditor" @click="toggleEditor" style="color: black;margin-right: 0.5em">Edit</button>
|
|
9
|
+
</div>
|
|
10
|
+
<div v-if="showEditor">
|
|
11
|
+
<edit-dashboard :dashboardId="dashboard._id" :code="code" @close="showEditor=false;" @update="updateCode"></edit-dashboard>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div v-if="!dashboard && status === 'loaded'">
|
|
15
|
+
No dashboard with the given id could be found.
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const api = require('../api');
|
|
4
|
+
const template = require('./dashboard.html');
|
|
5
|
+
|
|
6
|
+
module.exports = app => app.component('dashboard', {
|
|
7
|
+
template: template,
|
|
8
|
+
data: function() {
|
|
9
|
+
return {
|
|
10
|
+
status: 'loading',
|
|
11
|
+
code: '',
|
|
12
|
+
name: '',
|
|
13
|
+
showEditor: false,
|
|
14
|
+
dashboard: null
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
methods: {
|
|
18
|
+
toggleEditor() {
|
|
19
|
+
this.showEditor = !this.showEditor;
|
|
20
|
+
},
|
|
21
|
+
async updateCode(update) {
|
|
22
|
+
this.code = update;
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
mounted: async function() {
|
|
26
|
+
const dashboardId = this.$route.query.dashboardId;
|
|
27
|
+
const { dashboard } = await api.Dashboard.getDashboard({ params: { dashboardId: dashboardId } });
|
|
28
|
+
if (!dashboard) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
this.dashboard = dashboard;
|
|
32
|
+
this.name = this.dashboard.name;
|
|
33
|
+
this.code = this.dashboard.code;
|
|
34
|
+
this.status = 'loaded';
|
|
35
|
+
}
|
|
36
|
+
});
|