mirror of
https://github.com/litruv/picoGraph.git
synced 2026-07-24 10:46:06 +10:00
Initial commit
moved from private version control
This commit is contained in:
31
scripts/nodes/library/system/stat.js
Normal file
31
scripts/nodes/library/system/stat.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import { createNodeModule } from "../../nodeTypes.js";
|
||||
|
||||
/**
|
||||
* Queries system status values exposed through stat().
|
||||
*/
|
||||
export const statNode = createNodeModule(
|
||||
{
|
||||
id: "system_stat",
|
||||
title: "System Status",
|
||||
category: "System",
|
||||
description: "Fetch a system status value using the stat(index) helper.",
|
||||
searchTags: ["stat", "status", "system", "metrics"],
|
||||
inputs: [
|
||||
{
|
||||
id: "index",
|
||||
name: "Index",
|
||||
direction: "input",
|
||||
kind: "number",
|
||||
defaultValue: 0,
|
||||
},
|
||||
],
|
||||
outputs: [{ id: "value", name: "Value", direction: "output", kind: "any" }],
|
||||
properties: [],
|
||||
},
|
||||
{
|
||||
evaluateValue: ({ resolveValueInput }) => {
|
||||
const index = resolveValueInput("index", "0");
|
||||
return `stat(${index})`;
|
||||
},
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user