This commit is contained in:
Ruben Fiszel
2023-07-24 16:13:30 +02:00
parent a3de4767de
commit ca4ca371ff
3 changed files with 18 additions and 2 deletions
+9
View File
@@ -74,3 +74,12 @@ export function pathToMeta(path: string): Meta {
name: splitted.slice(2).join('/')
}
}
export function prettyLanguage(lang: string) {
switch (lang) {
case 'nativets':
return 'Native Typescript'
default:
return lang.charAt(0).toUpperCase() + lang.slice(1)
}
}
@@ -10,6 +10,7 @@
import type { Writable } from 'svelte/store'
import FlowModuleSchemaItem from './FlowModuleSchemaItem.svelte'
import InsertModuleButton from './InsertModuleButton.svelte'
import { prettyLanguage } from '$lib/common'
export let mod: FlowModule
export let trigger: boolean
@@ -154,7 +155,9 @@
{bgColor}
label={mod.summary ||
(`path` in mod.value ? mod.value.path : undefined) ||
(mod.value.type === 'rawscript' ? `Inline ${mod.value.language}` : 'To be defined')}
(mod.value.type === 'rawscript'
? `Inline ${prettyLanguage(mod.value.language)}`
: 'To be defined')}
>
<div slot="icon">
{#if mod.value.type === 'rawscript'}
@@ -29,7 +29,11 @@
}
async function loadInstanceGroups(): Promise<void> {
instanceGroups = await GroupService.listInstanceGroups()
try {
instanceGroups = await GroupService.listInstanceGroups()
} catch (e) {
instanceGroups = undefined
}
}
function handleKeyUp(event: KeyboardEvent) {