Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/Http/Controllers/BuildController.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ public function apiBuildUpdateGraph(): JsonResponse
]);

$response = [];
$response['deprecated'] = 'This endpoint will be removed in the next major version of CDash.';
$response['data'] = [];
$response['buildids'] = [];

Expand Down
104 changes: 0 additions & 104 deletions resources/js/vue/components/BuildUpdatePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,6 @@
{{ update.priorRevision }}
</tt>
</div>

<a
class="tw-link tw-link-hover tw-link-info"
@click="toggleGraph()"
>
<span v-text="showGraph ? 'Hide Activity Graph' : 'Show Activity Graph'" />
</a>
<div v-if="graphLoading">
<img
id="spinner"
:src="$baseURL + '/img/loading.gif'"
>
</div>
<div v-show="graphLoaded && showGraph">
<div id="graphoptions" />
<div id="graph" />
<div
id="graph_holder"
class="center-text"
/>
</div>
</div>

<h3
Expand All @@ -82,7 +61,6 @@
</template>

<script>
import $ from 'jquery';
import BuildSummaryCard from './shared/BuildSummaryCard.vue';
import LoadingIndicator from './shared/LoadingIndicator.vue';
import BuildSidebar from './shared/BuildSidebar.vue';
Expand Down Expand Up @@ -112,24 +90,6 @@ export default {
},
},

data() {
return {
// Booleans controlling whether a section should be displayed or not.
showGraph: false,

// Graph data.
graphLoading: false,
graphLoaded: false,
graphData: [],
graphRendered: {
'time': false,
'errors': false,
'warnings': false,
'tests': false,
},
};
},

apollo: {
update: {
query: gql`
Expand Down Expand Up @@ -254,69 +214,5 @@ export default {
return commits;
},
},

async mounted() {
// Ensure jQuery is globally available before loading plugins
window.jQuery = $;
await import('flot/dist/es5/jquery.flot');
},

methods: {
toggleGraph: function() {
this.showGraph = !this.showGraph;
if (!this.graphLoaded) {
this.loadGraph();
}
},

loadGraph: function() {
this.graphLoading = true;
this.$axios
.get(`/api/v1/buildUpdateGraph.php?buildid=${this.buildId}`)
.then(response => {
this.initializeGraph(response.data);
this.graphLoaded = true;
})
.finally(() => this.graphLoading = false);
},

initializeGraph: function(data) {
const options = {
lines: {show: true},
points: {show: true},
xaxis: {
mode: 'time',
timeformat: '%Y/%m/%d %H:%M',
timeBase: 'milliseconds',
},
grid: {
backgroundColor: '#fffaff',
clickable: true,
hoverable: true,
hoverFill: '#444',
hoverRadius: 4,
},
selection: {mode: 'x'},
colors: ['#0000FF', '#dba255', '#919733'],
};

let plot = $.plot($('#graph_holder'), [{label: 'Number of changed files', data: data.data}], options);

$('#graph_holder').bind('selected', (event, area) => {
plot = $.plot($('#graph_holder'), [{
label: 'Number of changed files',
data: data.data,
}], $.extend(true, {}, options, {xaxis: {min: area.x1, max: area.x2}}));
});

const baseURL = this.$baseURL;
$('#graph_holder').bind('plotclick', (e, pos, item) => {
if (item) {
plot.highlight(item.series, item.datapoint);
window.location = `${baseURL}/builds/${data.buildids[item.datapoint[0]]}`;
}
});
},
},
};
</script>