fix: made code follow ts-standard
This commit is contained in:
parent
48294da1ea
commit
cf8f1b844a
3 changed files with 17 additions and 17 deletions
|
|
@ -1,10 +1,7 @@
|
||||||
import HTML from '../HTML'
|
import HTML from '../HTML'
|
||||||
import { AppClosedEvent, AppOpenedEvent, Directory, FileSystemObject, Process } from '../types'
|
import { AppClosedEvent, AppOpenedEvent, Process } from '../types'
|
||||||
import { getTime } from '../utils'
|
import { getTime } from '../utils'
|
||||||
import { defaultFS } from './VirtualFS'
|
|
||||||
import nullIcon from '../assets/icons/application-default-icon.svg'
|
import nullIcon from '../assets/icons/application-default-icon.svg'
|
||||||
import { parse } from 'js-ini'
|
|
||||||
import { v4 as uuid } from 'uuid'
|
|
||||||
|
|
||||||
const BootLoader: Process = {
|
const BootLoader: Process = {
|
||||||
config: {
|
config: {
|
||||||
|
|
@ -17,7 +14,7 @@ const BootLoader: Process = {
|
||||||
const splashElement = splashScreen.getElement()
|
const splashElement = splashScreen.getElement()
|
||||||
splashElement.appendTo(document.body)
|
splashElement.appendTo(document.body)
|
||||||
|
|
||||||
const fs = process.fs
|
const { fs } = process
|
||||||
const wm = await process.loadLibrary('lib/WindowManager')
|
const wm = await process.loadLibrary('lib/WindowManager')
|
||||||
const launcher = await process.loadLibrary('lib/Launcher')
|
const launcher = await process.loadLibrary('lib/Launcher')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ const BrowserApp: Process = {
|
||||||
iframe: HTMLIFrameElement = document.createElement('iframe')
|
iframe: HTMLIFrameElement = document.createElement('iframe')
|
||||||
|
|
||||||
constructor (url: string) {
|
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.iframe.style.display = 'none'
|
||||||
|
|
||||||
this.header.innerHTML = `
|
this.header.innerHTML = `
|
||||||
|
|
@ -91,13 +91,13 @@ const BrowserApp: Process = {
|
||||||
(win.content.querySelector('.toggle') as HTMLElement).innerHTML = 'toggle_off'
|
(win.content.querySelector('.toggle') as HTMLElement).innerHTML = 'toggle_off'
|
||||||
}
|
}
|
||||||
(this.header.querySelector('.title') as HTMLElement).innerText = 'Tab'
|
(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
|
return
|
||||||
}
|
}
|
||||||
if (this === tabManager.activeTab) {
|
if (this === tabManager.activeTab) {
|
||||||
(win.content.querySelector('.toggle') as HTMLElement).innerHTML = 'toggle_on'
|
(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) => {
|
win.content.querySelector('.inp')?.addEventListener('keydown', (event: KeyboardEvent) => {
|
||||||
if (event.key === 'Enter') {
|
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
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,10 +50,11 @@ const Settings: Process = {
|
||||||
})
|
})
|
||||||
.appendMany(
|
.appendMany(
|
||||||
input,
|
input,
|
||||||
Button.new().text('Save').on('click', async () => {
|
Button.new().text('Save').on('click', () => {
|
||||||
config[item] = input.getValue()
|
config[item] = input.getValue()
|
||||||
process.kernel.setConfig(config)
|
process.kernel.setConfig(config)
|
||||||
await fs.writeFile('/etc/flow', stringify(config))
|
fs.writeFile('/etc/flow', stringify(config))
|
||||||
|
.then(() => {
|
||||||
document.dispatchEvent(
|
document.dispatchEvent(
|
||||||
new CustomEvent('config_update', {
|
new CustomEvent('config_update', {
|
||||||
detail: {
|
detail: {
|
||||||
|
|
@ -62,6 +63,8 @@ const Settings: Process = {
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
.catch(e => console.error(e))
|
||||||
|
})
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.appendTo(win.content)
|
.appendTo(win.content)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue