Skip to content

Commit

Permalink
Add auto formattings.
Browse files Browse the repository at this point in the history
  • Loading branch information
clemens-tolboom committed Nov 22, 2023
1 parent ac8358a commit f72beb2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ui/src/types/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type Principal = {
authorities: [
{
authority: string;
}
},
];
details: Object | null;
authenticated: boolean;
Expand Down
27 changes: 22 additions & 5 deletions ui/src/views/Profiles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,20 @@
</template>
<template #objectType="objectProps">
<div
v-if="objectProps.data && statusMapping[objectProps.data.status as keyof typeof statusMapping]"
v-if="
objectProps.data &&
statusMapping[objectProps.data.status as keyof typeof statusMapping]
"
class="row"
>
<div class="col-6">
<span
class="badge"
:class="`bg-${statusMapping[objectProps.data.status as keyof typeof statusMapping].color}`"
:class="`bg-${
statusMapping[
objectProps.data.status as keyof typeof statusMapping
].color
}`"
>
{{
statusMapping[
Expand All @@ -60,7 +67,9 @@
:disabled="true"
v-if="objectProps.row.name === loadingProfile"
:text="
statusMapping[objectProps.data.status as keyof typeof statusMapping].status === 'OFFLINE'
statusMapping[
objectProps.data.status as keyof typeof statusMapping
].status === 'OFFLINE'
? 'Starting'
: 'Stopping'
"
Expand All @@ -69,15 +78,23 @@
<ProfileStatus
v-else
:disabled="loading"
:text="statusMapping[objectProps.data.status as keyof typeof statusMapping].text"
:text="
statusMapping[
objectProps.data.status as keyof typeof statusMapping
].text
"
@click.prevent="
statusMapping[
objectProps.data.status as keyof typeof statusMapping
].status === 'ONLINE'
? stopProfile(objectProps.row.name)
: startProfile(objectProps.row.name)
"
:icon="statusMapping[objectProps.data.status as keyof typeof statusMapping].icon"
:icon="
statusMapping[
objectProps.data.status as keyof typeof statusMapping
].icon
"
></ProfileStatus>
</div>
</div>
Expand Down

0 comments on commit f72beb2

Please sign in to comment.