Skip to content

Commit

Permalink
Merge branch 'develop' into feat/collapsed-status-progress
Browse files Browse the repository at this point in the history
  • Loading branch information
matmen authored Jun 4, 2024
2 parents 02cb0c1 + 9b6676e commit cd7352d
Show file tree
Hide file tree
Showing 8 changed files with 275 additions and 225 deletions.
426 changes: 216 additions & 210 deletions package-lock.json

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,18 @@
"@fontsource/roboto": "^5.0.13",
"@irojs/iro-core": "^1.2.1",
"@jaames/iro": "^5.5.2",
"axios": "^1.6.8",
"axios": "^1.7.2",
"consola": "^3.2.3",
"dompurify": "^3.1.3",
"dompurify": "^3.1.5",
"echarts": "^5.5.0",
"echarts-gl": "^2.0.9",
"hls.js": "^1.5.8",
"hls.js": "^1.5.10",
"jwt-decode": "^4.0.0",
"lodash-es": "^4.17.21",
"marked": "^12.0.2",
"marked-base-url": "^1.1.3",
"md5": "^2.3.0",
"monaco-editor": "^0.48.0",
"monaco-editor": "^0.49.0",
"monaco-editor-textmate": "^4.0.0",
"monaco-textmate": "^3.0.1",
"onigasm": "^2.2.5",
Expand Down Expand Up @@ -78,15 +78,15 @@
"@mdi/js": "^7.4.47",
"@originjs/vite-plugin-content": "^1.0.5",
"@types/dompurify": "^3.0.5",
"@types/jsdom": "^21.1.6",
"@types/jsdom": "^21.1.7",
"@types/lodash-es": "^4.17.12",
"@types/md5": "^2.3.5",
"@types/node": "^20.12.12",
"@types/node": "^20.14.1",
"@types/semver": "^7.5.8",
"@types/sortablejs": "^1.15.8",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"@vitejs/plugin-vue2": "^2.3.1",
"@vue/eslint-config-standard": "^8.0.1",
"@vue/eslint-config-typescript": "^13.0.0",
Expand All @@ -95,17 +95,17 @@
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.26.0",
"husky": "^9.0.11",
"jsdom": "^24.0.0",
"jsdom": "^24.1.0",
"mockdate": "^3.0.5",
"monaco-vscode-textmate-theme-converter": "^0.1.7",
"rollup": "^4.17.2",
"rollup": "^4.18.0",
"sass": "~1.32.13",
"shx": "^0.3.4",
"skott": "^0.33.2",
"standard-version": "^9.5.0",
"typescript": "^5.4.5",
"unplugin-vue-components": "^0.27.0",
"vite": "^5.2.11",
"vite": "^5.2.12",
"vite-plugin-checker": "^0.6.4",
"vite-plugin-monaco-editor": "^1.1.0",
"vite-plugin-pwa": "^0.20.0",
Expand All @@ -114,7 +114,7 @@
"vue-i18n-extract": "^2.0.7",
"vue-template-compiler": "^2.7.16",
"vue-tsc": "^1.8.27",
"workbox-build": "^7.1.0",
"workbox-build": "^7.1.1",
"workbox-core": "^7.1.0",
"workbox-routing": "^7.1.0",
"workbox-strategies": "^7.1.0",
Expand Down
4 changes: 4 additions & 0 deletions src/components/widgets/console/Console.vue
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ export default class Console extends Mixins(StateMixin) {
display: block;
}
.console-item {
white-space: pre-wrap;
}
.console-wrapper {
font-family: monospace;
font-size: 1rem; // 15 px
Expand Down
7 changes: 6 additions & 1 deletion src/components/widgets/filesystem/setupMonaco.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ async function setupMonaco () {
const app = getVueApp()

monaco.editor.registerCommand('fluidd_open_docs', (_, service: CodeLensSupportedService, hash: string) => {
const serviceKey = service.replace(/-/g, '_')
const serviceKey = (
service === 'klipper'
? app.$store.getters['printer/getKlippyApp']
: service
).toLowerCase().replace(/-/g, '_')

const url = app.$t(`app.file_system.url.${serviceKey}_config`, { hash }).toString()

window.open(url)
Expand Down
9 changes: 8 additions & 1 deletion src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,14 @@ export const Globals = Object.freeze({
{ filename: 'mooncord-webcam.json', service: 'webcamd', link: 'https://github.com/eliteSchwein/mooncord' },
{ prefix: 'mooncord', service: 'MoonCord', link: 'https://github.com/eliteSchwein/mooncord' },
{ filename: 'telegram.conf', service: 'moonraker-telegram-bot', link: 'https://github.com/nlef/moonraker-telegram-bot/wiki/Sample-config' },
{ suffix: '.cfg', service: 'klipper', link: 'https://www.klipper3d.org/Config_Reference.html' }
{
suffix: '.cfg',
service: 'klipper',
link: 'https://www.klipper3d.org/Config_Reference.html',
linkOverride: {
'danger-klipper': 'https://dangerklipper.io/Config_Reference.html'
}
}
],
FILE_DATA_TRANSFER_TYPES: {
files: 'x-fluidd-files',
Expand Down
1 change: 1 addition & 0 deletions src/locales/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ app:
root_disabled: '{root} root is not available. Please check your logs.'
url:
klipper_config: 'https://www.klipper3d.org/Config_Reference.html#%{hash}'
danger_klipper_config: 'https://dangerklipper.io/Config_Reference.html#%{hash}'
moonraker_config: 'https://moonraker.readthedocs.io/en/latest/configuration/#%{hash}'
moonraker_telegram_bot_config: 'https://github.com/nlef/moonraker-telegram-bot/wiki/Sample-config#%{hash}'
crowsnest_config: 'https://crowsnest.mainsail.xyz/configuration/%{hash}-section'
Expand Down
15 changes: 15 additions & 0 deletions src/store/printer/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,21 @@ export const getters: GetterTree<PrinterState, RootState> = {
return 'Unknown'
},

getKlippyApp: (state) => {
const supportedKlippyApps = [
'Klipper',
'Danger-Klipper'
]

const app = state.printer.info.app

if (supportedKlippyApps.includes(app)) {
return app
}

return 'Klipper'
},

/**
* Returns a string value indicating the state of the printer.
*/
Expand Down
14 changes: 13 additions & 1 deletion src/store/server/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { ServerInfo, ServerConfig, ServerState, SystemInfo, ServerSystemSta
import type { RootState } from '../types'
import { Globals } from '@/globals'
import { gte, valid } from 'semver'
import isKeyOf from '@/util/is-key-of'

export const getters: GetterTree<ServerState, RootState> = {
/**
Expand Down Expand Up @@ -66,7 +67,7 @@ export const getters: GetterTree<ServerState, RootState> = {
* Maps configuration files to an object representing a config doc link,
* along with a service name.
*/
getConfigMapByFilename: (state, getters, rootState) => (filename: string) => {
getConfigMapByFilename: (state, getters, rootState, rootGetters) => (filename: string) => {
const configMap = Globals.CONFIG_SERVICE_MAP

// First, see if can find an exact match.
Expand All @@ -82,6 +83,17 @@ export const getters: GetterTree<ServerState, RootState> = {
item = configMap.find(o => o.suffix && filename.endsWith(o.suffix.toLowerCase()))
}

if (
item?.service === 'klipper' &&
item.linkOverride
) {
const app = rootGetters['printer/getKlippyApp'].toLowerCase()

if (isKeyOf(app, item.linkOverride)) {
item.link = item.linkOverride[app]
}
}

if (item) {
const itemService = item?.service
const instanceIds = rootState.server.system_info?.instance_ids
Expand Down

0 comments on commit cd7352d

Please sign in to comment.