diff --git a/src/routes/cloud/[...id]/+layout.svelte b/src/routes/cloud/[...id]/+layout.svelte
index 5c26053..81e1bd0 100644
--- a/src/routes/cloud/[...id]/+layout.svelte
+++ b/src/routes/cloud/[...id]/+layout.svelte
@@ -21,33 +21,33 @@ $: metricActive = $page.route.id == '/cloud/[...id]/metrics';
diff --git a/src/routes/cloud/[...id]/assessment/+page.svelte b/src/routes/cloud/[...id]/assessment/+page.svelte
index 6a3bb24..ef8f345 100644
--- a/src/routes/cloud/[...id]/assessment/+page.svelte
+++ b/src/routes/cloud/[...id]/assessment/+page.svelte
@@ -12,7 +12,7 @@ import {
Row,
Table,
} from 'sveltestrap';
-import { metrics } from '$lib/stores';
+import { metrics, controls } from '$lib/stores';
import AssessmentResultRow from '$lib/components/AssessmentResultRow.svelte';
export let data: import('./$types').PageData;
@@ -32,18 +32,15 @@ let filterEndTimestamp: string | number | Date;
$: filteredResults = results.filter((r) => {
let dateFilterStartTimestamp = new Date(filterStartTimestamp);
let dateFilterEndTimestamp = new Date(filterEndTimestamp);
- console.log(filterStartTimestamp)
- console.log(dateFilterStartTimestamp)
- console.log(filterStartTimestamp)
- console.log(dateFilterEndTimestamp)
+
return (
(filterCompliant != '' ? (r.compliant == (filterCompliant == 'true') ? true : false) : true) &&
(filterMetricCategory != ''
- ? $metrics
- .get(r.metricId)
- ?.category?.toLowerCase()
- ?.includes(filterMetricCategory?.toLowerCase())
- : true) &&
+ ? $metrics
+ .get(r.metricId)
+ ?.category?.toLowerCase()
+ ?.includes(filterMetricCategory?.toLowerCase())
+ : true) &&
(filterMetric != ''
? $metrics.get(r.metricId)?.name?.toLowerCase()?.includes(filterMetric?.toLowerCase())
: true) &&
@@ -58,6 +55,54 @@ $: filteredResults = results.filter((r) => {
: true)
);
});
+
+// getListOfControlCategories returns a string list of all metric categories
+function getListOfControlCategories(): String[] {
+ let categoryList: string[] = [];
+
+ for (var val of $controls) {
+ if (categoryList.includes(val.categoryName) == false) {
+ categoryList.push(val.categoryName)
+ }
+ }
+
+ return categoryList
+}
+
+// getListOfMetrics returns a string list of all metric_ids
+function getListOfMetricIds(): String[] {
+ let metricsList: string[] = [];
+
+ for (var val of $metrics.values()) {
+ if (metricsList.includes(val.id) == false) {
+ metricsList.push(val.id)
+ }
+ }
+
+ return metricsList
+}
+
+// getListOfResources returns a string list of all resource names of the given assessment_results
+function getListOfResources(): String[] {
+ let resourceList: string[] = [];
+
+ for (var val of results) {
+ const types = val.resourceTypes
+ console.log("types: ", types)
+ for (var elem of types) {
+ console.log("type: ", elem)
+ if (resourceList.includes(elem) == false) {
+ resourceList.push(elem)
+ }
+ }
+ }
+
+ return resourceList
+}
+
+const categoryList = getListOfControlCategories()
+const metricsList = getListOfMetricIds()
+const resourceList = getListOfResources()
@@ -81,12 +126,12 @@ $: filteredResults = results.filter((r) => {
-
+
+
+ {#each categoryList as value}
+
+ {/each}
+
@@ -94,13 +139,23 @@ $: filteredResults = results.filter((r) => {
-
+
+
+ {#each metricsList as value}
+
+ {/each}
+
-
-
+
+
+
+ {#each resourceList as value}
+
+ {/each}
+
diff --git a/src/routes/cloud/[...id]/configuration/toe/+page.svelte b/src/routes/cloud/[...id]/configuration/toe/+page.svelte
index cef3315..355f161 100644
--- a/src/routes/cloud/[...id]/configuration/toe/+page.svelte
+++ b/src/routes/cloud/[...id]/configuration/toe/+page.svelte
@@ -118,8 +118,28 @@ function getUsedCatalog(catalogID: string): Catalog {
return {} as any;
}
+// Get only sub-controls from controls_in_scope
+// Note: That is not a really good approach and only can be used for the EUCS catalog, because we have no hierarchy in the controls_in_scope list.
+function getSubControls(): ControlInScope[][] {
+ const subControls: ControlInScope[][] = []
+ var i = 0
+
+ for (var scope of data.scopes) {
+ subControls[i] = []
+ for (var s of scope) {
+ if (s.controlId.includes(".")) {
+ subControls[i].push(s)
+ }
+ }
+ i++
+ }
+
+ return subControls
+}
+
let open = false;
const toggle = () => (open = !open);
+const subControls = getSubControls()
{#each data.targets as target, idx}
@@ -134,7 +154,7 @@ const toggle = () => (open = !open);
# |
+ Category |
Description |
Implementation |
Configuration |
@@ -27,6 +28,7 @@ The following metrics are configured for the Cloud Service.
{#each data.metrics as metric, i}
{metric.id} |
+ {metric.category} |
{metric.description} |
{#await getMetricImplementation(metric.id) then impl}
diff --git a/src/routes/metrics/+page.svelte b/src/routes/metrics/+page.svelte
index 60232bc..ecc43ef 100644
--- a/src/routes/metrics/+page.svelte
+++ b/src/routes/metrics/+page.svelte
@@ -16,6 +16,7 @@ The following metrics are configured in the Clouditor orchestrator.
# |
+ Category |
Description |
Implementation |
@@ -24,6 +25,7 @@ The following metrics are configured in the Clouditor orchestrator.
{#each data.metrics as metric, i}
{metric.id} |
+ {metric.category} |
{metric.description} |
{#await getMetricImplementation(metric.id) then impl}
| |