Skip to content

Commit e28c3c1

Browse files
committed
Merge branch 'develop'
Signed-off-by: Pedro Lamas <[email protected]>
2 parents d7e03cf + 2b6f62e commit e28c3c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1594
-826
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@
1919
"esbenp.prettier-vscode",
2020
"lukas-tr.materialdesignicons-intellisense",
2121
"ms-azuretools.vscode-docker",
22+
"orta.vscode-twoslash-queries",
2223
"redhat.vscode-yaml",
2324
"vue.volar"
2425
],
2526
"settings": {
2627
"editor.codeActionsOnSave": {
27-
"source.fixAll.eslint": true
28+
"source.fixAll.eslint": "explicit"
2829
},
2930
"i18n-ally.localesPaths": [
3031
"src/locales"

.vscode/extensions.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"esbenp.prettier-vscode",
88
"lukas-tr.materialdesignicons-intellisense",
99
"ms-azuretools.vscode-docker",
10+
"orta.vscode-twoslash-queries",
1011
"redhat.vscode-yaml",
1112
"vue.volar"
1213
]

env.d.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/// <reference types="vuetify" />
44
/// <reference types="vue-meta" />
55
/// <reference types="vite-plugin-pwa/client" />
6+
/// <reference types="./tsreset" />
67

78
declare module '*.yaml' {
89
const data: unknown
@@ -26,13 +27,3 @@ interface ImportMetaEnv {
2627
interface ImportMeta {
2728
readonly env: ImportMetaEnv
2829
}
29-
30-
interface String {
31-
toLowerCase<T extends string>(this: T): Lowercase<T>
32-
33-
toUpperCase<T extends string>(this: T): Uppercase<T>
34-
35-
startsWith<T extends string, T2 extends string>(this: T, searchString: T2, position?: number): this is `${T2}${string}`
36-
37-
endWith<T extends string, T2 extends string>(this: T, searchString: T2, position?: number): this is `${string}${T2}`
38-
}

package-lock.json

Lines changed: 236 additions & 226 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"@types/jsdom": "^21.1.7",
8181
"@types/lodash-es": "^4.17.12",
8282
"@types/md5": "^2.3.5",
83-
"@types/node": "^22.13.1",
83+
"@types/node": "^22.13.4",
8484
"@types/semver": "^7.5.8",
8585
"@types/sortablejs": "^1.15.8",
8686
"@vitejs/plugin-vue2": "^2.3.3",
@@ -95,13 +95,13 @@
9595
"mockdate": "^3.0.5",
9696
"monaco-vscode-textmate-theme-converter": "^0.1.7",
9797
"neostandard": "^0.12.1",
98-
"rollup": "^4.34.6",
98+
"rollup": "^4.34.8",
9999
"sass": "~1.32.13",
100100
"skott": "^0.35.4",
101101
"standard-version": "^9.5.0",
102102
"typescript": "^5.7.3",
103-
"typescript-eslint": "^8.24.0",
104-
"unplugin-vue-components": "^28.0.0",
103+
"typescript-eslint": "^8.24.1",
104+
"unplugin-vue-components": "^28.2.0",
105105
"vite": "^6.1.0",
106106
"vite-plugin-checker": "^0.8.0",
107107
"vite-plugin-monaco-editor-esm": "^2.0.2",
@@ -110,7 +110,7 @@
110110
"vue-debounce-decorator": "^1.0.1",
111111
"vue-i18n-extract": "^2.0.7",
112112
"vue-template-compiler": "^2.7.16",
113-
"vue-tsc": "^2.2.0",
113+
"vue-tsc": "^2.2.2",
114114
"workbox-build": "^7.3.0",
115115
"workbox-core": "^7.3.0",
116116
"workbox-precaching": "^7.3.0",

src/App.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
(socketConnected && apiConnected) &&
5555
(!klippyReady || hasWarnings) &&
5656
!inLayout &&
57-
$route.path !== '/login'
57+
$route.name !== 'login'
5858
"
5959
>
6060
<v-col>
@@ -374,6 +374,8 @@ export default class App extends Mixins(StateMixin, FilesMixin, BrowserMixin) {
374374
375375
handleDragOver (event: DragEvent) {
376376
if (
377+
this.socketConnected &&
378+
this.authenticated &&
377379
this.fileDropRoot &&
378380
event.dataTransfer &&
379381
hasFilesInDataTransfer(event.dataTransfer)

src/api/socketActions.ts

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -573,23 +573,27 @@ export const SocketActions = {
573573
* Expects the full path including root.
574574
* Optionally pass the just the filename and path.
575575
*/
576-
async serverFilesMetadata (filepath: string) {
576+
async serverFilesMetadata (filename: string) {
577+
const wait = `${Waits.onFileSystem}/gcodes/${filename}`
577578
baseEmit(
578579
'server.files.metadata', {
579580
dispatch: 'files/onFileMetaData',
581+
wait,
580582
params: {
581-
filename: filepath
583+
filename
582584
}
583585
}
584586
)
585587
},
586588

587-
async serverFilesMetascan (filepath: string) {
589+
async serverFilesMetascan (filename: string) {
590+
const wait = `${Waits.onFileSystem}/gcodes/${filename}`
588591
baseEmit(
589592
'server.files.metascan', {
590593
dispatch: 'files/onFileMetaData',
594+
wait,
591595
params: {
592-
filename: filepath
596+
filename
593597
}
594598
}
595599
)
@@ -689,7 +693,7 @@ export const SocketActions = {
689693
},
690694

691695
async serverFilesDeleteFile (path: string) {
692-
const wait = `${Waits.onFileSystem}/${path}/`
696+
const wait = `${Waits.onFileSystem}/${path}`
693697
baseEmit(
694698
'server.files.delete_file', {
695699
dispatch: 'void',
@@ -780,6 +784,43 @@ export const SocketActions = {
780784
)
781785
},
782786

787+
async serverAnalysisStatus () {
788+
baseEmit(
789+
'server.analysis.status', {
790+
dispatch: 'analysis/onAnalysisStatus'
791+
}
792+
)
793+
},
794+
795+
async serverAnalysisEstimate (filename: string, estimator_config?: string) {
796+
const wait = `${Waits.onFileSystem}/gcodes/${filename}`
797+
baseEmit(
798+
'server.analysis.estimate', {
799+
params: {
800+
filename,
801+
estimator_config
802+
},
803+
wait,
804+
dispatch: 'void'
805+
}
806+
)
807+
},
808+
809+
async serverAnalysisProcess (filename: string, estimator_config?: string, force?: boolean) {
810+
const wait = `${Waits.onFileSystem}/gcodes/${filename}`
811+
baseEmit(
812+
'server.analysis.process', {
813+
params: {
814+
filename,
815+
estimator_config,
816+
force
817+
},
818+
wait,
819+
dispatch: 'analysis/onAnalysisProcess'
820+
}
821+
)
822+
},
823+
783824
async serverSpoolmanGetSpoolId () {
784825
baseEmit(
785826
'server.spoolman.get_spool_id', {

src/components/layout/AppBar.vue

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -329,23 +329,20 @@ export default class AppBar extends Mixins(StateMixin, ServicesMixin, FilesMixin
329329
}
330330
331331
get isDashboard () {
332-
return this.$route.path === '/'
332+
return this.$route.name === 'home'
333333
}
334334
335335
handleResetLayout () {
336-
const pathLayouts: Record<string, string> = {
337-
'/diagnostics': 'diagnostics'
338-
}
339-
340-
const pathLayout = pathLayouts[this.$route.path]
341-
let layoutDefaultState
342-
if (pathLayout) {
343-
// reset to default init state
344-
layoutDefaultState = defaultState().layouts[pathLayout]
345-
} else {
346-
// reset dashboard to default layout
347-
layoutDefaultState = this.$store.getters['layout/getLayout']('dashboard')
348-
}
336+
const pathLayouts = [
337+
'diagnostics'
338+
]
339+
340+
const pathLayout = pathLayouts.includes(this.$route.name ?? '')
341+
? this.$route.name
342+
: undefined
343+
const layoutDefaultState = pathLayout
344+
? defaultState().layouts[pathLayout]
345+
: this.$store.getters['layout/getLayout']('dashboard')
349346
350347
const toReset = pathLayout ?? this.$store.getters['layout/getSpecificLayoutName']
351348

src/components/ui/AppNavItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default class AppNavItem extends Mixins(StateMixin, BrowserMixin) {
7777
if (
7878
shortcut === this.accelerator &&
7979
!eventTargetIsContentEditable(event) &&
80-
this.$router.currentRoute.name !== this.to
80+
this.$route.name !== this.to
8181
) {
8282
event.preventDefault()
8383

src/components/widgets/camera/services/DeviceCamera.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export default class DeviceCamera extends Mixins(CameraMixin) {
4040
this.updateStatus('disconnected')
4141
4242
try {
43-
const stream = this.cameraVideo.srcObject as MediaStream
43+
const stream = this.cameraVideo.srcObject as MediaStream | null
4444
4545
if (stream) {
4646
for (const track of stream.getTracks()) {

0 commit comments

Comments
 (0)