Skip to content

Commit fbddf9f

Browse files
committed
add greenops graphs
1 parent 68bf6c1 commit fbddf9f

2 files changed

Lines changed: 67 additions & 32 deletions

File tree

ui/src/views/reporting/finops.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ export default {
253253
// generate data
254254
const datas = []
255255
const timestamp = new Date()
256+
timestamp.setMonth(1)
256257
for (let i = 0; i < 60; i++) {
257258
timestamp.setHours(timestamp.getHours() + i)
258259

ui/src/views/reporting/greenops.vue

Lines changed: 66 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,50 @@
1616
// under the License.
1717

1818
<template>
19-
<div>
20-
<chart-card class="dashboard-card">
21-
<template #title>
22-
<div class="center">
23-
<h3>
24-
<bank-outlined />
25-
{{ $t('label.greenops') }}
26-
</h3>
27-
</div>
28-
</template>
29-
</chart-card>
19+
<a-row :gutter="12">
20+
<a-col :md="24">
21+
<a-card class="breadcrumb-card">
22+
<a-col :md="24" style="display: flex">
23+
<breadcrumb style="padding-top: 6px; padding-left: 8px" />
24+
<a-button
25+
style="margin-left: 12px; margin-top: 4px"
26+
:loading="loading"
27+
size="small"
28+
shape="round"
29+
@click="fetchData()" >
30+
<template #icon><ReloadOutlined /></template>
31+
{{ $t('label.refresh') }}
32+
</a-button>
33+
</a-col>
34+
</a-card>
35+
</a-col>
36+
</a-row>
37+
<div class="chart-container">
38+
<div class="little-card">
39+
<chart-card class="metric-card">
40+
<div class="center">
41+
<a-statistic title="Average Age Of Machines" :value="2.73" >
42+
<template #suffix>
43+
Years
44+
</template>
45+
</a-statistic>
46+
</div>
47+
</chart-card>
48+
<chart-card class="metric-card">
49+
<div class="center">
50+
<a-statistic title="Metrics 2" :value="93" >
51+
<template #suffix>
52+
<DesktopOutlined />
53+
</template>
54+
</a-statistic>
55+
</div>
56+
</chart-card>
57+
</div>
58+
<div class="big-card">
59+
<chart-card class="map">
60+
<iframe width="100%" height="730px" src="https://www.openstreetmap.org/export/embed.html?bbox=-125.15625000000001%2C-30.60009387355006%2C106.87500000000001%2C76.96033358827414&amp;layer=mapnik" style="border: 1px solid black"></iframe><br/><small><a href="https://www.openstreetmap.org/?#map=3/41.77/-9.14">Afficher une carte plus grande</a></small>
61+
</chart-card>
62+
</div>
3063
</div>
3164
</template>
3265

@@ -76,30 +109,31 @@ export default {
76109
margin-bottom: 12px;
77110
}
78111
79-
.chart-card-inner {
80-
text-align: center;
81-
white-space: nowrap;
82-
overflow: hidden;
83-
}
84-
.intermediate-certificate {
85-
opacity: 1;
86-
transform: none;
87-
transition: opacity 0.2s ease 0s, transform 0.5s ease;
88-
will-change: transform;
112+
.chart-container {
113+
display: inline-flex;
114+
width: 100%;
115+
min-height: 500px;
89116
}
90-
.intermediate-certificate.fadeInUp-enter-active {
91-
opacity: 0;
92-
transform: translateY(10px);
93-
transition: none;
117+
118+
.little-card {
119+
width: 20%;
120+
min-height: 500px;
121+
margin-right: 10px;
94122
}
95-
.controls {
96-
display: flex;
97-
justify-content: flex-end;
123+
124+
.metric-card {
125+
width: 100%;
126+
min-height: 400px;
127+
margin-bottom: 10px;
98128
}
99-
.close-button {
100-
margin-right: 20px;
129+
130+
.big-card {
131+
width: 80%;
132+
min-height: 810px;
101133
}
102-
.ant-form-item {
103-
margin-bottom: 10px;
134+
135+
.map {
136+
width: 100%;
137+
min-height: 810px;
104138
}
105139
</style>

0 commit comments

Comments
 (0)