Skip to content

Commit

Permalink
Merge pull request #611 from fdm-monster/fix/printer-list-action-tool…
Browse files Browse the repository at this point in the history
…tips

Terminal feat: add tooltips to printer list actions, fix: printer quick stop alert typo
  • Loading branch information
davidzwa authored Dec 13, 2024
2 parents a2e7b24 + 0624e18 commit 052b4a1
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 64 deletions.
9 changes: 8 additions & 1 deletion RELEASE_NOTES.MD
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Develop

# Client 0.0.14

## Features

- Printer list: add tooltips to printer list actions

## Fixes

- YAML dialog wouldn't reset error after re-opening
- Printer list - quick stop action: quick stop showed delete in alert, typo fixed

# Client 0.0.13

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fdm-monster/client-next",
"version": "0.0.13",
"version": "0.0.14",
"repository": {
"type": "git",
"url": "git+https://github.com/fdm-monster/fdm-monster-client-next.git"
Expand Down
42 changes: 24 additions & 18 deletions src/components/Generic/Actions/PrinterConnectionAction.vue
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
<template>
<v-badge
v-if="printer.enabled"
:color="isPrinterOperational() ? 'green' : 'red'"
class="pa-2"
>
<template #badge>
<v-icon v-if="isPrinterOperational()">check</v-icon>
<v-icon v-else>close</v-icon>
<v-tooltip location="top">
<template v-slot:activator="{ props }">
<v-badge
v-if="printer.enabled"
:color="isPrinterOperational() ? 'green' : 'red'"
class="pa-2"
>
<template #badge>
<v-icon v-if="isPrinterOperational()">check</v-icon>
<v-icon v-else>close</v-icon>
</template>
<v-btn
:disabled="isPrinterPrinting()"
v-bind="props"
color="secondary"
rounded
size="small"
@click.stop="togglePrinterConnection"
>
<v-icon>usb</v-icon>
</v-btn>
</v-badge>
</template>
<v-btn
:disabled="isPrinterPrinting()"
color="secondary"
rounded
size="small"
@click.stop="togglePrinterConnection"
>
<v-icon>usb</v-icon>
</v-btn>
</v-badge>
<template v-slot:default>Connect USB (OctoPrint only)</template>
</v-tooltip>
</template>

<script lang="ts" setup>
Expand Down
24 changes: 15 additions & 9 deletions src/components/Generic/Actions/PrinterDeleteAction.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
<template>
<v-btn
class="ms-4"
color="secondary"
size="small"
rounded
@click.prevent.stop="deletePrinter"
>
<v-icon>delete</v-icon>
</v-btn>
<v-tooltip location="top">
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
class="ms-4"
color="secondary"
size="small"
rounded
@click.prevent.stop="deletePrinter"
>
<v-icon>delete</v-icon>
</v-btn>
</template>
<template v-slot:default>Delete printer</template>
</v-tooltip>
</template>

<script lang="ts" setup>
Expand Down
42 changes: 24 additions & 18 deletions src/components/Generic/Actions/PrinterQuickStopAction.vue
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
<template>
<v-badge
v-if="printer.enabled"
class="ma-2"
>
<template #badge>
<v-icon>bolt</v-icon>
<v-tooltip location="top">
<template v-slot:activator="{ props }">
<v-badge
v-if="printer.enabled"
class="ma-2"
>
<template #badge>
<v-icon>bolt</v-icon>
</template>
<v-btn
v-bind="props"
color="secondary"
size="small"
rounded
@click.stop="clickQuickStop"
>
<v-icon>dangerous</v-icon>
</v-btn>
</v-badge>
</template>
<v-btn
color="secondary"
size="small"
rounded
@click.stop="clickQuickStop"
>
<v-icon>dangerous</v-icon>
</v-btn>
</v-badge>
<template v-slot:default>Perform quick stop of printer</template>
</v-tooltip>
</template>

<script lang="ts" setup>
Expand All @@ -26,8 +32,8 @@ const props = defineProps<{
}>()
async function clickQuickStop() {
if (confirm('Are you sure to abort the print? Please reconnect after.')) {
await CustomGcodeService.postQuickStopM112Command(props.printer.id)
}
if (!confirm('Are you sure to quick stop this printer?')) return
await CustomGcodeService.postQuickStopM112Command(props.printer.id)
}
</script>
24 changes: 15 additions & 9 deletions src/components/Generic/Actions/PrinterSettingsAction.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
<template>
<v-btn
color="secondary"
class="ma-2"
size="small"
rounded
@click.c.capture.native.stop="openSettings()"
>
<v-icon>settings</v-icon>
</v-btn>
<v-tooltip location="top">
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
color="secondary"
class="ma-2"
size="small"
rounded
@click.c.capture.native.stop="openSettings()"
>
<v-icon>settings</v-icon>
</v-btn>
</template>
<template v-slot:default>Update printer settings</template>
</v-tooltip>
</template>

<script lang="ts">
Expand Down
22 changes: 14 additions & 8 deletions src/components/Generic/Actions/PrinterUrlAction.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<template>
<v-btn
color="secondary"
rounded
size="small"
@click.c.capture.native.stop="openPrinterURL()"
>
<v-icon>directions</v-icon>
</v-btn>
<v-tooltip location="top">
<template v-slot:activator="{ props }">
<v-btn
v-bind="props"
color="secondary"
rounded
size="small"
@click.c.capture.native.stop="openPrinterURL()"
>
<v-icon>directions</v-icon>
</v-btn>
</template>
<template v-slot:default>Visit printer service</template>
</v-tooltip>
</template>

<script lang="ts" setup>
Expand Down

0 comments on commit 052b4a1

Please sign in to comment.