You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.0 KiB
JavaScript
48 lines
1.0 KiB
JavaScript
"use strict";
|
|
|
|
const React = require("react");
|
|
const ansiHTML = require("ansi-html-community");
|
|
const htmlentities = require("htmlentities");
|
|
const util = require("util");
|
|
|
|
const Layout = require("./layout.jsx");
|
|
|
|
module.exports = {
|
|
query: {
|
|
hardware: {
|
|
drives: {
|
|
path: true,
|
|
partitions: {
|
|
$key: "allBlockDevices",
|
|
name: true,
|
|
size: true,
|
|
|
|
mounts: {
|
|
mountpoint: true
|
|
},
|
|
|
|
children: {
|
|
$recurse: true,
|
|
$recurseLimit: Infinity, // 3 by default
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
template: function StorageDeviceList({data}) {
|
|
if (process.env.NODE_ENV === "development") {
|
|
return (
|
|
<Layout title="Debug query">
|
|
<pre
|
|
className="debugPrint"
|
|
dangerouslySetInnerHTML={{ __html: ansiHTML(htmlentities.encode(util.inspect(data, { colors: true, depth: null })))}}
|
|
/>
|
|
</Layout>
|
|
);
|
|
} else {
|
|
// FIXME: Proper error, or just prevent the route from being set outside of development mode at all
|
|
return "This view is only accessible in development mode.";
|
|
}
|
|
}
|
|
};
|