@appscode/design-system 2.17.25 → 2.17.26-alpha-1
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/main.scss +4 -1
- package/package.json +1 -1
- package/vue-components/styles/base/utilities/_global.scss +8 -0
- package/vue-components/styles/base/utilities/_typography.scss +5 -0
- package/vue-components/styles/components/_ac-duration.scss +50 -0
- package/vue-components/styles/components/_file-explore.scss +31 -0
- package/vue-components/styles/components/_time-picker.scss +140 -0
- package/vue-components/styles/components/cards/_all.scss +1 -1
- package/vue-components/styles/components/cards/_cards-group.scss +26 -0
- package/vue-components/styles/components/form-fields/_input-card.scss +3 -1
- package/vue-components/styles/components/form-fields/_input.scss +65 -2
- package/vue-components/v3/alert/AlertLinked.vue +32 -0
- package/vue-components/v3/cards/UsageTableCard.vue +56 -4
- package/vue-components/v3/cards/UsageTableCardTwo.vue +162 -0
- package/vue-components/v3/config-secret/ConfigSecret.vue +61 -0
- package/vue-components/v3/editor/Editor.vue +3 -4
- package/vue-components/v3/form-fields/AcSingleInput.vue +20 -0
- package/vue-components/v3/form-fields/CheckRadio.vue +3 -1
- package/vue-components/v3/icons/ArrowDownLongIcon.vue +8 -0
- package/vue-components/v3/icons/ArrowRightIcon.vue +14 -0
- package/vue-components/v3/icons/BillableInfo.vue +13 -0
- package/vue-components/v3/icons/InfoLightIcon.vue +15 -0
- package/vue-components/v3/icons/MachineCpuIcon.vue +8 -0
- package/vue-components/v3/icons/MachineMemoryIcon.vue +8 -0
- package/vue-components/v3/icons/StorageIcon-2.vue +14 -0
- package/vue-components/v3/navbar/Appdrawer.vue +1 -1
- package/vue-components/v3/node-selection/NodeSelection.vue +82 -0
- package/vue-components/v3/postgres/Postgres.vue +33 -0
- package/vue-components/v3/replica-set/MachineProfile.vue +119 -0
- package/vue-components/v3/replica-set/MultiMachineProfile.vue +100 -0
- package/vue-components/v3/replica-set/UpgradeSet.vue +40 -0
- package/vue-components/v3/scaling-rules/ScalingRules.vue +93 -0
- package/vue-components/v3/section/SectionContent.vue +1 -1
- package/vue-components/v3/threshold/UsageThreshold.vue +24 -0
- package/vue-components/v3/time/AcDuration.vue +167 -0
- package/vue-components/v3/time/AcDurationNew.vue +235 -0
package/main.scss
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
// @import "@/components/vue-components/styles/components/all";
|
|
18
18
|
@import "@/components/vue-components/styles/components/button";
|
|
19
19
|
@import "@/components/vue-components/styles/components/table";
|
|
20
|
+
@import "@/components/vue-components/styles/components/tabs";
|
|
20
21
|
@import "@/components/vue-components/styles/components/avatar";
|
|
21
22
|
@import "@/components/vue-components/styles/components/terminal";
|
|
22
23
|
@import "@/components/vue-components/styles/components/steps";
|
|
@@ -30,6 +31,8 @@
|
|
|
30
31
|
@import "@/components/vue-components/styles/components/dropdown";
|
|
31
32
|
@import "@/components/vue-components/styles/components/badge-tags";
|
|
32
33
|
@import "@/components/vue-components/styles/components/platform-design";
|
|
33
|
-
@import "@/components/vue-components/styles/components/cards/
|
|
34
|
+
@import "@/components/vue-components/styles/components/cards/cards-group";
|
|
35
|
+
@import "@/components/vue-components/styles/components/file-explore";
|
|
36
|
+
@import "@/components/vue-components/styles/components/ac-duration";
|
|
34
37
|
|
|
35
38
|
// @import "@/components/vue-components/styles/theme/appscode.scss";
|
package/package.json
CHANGED
|
@@ -690,3 +690,11 @@ $whitespace-values: normal, nowrap, pre, pre-line, pre-wrap, break-spaces;
|
|
|
690
690
|
.is-no-underlined {
|
|
691
691
|
text-decoration: none !important;
|
|
692
692
|
}
|
|
693
|
+
|
|
694
|
+
.container-sm {
|
|
695
|
+
max-width: 1080px;
|
|
696
|
+
margin: 0 auto;
|
|
697
|
+
&.is-fullwidth {
|
|
698
|
+
max-width: 100%;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
.ac-duration-wrapper {
|
|
2
|
+
position: relative;
|
|
3
|
+
z-index: 1;
|
|
4
|
+
.ac-duration {
|
|
5
|
+
position: absolute;
|
|
6
|
+
bottom: 30px;
|
|
7
|
+
left: 0;
|
|
8
|
+
z-index: 999;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
.ac-duration {
|
|
12
|
+
height: 261px;
|
|
13
|
+
display: inline-flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
text-align: center;
|
|
16
|
+
box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.15);
|
|
17
|
+
border: 1px solid $color-border;
|
|
18
|
+
background-color: #fff;
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
border-radius: 4px;
|
|
21
|
+
.duration {
|
|
22
|
+
padding: 8px 16px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.duration-header {
|
|
26
|
+
background-color: $secondary-light-gray;
|
|
27
|
+
padding: 8px;
|
|
28
|
+
}
|
|
29
|
+
.duration-body {
|
|
30
|
+
ul {
|
|
31
|
+
li {
|
|
32
|
+
padding: 6px;
|
|
33
|
+
// color: $color-border-dark;
|
|
34
|
+
cursor: all-scroll;
|
|
35
|
+
user-select: none;
|
|
36
|
+
}
|
|
37
|
+
max-height: 150px;
|
|
38
|
+
overflow-y: auto;
|
|
39
|
+
&::-webkit-scrollbar {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
.duration-footer {
|
|
45
|
+
display: flex;
|
|
46
|
+
justify-content: end;
|
|
47
|
+
padding: 4px;
|
|
48
|
+
border-top: 1px solid $color-border;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.file-explore {
|
|
2
|
+
.content-sidebar {
|
|
3
|
+
width: 220px;
|
|
4
|
+
border: 1px solid $color-border;
|
|
5
|
+
padding: 8px;
|
|
6
|
+
min-height: 400px;
|
|
7
|
+
border-radius: 4px;
|
|
8
|
+
|
|
9
|
+
li {
|
|
10
|
+
a {
|
|
11
|
+
display: flex;
|
|
12
|
+
color: $color-text;
|
|
13
|
+
padding: 4px 8px;
|
|
14
|
+
border-radius: 4px;
|
|
15
|
+
&:hover {
|
|
16
|
+
color: $color-heading;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
&.is-active {
|
|
20
|
+
a {
|
|
21
|
+
color: $color-heading;
|
|
22
|
+
background-color: $secondary-light-gray;
|
|
23
|
+
border: 1px solid $color-border;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
.right-content {
|
|
29
|
+
width: calc(100% - 200px);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/* ========== Variables ========== */
|
|
2
|
+
$cool-gray: #eff1f1;
|
|
3
|
+
$secondary-light-gray: #f7f9fa;
|
|
4
|
+
$scroll-highlight: darken($cool-gray, 10%);
|
|
5
|
+
|
|
6
|
+
/* ========== Mixins ========== */
|
|
7
|
+
@mixin hide-scrollbars {
|
|
8
|
+
-ms-overflow-style: none; // IE 10+
|
|
9
|
+
scrollbar-width: none; // Firefox
|
|
10
|
+
&::-webkit-scrollbar {
|
|
11
|
+
display: none;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* ========== Container ========== */
|
|
16
|
+
.picker-wrapper {
|
|
17
|
+
background: white;
|
|
18
|
+
box-shadow: 0 0.5vw 2vw -5px rgba(0, 0, 0, 0.2);
|
|
19
|
+
display: inline-flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
border-radius: 8px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* ========== Header ========== */
|
|
25
|
+
.duration-header {
|
|
26
|
+
background-color: $secondary-light-gray;
|
|
27
|
+
text-align: center;
|
|
28
|
+
height: 36px;
|
|
29
|
+
display: flex;
|
|
30
|
+
align-items: center;
|
|
31
|
+
justify-content: center;
|
|
32
|
+
|
|
33
|
+
h6 {
|
|
34
|
+
font-size: 13px;
|
|
35
|
+
margin: 0;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* ========== Title Labels ========== */
|
|
41
|
+
.d-title {
|
|
42
|
+
display: inline-grid;
|
|
43
|
+
grid-template-columns: repeat(3, fit-content(100px));
|
|
44
|
+
justify-content: end;
|
|
45
|
+
gap: 0.5em;
|
|
46
|
+
font-weight: bold;
|
|
47
|
+
font-size: 11px;
|
|
48
|
+
padding: 8px 1rem 0;
|
|
49
|
+
|
|
50
|
+
span {
|
|
51
|
+
width: 40px;
|
|
52
|
+
text-align: center;
|
|
53
|
+
margin-right: 1em;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* ========== Picker Section ========== */
|
|
58
|
+
.picker {
|
|
59
|
+
position: relative;
|
|
60
|
+
display: inline-grid;
|
|
61
|
+
grid-template-columns: repeat(3, fit-content(80px));
|
|
62
|
+
justify-content: end;
|
|
63
|
+
padding: 0 1rem;
|
|
64
|
+
font-size: 13px;
|
|
65
|
+
font-weight: 500;
|
|
66
|
+
font-feature-settings: "tnum";
|
|
67
|
+
|
|
68
|
+
&::before,
|
|
69
|
+
&::after {
|
|
70
|
+
content: "";
|
|
71
|
+
position: absolute;
|
|
72
|
+
width: 100%;
|
|
73
|
+
pointer-events: none;
|
|
74
|
+
z-index: 1;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&::before {
|
|
78
|
+
top: 0;
|
|
79
|
+
height: 50%;
|
|
80
|
+
background: linear-gradient(white, rgba(255, 255, 255, 0));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
&::after {
|
|
84
|
+
bottom: 0;
|
|
85
|
+
height: 50%;
|
|
86
|
+
background: linear-gradient(rgba(255, 255, 255, 0), white);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
ul {
|
|
90
|
+
@include hide-scrollbars();
|
|
91
|
+
max-height: 190px;
|
|
92
|
+
overflow-y: scroll;
|
|
93
|
+
padding: 1.5em 0;
|
|
94
|
+
margin-right: 1em;
|
|
95
|
+
scroll-snap-type: y mandatory;
|
|
96
|
+
scroll-behavior: smooth;
|
|
97
|
+
|
|
98
|
+
li {
|
|
99
|
+
scroll-snap-align: center;
|
|
100
|
+
height: 2.35em;
|
|
101
|
+
width: 40px;
|
|
102
|
+
text-align: center;
|
|
103
|
+
user-select: none;
|
|
104
|
+
cursor: pointer;
|
|
105
|
+
line-height: 2.35em;
|
|
106
|
+
border-radius: 4px;
|
|
107
|
+
|
|
108
|
+
&:hover {
|
|
109
|
+
background: #f0f0f0;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/* ========== Highlight Window ========== */
|
|
116
|
+
.picker-window {
|
|
117
|
+
position: absolute;
|
|
118
|
+
top: 50%;
|
|
119
|
+
left: 0;
|
|
120
|
+
width: 100%;
|
|
121
|
+
height: 2.4em;
|
|
122
|
+
transform: translateY(-52%);
|
|
123
|
+
border-top: 1px solid $scroll-highlight;
|
|
124
|
+
border-bottom: 1px solid $scroll-highlight;
|
|
125
|
+
pointer-events: none;
|
|
126
|
+
z-index: 2;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* ========== Footer Buttons ========== */
|
|
130
|
+
.duration-footer {
|
|
131
|
+
padding: 0 1rem 1rem;
|
|
132
|
+
display: flex;
|
|
133
|
+
justify-content: flex-end;
|
|
134
|
+
gap: 0.5rem;
|
|
135
|
+
|
|
136
|
+
.buttons {
|
|
137
|
+
display: flex;
|
|
138
|
+
gap: 0.5rem;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
.card-group {
|
|
2
|
+
background-color: #f4f5f6;
|
|
3
|
+
border: 1px solid $color-border;
|
|
4
|
+
border-radius: 8px;
|
|
5
|
+
position: relative;
|
|
6
|
+
z-index: 1;
|
|
7
|
+
.card-label {
|
|
8
|
+
position: absolute;
|
|
9
|
+
content: "";
|
|
10
|
+
left: 16px;
|
|
11
|
+
top: -10px;
|
|
12
|
+
&::after {
|
|
13
|
+
position: absolute;
|
|
14
|
+
content: "";
|
|
15
|
+
left: 0px;
|
|
16
|
+
top: 9px;
|
|
17
|
+
background-color: #fff;
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: 2px;
|
|
20
|
+
z-index: -1;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
.section-card {
|
|
24
|
+
background-color: #fff;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
.card-select {
|
|
3
3
|
min-height: 98px;
|
|
4
4
|
padding: 16px;
|
|
5
|
-
background-color: $
|
|
5
|
+
background-color: $secondary-light-gray;
|
|
6
6
|
border: 1px solid $color-border;
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
border-radius: 4px;
|
|
@@ -104,6 +104,8 @@
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
&.is-selected {
|
|
107
|
+
background-color: $primary-light-gray;
|
|
108
|
+
box-shadow: 0px 8px 50px rgba(0, 0, 0, 0.2);
|
|
107
109
|
&::after {
|
|
108
110
|
position: absolute;
|
|
109
111
|
content: "";
|
|
@@ -338,7 +338,30 @@
|
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
|
|
341
|
+
.up-down-btns {
|
|
342
|
+
position: absolute;
|
|
343
|
+
right: 1px;
|
|
344
|
+
top: 1px;
|
|
345
|
+
button {
|
|
346
|
+
background-color: #fff;
|
|
347
|
+
border: 1px solid $color-border;
|
|
348
|
+
height: 17px;
|
|
349
|
+
width: 32px;
|
|
350
|
+
display: flex;
|
|
351
|
+
align-items: center;
|
|
352
|
+
justify-content: center;
|
|
353
|
+
cursor: pointer;
|
|
354
|
+
&:hover {
|
|
355
|
+
border-color: $color-border-dark;
|
|
356
|
+
}
|
|
357
|
+
&.arrow-up {
|
|
358
|
+
border-radius: 4px 4px 0 0;
|
|
359
|
+
}
|
|
360
|
+
&.arrow-down {
|
|
361
|
+
border-radius: 0 0 4px 4px;
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
342
365
|
.ac-search-button {
|
|
343
366
|
background-color: transparent;
|
|
344
367
|
border: none;
|
|
@@ -494,7 +517,8 @@
|
|
|
494
517
|
padding: 0;
|
|
495
518
|
}
|
|
496
519
|
|
|
497
|
-
.ac-search:focus
|
|
520
|
+
.ac-search:focus,
|
|
521
|
+
.ac-search:not(:placeholder-shown) {
|
|
498
522
|
width: 200px !important;
|
|
499
523
|
padding-right: 10px;
|
|
500
524
|
}
|
|
@@ -578,3 +602,42 @@
|
|
|
578
602
|
}
|
|
579
603
|
}
|
|
580
604
|
}
|
|
605
|
+
// icon with input
|
|
606
|
+
.icon-with-input,
|
|
607
|
+
.input-with-icon {
|
|
608
|
+
position: relative;
|
|
609
|
+
border: 1px solid $color-border-dark;
|
|
610
|
+
border-radius: 4px;
|
|
611
|
+
display: flex;
|
|
612
|
+
&.is-inactive {
|
|
613
|
+
background-color: #f0efef;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
.icon {
|
|
617
|
+
width: 36px;
|
|
618
|
+
height: 36px;
|
|
619
|
+
border-right: 1px solid $color-border-dark;
|
|
620
|
+
}
|
|
621
|
+
input {
|
|
622
|
+
border: none;
|
|
623
|
+
width: calc(100% - 36px);
|
|
624
|
+
height: 36px;
|
|
625
|
+
padding: 4px 8px;
|
|
626
|
+
border-radius: 0 4px 4px 0;
|
|
627
|
+
background-color: transparent;
|
|
628
|
+
&:focus {
|
|
629
|
+
outline: 1px solid $color-border-dark;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
.input-with-icon {
|
|
634
|
+
.icon {
|
|
635
|
+
border-right: none;
|
|
636
|
+
border-left: 1px solid $color-border-dark;
|
|
637
|
+
cursor: pointer;
|
|
638
|
+
transition: 0.3s ease-in-out;
|
|
639
|
+
&:hover {
|
|
640
|
+
background-color: $secondary-light-gray;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineAsyncComponent } from "vue";
|
|
3
|
+
const AlertMessage = defineAsyncComponent(() => import("@/components/vue-components/v3/alert/AlertMessage.vue"));
|
|
4
|
+
const InfoLightIcon = defineAsyncComponent(() => import("@/components/vue-components/v3/icons/InfoLightIcon.vue"));
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
message?: string;
|
|
8
|
+
hasLink?: boolean;
|
|
9
|
+
linkTitle?: string;
|
|
10
|
+
linkAddress?: string;
|
|
11
|
+
modifierClasses?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
withDefaults(defineProps<Props>(), {
|
|
15
|
+
linkTitle: "Link",
|
|
16
|
+
linkAddress: "#",
|
|
17
|
+
hasLink: false,
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<AlertMessage :modifier-classes="modifierClasses">
|
|
23
|
+
<template #icon>
|
|
24
|
+
<InfoLightIcon />
|
|
25
|
+
</template>
|
|
26
|
+
<template #custom-text>
|
|
27
|
+
<p>
|
|
28
|
+
{{ message }} <a v-if="hasLink" :href="linkAddress">{{ linkTitle }}</a>
|
|
29
|
+
</p>
|
|
30
|
+
</template>
|
|
31
|
+
</AlertMessage>
|
|
32
|
+
</template>
|
|
@@ -1,31 +1,72 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { defineProps, type Component } from "vue";
|
|
2
|
+
import { defineProps, defineEmits, type Component, defineAsyncComponent } from "vue";
|
|
3
|
+
import AcButton from "../../v3/button/Button.vue";
|
|
4
|
+
const Skeletons = defineAsyncComponent(() => import("../skeleton/Skeletons.vue"));
|
|
5
|
+
const Skeleton = defineAsyncComponent(() => import("../skeleton/Skeleton.vue"));
|
|
3
6
|
|
|
4
7
|
interface UsageRow {
|
|
5
8
|
icon?: Component;
|
|
6
9
|
label: string;
|
|
7
10
|
values: (string | number)[];
|
|
8
11
|
}
|
|
12
|
+
|
|
13
|
+
type Header = string | { label: string; button?: boolean; text?: string };
|
|
14
|
+
|
|
9
15
|
withDefaults(
|
|
10
16
|
defineProps<{
|
|
11
17
|
title?: string;
|
|
12
|
-
thead?:
|
|
18
|
+
thead?: Header[];
|
|
13
19
|
tbody?: UsageRow[];
|
|
20
|
+
isLoaderActive?: boolean;
|
|
14
21
|
}>(),
|
|
15
22
|
{
|
|
16
23
|
title: "Total Usage Data",
|
|
17
24
|
thead: () => [],
|
|
18
25
|
tbody: () => [],
|
|
26
|
+
isLoaderActive: false,
|
|
19
27
|
},
|
|
20
28
|
);
|
|
29
|
+
|
|
30
|
+
const emit = defineEmits<{
|
|
31
|
+
"header-button-click": [index: number];
|
|
32
|
+
}>();
|
|
33
|
+
|
|
34
|
+
const handleHeaderButtonClick = (index: number) => {
|
|
35
|
+
emit("header-button-click", index);
|
|
36
|
+
};
|
|
21
37
|
</script>
|
|
22
38
|
|
|
23
39
|
<template>
|
|
24
40
|
<h5 class="mb-8">{{ title }}</h5>
|
|
25
41
|
<div class="usage-table-card">
|
|
26
42
|
<div class="table-row thead">
|
|
27
|
-
<div v-for="(header, index) in thead" :key="index" class="table-cell">
|
|
43
|
+
<div v-for="(header, index) in thead" :key="index" class="table-cell has-text-weight-normal">
|
|
44
|
+
<template v-if="typeof header === 'string'">
|
|
45
|
+
{{ header }}
|
|
46
|
+
</template>
|
|
47
|
+
<template v-else>
|
|
48
|
+
<div class="is-flex is-align-items-center is-justify-content-flex-end gap-4">
|
|
49
|
+
<span>{{ header.label }}</span>
|
|
50
|
+
<ac-button
|
|
51
|
+
modifier-classes="is-text has-text-primary p-0 height-auto"
|
|
52
|
+
v-if="header.button"
|
|
53
|
+
@click="handleHeaderButtonClick(1)"
|
|
54
|
+
>({{ header.text }})</ac-button
|
|
55
|
+
>
|
|
56
|
+
</div>
|
|
57
|
+
</template>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<div v-if="tbody.length === 0 && !isLoaderActive" class="table-row">
|
|
62
|
+
<div class="table-cell" :style="{ gridColumn: `1 / -1`, textAlign: 'center' }">
|
|
63
|
+
<strong>
|
|
64
|
+
Resource Not Found
|
|
65
|
+
<i class="pl-5 fa fa-exclamation-circle" aria-hidden="true"></i>
|
|
66
|
+
</strong>
|
|
67
|
+
</div>
|
|
28
68
|
</div>
|
|
69
|
+
|
|
29
70
|
<div v-for="(row, rowIndex) in tbody" :key="rowIndex" class="table-row">
|
|
30
71
|
<div class="table-cell">
|
|
31
72
|
<div class="is-flex gap-8">
|
|
@@ -35,7 +76,18 @@ withDefaults(
|
|
|
35
76
|
<span>{{ row.label }}</span>
|
|
36
77
|
</div>
|
|
37
78
|
</div>
|
|
38
|
-
<div v-for="(val, valIndex) in row.values" :key="valIndex" class="table-cell">
|
|
79
|
+
<div v-for="(val, valIndex) in row.values" :key="valIndex" class="table-cell has-text-weight-normal">
|
|
80
|
+
<div v-if="isLoaderActive">
|
|
81
|
+
<skeletons>
|
|
82
|
+
<template #default>
|
|
83
|
+
<Skeleton />
|
|
84
|
+
</template>
|
|
85
|
+
</skeletons>
|
|
86
|
+
</div>
|
|
87
|
+
<div v-else>
|
|
88
|
+
{{ val }}
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
39
91
|
</div>
|
|
40
92
|
</div>
|
|
41
93
|
</template>
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineProps, defineEmits, type Component, defineAsyncComponent, ref } from "vue";
|
|
3
|
+
import AcButton from "../../v3/button/Button.vue";
|
|
4
|
+
const Skeletons = defineAsyncComponent(() => import("../skeleton/Skeletons.vue"));
|
|
5
|
+
const Skeleton = defineAsyncComponent(() => import("../skeleton/Skeleton.vue"));
|
|
6
|
+
const LinkIcon = defineAsyncComponent(() => import("../icons/BillableInfo.vue"));
|
|
7
|
+
interface UsageRow {
|
|
8
|
+
icon?: Component;
|
|
9
|
+
label: string;
|
|
10
|
+
values: (string | number)[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type Header = string | { label: string; button?: boolean; text?: string };
|
|
14
|
+
|
|
15
|
+
withDefaults(
|
|
16
|
+
defineProps<{
|
|
17
|
+
title?: string;
|
|
18
|
+
thead?: Header[];
|
|
19
|
+
tbody?: UsageRow[];
|
|
20
|
+
isLoaderActive?: boolean;
|
|
21
|
+
}>(),
|
|
22
|
+
{
|
|
23
|
+
title: "Total Usage Data",
|
|
24
|
+
thead: () => [],
|
|
25
|
+
tbody: () => [],
|
|
26
|
+
isLoaderActive: false,
|
|
27
|
+
},
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const emit = defineEmits<{
|
|
31
|
+
"header-button-click": [index: number];
|
|
32
|
+
}>();
|
|
33
|
+
|
|
34
|
+
const handleHeaderButtonClick = (index: number) => {
|
|
35
|
+
emit("header-button-click", index);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const hoveredRow = ref<number | null>(null);
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<template>
|
|
42
|
+
<div class="columns is-multiline">
|
|
43
|
+
<div class="column is-12">
|
|
44
|
+
<h5>{{ title }}</h5>
|
|
45
|
+
<div class="usage-table-card">
|
|
46
|
+
<div class="table-row thead">
|
|
47
|
+
<div class="table-cell has-text-weight-normal">{{ thead[0] }}</div>
|
|
48
|
+
<div class="table-cell has-text-weight-normal">{{ thead[1] }}</div>
|
|
49
|
+
<div
|
|
50
|
+
class="table-cell has-text-weight-normal has-background-white has-text-centered is-flex is-justify-content-center b-1 ml-40"
|
|
51
|
+
>
|
|
52
|
+
<span class="width-70 is-flex is-align-items-center is-justify-content-flex-end">{{ thead[2] }}</span>
|
|
53
|
+
<span class="b-r-1 mx-4"></span>
|
|
54
|
+
<span class="width-70 is-flex is-align-items-center">{{ thead[3] }}</span>
|
|
55
|
+
<span class="b-l-1 px-2 is-flex is-align-items-center is-clickable">
|
|
56
|
+
<ac-button @click="handleHeaderButtonClick(2)" modifier-classes="is-text has-text-primary p-0 height-16">
|
|
57
|
+
<LinkIcon />
|
|
58
|
+
</ac-button>
|
|
59
|
+
</span>
|
|
60
|
+
</div>
|
|
61
|
+
<div class="table-cell has-text-weight-normal is-flex is-justify-content-end gap-5">
|
|
62
|
+
<div>{{ thead[4] }}</div>
|
|
63
|
+
<div class="is-flex is-clickable">
|
|
64
|
+
<ac-button modifier-classes="is-text has-text-primary p-0 height-16" @click="handleHeaderButtonClick(1)">
|
|
65
|
+
<LinkIcon />
|
|
66
|
+
</ac-button>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</div>
|
|
70
|
+
|
|
71
|
+
<div v-for="(row, rowIndex) in tbody" :key="rowIndex" class="table-row">
|
|
72
|
+
<div class="table-cell">
|
|
73
|
+
<div class="is-flex gap-8">
|
|
74
|
+
<span class="icon" v-if="row.icon">
|
|
75
|
+
<component :is="row.icon" />
|
|
76
|
+
</span>
|
|
77
|
+
<span>{{ row.label }}</span>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div class="table-cell has-text-weight-normal">
|
|
82
|
+
<div v-if="isLoaderActive">
|
|
83
|
+
<skeletons>
|
|
84
|
+
<template #default>
|
|
85
|
+
<Skeleton />
|
|
86
|
+
</template>
|
|
87
|
+
</skeletons>
|
|
88
|
+
</div>
|
|
89
|
+
<div v-else @mouseenter="hoveredRow = rowIndex" @mouseleave="hoveredRow = null">
|
|
90
|
+
<span>{{ row.values[0] }}</span>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div
|
|
95
|
+
class="table-cell has-text-weight-normal has-background-white has-text-centered is-flex is-justify-content-center b-1 ml-40 relative-cell"
|
|
96
|
+
:class="{ 'highlighted-cell': hoveredRow === rowIndex }"
|
|
97
|
+
>
|
|
98
|
+
<div v-if="hoveredRow === rowIndex" class="tooltip">Sum = ({{ row.values[1] }} + {{ row.values[2] }})</div>
|
|
99
|
+
|
|
100
|
+
<span class="width-70 is-flex is-justify-content-flex-end">
|
|
101
|
+
<Skeleton v-if="isLoaderActive" />
|
|
102
|
+
<template v-else>{{ row.values[1] }}</template>
|
|
103
|
+
</span>
|
|
104
|
+
<span class="b-r-1 mx-4"></span>
|
|
105
|
+
<span class="width-70 is-flex">
|
|
106
|
+
<Skeleton v-if="isLoaderActive" />
|
|
107
|
+
<template v-else>{{ row.values[2] }}</template>
|
|
108
|
+
</span>
|
|
109
|
+
<span class="width-30"></span>
|
|
110
|
+
</div>
|
|
111
|
+
<div class="table-cell has-text-weight-normal">
|
|
112
|
+
<div v-if="isLoaderActive">
|
|
113
|
+
<skeletons>
|
|
114
|
+
<template #default>
|
|
115
|
+
<Skeleton />
|
|
116
|
+
</template>
|
|
117
|
+
</skeletons>
|
|
118
|
+
</div>
|
|
119
|
+
<div v-else>{{ row.values[3] }}</div>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
</template>
|
|
126
|
+
|
|
127
|
+
<style scoped>
|
|
128
|
+
.highlighted-cell {
|
|
129
|
+
border: 1px dashed #333 !important;
|
|
130
|
+
background-color: #f1f1f1 !important;
|
|
131
|
+
position: relative;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.relative-cell {
|
|
135
|
+
position: relative;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.tooltip {
|
|
139
|
+
position: absolute;
|
|
140
|
+
top: -26px;
|
|
141
|
+
left: 50%;
|
|
142
|
+
transform: translateX(-50%);
|
|
143
|
+
background: #333;
|
|
144
|
+
color: #fff;
|
|
145
|
+
padding: 4px 8px;
|
|
146
|
+
font-size: 12px;
|
|
147
|
+
border-radius: 4px;
|
|
148
|
+
white-space: nowrap;
|
|
149
|
+
z-index: 10;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.tooltip::after {
|
|
153
|
+
content: "";
|
|
154
|
+
position: absolute;
|
|
155
|
+
bottom: -4px;
|
|
156
|
+
left: 50%;
|
|
157
|
+
transform: translateX(-50%);
|
|
158
|
+
border-width: 5px;
|
|
159
|
+
border-style: solid;
|
|
160
|
+
border-color: #333 transparent transparent;
|
|
161
|
+
}
|
|
162
|
+
</style>
|