Skip to content

Commit

Permalink
feat(frontend): add display for keywords and new status codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Data5tream committed Aug 1, 2023
1 parent 1c12eec commit 9c2dfd7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
21 changes: 15 additions & 6 deletions frontend/src/lib/components/StatusEntry.svelte
Expand Up @@ -16,18 +16,25 @@
statusMsg = 'Invalid DNS';
} else if (data.status === 601) {
statusMsg = 'TLS validation error';
} else if (data.status === 604) {
statusMsg = 'Keyword not found';
} else if (data.status === 610) {
statusMsg = 'Unable to parse HTML content';
}
}
</script>

<div class="watchpoint">
<h4>{data.watchpoint.name}</h4>
<div class="content">
Status: <StatusIcon status={data.status} />&nbsp;{statusMsg}<br />
{#if data.watchpoint.kind === 'url'}
URL: <a href={data.watchpoint.target} class="url" target='_blank' rel='noreferrer'>{data.watchpoint.target}</a>
<ul class="content">
<li>Status: <StatusIcon status={data.status} />&nbsp;{statusMsg}</li>
{#if data.watchpoint.kind === 'url' || data.watchpoint.kind === 'keyword' }
<li>URL: <a href={data.watchpoint.target} class="url" target='_blank' rel='noreferrer'>{data.watchpoint.target}</a></li>
{/if}
</div>
{#if data.watchpoint.kind === 'keyword' }
<li>Keyword: <span class='keyword'>{data.watchpoint.keyword}</span></li>
{/if}
</ul>
</div>

<style lang="scss">
Expand Down Expand Up @@ -80,9 +87,11 @@
.content {
padding: 16px 8px 8px;
margin: 0;
list-style: none;
}
.url {
.url, .keyword {
font-family: monospace;
}
</style>
1 change: 1 addition & 0 deletions frontend/src/lib/dataprovider.ts
Expand Up @@ -7,6 +7,7 @@ export interface Watchpoint {
name: string;
kind: string;
target: string;
keyword?: string;
};
}

Expand Down

0 comments on commit 9c2dfd7

Please sign in to comment.