Skip to content

Commit

Permalink
feat: config ai image status
Browse files Browse the repository at this point in the history
  • Loading branch information
jakowenko committed Jun 22, 2023
1 parent 3657c0d commit 74a4ef1
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions frontend/src/views/ConfigView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ const waitForRestart = ref(false);
let timeout: ReturnType<typeof setTimeout>;
const status = ref<HTMLElement | null>(null);
const statusHeight = ref<number>(0);
const services = ref<Array<{ name: string; status?: any; tooltip?: any }>>([
const services = ref<Array<{ name: string; status?: any; tooltip?: any; services: string[] }>>([
{
name: 'Phrame',
status: null,
tooltip: null,
services: [],
},
]);
Expand Down Expand Up @@ -101,6 +102,7 @@ const checkServices = async () => {
services.value.push({
name: aiToTitleCase(configuredAI.ai),
status: configuredAI.status === true ? 200 : 500,
services: configuredAI.services,
tooltip:
configuredAI.status === true
? `Image Service ${configuredAI.services.includes('image') ? 'Enabled' : 'Disabled'}`
Expand Down Expand Up @@ -162,8 +164,9 @@ onMounted(async () => {
: service.tooltip
"
class="flex align-items-center mr-2"
v-for="service in services"
v-for="(service, index) in services"
:key="service.name"
:class="{ 'no-image': index > 0 && !service.services.includes('image') }"
>
<div
v-if="service.status"
Expand Down Expand Up @@ -230,6 +233,8 @@ ul.service-status {
list-style: none;
margin: 0;
padding: 0;
white-space: nowrap;
overflow-x: auto;
.icon {
width: 10px;
Expand All @@ -241,6 +246,12 @@ ul.service-status {
li {
cursor: pointer;
&:hover {
text-decoration: underline;
}
}
li.no-image {
opacity: 0.35;
}
.icon.pulse {
Expand Down

0 comments on commit 74a4ef1

Please sign in to comment.