Skip to content
This repository was archived by the owner on Feb 6, 2026. It is now read-only.

Commit 25969a4

Browse files
authored
Merge pull request #8328 from systeminit/jobelenus/label-action-toggle
Add label for actions panel toggle
2 parents ba0d6e6 + 48413f5 commit 25969a4

File tree

2 files changed

+45
-24
lines changed

2 files changed

+45
-24
lines changed

app/web/src/newhotness/ActionWidget.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,19 @@
99
"
1010
@click="clickHandler"
1111
>
12-
<Toggle :selected="!!props.actionId" class="flex-none" />
1312
<StatusIndicatorIcon type="action" :status="actionPrototypeView.kind" tone="inherit" class="flex-none" />
1413
<div class="font-bold leading-normal text-sm">
1514
{{ actionPrototypeView.displayName || actionPrototypeView.name }}
1615
</div>
1716

18-
<Icon v-if="actionBifrosting" name="loader" class="ml-auto" size="sm" />
17+
<Toggle
18+
:selected="!!props.actionId"
19+
class="flex-none ml-auto"
20+
onLabel="Queued"
21+
offLabel="UnQueued"
22+
labelWidth="w-[70px]"
23+
/>
24+
<Icon v-if="actionBifrosting" name="loader" size="sm" />
1925
</div>
2026
</template>
2127

Lines changed: 37 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,43 @@
11
<template>
2-
<div
3-
:class="
4-
clsx(
5-
size === 'sm' ? 'w-6 h-4' : 'w-9 h-6',
6-
'cursor-pointer flex-none flex items-center rounded-full p-1 duration-300 ease-in-out',
7-
props.selected
8-
? themeClasses('bg-action-300', 'bg-action-500')
9-
: themeClasses('bg-neutral-400', 'bg-neutral-500'),
10-
)
11-
"
12-
@click="click"
13-
>
2+
<div :class="clsx('flex flex-row items-center')">
143
<div
154
:class="
165
clsx(
17-
'bg-white rounded-full shadow-md transform duration-300 ease-in-out',
18-
size === 'sm'
19-
? [
20-
'w-3 h-3',
21-
props.selected
22-
? 'translate-x-[0.35rem]'
23-
: 'translate-x-[-0.1rem]',
24-
]
25-
: ['w-4 h-4', props.selected ? 'translate-x-3' : ''],
6+
size === 'sm' ? 'w-6 h-4' : 'w-9 h-6',
7+
'cursor-pointer flex-none flex items-center rounded-full p-1 duration-300 ease-in-out',
8+
props.selected
9+
? themeClasses('bg-action-300', 'bg-action-500')
10+
: themeClasses('bg-neutral-400', 'bg-neutral-500'),
2611
)
2712
"
28-
></div>
13+
@click="click"
14+
>
15+
<div
16+
:class="
17+
clsx(
18+
'bg-white rounded-full shadow-md transform duration-300 ease-in-out',
19+
size === 'sm'
20+
? [
21+
'w-3 h-3',
22+
props.selected
23+
? 'translate-x-[0.35rem]'
24+
: 'translate-x-[-0.1rem]',
25+
]
26+
: ['w-4 h-4', props.selected ? 'translate-x-3' : ''],
27+
)
28+
"
29+
></div>
30+
</div>
31+
<span
32+
:class="clsx('px-1 text-xs', props.labelWidth)"
33+
v-if="props.onLabel && props.selected"
34+
>{{ props.onLabel }}</span
35+
>
36+
<span
37+
:class="clsx('px-1 text-xs', props.labelWidth)"
38+
v-if="props.offLabel && !props.selected"
39+
>{{ props.offLabel }}</span
40+
>
2941
</div>
3042
</template>
3143

@@ -40,5 +52,8 @@ const props = defineProps({
4052
size: { type: String, default: "md" },
4153
selected: { type: Boolean },
4254
click: { type: Function as PropType<clickFn>, default: () => {} },
55+
onLabel: { type: String, required: false },
56+
offLabel: { type: String, required: false },
57+
labelWidth: { type: String, required: false, default: "" },
4358
});
4459
</script>

0 commit comments

Comments
 (0)