fix: made code follow ts-standard

This commit is contained in:
ThinLiquid 2024-01-22 16:50:07 +00:00
parent 48294da1ea
commit cf8f1b844a
No known key found for this signature in database
GPG key ID: 17538DC3DF6A7387
3 changed files with 17 additions and 17 deletions

View file

@ -1,10 +1,7 @@
import HTML from '../HTML'
import { AppClosedEvent, AppOpenedEvent, Directory, FileSystemObject, Process } from '../types'
import { AppClosedEvent, AppOpenedEvent, Process } from '../types'
import { getTime } from '../utils'
import { defaultFS } from './VirtualFS'
import nullIcon from '../assets/icons/application-default-icon.svg'
import { parse } from 'js-ini'
import { v4 as uuid } from 'uuid'
const BootLoader: Process = {
config: {
@ -17,7 +14,7 @@ const BootLoader: Process = {
const splashElement = splashScreen.getElement()
splashElement.appendTo(document.body)
const fs = process.fs
const { fs } = process
const wm = await process.loadLibrary('lib/WindowManager')
const launcher = await process.loadLibrary('lib/Launcher')

View file

@ -75,7 +75,7 @@ const BrowserApp: Process = {
iframe: HTMLIFrameElement = document.createElement('iframe')
constructor (url: string) {
this.iframe.src = `/service/${xor.encode(url) as string}`
this.iframe.src = `/service/${xor.encode(url)}`
this.iframe.style.display = 'none'
this.header.innerHTML = `
@ -91,13 +91,13 @@ const BrowserApp: Process = {
(win.content.querySelector('.toggle') as HTMLElement).innerHTML = 'toggle_off'
}
(this.header.querySelector('.title') as HTMLElement).innerText = 'Tab'
this.iframe.src = (win.content.querySelector('input')?.value as string)
this.iframe.src = (win.content.querySelector('input')?.value)
return
}
if (this === tabManager.activeTab) {
(win.content.querySelector('.toggle') as HTMLElement).innerHTML = 'toggle_on'
}
this.iframe.src = `/service/${xor.encode(win.content.querySelector('input')?.value ?? '') as string}`
this.iframe.src = `/service/${xor.encode(win.content.querySelector('input')?.value ?? '')}`
}
}
@ -167,7 +167,7 @@ const BrowserApp: Process = {
win.content.querySelector('.inp')?.addEventListener('keydown', (event: KeyboardEvent) => {
if (event.key === 'Enter') {
tabManager.activeTab.iframe.src = tabManager.activeTab.proxy ? `/service/${xor.encode((win.content.querySelector('.inp') as HTMLInputElement).value) as string}` : (win.content.querySelector('.inp') as HTMLInputElement).value
tabManager.activeTab.iframe.src = tabManager.activeTab.proxy ? `/service/${xor.encode((win.content.querySelector('.inp') as HTMLInputElement).value)}` : (win.content.querySelector('.inp') as HTMLInputElement).value
}
});

View file

@ -50,17 +50,20 @@ const Settings: Process = {
})
.appendMany(
input,
Button.new().text('Save').on('click', async () => {
Button.new().text('Save').on('click', () => {
config[item] = input.getValue()
process.kernel.setConfig(config)
await fs.writeFile('/etc/flow', stringify(config))
document.dispatchEvent(
new CustomEvent('config_update', {
detail: {
config
}
fs.writeFile('/etc/flow', stringify(config))
.then(() => {
document.dispatchEvent(
new CustomEvent('config_update', {
detail: {
config
}
})
)
})
)
.catch(e => console.error(e))
})
)
)