Added YAML support to Host and Group variable data. User can enter variables in either format, UI will parse it and send to API as JSON. Fixed post to /hosts/N/variable_data and /groups/N/variable_data so that JSON is sent as an object rather than a string.

This commit is contained in:
chouseknecht
2013-06-11 17:23:08 -04:00
parent 65c8176507
commit c8c9e62b4c
10 changed files with 180 additions and 52 deletions

View File

@@ -257,7 +257,11 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
html += "><i class=\"icon-info-sign\"></i></a> ";
}
html += field.label + '</label>' + "\n";
html += "<div class=\"controls\">\n";
html += "<div class=\"controls\">\n";
if (fld == "variables") {
html += "<div class=\"parse-selection\">Parse as: <label class=\"radio inline\"><input type=\"radio\" ng-model=\"parseType\" value=\"json\"> JSON</label>\n";
html += "<label class=\"radio inline\"><input type=\"radio\" ng-model=\"parseType\" value=\"yaml\"> YAML</label></div>\n";
}
html += "<textarea ";
html += (field.rows) ? this.attr(field, 'rows') : "";
html += "ng-model=\"" + fld + '" ';

File diff suppressed because one or more lines are too long