1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-24 18:16:21 +03:00

nixos-gui:

- Reduce the number of call the nix-instantiate.
- Improve the option panel, show the name, type, description, value,
example, default value, declarations and definitions files.

svn path=/nixos/trunk/; revision=26951
This commit is contained in:
Nicolas Pierron 2011-04-24 15:30:30 +00:00
parent 66eed7681d
commit 97b39bd17c
4 changed files with 225 additions and 55 deletions

View file

@ -18,13 +18,36 @@ function setProgress(current, max)
function updatePanel(options)
{
log("updatePanel: " + options.length);
var t = "";
for (var i = 0; i < options.length; i++)
{
log("Called with " + options[i].path);
t += options[i].description;
}
$("#option-desc").text(t);
if (options.length == 0)
return;
// FIXME: ignore the rest of the selection for now.
var o = options[0];
$("#name").attr("label", o.path);
if (o.typename != null)
$("#typename").attr("label", o.typename);
else
$("#typename").attr("label", "");
$("#desc").text(o.description);
if (o.value != null)
$("#val").text(o.value);
else
$("#val").text("");
if (o.defaultValue != null)
$("#def").text(o.defaultValue);
else
$("#def").text("");
if (o.example != null)
$("#exp").text(o.example);
else
$("#exp").text("");
$("#decls").text(o.declarations.join("\n"));
$("#defs").text(o.definitions.join("\n"));
}