diff --git a/babel.config.js b/babel.config.js index e9558405..c94e7293 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,5 +1,5 @@ module.exports = { - presets: [ - '@vue/cli-plugin-babel/preset' - ] + presets: [ + '@vue/cli-plugin-babel/preset' + ] } diff --git a/src/App.vue b/src/App.vue index ab7bf97d..3ffa8913 100644 --- a/src/App.vue +++ b/src/App.vue @@ -81,7 +81,7 @@ export default class App extends Mixins(BaseMixin) { } get customStylesheet () { - return this.$store.getters["files/getCustomStylesheet"] + return this.$store.getters['files/getCustomStylesheet'] } get customFavicons(): string | null { diff --git a/src/components/panels/FarmPrinterPanel.vue b/src/components/panels/FarmPrinterPanel.vue index dc66cf80..125fcadf 100644 --- a/src/components/panels/FarmPrinterPanel.vue +++ b/src/components/panels/FarmPrinterPanel.vue @@ -179,7 +179,7 @@ export default class FarmPrinterPanel extends Mixins(BaseMixin) { } get printerLogoColor() { - return this.$store.getters["farm/"+this.printer._namespace+"/getLogoColor"] + return this.$store.getters['farm/'+this.printer._namespace+'/getLogoColor'] } get printer_position() { @@ -209,12 +209,12 @@ export default class FarmPrinterPanel extends Mixins(BaseMixin) { } mounted() { - window.addEventListener("resize", this.resize) + window.addEventListener('resize', this.resize) this.resize() } beforeDestroy() { - window.addEventListener("resize", this.resize) + window.addEventListener('resize', this.resize) } resize() { diff --git a/src/pages/Files.vue b/src/pages/Files.vue index 8e6027e8..0b200f91 100644 --- a/src/pages/Files.vue +++ b/src/pages/Files.vue @@ -807,8 +807,8 @@ export default class PageFiles extends Mixins(BaseMixin) { this.files = this.files.filter(file => { if (file.isDirectory) return true else { - return (this.$store.getters["server/history/getPrintStatusByFilename"]( - (this.currentPath+"/"+file.filename).substr(7), + return (this.$store.getters['server/history/getPrintStatusByFilename']( + (this.currentPath+'/'+file.filename).substr(7), file.modified.getTime() ) !== 'completed') } diff --git a/src/store/farm/printer/getters.ts b/src/store/farm/printer/getters.ts index 38328dd5..bbb0676c 100644 --- a/src/store/farm/printer/getters.ts +++ b/src/store/farm/printer/getters.ts @@ -37,9 +37,9 @@ export const getters: GetterTree = { return state.socket.port !== 80 ? state.socket.hostname+':'+state.socket.port : state.socket.hostname }, - getLogoColor: (state) => { - return state.data.gui?.theme?.logo ?? defaultLogoColor - }, + getLogoColor: (state) => { + return state.data.gui?.theme?.logo ?? defaultLogoColor + }, getStatus: (state, getters) => { if (!state.socket.isConnected) { diff --git a/src/store/farm/printer/mutations.ts b/src/store/farm/printer/mutations.ts index 7d40a791..55528234 100644 --- a/src/store/farm/printer/mutations.ts +++ b/src/store/farm/printer/mutations.ts @@ -58,11 +58,11 @@ export const mutations: MutationTree = { setConfigDir(state, payload) { // eslint-disable-next-line Object.values(payload).forEach((file: any) => { - if (file.path?.startsWith(".theme/")) { - state.theme_files.push(file.path) - } - }) - }, + if (file.path?.startsWith('.theme/')) { + state.theme_files.push(file.path) + } + }) + }, setDatabases(state, payload) { Vue.set(state, 'databases', payload.namespaces) diff --git a/src/store/files/getters.ts b/src/store/files/getters.ts index 20577253..0312090e 100644 --- a/src/store/files/getters.ts +++ b/src/store/files/getters.ts @@ -36,8 +36,8 @@ export const getters: GetterTree = { const acceptName = 'main-background' const acceptExtensions = ['jpg', 'jpeg', 'png', 'gif', 'svg'] - return getters['getThemeFileUrl'](acceptName, acceptExtensions) - }, + return getters['getThemeFileUrl'](acceptName, acceptExtensions) + }, getCustomStylesheet: (state, getters) => { const acceptName = 'custom' diff --git a/src/store/printer/mutations.ts b/src/store/printer/mutations.ts index b3e1edd8..4b5e7f36 100644 --- a/src/store/printer/mutations.ts +++ b/src/store/printer/mutations.ts @@ -26,12 +26,12 @@ export const mutations: MutationTree = { const value = payload[key] if ( - typeof value === 'object' && + typeof value === 'object' && !Array.isArray(value) && key in currentState && value !== null && currentState[key] !== null - ) { + ) { setDataDeep(currentState[key], value) } else if (key === 'temperature') { const newValue = Math.round(value * 10) / 10 diff --git a/src/store/server/history/getters.ts b/src/store/server/history/getters.ts index 7092ce25..d25f9042 100644 --- a/src/store/server/history/getters.ts +++ b/src/store/server/history/getters.ts @@ -184,18 +184,18 @@ export const getters: GetterTree = { }, getPrintStatusByFilename: (state) => (filename: string, modified: number) => { - if (state.jobs.length) { - const job = state.jobs.find((job) => { - return job.filename === filename && Math.round(job.metadata?.modified*1000) === modified - }) + if (state.jobs.length) { + const job = state.jobs.find((job) => { + return job.filename === filename && Math.round(job.metadata?.modified*1000) === modified + }) - return job?.status ?? "" - } + return job?.status ?? '' + } - return "" - }, + return '' + }, - getPrintStatusChipColor: () => (status: string) => { + getPrintStatusChipColor: () => (status: string) => { switch(status) { case 'in_progress': return 'blue accent-3' //'blue-grey darken-1' case 'completed': return 'green' //'green' diff --git a/src/store/socket/getters.ts b/src/store/socket/getters.ts index 2db2f6db..30992e32 100644 --- a/src/store/socket/getters.ts +++ b/src/store/socket/getters.ts @@ -9,10 +9,10 @@ export const getters: GetterTree = { }, getHostUrl: (state) => { - return (state.protocol === 'wss' ? 'https' : 'http')+"://" + state.hostname + '/' - }, + return (state.protocol === 'wss' ? 'https' : 'http')+'://' + state.hostname + '/' + }, - getWebsocketUrl: (state, getters) => { + getWebsocketUrl: (state, getters) => { return state.protocol + ':' + getters['getUrl'] + '/websocket' }, } \ No newline at end of file diff --git a/vue-i18n-extract.config.js b/vue-i18n-extract.config.js index ae603868..0827f162 100644 --- a/vue-i18n-extract.config.js +++ b/vue-i18n-extract.config.js @@ -1,9 +1,9 @@ module.exports = { - vueFilesPath: './src/**/{*.?(js|ts|vue),.i18nignore}', - languageFilesPath: './src/locales/*.json', - options: { - output: false, - add: false, - dynamic: true - } + vueFilesPath: './src/**/{*.?(js|ts|vue),.i18nignore}', + languageFilesPath: './src/locales/*.json', + options: { + output: false, + add: false, + dynamic: true + } } \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index 51597e2d..37563104 100644 --- a/vue.config.js +++ b/vue.config.js @@ -8,71 +8,71 @@ const packageJson = fs.readFileSync('./package.json') const version = JSON.parse(packageJson).version || 0 module.exports = { - productionSourceMap: false, - transpileDependencies: [ 'vuetify' ], - pluginOptions: { - i18n: { - locale: 'en', - fallbackLocale: 'en', - localeDir: 'locales', - enableInSFC: true - } - }, - configureWebpack: { - plugins: [ - new webpack.DefinePlugin({ - 'process.env': { - PACKAGE_VERSION: '"' + version + '"' - } - }), - generate({ - file: '.version', - content: 'v' + version - }), - ], - resolve: { - alias: { - vue$: 'vue/dist/vue.esm.js', - '@': path.resolve('src') - } - } - }, - pwa: { - serviceWorker: false, - iconPaths: { - favicon16: 'img/icons/favicon-16x16.png', - favicon32: 'img/icons/favicon-32x32.png', - appleTouchIcon: 'img/icons/apple-touch-icon-152x152.png', - msTileImage: 'img/icons/mstile-150x150.png' - }, - manifestPath: 'manifest.json', - name: 'Mainsail', - themeColor: '#121212', - msTileColor: '#121212', - appleMobileWebAppCapable: 'yes', - appleMobileWebAppStatusBarStyle: 'black', + productionSourceMap: false, + transpileDependencies: [ 'vuetify' ], + pluginOptions: { + i18n: { + locale: 'en', + fallbackLocale: 'en', + localeDir: 'locales', + enableInSFC: true + } + }, + configureWebpack: { + plugins: [ + new webpack.DefinePlugin({ + 'process.env': { + PACKAGE_VERSION: '"' + version + '"' + } + }), + generate({ + file: '.version', + content: 'v' + version + }), + ], + resolve: { + alias: { + vue$: 'vue/dist/vue.esm.js', + '@': path.resolve('src') + } + } + }, + pwa: { + serviceWorker: false, + iconPaths: { + favicon16: 'img/icons/favicon-16x16.png', + favicon32: 'img/icons/favicon-32x32.png', + appleTouchIcon: 'img/icons/apple-touch-icon-152x152.png', + msTileImage: 'img/icons/mstile-150x150.png' + }, + manifestPath: 'manifest.json', + name: 'Mainsail', + themeColor: '#121212', + msTileColor: '#121212', + appleMobileWebAppCapable: 'yes', + appleMobileWebAppStatusBarStyle: 'black', - manifestOptions: { - "short_name": "Mainsail", - "name": "Mainsail", - "start_url": "/", - "display": "standalone", - "theme_color": "#D51F26", - "background_color": "#121212", - "icons": [ - { - "src": "./img/icons/icon-196-maskable.png", - "sizes": "196x196", - "type": "image/png", - "purpose": "maskable", - }, - { - "src": "./img/icons/icon-512-maskable.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable", - }, - ] - } - } + manifestOptions: { + 'short_name': 'Mainsail', + 'name': 'Mainsail', + 'start_url': '/', + 'display': 'standalone', + 'theme_color': '#D51F26', + 'background_color': '#121212', + 'icons': [ + { + 'src': './img/icons/icon-196-maskable.png', + 'sizes': '196x196', + 'type': 'image/png', + 'purpose': 'maskable', + }, + { + 'src': './img/icons/icon-512-maskable.png', + 'sizes': '512x512', + 'type': 'image/png', + 'purpose': 'maskable', + }, + ] + } + } }