Skip to content

Commit

Permalink
Merge pull request #15 from labbsr0x/app-status
Browse files Browse the repository at this point in the history
Check App Ingress Status
  • Loading branch information
gutorc92 authored Sep 11, 2020
2 parents 2bc587f + bf0a8c7 commit e1e3389
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/Services.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,19 @@
console.log(`erro`, err)
}
}
const getIngressStatus = async (app) => {
let basicName = app._name.split('-')
basicName.shift()
basicName = basicName.join('-')
const promsterUrl = `http://${basicName}-promster.${process.env.BB_MANAGER_DNS_EXTENSION}/api/v1/targets`
const res = await api.get(promsterUrl)
if (res.status === 200 ) {
return 'done'
} else {
throw new Error(error);
}
}
</script>
<div class="row mt-5">
<Button type="button" on:click={newApp} class="btn btn-info">
Expand All @@ -88,7 +101,19 @@
<div class="card-container">
<Card style="width: 360px;">
<Content class="mdc-typography--body2">
<h2 class="mdc-typography--headline6" style="margin: 0;">{app._name}</h2>
<h2 class="mdc-typography--headline6" style="margin: 0;">
{#await getIngressStatus(app)}
<p>...waiting</p>
{:then icon}
<span style="color: green">
<Icon class="material-icons">{icon}</Icon>
</span>
{:catch error}
<span style="color: red">
<Icon class="material-icons">highlight_off</Icon>
</span>
{/await}
{app._name}</h2>
<div class="card-internal">
{app._desc}
</div>
Expand All @@ -109,7 +134,7 @@
</IconButton>
<IconButton color="primary" on:click={deployPage(app._name)}>
<Icon class="material-icons">restore_page</Icon>
</IconButton>
</IconButton>
</ActionButtons>
</Actions>
</Card>
Expand Down

0 comments on commit e1e3389

Please sign in to comment.