traefik/webui/src/components/_commons/PanelMirroringServices.vue

135 lines
3.1 KiB
Vue
Raw Normal View History

2019-09-10 12:40:05 +00:00
<template>
<q-card flat bordered v-bind:class="['panel-services', {'panel-services-dense':isDense}]">
<q-scroll-area :thumb-style="appThumbStyle" style="height:100%;">
<q-card-section>
<div class="row items-start no-wrap">
<div class="col-6">
<div class="text-subtitle2 text-table">Name</div>
</div>
<div class="col-3">
<div class="text-subtitle2 text-table" style="text-align: right">Percent</div>
</div>
<div class="col-3">
<div class="text-subtitle2 text-table" style="text-align: right">Provider</div>
</div>
</div>
</q-card-section>
<q-separator />
<div v-for="(service, index) in data.mirroring.mirrors" :key="index">
<q-card-section>
<div class="row items-center no-wrap">
<div class="col-6">
<q-chip
dense
2020-12-07 13:14:03 +00:00
class="app-chip app-chip-rule app-chip-overflow">
2019-09-10 12:40:05 +00:00
{{ service.name }}
2020-12-07 13:14:03 +00:00
<q-tooltip>{{service.name}}</q-tooltip>
2019-09-10 12:40:05 +00:00
</q-chip>
</div>
<div class="col-3 text-right">
{{ service.percent }}
</div>
<div class="col-3 text-right">
<q-avatar class="provider-logo">
<q-icon :name="`img:statics/providers/${getProvider(service)}.svg`" />
</q-avatar>
</div>
</div>
</q-card-section>
<q-separator />
</div>
</q-scroll-area>
</q-card>
</template>
<script>
export default {
name: 'PanelMirroringServices',
props: ['data', 'dense'],
components: {},
computed: {
isDense () {
return this.dense !== undefined
}
},
methods: {
getProvider (service) {
const words = service.name.split('@')
2019-12-10 14:14:06 +00:00
if (words.length === 2) {
return words[1]
2019-09-10 12:40:05 +00:00
}
2019-12-10 14:14:06 +00:00
return this.data.provider
2019-09-10 12:40:05 +00:00
}
}
}
</script>
<style scoped lang="scss">
@import "../../css/sass/variables";
.panel-services {
height: 600px;
&-dense{
height: 400px;
}
.q-card__section {
padding: 12px 24px;
+ .q-card__section {
padding-top: 0;
}
}
.block-right-text{
height: 32px;
line-height: 32px;
&-label{
font-size: 14px;
font-weight: 600;
color: $app-text-grey;
float: left;
margin-left: 10px;
text-transform: capitalize;
&-enabled {
color: $positive;
}
&-disabled {
color: $negative;
}
&-warning {
color: $warning;
}
}
}
.text-subtitle2 {
font-size: 11px;
color: $app-text-grey;
line-height: 16px;
margin-bottom: 4px;
text-align: left;
letter-spacing: 2px;
font-weight: 600;
text-transform: uppercase;
}
.text-table {
font-size: 14px;
font-weight: 700;
letter-spacing: normal;
text-transform: none;
}
.provider-logo {
width: 32px;
height: 32px;
img {
width: 100%;
height: 100%;
}
}
}
</style>