Skip to content

Commit f8045ca

Browse files
committed
adjust colors, fix order
1 parent cec3a09 commit f8045ca

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

src/templates/portal-summary.html

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,15 @@ <h1>Portal Summary</h1>
215215
let self = this;
216216
let statuses = {}
217217

218+
if(field == 'uptime_status'){
219+
statuses = {
220+
'good' : 0,
221+
'unknown' : 0,
222+
'incompatible' : 0,
223+
'bad' : 0,
224+
}
225+
}
226+
218227
self.data.forEach(item => {
219228
if(Object.prototype.hasOwnProperty.call(item['_status'], field)){
220229
//table data
@@ -322,7 +331,7 @@ <h1>Portal Summary</h1>
322331
labels: []
323332
};
324333

325-
yesTF ? (data.datasets[0].data.push(yesTF), data.labels.push(yesTF_label),data.datasets[0].backgroundColor.push('#5ed668')) : false
334+
yesTF ? (data.datasets[0].data.push(yesTF), data.labels.push(yesTF_label),data.datasets[0].backgroundColor.push('#20c96a')) : false
326335
yesTnoF ? (data.datasets[0].data.push(yesTnoF), data.labels.push(yesTnoF_label),data.datasets[0].backgroundColor.push("#ffbf47")) : false
327336
noTyesF ? (data.datasets[0].data.push(noTyesF), data.labels.push(noTyesF_label),data.datasets[0].backgroundColor.push("#925ed6")) : false
328337
if (self.summary_type !== 'x-trapi_Compliant') {
@@ -504,23 +513,24 @@ <h6 class="white-text p-1" :style="{backgroundColor: bgColor}" v-show="filter &&
504513
data: function(){
505514
return {
506515
summaries: Array,
507-
totalAPIs: 0
516+
totalAPIs: 0,
517+
colorList: ['#2c98f0', '#4bc0c0', '#8d5bd4', '#ff9f3f', '#224b80', '#ffcd56', '#ff6384', '#d8823e', '#3e6fd8',
518+
'#0890aa', '#60878f', '#6354b4', '#e66822', '#c4b5ad', '#dd4aba']
508519
}
509520
},
510521
methods: {
511522
getSummaries(url){
512523
let self = this;
513524
axios.get(url).then(res=>{
514-
// console.log('ALL RES', res.data)
515525
self.data = res.data.hits
516526
self.totalAPIs = res.data.total
517527
Vue.set(self, 'summaries', [
518-
{'name': 'x-translator_Compliant', 'colors': ["#5ed668", "#ffbf47","#925ed6","#e65a78"]},
519-
{'name': 'x-trapi_Compliant', 'colors': ["#5ed668", "#ffbf47","#925ed6","#e65a78"]},
520-
{'name': 'By_Teams', 'colors': 'random'},
521-
{'name': 'By_Component', 'colors': 'random'},
522-
{'name': 'Uptime_Status', 'colors': ["#5ed668","#ffc107","#0277bd","#ff5722"]},
523-
{'name': 'Source_Status', 'colors': ["#5ed668","#ffc107","#e65a78","#9c27b0"]},
528+
{'name': 'x-translator_Compliant', 'colors': ["#20c96a", "#ffbf47","#925ed6","#e65a78"]},
529+
{'name': 'x-trapi_Compliant', 'colors': ["#20c96a", "#ffbf47","#925ed6","#e65a78"]},
530+
{'name': 'By_Teams', 'colors': self.colorList},
531+
{'name': 'By_Component', 'colors': self.colorList},
532+
{'name': 'Uptime_Status', 'colors': ["#20c96a","#ffcd56","#0277bd","#ff5722"]},
533+
{'name': 'Source_Status', 'colors': ["#20c96a","#ffcd56","#e65a78","#9c27b0"]},
524534
])
525535
}).catch(err=>{
526536
throw err;

0 commit comments

Comments
 (0)