Fix performance bar spacing

This commit is contained in:
Phil Hughes 2018-03-21 16:28:07 +00:00
parent 40c338a4bb
commit ab53f7aa13
No known key found for this signature in database
GPG key ID: 32245528C52E0F9F
5 changed files with 34 additions and 16 deletions

View file

@ -27,6 +27,11 @@ export default {
required: true,
},
},
computed: {
detailsList() {
return this.currentRequest.details[this.metric][this.details];
},
},
};
</script>
<template>
@ -55,19 +60,30 @@ export default {
:header-title-text="header"
class="performance-bar-modal"
>
<table class="table">
<tr
v-for="(item, index) in currentRequest.details[metric][details]"
:key="index"
>
<td><strong>{{ item.duration }}ms</strong></td>
<td
v-for="key in keys"
:key="key"
<table
class="table"
>
<template v-if="detailsList.length">
<tr
v-for="(item, index) in detailsList"
:key="index"
>
{{ item[key] }}
</td>
</tr>
<td><strong>{{ item.duration }}ms</strong></td>
<td
v-for="key in keys"
:key="key"
>
{{ item[key] }}
</td>
</tr>
</template>
<template v-else>
<tr>
<td>
No {{ header.toLowerCase() }} for this request.
</td>
</tr>
</template>
</table>
<div slot="footer">

View file

@ -124,7 +124,7 @@ export default {
class="view prepend-left-5"
>
<span
v-if="currentRequest && currentRequest.details"
v-if="currentRequest && currentRequest.details && currentRequest.details.host"
class="current-host"
>
{{ currentRequest.details.host.hostname }}

View file

@ -5,6 +5,8 @@ export default {
.getElementById('peek-view-performance-bar')
.cloneNode(true);
upstreamPerformanceBar.classList.remove('hidden');
this.$refs.wrapper.appendChild(upstreamPerformanceBar);
},
};

View file

@ -4,9 +4,9 @@ import Vue from 'vue';
import performanceBarApp from './components/performance_bar_app.vue';
import PerformanceBarStore from './stores/performance_bar_store';
export default () =>
export default ({ container }) =>
new Vue({
el: '#js-peek',
el: container,
components: {
performanceBarApp,
},

View file

@ -6,7 +6,7 @@
profile_url: url_for(params.merge(lineprofiler: 'true')) },
class: Peek.env }
#peek-view-performance-bar
#peek-view-performance-bar.hidden
= render_server_response_time
%span#serverstats
%ul.performance-bar