mirror of
https://github.com/MeexReay/poshlostios.git
synced 2025-06-24 02:22:58 +03:00
try catch neofetch
This commit is contained in:
parent
3911454188
commit
c2ba9da433
@ -69,7 +69,6 @@ async function draw() {
|
||||
if (found_color) {
|
||||
ctx.fillStyle = color_before;
|
||||
ctx.fillText(buffer, x, y);
|
||||
console.log(x, y, buffer)
|
||||
color_before = color
|
||||
x += buffer.length * CHAR_WIDTH
|
||||
buffer = ""
|
||||
@ -81,8 +80,6 @@ async function draw() {
|
||||
ctx.fillStyle = color_before;
|
||||
ctx.fillText(buffer, x, y);
|
||||
|
||||
console.log(x, y, buffer)
|
||||
|
||||
y -= CHAR_HEIGHT
|
||||
}
|
||||
}
|
||||
|
@ -32,10 +32,27 @@ function getDiskInfo() {
|
||||
|
||||
// Function to get CPU, GPU, and memory information
|
||||
function getSystemInfo() {
|
||||
const cpuInfo = navigator.hardwareConcurrency;
|
||||
const cpuInfo = (() => {try {
|
||||
return navigator.hardwareConcurrency
|
||||
} catch (e) {
|
||||
return 1
|
||||
}})()
|
||||
|
||||
const memoryInfo = navigator.deviceMemory;
|
||||
const totalJSHeap = performance.memory.totalJSHeapSize / (1024 * 1024);
|
||||
const memoryInfo = (() => {
|
||||
try {
|
||||
return navigator.deviceMemory
|
||||
} catch (e) {
|
||||
return 8
|
||||
}
|
||||
})()
|
||||
|
||||
const totalJSHeap = (() => {
|
||||
try {
|
||||
return performance.memory.totalJSHeapSize / (1024 * 1024)
|
||||
} catch (e) {
|
||||
return 1
|
||||
}
|
||||
})();
|
||||
|
||||
const canvas = document.createElement('canvas');
|
||||
const gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl');
|
||||
@ -53,8 +70,8 @@ function getSystemInfo() {
|
||||
|
||||
return [
|
||||
cpuInfo + " cores",
|
||||
memoryInfo ? memoryInfo * 1024 + ' MB' : 'Not supported',
|
||||
totalJSHeap.toFixed(2) + ' MB',
|
||||
memoryInfo ? memoryInfo * 1024 + 'MB' : '8096MB',
|
||||
totalJSHeap.toFixed(2) + 'MB',
|
||||
gpuInfo ? `${gpuInfo.renderer}` : 'Poshlosti GGraphics 1.0.233'
|
||||
]
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "neofetch",
|
||||
"version": "0.1.3",
|
||||
"version": "0.1.4",
|
||||
"description": "neofetch damn",
|
||||
"author": "MeexReay",
|
||||
"apps": [ "neofetch.js" ],
|
||||
|
Loading…
x
Reference in New Issue
Block a user