fix: rename dashboardapi.{js,html} → dashboardAPI.{js,html}
Aligns the entry-file naming with the folder-name convention from
.claude/rules/node-architecture.md / superproject CLAUDE.md.
NON-BREAKING: the Node-RED type id stays lowercase
(`RED.nodes.registerType('dashboardapi', ...)`) so every deployed flow
that references this node continues to load. Only the file paths
change. Admin endpoints `/dashboardapi/menu.js` and
`/dashboardapi/configData.js` are unaffected — they follow the type
id, not the filename.
Updated:
- package.json `main` + `node-red.nodes` value
- test/basic/structure-module-load.basic.test.js require path
- CLAUDE.md: legacy-drift warning replaced with a note explaining the
type-id preservation strategy
Same approach recommended for the remaining two legacy renames (mgc,
vgc); the superproject CLAUDE.md drift table now spells that out.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
109
dashboardAPI.html
Normal file
109
dashboardAPI.html
Normal file
@@ -0,0 +1,109 @@
|
||||
<script src="/dashboardapi/menu.js"></script>
|
||||
<script src="/dashboardapi/configData.js"></script>
|
||||
|
||||
<script>
|
||||
RED.nodes.registerType('dashboardapi', {
|
||||
category: 'EVOLV',
|
||||
color: '#4f8582',
|
||||
defaults: {
|
||||
name: { value: '' },
|
||||
enableLog: { value: true },
|
||||
logLevel: { value: 'info' },
|
||||
|
||||
protocol: { value: 'http' },
|
||||
host: { value: 'localhost' },
|
||||
port: { value: 3000 },
|
||||
bearerToken: { value: '' },
|
||||
defaultBucket: { value: '' },
|
||||
},
|
||||
inputs: 1,
|
||||
outputs: 1,
|
||||
inputLabels: ['Input'],
|
||||
outputLabels: ['grafana'],
|
||||
icon: 'font-awesome/fa-area-chart',
|
||||
|
||||
label: function () {
|
||||
return this.name || 'dashboardapi';
|
||||
},
|
||||
|
||||
oneditprepare: function () {
|
||||
const waitForMenuData = () => {
|
||||
if (window.EVOLV?.nodes?.dashboardapi?.loggerMenu?.initEditor) {
|
||||
window.EVOLV.nodes.dashboardapi.loggerMenu.initEditor(this);
|
||||
} else {
|
||||
setTimeout(waitForMenuData, 50);
|
||||
}
|
||||
};
|
||||
waitForMenuData();
|
||||
},
|
||||
|
||||
oneditsave: function () {
|
||||
const node = this;
|
||||
|
||||
if (window.EVOLV?.nodes?.dashboardapi?.loggerMenu?.saveEditor) {
|
||||
window.EVOLV.nodes.dashboardapi.loggerMenu.saveEditor(node);
|
||||
}
|
||||
|
||||
['name', 'protocol', 'host', 'port', 'bearerToken', 'defaultBucket'].forEach((field) => {
|
||||
const element = document.getElementById(`node-input-${field}`);
|
||||
if (!element) return;
|
||||
node[field] = field === 'port' ? parseInt(element.value, 10) || 3000 : element.value || '';
|
||||
});
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Main UI Template -->
|
||||
<script type="text/html" data-template-name="dashboardapi">
|
||||
<div class="form-row">
|
||||
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||||
<input type="text" id="node-input-name" placeholder="name" style="width:70%;" />
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-protocol"><i class="fa fa-exchange"></i> Protocol</label>
|
||||
<select id="node-input-protocol" style="width:70%;">
|
||||
<option value="http">http</option>
|
||||
<option value="https">https</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-host"><i class="fa fa-server"></i> Grafana Host</label>
|
||||
<input type="text" id="node-input-host" placeholder="localhost" style="width:70%;" />
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-port"><i class="fa fa-plug"></i> Grafana Port</label>
|
||||
<input type="number" id="node-input-port" placeholder="3000" style="width:70%;" />
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-bearerToken"><i class="fa fa-key"></i> Bearer Token</label>
|
||||
<input type="password" id="node-input-bearerToken" placeholder="optional" style="width:70%;" />
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label for="node-input-defaultBucket"><i class="fa fa-database"></i> InfluxDB Bucket</label>
|
||||
<input type="text" id="node-input-defaultBucket" placeholder="env INFLUXDB_BUCKET or lvl2" style="width:70%;" />
|
||||
</div>
|
||||
|
||||
<div id="logger-fields-placeholder"></div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" data-help-name="dashboardapi">
|
||||
<p>
|
||||
This node interacts with the Grafana API with the following capabilities:
|
||||
|
||||
• Dashboard Management: Create, update, or delete dashboards.
|
||||
• Metrics Querying: Retrieve performance and operational data.
|
||||
• Alerts Management: Monitor and manage alerts.
|
||||
|
||||
It allows you to configure:
|
||||
|
||||
- Connection details (host, port, bearer token) for secure API access.
|
||||
- Logging options, including the ability to enable logging and set the log level (info, debug, warn, error).
|
||||
|
||||
These features provide flexible and controlled interactions with the Grafana API.
|
||||
</p>
|
||||
</script>
|
||||
Reference in New Issue
Block a user