@mongoosejs/studio 0.0.21 → 0.0.22
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/getDashboards.js +10 -0
- package/backend/actions/Dashboard/index.js +3 -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 +5 -1
- package/frontend/public/app.js +30567 -467
- package/frontend/public/images/json.svg +2 -0
- package/frontend/public/images/table.svg +1 -0
- package/frontend/public/tw.css +197 -22
- package/frontend/src/api.js +16 -0
- package/frontend/src/create-document/create-document.css +0 -0
- package/frontend/src/create-document/create-document.html +6 -0
- package/frontend/src/create-document/create-document.js +75 -0
- package/frontend/src/dashboard/dashboard.html +8 -0
- package/frontend/src/dashboard/dashboard.js +22 -0
- package/frontend/src/dashboard-details/dashboard-details.html +8 -0
- package/frontend/src/dashboard-details/dashboard-details.js +10 -0
- package/frontend/src/document/document.html +2 -1
- package/frontend/src/document/document.js +3 -1
- package/frontend/src/edit-date/edit-date.html +18 -1
- package/frontend/src/edit-date/edit-date.js +12 -0
- package/frontend/src/index.js +4 -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 -6
- package/frontend/src/models/models.html +42 -10
- package/frontend/src/models/models.js +26 -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 +5 -0
- package/package.json +7 -2
- package/tailwind.config.js +27 -1
|
@@ -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>
|
package/frontend/public/tw.css
CHANGED
|
@@ -578,6 +578,22 @@ video {
|
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
580
|
|
|
581
|
+
.relative {
|
|
582
|
+
position: relative;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
.isolate {
|
|
586
|
+
isolation: isolate;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.m-0 {
|
|
590
|
+
margin: 0px;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
.-ml-px {
|
|
594
|
+
margin-left: -1px;
|
|
595
|
+
}
|
|
596
|
+
|
|
581
597
|
.mb-1 {
|
|
582
598
|
margin-bottom: 0.25rem;
|
|
583
599
|
}
|
|
@@ -586,10 +602,6 @@ video {
|
|
|
586
602
|
margin-bottom: 0.5rem;
|
|
587
603
|
}
|
|
588
604
|
|
|
589
|
-
.mr-2 {
|
|
590
|
-
margin-right: 0.5rem;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
605
|
.mt-4 {
|
|
594
606
|
margin-top: 1rem;
|
|
595
607
|
}
|
|
@@ -606,26 +618,62 @@ video {
|
|
|
606
618
|
display: flex;
|
|
607
619
|
}
|
|
608
620
|
|
|
621
|
+
.inline-flex {
|
|
622
|
+
display: inline-flex;
|
|
623
|
+
}
|
|
624
|
+
|
|
609
625
|
.table {
|
|
610
626
|
display: table;
|
|
611
627
|
}
|
|
612
628
|
|
|
629
|
+
.h-5 {
|
|
630
|
+
height: 1.25rem;
|
|
631
|
+
}
|
|
632
|
+
|
|
613
633
|
.h-\[calc\(100vh-55px\)\] {
|
|
614
634
|
height: calc(100vh - 55px);
|
|
615
635
|
}
|
|
616
636
|
|
|
637
|
+
.h-full {
|
|
638
|
+
height: 100%;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
.w-5 {
|
|
642
|
+
width: 1.25rem;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
.w-full {
|
|
646
|
+
width: 100%;
|
|
647
|
+
}
|
|
648
|
+
|
|
617
649
|
.flex-1 {
|
|
618
650
|
flex: 1 1 0%;
|
|
619
651
|
}
|
|
620
652
|
|
|
653
|
+
.flex-grow {
|
|
654
|
+
flex-grow: 1;
|
|
655
|
+
}
|
|
656
|
+
|
|
621
657
|
.grow {
|
|
622
658
|
flex-grow: 1;
|
|
623
659
|
}
|
|
624
660
|
|
|
661
|
+
.flex-row {
|
|
662
|
+
flex-direction: row;
|
|
663
|
+
}
|
|
664
|
+
|
|
625
665
|
.flex-col {
|
|
626
666
|
flex-direction: column;
|
|
627
667
|
}
|
|
628
668
|
|
|
669
|
+
.items-center {
|
|
670
|
+
align-items: center;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
.gap-2 {
|
|
674
|
+
gap: 0.5rem;
|
|
675
|
+
}
|
|
676
|
+
|
|
629
677
|
.gap-y-5 {
|
|
630
678
|
row-gap: 1.25rem;
|
|
631
679
|
}
|
|
@@ -646,6 +694,28 @@ video {
|
|
|
646
694
|
border-radius: 0.375rem;
|
|
647
695
|
}
|
|
648
696
|
|
|
697
|
+
.rounded-none {
|
|
698
|
+
border-radius: 0px;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
.rounded-l-md {
|
|
702
|
+
border-top-left-radius: 0.375rem;
|
|
703
|
+
border-bottom-left-radius: 0.375rem;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
.rounded-r-md {
|
|
707
|
+
border-top-right-radius: 0.375rem;
|
|
708
|
+
border-bottom-right-radius: 0.375rem;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
.border {
|
|
712
|
+
border-width: 1px;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
.border-b-2 {
|
|
716
|
+
border-bottom-width: 2px;
|
|
717
|
+
}
|
|
718
|
+
|
|
649
719
|
.border-r {
|
|
650
720
|
border-right-width: 1px;
|
|
651
721
|
}
|
|
@@ -655,19 +725,23 @@ video {
|
|
|
655
725
|
border-color: rgb(229 231 235 / var(--tw-border-opacity));
|
|
656
726
|
}
|
|
657
727
|
|
|
658
|
-
.
|
|
659
|
-
--tw-
|
|
660
|
-
|
|
728
|
+
.border-teal-500 {
|
|
729
|
+
--tw-border-opacity: 1;
|
|
730
|
+
border-color: rgb(0 208 201 / var(--tw-border-opacity));
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
.border-transparent {
|
|
734
|
+
border-color: transparent;
|
|
661
735
|
}
|
|
662
736
|
|
|
663
|
-
.bg-
|
|
737
|
+
.bg-gray-200 {
|
|
664
738
|
--tw-bg-opacity: 1;
|
|
665
|
-
background-color: rgb(
|
|
739
|
+
background-color: rgb(229 231 235 / var(--tw-bg-opacity));
|
|
666
740
|
}
|
|
667
741
|
|
|
668
|
-
.bg-
|
|
742
|
+
.bg-green-600 {
|
|
669
743
|
--tw-bg-opacity: 1;
|
|
670
|
-
background-color: rgb(
|
|
744
|
+
background-color: rgb(22 163 74 / var(--tw-bg-opacity));
|
|
671
745
|
}
|
|
672
746
|
|
|
673
747
|
.bg-red-600 {
|
|
@@ -685,6 +759,16 @@ video {
|
|
|
685
759
|
background-color: rgb(71 85 105 / var(--tw-bg-opacity));
|
|
686
760
|
}
|
|
687
761
|
|
|
762
|
+
.bg-teal-100 {
|
|
763
|
+
--tw-bg-opacity: 1;
|
|
764
|
+
background-color: rgb(197 255 250 / var(--tw-bg-opacity));
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
.bg-teal-600 {
|
|
768
|
+
--tw-bg-opacity: 1;
|
|
769
|
+
background-color: rgb(0 168 165 / var(--tw-bg-opacity));
|
|
770
|
+
}
|
|
771
|
+
|
|
688
772
|
.bg-white {
|
|
689
773
|
--tw-bg-opacity: 1;
|
|
690
774
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
|
@@ -694,6 +778,15 @@ video {
|
|
|
694
778
|
padding: 0.25rem;
|
|
695
779
|
}
|
|
696
780
|
|
|
781
|
+
.p-2 {
|
|
782
|
+
padding: 0.5rem;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.px-1 {
|
|
786
|
+
padding-left: 0.25rem;
|
|
787
|
+
padding-right: 0.25rem;
|
|
788
|
+
}
|
|
789
|
+
|
|
697
790
|
.px-2 {
|
|
698
791
|
padding-left: 0.5rem;
|
|
699
792
|
padding-right: 0.5rem;
|
|
@@ -727,6 +820,15 @@ video {
|
|
|
727
820
|
padding-right: 0.5rem;
|
|
728
821
|
}
|
|
729
822
|
|
|
823
|
+
.pt-1 {
|
|
824
|
+
padding-top: 0.25rem;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
.text-lg {
|
|
828
|
+
font-size: 1.125rem;
|
|
829
|
+
line-height: 1.75rem;
|
|
830
|
+
}
|
|
831
|
+
|
|
730
832
|
.text-sm {
|
|
731
833
|
font-size: 0.875rem;
|
|
732
834
|
line-height: 1.25rem;
|
|
@@ -736,15 +838,34 @@ video {
|
|
|
736
838
|
font-weight: 700;
|
|
737
839
|
}
|
|
738
840
|
|
|
841
|
+
.font-medium {
|
|
842
|
+
font-weight: 500;
|
|
843
|
+
}
|
|
844
|
+
|
|
739
845
|
.font-semibold {
|
|
740
846
|
font-weight: 600;
|
|
741
847
|
}
|
|
742
848
|
|
|
849
|
+
.text-gray-400 {
|
|
850
|
+
--tw-text-opacity: 1;
|
|
851
|
+
color: rgb(156 163 175 / var(--tw-text-opacity));
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
.text-gray-500 {
|
|
855
|
+
--tw-text-opacity: 1;
|
|
856
|
+
color: rgb(107 114 128 / var(--tw-text-opacity));
|
|
857
|
+
}
|
|
858
|
+
|
|
743
859
|
.text-gray-700 {
|
|
744
860
|
--tw-text-opacity: 1;
|
|
745
861
|
color: rgb(55 65 81 / var(--tw-text-opacity));
|
|
746
862
|
}
|
|
747
863
|
|
|
864
|
+
.text-gray-900 {
|
|
865
|
+
--tw-text-opacity: 1;
|
|
866
|
+
color: rgb(17 24 39 / var(--tw-text-opacity));
|
|
867
|
+
}
|
|
868
|
+
|
|
748
869
|
.text-sky-800 {
|
|
749
870
|
--tw-text-opacity: 1;
|
|
750
871
|
color: rgb(7 89 133 / var(--tw-text-opacity));
|
|
@@ -761,6 +882,25 @@ video {
|
|
|
761
882
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
762
883
|
}
|
|
763
884
|
|
|
885
|
+
.outline-gray-300 {
|
|
886
|
+
outline-color: #d1d5db;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
.ring-1 {
|
|
890
|
+
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
891
|
+
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
892
|
+
box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
.ring-inset {
|
|
896
|
+
--tw-ring-inset: inset;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
.ring-gray-300 {
|
|
900
|
+
--tw-ring-opacity: 1;
|
|
901
|
+
--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity));
|
|
902
|
+
}
|
|
903
|
+
|
|
764
904
|
.filter {
|
|
765
905
|
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
906
|
}
|
|
@@ -773,19 +913,19 @@ video {
|
|
|
773
913
|
transition-duration: 150ms;
|
|
774
914
|
}
|
|
775
915
|
|
|
776
|
-
.hover\:
|
|
777
|
-
--tw-
|
|
778
|
-
|
|
916
|
+
.hover\:border-gray-300:hover {
|
|
917
|
+
--tw-border-opacity: 1;
|
|
918
|
+
border-color: rgb(209 213 219 / var(--tw-border-opacity));
|
|
779
919
|
}
|
|
780
920
|
|
|
781
|
-
.hover\:bg-
|
|
921
|
+
.hover\:bg-gray-50:hover {
|
|
782
922
|
--tw-bg-opacity: 1;
|
|
783
|
-
background-color: rgb(
|
|
923
|
+
background-color: rgb(249 250 251 / var(--tw-bg-opacity));
|
|
784
924
|
}
|
|
785
925
|
|
|
786
|
-
.hover\:bg-
|
|
926
|
+
.hover\:bg-green-500:hover {
|
|
787
927
|
--tw-bg-opacity: 1;
|
|
788
|
-
background-color: rgb(
|
|
928
|
+
background-color: rgb(34 197 94 / var(--tw-bg-opacity));
|
|
789
929
|
}
|
|
790
930
|
|
|
791
931
|
.hover\:bg-red-500:hover {
|
|
@@ -798,6 +938,25 @@ video {
|
|
|
798
938
|
background-color: rgb(100 116 139 / var(--tw-bg-opacity));
|
|
799
939
|
}
|
|
800
940
|
|
|
941
|
+
.hover\:bg-teal-100:hover {
|
|
942
|
+
--tw-bg-opacity: 1;
|
|
943
|
+
background-color: rgb(197 255 250 / var(--tw-bg-opacity));
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
.hover\:bg-teal-500:hover {
|
|
947
|
+
--tw-bg-opacity: 1;
|
|
948
|
+
background-color: rgb(0 208 201 / var(--tw-bg-opacity));
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
.hover\:text-gray-700:hover {
|
|
952
|
+
--tw-text-opacity: 1;
|
|
953
|
+
color: rgb(55 65 81 / var(--tw-text-opacity));
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
.focus\:z-10:focus {
|
|
957
|
+
z-index: 10;
|
|
958
|
+
}
|
|
959
|
+
|
|
801
960
|
.focus-visible\:outline:focus-visible {
|
|
802
961
|
outline-style: solid;
|
|
803
962
|
}
|
|
@@ -814,14 +973,30 @@ video {
|
|
|
814
973
|
outline-color: #16a34a;
|
|
815
974
|
}
|
|
816
975
|
|
|
817
|
-
.focus-visible\:outline-puerto-rico-600:focus-visible {
|
|
818
|
-
outline-color: #00a491;
|
|
819
|
-
}
|
|
820
|
-
|
|
821
976
|
.focus-visible\:outline-red-600:focus-visible {
|
|
822
977
|
outline-color: #dc2626;
|
|
823
978
|
}
|
|
824
979
|
|
|
825
980
|
.focus-visible\:outline-slate-600:focus-visible {
|
|
826
981
|
outline-color: #475569;
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
.focus-visible\:outline-teal-600:focus-visible {
|
|
985
|
+
outline-color: #00a8a5;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
@media (min-width: 640px) {
|
|
989
|
+
.sm\:ml-6 {
|
|
990
|
+
margin-left: 1.5rem;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
.sm\:flex {
|
|
994
|
+
display: flex;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
.sm\:space-x-8 > :not([hidden]) ~ :not([hidden]) {
|
|
998
|
+
--tw-space-x-reverse: 0;
|
|
999
|
+
margin-right: calc(2rem * var(--tw-space-x-reverse));
|
|
1000
|
+
margin-left: calc(2rem * calc(1 - var(--tw-space-x-reverse)));
|
|
1001
|
+
}
|
|
827
1002
|
}
|
package/frontend/src/api.js
CHANGED
|
@@ -19,10 +19,18 @@ if (typeof config__setAuthorizationHeaderFrom === 'string' && config__setAuthori
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
if (config__isLambda) {
|
|
22
|
+
exports.Dashboard = {
|
|
23
|
+
getDashboards(params) {
|
|
24
|
+
return client.post('', { action: 'Dashboard.getDashboards', ...params }).then(res => res.data);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
22
27
|
exports.Model = {
|
|
23
28
|
createChart(params) {
|
|
24
29
|
return client.post('', { action: 'Model.createChart', ...params}).then(res => res.data);
|
|
25
30
|
},
|
|
31
|
+
createDocument(params) {
|
|
32
|
+
return client.post('', { action: 'Model.createDocument', ...params}).then(res => res.data);
|
|
33
|
+
},
|
|
26
34
|
deleteDocument(params) {
|
|
27
35
|
return client.post('', { action: 'Model.deleteDocument', ...params}).then(res => res.data);
|
|
28
36
|
},
|
|
@@ -43,10 +51,18 @@ if (config__isLambda) {
|
|
|
43
51
|
}
|
|
44
52
|
};
|
|
45
53
|
} else {
|
|
54
|
+
exports.Dashboard = {
|
|
55
|
+
getDashboards: function getDashboards(params) {
|
|
56
|
+
return client.get('/Dashboard/getDashboards', params).then(res => res.data);
|
|
57
|
+
},
|
|
58
|
+
}
|
|
46
59
|
exports.Model = {
|
|
47
60
|
createChart: function (params) {
|
|
48
61
|
return client.post('/Model/createChart', params).then(res => res.data);
|
|
49
62
|
},
|
|
63
|
+
createDocument: function(params) {
|
|
64
|
+
return client.post('/Model/createDocument', params).then(res => res.data);
|
|
65
|
+
},
|
|
50
66
|
deleteDocument: function (params) {
|
|
51
67
|
return client.post('/Model/deleteDocument', params).then(res => res.data);
|
|
52
68
|
},
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<div class="mb-2">
|
|
3
|
+
<textarea class="border border-gray-200 p-2" ref="codeEditor" v-model="documentData"></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>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const api = require('../api');
|
|
4
|
+
const { EditorState } = require('@codemirror/state');
|
|
5
|
+
const { lineNumbers } = require('@codemirror/view')
|
|
6
|
+
const { EditorView, basicSetup } = require('codemirror');
|
|
7
|
+
const { javascript } = require('@codemirror/lang-javascript');
|
|
8
|
+
|
|
9
|
+
const { BSON, EJSON } = require('bson');
|
|
10
|
+
|
|
11
|
+
const ObjectId = new Proxy(BSON.ObjectId, {
|
|
12
|
+
apply (target, thisArg, argumentsList) {
|
|
13
|
+
return new target(...argumentsList);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const appendCSS = require('../appendCSS');
|
|
18
|
+
|
|
19
|
+
appendCSS(require('./create-document.css'));
|
|
20
|
+
|
|
21
|
+
const template = require('./create-document.html')
|
|
22
|
+
|
|
23
|
+
module.exports = app => app.component('create-document', {
|
|
24
|
+
props: ['currentModel', 'paths'],
|
|
25
|
+
template,
|
|
26
|
+
data: function() {
|
|
27
|
+
return {
|
|
28
|
+
documentData: '',
|
|
29
|
+
editor: null
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
methods: {
|
|
33
|
+
async createDocument() {
|
|
34
|
+
const data = EJSON.serialize(eval(`(${this.documentData})`));
|
|
35
|
+
const { doc } = await api.Model.createDocument({ model: this.currentModel, data }).catch(err => {
|
|
36
|
+
if (err.response?.data?.message) {
|
|
37
|
+
throw new Error(err.response?.data?.message);
|
|
38
|
+
}
|
|
39
|
+
throw err;
|
|
40
|
+
});
|
|
41
|
+
this.$emit('close', doc);
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
mounted: function() {
|
|
45
|
+
console.log(this.currentModel, this.paths);
|
|
46
|
+
const requiredPaths = this.paths.filter(x => x.required);
|
|
47
|
+
this.documentData = `{\n`;
|
|
48
|
+
for (let i = 0; i < requiredPaths.length; i++) {
|
|
49
|
+
const isLast = i + 1 >= requiredPaths.length;
|
|
50
|
+
this.documentData += ` ${requiredPaths[i].path}: ${isLast ? '': ','}\n`
|
|
51
|
+
}
|
|
52
|
+
this.documentData += '}';
|
|
53
|
+
|
|
54
|
+
this.editor = new EditorView({
|
|
55
|
+
state: EditorState.create({
|
|
56
|
+
doc: this.documentData,
|
|
57
|
+
extensions: [
|
|
58
|
+
basicSetup,
|
|
59
|
+
javascript(),
|
|
60
|
+
// history(),
|
|
61
|
+
EditorView.updateListener.of((v) => {
|
|
62
|
+
// Your update logic here
|
|
63
|
+
}),
|
|
64
|
+
// keymap.of(historyKeymap)
|
|
65
|
+
]
|
|
66
|
+
}),
|
|
67
|
+
parent: this.$refs.codeEditor
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
beforeDestroy() {
|
|
71
|
+
if (this.editor) {
|
|
72
|
+
this.editor.toTextArea();
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
})
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const api = require('../api');
|
|
4
|
+
const template = require('./dashboard.html');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
module.exports = app => app.component('dashboard', {
|
|
8
|
+
template: template,
|
|
9
|
+
data: () => ({
|
|
10
|
+
dashboards: [],
|
|
11
|
+
dashboard: null
|
|
12
|
+
}),
|
|
13
|
+
async mounted() {
|
|
14
|
+
const { dashboards } = await api.Dashboard.getDashboards();
|
|
15
|
+
this.dashboards = dashboards;
|
|
16
|
+
if (!this.$route.query.dashboardId) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
this.dashboard = dashboards.find(x => x._id.toString() == this.$route.query.dashboardId);
|
|
20
|
+
this.status = 'loaded';
|
|
21
|
+
},
|
|
22
|
+
});
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
v-if="!editting"
|
|
12
12
|
@click="editting = true"
|
|
13
13
|
type="button"
|
|
14
|
-
class="rounded-md bg-
|
|
14
|
+
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">
|
|
15
15
|
<img src="images/edit.svg" class="inline" /> Edit
|
|
16
16
|
</button>
|
|
17
17
|
<button
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
<span class="path-type">
|
|
44
44
|
({{(path.instance || 'unknown').toLowerCase()}})
|
|
45
45
|
</span>
|
|
46
|
+
|
|
46
47
|
</div>
|
|
47
48
|
<div v-if="editting && path.path !== '_id'">
|
|
48
49
|
<component
|
|
@@ -18,10 +18,12 @@ module.exports = app => app.component('document', {
|
|
|
18
18
|
document: null,
|
|
19
19
|
changes: {},
|
|
20
20
|
editting: false,
|
|
21
|
-
virtuals: []
|
|
21
|
+
virtuals: [],
|
|
22
22
|
}),
|
|
23
23
|
async mounted() {
|
|
24
|
+
window.pageState = this;
|
|
24
25
|
const { doc, schemaPaths } = await api.Model.getDocument({ model: this.model, documentId: this.documentId });
|
|
26
|
+
window.doc = doc;
|
|
25
27
|
this.document = doc;
|
|
26
28
|
this.schemaPaths = await Object.keys(schemaPaths).sort((k1, k2) => {
|
|
27
29
|
if (k1 === '_id' && k2 !== '_id') {
|
|
@@ -1,3 +1,20 @@
|
|
|
1
1
|
<div>
|
|
2
|
-
<
|
|
2
|
+
<div class="flex mb-[-1px] w-64 justify-end">
|
|
3
|
+
<button
|
|
4
|
+
@click="inputType = 'picker'"
|
|
5
|
+
type="button"
|
|
6
|
+
class="relative inline-flex items-center rounded-none p-1 rounded-tl-md text-sm text-gray-800 ring-1 ring-inset ring-gray-300 hover:bg-gray-200 focus:z-10"
|
|
7
|
+
:class="inputType === 'picker' ? 'bg-gray-200' : 'bg-white'">
|
|
8
|
+
Date Picker
|
|
9
|
+
</button>
|
|
10
|
+
<button
|
|
11
|
+
@click="inputType = 'iso'"
|
|
12
|
+
type="button"
|
|
13
|
+
class="relative -ml-px inline-flex items-center p-1 rounded-none rounded-tr-md text-sm text-gray-800 ring-1 ring-inset ring-gray-300 hover:bg-gray-200 focus:z-10"
|
|
14
|
+
:class="inputType === 'iso' ? 'bg-gray-200' : 'bg-white'">
|
|
15
|
+
ISO String Input
|
|
16
|
+
</button>
|
|
17
|
+
</div>
|
|
18
|
+
<input v-if="inputType == 'picker'" class="w-64 h-8 border border-gray-300 outline-0" type="datetime-local" :value="valueAsLocalString" @input="$emit('input', $event.target.value)">
|
|
19
|
+
<input v-if="inputType == 'iso'" type="text" class="w-64 h-8 border border-gray-300 outline-0" :value="valueAsISOString" @input="$emit('input', $event.target.value)">
|
|
3
20
|
</div>
|
|
@@ -6,6 +6,11 @@ module.exports = app => app.component('edit-date', {
|
|
|
6
6
|
template: template,
|
|
7
7
|
props: ['value'],
|
|
8
8
|
emits: ['input'],
|
|
9
|
+
data: function() {
|
|
10
|
+
return {
|
|
11
|
+
inputType: 'picker' // picker, iso
|
|
12
|
+
}
|
|
13
|
+
},
|
|
9
14
|
computed: {
|
|
10
15
|
valueAsLocalString() {
|
|
11
16
|
if (this.value == null) {
|
|
@@ -23,6 +28,13 @@ module.exports = app => app.component('edit-date', {
|
|
|
23
28
|
':',
|
|
24
29
|
date.getMinutes().toString().padStart(2, '0')
|
|
25
30
|
].join('');
|
|
31
|
+
},
|
|
32
|
+
valueAsISOString() {
|
|
33
|
+
if (this.value == null) {
|
|
34
|
+
return this.value;
|
|
35
|
+
}
|
|
36
|
+
const date = new Date(this.value);
|
|
37
|
+
return date.toISOString();
|
|
26
38
|
}
|
|
27
39
|
}
|
|
28
40
|
});
|
package/frontend/src/index.js
CHANGED
|
@@ -8,6 +8,9 @@ const app = Vue.createApp({
|
|
|
8
8
|
|
|
9
9
|
require('./async-button/async-button')(app);
|
|
10
10
|
require('./charts/charts')(app);
|
|
11
|
+
require('./create-document/create-document')(app);
|
|
12
|
+
require('./dashboard/dashboard')(app);
|
|
13
|
+
require('./dashboard-details/dashboard-details')(app);
|
|
11
14
|
require('./detail-array/detail-array')(app);
|
|
12
15
|
require('./detail-default/detail-default')(app);
|
|
13
16
|
require('./document/document')(app);
|
|
@@ -18,6 +21,7 @@ require('./edit-date/edit-date')(app);
|
|
|
18
21
|
require('./export-query-results/export-query-results')(app);
|
|
19
22
|
require('./list-array/list-array')(app);
|
|
20
23
|
require('./list-default/list-default')(app);
|
|
24
|
+
require('./list-json/list-json')(app)
|
|
21
25
|
require('./list-mixed/list-mixed')(app);
|
|
22
26
|
require('./list-string/list-string')(app);
|
|
23
27
|
require('./list-subdocument/list-subdocument')(app);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const api = require('../api');
|
|
4
|
+
const template = require('./list-json.html');
|
|
5
|
+
|
|
6
|
+
const vanillatoast = require('vanillatoasts');
|
|
7
|
+
|
|
8
|
+
require('../appendCSS')(require('./list-json.css'));
|
|
9
|
+
|
|
10
|
+
module.exports = app => app.component('list-json', {
|
|
11
|
+
template: template,
|
|
12
|
+
props: ['value'],
|
|
13
|
+
computed: {
|
|
14
|
+
shortenValue() {
|
|
15
|
+
return JSON.stringify(this.value, null, 4);
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
methods: {
|
|
19
|
+
copyText(value) {
|
|
20
|
+
const storage = document.createElement('textarea');
|
|
21
|
+
storage.value = JSON.stringify(value);
|
|
22
|
+
const elem = this.$refs.JSONCode;
|
|
23
|
+
elem.appendChild(storage);
|
|
24
|
+
storage.select();
|
|
25
|
+
storage.setSelectionRange(0, 99999);
|
|
26
|
+
document.execCommand('copy');
|
|
27
|
+
elem.removeChild(storage);
|
|
28
|
+
vanillatoast.create({
|
|
29
|
+
title: 'Text copied!',
|
|
30
|
+
type: 'success',
|
|
31
|
+
timeout: 3000,
|
|
32
|
+
icon: 'images/success.png',
|
|
33
|
+
positionClass: 'bottomRight'
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
mounted: function() {
|
|
38
|
+
Prism.highlightElement(this.$refs.JSONCode);
|
|
39
|
+
}
|
|
40
|
+
});
|