Skip to content

Commit

Permalink
feat: Product status added
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Junk committed Sep 7, 2023
1 parent 5722caa commit 1f7ea63
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 0 deletions.
83 changes: 83 additions & 0 deletions src/lib/singleview/vulnerabilities/ProductStatus.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<script lang="ts">
export let vulnerability: any;
</script>

<div class="status">
{#if vulnerability.product_status?.fist_affected}
<h6>- Fist affected</h6>
<ul>
{#each vulnerability.product_status?.fist_affected as elem}
<li>{elem}</li>
{/each}
</ul>
{/if}
{#if vulnerability.product_status?.first_fixed}
<h6>First fixed</h6>
<ul>
{#each vulnerability.product_status?.first_fixed as elem}
<li>{elem}</li>
{/each}
</ul>
{/if}
{#if vulnerability.product_status?.fixed}
<h6>Fixed</h6>
<ul>
{#each vulnerability.product_status?.fixed as elem}
<li>{elem}</li>
{/each}
</ul>
{/if}
{#if vulnerability.product_status?.under_invenstigation}
<h6>Under investigation</h6>
<ul>
{#each vulnerability.product_status?.under_invenstigation as elem}
<li>{elem}</li>
{/each}
</ul>
{/if}
{#if vulnerability.product_status?.known_affected}
<h6>Known affected</h6>
<ul>
{#each vulnerability.product_status?.known_affected as elem}
<li>{elem}</li>
{/each}
</ul>
{/if}
{#if vulnerability.product_status?.known_not_affected}
<h6>Known not affected</h6>
<ul>
{#each vulnerability.product_status?.known_not_affected as elem}
<li>{elem}</li>
{/each}
</ul>
{/if}
{#if vulnerability.product_status?.last_affected}
<h6>Last affected</h6>
<ul>
{#each vulnerability.product_status?.last_affected as elem}
<li>{elem}</li>
{/each}
</ul>
{/if}
{#if vulnerability.product_status?.recommended}
<h6>Recommended</h6>
<ul>
{#each vulnerability.product_status?.recommended as elem}
<li>{elem}</li>
{/each}
</ul>
{/if}
</div>

<style>
.status {
margin-top: 1.5rem;
}
h6 {
line-height: 0.3em;
font-size: large;
}
ul {
list-style-type: none;
}
</style>
6 changes: 6 additions & 0 deletions src/lib/singleview/vulnerabilities/Vulnerability.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import Collapsible from "$lib/Collapsible.svelte";
import { appStore } from "$lib/store";
import { tick } from "svelte";
import ProductStatus from "./ProductStatus.svelte";
export let vulnerability: any;
export let index: number = 1;
Expand Down Expand Up @@ -81,6 +82,11 @@
{/each}
</Collapsible>
{/if}
{#if vulnerability.product_status}
<Collapsible header="Product status" level="4">
<ProductStatus {vulnerability} />
</Collapsible>
{/if}
</div>
</Collapsible>
</div>
Expand Down

0 comments on commit 1f7ea63

Please sign in to comment.