-
-
+
@@ -266,653 +413,879 @@
Category Filter
+ div_otherJsons
+ .children("button")
+ .html(jsonFile + '
');
+ div_otherJsons.children("button").data("jsonFile", jsonFile);
+ var dataNum = ObjectLength(data.results);
+ var counter = 0;
+ $.each(data.results, function (i, item) {
+ // This counter will let us know when we are done looping
+ // We need this because JS is async
+ counter++;
-
+ if (counter == dataNum) {
+ // Here we are done with looping all the results, we are going to update the filters above
+ var unique = plugin_cats_array.filter(onlyUnique).sort();
+ // We generate the category filters here
+ var div_cat_list =
+ '
All
\n';
+ $.each(unique, function (c, cname) {
+ div_cat_list +=
+ '
' +
+ cname +
+ "
\n";
+ });
+ div_cat_list += "
";
+ $("#category-list").html(div_cat_list);
+ $("#numresults").html(counter);
+ }
+ // Here we have a risu.json
+ if (data.metadata.source == "risu") {
+ if (item.backend == "profile") {
+ var plugins = new Array();
+ $.each(JSON.parse(item.result.err), function (i, o) {
+ plugins.push({
+ server: "localhost",
+ hostname: "localhost",
+ msg: o.err,
+ rc: o.rc,
+ plugin_name: o.plugin,
+ plugin_id: o.plugin_id,
+ });
+ });
+ console.log(plugins);
+ item.result.err = plugins;
+ }
+ printRisuPlugin(
+ item,
+ item.result.out,
+ item.result.err,
+ item.result.rc,
+ data
+ );
+ // Here we have a magui.json
+ } else if (data.metadata.source == "magui") {
+ if (
+ item.plugin == "risu-outputs" ||
+ item.plugin == "metadata-outputs"
+ ) {
+ $.each(item.result, function (s, result) {
+ if (s == "err") {
+ $.each(result, function (plugin, pdata) {
+ // Defining defaults for globals
+ var gout = "";
+ var gerr = "";
+ var grc = 30;
+ var plugins = new Array();
+ $.each(pdata.sosreport, function (server, obj) {
+ // If we have a failed, the global will definitely be failed
+ if (obj.rc == 20) {
+ grc = 20;
+ }
+ if (obj.rc == 40 && grc != 20) {
+ grc = 40;
+ }
+ if (obj.rc == 10 && grc != 20 && grc != 40) {
+ grc = 10;
+ }
+ if (
+ obj.rc == 30 &&
+ grc != 20 &&
+ grc != 40 &&
+ grc != 10
+ ) {
+ rc = 30;
+ }
+ var plugin_state = getPluginState(
+ obj.rc,
+ obj.priority
+ );
+ gout +=
+ plugin_state.badge +
+ " " +
+ server +
+ ": " +
+ obj.out +
+ "
";
+ gerr +=
+ plugin_state.badge +
+ " " +
+ server +
+ ": " +
+ obj.err +
+ "
";
+ if (pdata.backend == "profile") {
+ subobject = JSON.parse(obj.err);
+ $.each(subobject, function (i, o) {
+ plugins.push({
+ hostname: server,
+ msg: o.err,
+ rc: o.rc,
+ plugin_name: o.plugin,
+ plugin_id: o.plugin_id,
+ });
+ });
+ }
+ });
+ if (pdata.backend == "profile") gerr = plugins;
+ printRisuPlugin(
+ pdata,
+ gout,
+ gerr,
+ grc,
+ data,
+ item.plugin
+ );
+ }); // each result
+ } // s == "err"
+ }); // each item.result
+ } else {
+ printRisuPlugin(
+ item,
+ item.result.out,
+ item.result.err,
+ item.result.rc,
+ data,
+ false,
+ "magui"
+ );
+ } // if risu-outputs
+ } // if data source == "magui"
+ }); // each data.result
+ $("#numtests").html(counter);
+ sortPlugins("priority");
+ filterCards();
+ scrollToPlugin();
+ }, // ajax success
+ }); // ajax query
+ }); // doc ready
+
+