Skip to content

Commit

Permalink
Merge pull request #1665 from fdm-monster/fix/add-moonraker-warning
Browse files Browse the repository at this point in the history
Fix/add moonraker warning
  • Loading branch information
davidzwa authored Nov 1, 2024
2 parents 4f8c377 + 662ed77 commit 8bb041b
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 2 deletions.
5 changes: 5 additions & 0 deletions RELEASE_NOTES.MD
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Release notes

## Client 27/10/2024 1.6.5

Feature:

- Support klipper in printer create/update dialog, if backend is able to provide said feature (feature flags).
- Show klipper/octoprint on tile
- Add moonraker/mainsail redirects in side panel
- Show klipper/octoprint in printer list

## Client 27/10/2024 1.6.4

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",
"version": "1.6.4",
"version": "1.6.5",
"author": "David Zwart",
"license": "AGPL-3.0-or-later",
"repository": {
Expand Down
31 changes: 30 additions & 1 deletion src/components/Generic/FileExplorerSideNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
>
<v-list-item-avatar class="ml-3 mr-6 ma-5" size="20px">
<v-img v-if="isOctoPrint" :src="octoPrintIcon"></v-img>
<span v-else>M</span>
<span v-else>MO</span>
</v-list-item-avatar>
<v-list-item-content>
<span v-if="isOctoPrint">Open OctoPrint</span>
Expand All @@ -111,6 +111,26 @@
<span>Visit the {{ serviceName }} associated to this printer</span>
</v-tooltip>

<v-tooltip left v-if="isMoonraker">
<template v-slot:activator="{ on, attrs }">
<v-list-item
class="extra-dense-list-item"
link
v-bind="attrs"
v-on="on"
@click.prevent.stop="openPrinterMainsail()"
>
<v-list-item-avatar class="ml-3 mr-6 ma-5" size="20px">
<span>MA</span>
</v-list-item-avatar>
<v-list-item-content>
<span>Open Mainsail</span>
</v-list-item-content>
</v-list-item>
</template>
<span>Visit Mainsail for this printer</span>
</v-tooltip>

<v-tooltip left>
<template v-slot:activator="{ on, attrs }">
<v-list-item
Expand Down Expand Up @@ -593,6 +613,15 @@ function openPrinterURL() {
closeDrawer();
}
function openPrinterMainsail() {
if (!storedSideNavPrinter.value) return;
const url = new URL(storedSideNavPrinter.value.printerURL);
url.port = "8080";
PrintersService.openPrinterURL(url.toString());
closeDrawer();
}
async function togglePrinterConnection() {
if (!printerId.value) return;
if (printerStateStore.isPrinterOperational(printerId.value)) {
Expand Down
8 changes: 8 additions & 0 deletions src/components/PrinterGrid/PrinterGridTile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
tile
@click="selectOrUnplacePrinter()"
>
<div
v-if="printer?.printerType !== undefined"
class="printer-type-indicator"
style="position: absolute; top: 5%; right: 5%; font-size: 14px; font-weight: bold"
>
{{ printer.printerType === 1 ? "KL" : "OP" }}
</div>

<v-icon
v-if="printerState?.text.includes('API')"
color="primary"
Expand Down
16 changes: 16 additions & 0 deletions src/components/PrinterList/PrintersView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@
{{ item.enabled }}
</v-switch>
</template>
<template v-slot:item.printerType="{ item }">
{{
item.printerType === 0
? "OctoPrint"
: isSupportedPrinterType
? "Klipper"
: "Klipper (feature disabled)"
}}
</template>
<template v-slot:item.name="{ item }">
<v-chip color="primary" dark>
{{ item.name || item.printerURL }}
Expand Down Expand Up @@ -251,6 +260,7 @@ const expanded = ref<PrinterDto[]>([]);
const hasPrinterGroupFeature = computed(() => featureStore.hasFeature("printerGroupsApi"));
const tableHeaders = computed(() => [
{ text: "Enabled", value: "enabled" },
{ text: "Type", value: "printerType" },
{ text: "Printer Name", align: "start", sortable: true, value: "name" },
{ text: "Floor", value: "floor", sortable: false },
...(featureStore.hasFeature("printerGroupsApi")
Expand Down Expand Up @@ -297,6 +307,12 @@ const selectedGroupObject = computed(() => {
return groupsWithPrinters.value[selectedGroup.value];
});
const isSupportedPrinterType = computed(() => {
return featureStore
.getFeature<{ types: string[] }>("multiplePrinterServices")
?.subFeatures?.types?.includes("klipper");
});
const diffSeconds = (timestamp: number) => {
if (!timestamp) return;
const now = Date.now();
Expand Down
6 changes: 6 additions & 0 deletions src/components/Settings/ExperimentalSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@
<span>Enable Experimental Moonraker Support</span>
</template>
</v-checkbox>

<!-- Warning message -->
<v-alert v-if="experimentalMoonrakerSupport" type="warning" class="mt-2" outlined>
Disabling Moonraker support will disable all printers of type Moonraker. You
need to re-enable them after re-enabling this feature.
</v-alert>
</v-card-text>
</v-card>
</v-col>
Expand Down

0 comments on commit 8bb041b

Please sign in to comment.