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
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,11 @@ async function fetchStatistics() {
ids: baseStats.runIds.value
});

runs.value = await ccService.getRuns(_run_filter);
runs.value = (await ccService.getRuns(_run_filter)).map(_run => ({
runId: _run.runId,
runName: _run.name,
codeCheckerVersion: _run.codeCheckerVersion
}));

const _filter = new ReportFilter(baseStats.reportFilter.value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,11 @@ async function fetchStatistics() {
ids: baseStatistics.runIds.value
});

runs.value = await ccService.getRuns(_filter);
runs.value = (await ccService.getRuns(_filter)).map(_run => ({
runId: _run.runId,
runName: _run.name,
codeCheckerVersion: _run.codeCheckerVersion
}));

await getAllGuidelineRules();

Expand Down
133 changes: 86 additions & 47 deletions web/server/vue-cli/src/components/Statistics/StatisticsDialog.vue
Original file line number Diff line number Diff line change
@@ -1,55 +1,72 @@
<template>
<ConfirmDialog
v-model="dialog"
max-width="70%"
max-width="640px"
:title="title"
:icon="headerIcon"
:buttons="false"
>
<template v-slot:content>
<div
v-for="run in runs"
:key="run.message"
>
<div class="font-alert-message">
<span
<div class="statistics-dialog-content">
<div class="run-count-summary mb-3">
<v-chip
:color="type === 'enabled' ? 'success' : 'error'"
variant="tonal"
size="small"
label
>
{{ totalRunCount }}
{{ totalRunCount === 1 ? "run" : "runs" }}
</v-chip>
</div>

<div
v-for="(run, groupIndex) in runs"
:key="run.message || groupIndex"
class="run-group"
>
<v-alert
v-if="run.message && run.runNames.length"
type="warning"
variant="tonal"
density="compact"
class="mb-2"
>
{{ run.runNames.length > 1 ? "These runs are": "This run is" }}
{{ run.runNames.length > 1 ? "These runs are" : "This run is" }}
{{ run.message }}
</span>
</div>
<v-container class="checker-rows-in-columns">
<v-row
v-for="runName in run.runNames"
:key="runName"
no-gutters
align="center"
</v-alert>

<v-list
class="run-list pa-0"
density="compact"
lines="one"
>
<v-col cols="auto" align-self="center">
<v-icon
v-if="type == 'enabled'"
class="mr-1"
color="success"
>
mdi-check
</v-icon>
<v-icon
v-else
class="mr-1"
color="error"
>
mdi-close
</v-icon>
</v-col>
<v-col
col="auto"
align-self="center"
style="font-size: larger;"
<v-list-item
v-for="runName in run.runNames"
:key="runName"
class="run-list-item px-2"
>
{{ runName }}
</v-col>
</v-row>
</v-container>
<template v-slot:prepend>
<v-icon
:color="type === 'enabled' ? 'success' : 'error'"
:icon="type === 'enabled' ? 'mdi-check-circle'
: 'mdi-close-circle'"
size="small"
/>
</template>
<v-list-item-title class="run-name">
{{ runName }}
</v-list-item-title>
</v-list-item>
</v-list>
</div>

<div
v-if="!totalRunCount"
class="text-medium-emphasis text-center py-4"
>
No runs to display.
</div>
</div>
</template>
</ConfirmDialog>
Expand Down Expand Up @@ -86,6 +103,17 @@ const title = computed(function() {
return _title;
});

const headerIcon = computed(function() {
return props.type === "enabled"
? "mdi-check-circle-outline"
: "mdi-close-circle-outline";
});

const totalRunCount = computed(function() {
return runs.value.reduce(
(_sum, _run) => _sum + _run.runNames.length, 0);
});

const runs = computed(function() {
if (props.runData.length && props.runData[0].analysisInfo !== undefined) {
const _alertTypes = {
Expand Down Expand Up @@ -121,13 +149,24 @@ const runs = computed(function() {
</script>

<style lang="scss" scoped>
.checker-rows-in-columns {
columns: 32em auto;
}
.font-alert-message {
margin-top: 10px;
font-size: 125%;
font-weight: bold;
.statistics-dialog-content {
.run-group:not(:last-child) {
margin-bottom: 12px;
}

.run-list {
border: thin solid rgba(0, 0, 0, 0.12);
border-radius: 6px;
overflow: hidden;
}

.run-list-item:not(:last-child) {
border-bottom: thin solid rgba(0, 0, 0, 0.06);
}

.run-name {
font-size: 0.95rem;
}
}
</style>

Loading