Skip to content

Commit

Permalink
Merge pull request #71 from Flow-Works/dev
Browse files Browse the repository at this point in the history
🔖 tags: v1.0.9-beta
  • Loading branch information
ThinLiquid authored Jul 26, 2023
2 parents b151048 + c5500c5 commit 3b5c030
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 23 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flow-os",
"version": "1.0.8-beta",
"version": "1.0.9-beta",
"description": "The customizable webOS.",
"keywords": [
"tomp",
Expand Down
6 changes: 3 additions & 3 deletions public/builtin/apps/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

<h2>About FlowOS</h2>

<div>Version: <v></v></div>
<div>Designed By: thinliquid</div>
<div>Developed By: thinliquid, 1nspird, proudparrot2</div>
<div><v></v></div>
<p></p>
<div>Created by thinliquid, 1nspird, proudparrot2</div>

<br /><br />

Expand Down
2 changes: 1 addition & 1 deletion public/builtin/apps/scripts/about.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-env browser */

window.onload = () => {
document.querySelector('v').innerText = parent.Flow.version;
document.querySelector('v').innerHTML = `<a target="_blank" href="${parent.Flow.url.replace(/\.git/g, '')}/commit/${parent.Flow.version.substring(0, 8)}">${parent.Flow.version.substring(0, 8)}</a> (${parent.Flow.branch})`;
};
14 changes: 11 additions & 3 deletions public/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,25 @@ import apps from './constants/apps.js';
import { WindowManager, WindowInstance } from './wm.js';

export default class FlowInstance {
version = 'v1.0.8-beta';
version; branch; url;
wm = new WindowManager();

#init = false;
#setup = false;

constructor() {
registerSW();
this.setVersion();
}

setVersion = async () => {
const res = await fetch('/ver');
const data = await res.json();
this.version = data.hash;
this.branch = data.branch;
this.url = data.url;
};

boot = async () => {
document.querySelector('.boot').style.opacity = 0;
setTimeout(() => {
Expand All @@ -37,8 +46,7 @@ export default class FlowInstance {
this.apps.register();
this.hotkeys.register();

for (let i = 0; i < config.settings.get('modules').urls.length; i++) {
const url = config.settings.get('modules').urls[i];
for (const url of config.settings.get('modules').urls) {
const module = await import(url);
await this.bar.add(module.default);
}
Expand Down
25 changes: 11 additions & 14 deletions public/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,23 @@ self.logger = new Logger();

window.onload = () => {
registerSettings();
switch (config.settings.get('search').proxy) {
case 'Ultraviolet':
self.currentProxy = __uv$config;
break;
if (config.settings.get('search').proxy === 'Ultraviolet') {
self.currentProxy = __uv$config;
}

useCustomCSS();

window.Flow.boot();
};

document.querySelector('.searchbar').onkeyup = () => {
const input = document.querySelector('.searchbar').value.toLowerCase();
let x = Array.from(document.querySelector('ul.apps').children);
const searchBar = document.querySelector('.searchbar');
const appsList = document.querySelector('ul.apps');

x.forEach((item) => {
if (!item.innerText.toLowerCase().includes(input)) {
item.style.display = 'none';
} else {
item.style.display = 'flex';
}
searchBar.addEventListener('keyup', () => {
const input = searchBar.value.toLowerCase();
const apps = Array.from(appsList.children);

apps.forEach((item) => {
item.style.display = item.innerText.toLowerCase().includes(input) ? 'flex' : 'none';
});
};
});
9 changes: 8 additions & 1 deletion public/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ body {
background: transparent;
border-radius: 10px;
outline: 2px solid transparent;
transition: outline 1s cubic-bezier(0, 0, 0, 1);
transition: width .3s, height .3s, left .3s, top .3s, outline 1s cubic-bezier(0, 0, 0, 1);
}

.winbox.focus {
Expand All @@ -209,12 +209,18 @@ body {

.wb-header {
border-radius: 10px 10px 0 0;
transition: border-radius .3s;
}

.max .wb-header, .max .wb-body {
border-radius: 0;
}

.wb-body {
backdrop-filter: blur(20px);
border-radius: 0 0 10px 10px;
background: transparent;
transition: border-radius .3s;
}

.winbox iframe {
Expand All @@ -233,6 +239,7 @@ body {
padding: 10px;
flex-direction: row;
align-items: center;
z-index: 1000;
}

.taskbar-item {
Expand Down
13 changes: 13 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import { uvPath } from '@proudparrot2/uv';
import { createServer } from 'http';
import fs from 'fs';

import Module from 'node:module';
const require = Module.createRequire(import.meta.url);

import ai from './ai.js';

const port = process.env.PORT || 3000;
Expand Down Expand Up @@ -72,6 +75,16 @@ app.get('/uv/uv.config.js', (req, res) => {
res.type('text/javascript').send(fs.readFileSync(`${publicPath}/uv/uv.config.js`));
});

app.get('/ver', (req, res) => {
require('child_process').exec('git rev-parse HEAD', (err1, hash) => {
require('child_process').exec('git branch --show-current', (err2, branch) => {
require('child_process').exec('git ls-remote --get-url', (err3, url) => {
res.type('application/json').send({ hash: hash.replace(/\n/g, ''), branch: branch.replace(/\n/g, ''), url: url.replace(/\n/g, '') });
});
});
});
});

process.on('SIGINT', shutdown);
process.on('SIGTERM', shutdown);

Expand Down

0 comments on commit 3b5c030

Please sign in to comment.