mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-08-26 08:01:38 +00:00
ata nits
This commit is contained in:
@@ -96,19 +96,21 @@ export const setupTypeAcquisition = (config: ATABootstrapConfig) => {
|
||||
// Make it so it won't get re-downloaded
|
||||
depsToGet.forEach((dep) => moduleMap.set(dep.raw, { state: 'loading' }))
|
||||
|
||||
const relativeDeps = depsToGet.filter((f) => isRelativePath(f.raw))
|
||||
relativeDeps.forEach(async (f) => {
|
||||
let path = f.raw.startsWith('/')
|
||||
? ''
|
||||
: '/' + config.scriptPath + (f.raw.startsWith('../') ? '/../' : '/.') + f.raw
|
||||
let url = config.root + path
|
||||
console.log('path', config.scriptPath, path, url)
|
||||
const res = await fetch(url)
|
||||
if (res.ok) {
|
||||
config.delegate.localFile?.(await res.text(), f.raw)
|
||||
}
|
||||
})
|
||||
depsToGet = depsToGet.filter((f) => !isRelativePath(f.raw))
|
||||
if (depth == 0) {
|
||||
const relativeDeps = depsToGet.filter((f) => isRelativePath(f.raw))
|
||||
relativeDeps.forEach(async (f) => {
|
||||
let path = f.raw.startsWith('/')
|
||||
? ''
|
||||
: '/' + config.scriptPath + (f.raw.startsWith('../') ? '/../' : '/.') + f.raw
|
||||
let url = config.root + path
|
||||
console.log('path', config.scriptPath, path, url)
|
||||
const res = await fetch(url)
|
||||
if (res.ok) {
|
||||
config.delegate.localFile?.(await res.text(), f.raw)
|
||||
}
|
||||
})
|
||||
depsToGet = depsToGet.filter((f) => !isRelativePath(f.raw))
|
||||
}
|
||||
|
||||
// Grab the module trees which gives us a list of files to download
|
||||
const trees = await Promise.all(
|
||||
|
||||
@@ -770,7 +770,11 @@
|
||||
const path = 'file://' + _path
|
||||
let uri = mUri.parse(path)
|
||||
languages.typescript.javascriptDefaults.addExtraLib(code, path)
|
||||
await vscode.workspace.fs.writeFile(uri, new TextEncoder().encode(code))
|
||||
try {
|
||||
await vscode.workspace.fs.writeFile(uri, new TextEncoder().encode(code))
|
||||
} catch (e) {
|
||||
console.log('error writing file', e)
|
||||
}
|
||||
}
|
||||
|
||||
const addLocalFile = async (code: string, _path: string) => {
|
||||
@@ -982,7 +986,7 @@
|
||||
websocketInterval && clearInterval(websocketInterval)
|
||||
}
|
||||
|
||||
let widgets: HTMLElement | undefined = document.getElementById('monaco-widgets-root') ?? undefined
|
||||
// let widgets: HTMLElement | undefined = document.getElementById('monaco-widgets-root') ?? undefined
|
||||
let model: meditor.ITextModel | undefined = undefined
|
||||
|
||||
let monacoBinding: MonacoBinding | undefined = undefined
|
||||
@@ -1089,7 +1093,7 @@
|
||||
...editorConfig(code, lang, automaticLayout, fixedOverflowWidgets),
|
||||
model,
|
||||
fontSize: !small ? 14 : 12,
|
||||
overflowWidgetsDomNode: widgets,
|
||||
// overflowWidgetsDomNode: widgets,
|
||||
tabSize: lang == 'python' ? 4 : 2,
|
||||
folding
|
||||
})
|
||||
@@ -1114,10 +1118,12 @@
|
||||
})
|
||||
|
||||
editor.onDidBlurEditorText(() => {
|
||||
console.log('blur')
|
||||
dispatch('blur')
|
||||
})
|
||||
|
||||
editor.onDidFocusEditorText(() => {
|
||||
console.log('focus')
|
||||
dispatch('focus')
|
||||
|
||||
editor.addCommand(KeyMod.CtrlCmd | KeyCode.KeyS, function () {
|
||||
@@ -1207,6 +1213,7 @@
|
||||
let root = hostname + '/api/scripts_u/tokened_raw/' + $workspaceStore + '/' + token
|
||||
return root
|
||||
}
|
||||
console.log('FOO')
|
||||
</script>
|
||||
|
||||
<EditorTheme />
|
||||
|
||||
@@ -94,10 +94,7 @@
|
||||
)
|
||||
arg.type = 'javascript'
|
||||
propertyType = 'static'
|
||||
console.log('A')
|
||||
} else {
|
||||
console.log('B')
|
||||
|
||||
if (arg.type === 'javascript' && propertyType === 'static') {
|
||||
arg.type = 'static'
|
||||
}
|
||||
|
||||
@@ -162,13 +162,13 @@
|
||||
model = nmodel
|
||||
}
|
||||
model.updateOptions(updateOptions)
|
||||
let widgets: HTMLElement | undefined =
|
||||
document.getElementById('monaco-widgets-root') ?? undefined
|
||||
// let widgets: HTMLElement | undefined =
|
||||
// document.getElementById('monaco-widgets-root') ?? undefined
|
||||
|
||||
editor = meditor.create(divEl as HTMLDivElement, {
|
||||
...editorConfig(code, lang, automaticLayout, fixedOverflowWidgets),
|
||||
model,
|
||||
overflowWidgetsDomNode: widgets,
|
||||
// overflowWidgetsDomNode: widgets,
|
||||
fontSize: small ? 12 : 14
|
||||
})
|
||||
|
||||
|
||||
@@ -407,7 +407,7 @@
|
||||
let extraModel
|
||||
|
||||
let width = 0
|
||||
let widgets: HTMLElement | undefined = document.getElementById('monaco-widgets-root') ?? undefined
|
||||
// let widgets: HTMLElement | undefined = document.getElementById('monaco-widgets-root') ?? undefined
|
||||
|
||||
let initialized = false
|
||||
|
||||
@@ -447,7 +447,7 @@
|
||||
editor = meditor.create(divEl as HTMLDivElement, {
|
||||
...editorConfig(code, lang, automaticLayout, fixedOverflowWidgets),
|
||||
model,
|
||||
overflowWidgetsDomNode: widgets,
|
||||
// overflowWidgetsDomNode: widgets,
|
||||
lineNumbers: 'off',
|
||||
fontSize,
|
||||
suggestOnTriggerCharacters: true,
|
||||
|
||||
@@ -165,6 +165,8 @@
|
||||
</Button>
|
||||
</div>
|
||||
</ConfirmationModal>
|
||||
<!-- <div id="monaco-widgets-root" class="monaco-editor" style="z-index: 1200;" /> -->
|
||||
|
||||
<Drawer
|
||||
bind:this={scriptEditorDrawer}
|
||||
size="1200px"
|
||||
@@ -188,7 +190,7 @@
|
||||
noSyncFromGithub
|
||||
lang={script.language}
|
||||
path={script.path}
|
||||
fixedOverflowWidgets={true}
|
||||
fixedOverflowWidgets={false}
|
||||
bind:code={script.content}
|
||||
bind:schema={script.schema}
|
||||
tag={undefined}
|
||||
|
||||
@@ -161,8 +161,6 @@
|
||||
|
||||
nodes = layered.nodes
|
||||
|
||||
console.log(flatNodes, nodes)
|
||||
|
||||
let hfull = Math.max(layered.height, minHeight)
|
||||
fullWidth = layered.width
|
||||
height = fullSize ? hfull : Math.min(hfull, maxHeight ?? window.innerHeight * 1.5)
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
let flowBuilder: FlowBuilder | undefined = undefined
|
||||
</script>
|
||||
|
||||
<div id="monaco-widgets-root" class="monaco-editor" style="z-index: 1200;" />
|
||||
<!-- <div id="monaco-widgets-root" class="monaco-editor" style="z-index: 1200;" /> -->
|
||||
|
||||
<FlowBuilder
|
||||
on:saveInitial={(e) => {
|
||||
|
||||
@@ -189,7 +189,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="monaco-widgets-root" class="monaco-editor" style="z-index: 1200;" />
|
||||
<!-- <div id="monaco-widgets-root" class="monaco-editor" style="z-index: 1200;" /> -->
|
||||
|
||||
<DiffDrawer bind:this={diffDrawer} {restoreDeployed} {restoreDraft} />
|
||||
<FlowBuilder
|
||||
|
||||
Reference in New Issue
Block a user