Commit 869657bd authored by Sven Franck's avatar Sven Franck

added generic removal of objects

parent bb532a6b
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"id": "computer_overview", "id": "computer_overview",
"property_dict": { "property_dict": {
"initial_query_url_identifier": "_id", "initial_query_url_identifier": "_id",
"dynamic_children": [1], "dynamic_children": [2],
"requires_authentication": true, "requires_authentication": true,
"depends_on": "login_state", "depends_on": "login_state",
"wrap_gadget": 2, "wrap_gadget": 2,
...@@ -42,6 +42,11 @@ ...@@ -42,6 +42,11 @@
}, },
"logic": {"text":"Add server"} "logic": {"text":"Add server"}
},{ },{
"generate": "widget",
"type": "controlbar",
"property_dict": {"slot": 1},
"children": [{"type": "p", "direct": {"className": "ui-table-caption translate"},"attributes": {"data-i18n":"page_dict.servers.servers"},"logic": {"text":"Created Servers"}}]
}, {
"generate": "widget", "generate": "widget",
"type": "table", "type": "table",
"class_list": "table-stroke ui-responsive", "class_list": "table-stroke ui-responsive",
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"id": "network_overview", "id": "network_overview",
"property_dict": { "property_dict": {
"initial_query_url_identifier": "reference_reference", "initial_query_url_identifier": "reference_reference",
"dynamic_children": [1], "dynamic_children": [2],
"requires_authentication": true, "requires_authentication": true,
"depends_on": "login_state", "depends_on": "login_state",
"wrap_gadget": 2, "wrap_gadget": 2,
...@@ -36,7 +36,12 @@ ...@@ -36,7 +36,12 @@
"data-icon": "edit" "data-icon": "edit"
}, },
"logic": {"text":"Add server"} "logic": {"text":"Add server"}
},{ }, {
"generate": "widget",
"type": "controlbar",
"property_dict": {"slot": 1},
"children": [{"type": "p", "direct": {"className": "ui-table-caption translate"},"attributes": {"data-i18n":"page_dict.networks.networks"},"logic": {"text":"Created Networks"}}]
}, {
"generate": "widget", "generate": "widget",
"type": "table", "type": "table",
"class_list": "table-stroke ui-responsive", "class_list": "table-stroke ui-responsive",
......
{
"portal_type_source": "Service",
"portal_type_title": "service",
"portal_type_fields": "service_fieldlist",
"form": true,
"id": "service_connection",
"property_dict": {
"dynamic_children": [1],
"wrap_gadget": 2,
"layout": {
"header": [
[
{"column": "service_connection_url", "show": true, "priority": 1},
{"column": "service_connection_backend_url", "show": true, "priority": 2},
{"column": "service_connection_password", "show": true, "priority": 6}
]
],
"body": [
{"column": "service_connection_url", "show": true, "priority": 1},
{"column": "service_connection_backend_url", "show": true, "priority": 2},
{"column": "service_connection_password", "show": true, "priority": 6}
],
"footer": []
},
"feature_dict": {}
},
"children": [{
"generate": "widget",
"type": "controlbar",
"property_dict": {"slot": 1},
"children": [{"type": "p", "direct": {"className": "ui-table-caption translate"},"attributes": {"data-i18n":"page_dict.services.connection_param"},"logic": {"text":"Connection parameters"}}]
}, {
"generate": "widget",
"type": "table",
"class_list": "table-stroke ui-responsive",
"property_dict": {
"mode": "columntoggle",
"toggle_popup": false,
"wrap": "both",
"top_grid": 1,
"bottom_grid": 1
},
"children": []
}],
"placeholder_dict": {
"no_auth": {
"text":"Requires authorization.",
"text_i18n":"validation_dict.requires_auth",
"children": [
{
"generate": "widget",
"type": "controlgroup",
"property_dict": {"direction": "horizontal"},
"children": [{
"type": "a",
"direct":{"className":"translate action", "href":"#global-popup"},
"attributes":{
"data-i18n":"global_dict.common_dict.login",
"data-action":"login",
"data-icon":"lock",
"data-rel": "popup"
},
"logic": {"text":"Login"}
}, {
"type": "a",
"direct": {"className":"translate ui-btn-slapos-black", "href": "#person::new"},
"attributes": {
"data-i18n": "global_dict.common_dict.register",
"data-icon": "edit"
},
"logic": {"text":"Register"}
}
]
}
]
}
}
}
...@@ -459,9 +459,9 @@ ...@@ -459,9 +459,9 @@
"widget": { "widget": {
"id": "service_xml_recipe", "id": "service_xml_recipe",
"title": "Parameter XML", "title": "Parameter XML",
"title_i18n": "portal_type_dict.person_dict.field_list.recipe.title", "title_i18n": "portal_type_dict.service_dict.field_list.recipe.title",
"description": "The XML recipe for this software installation.", "description": "The XML recipe for this software installation.",
"description_i18n": "portal_type_dict.person_dict.field_list.recipe.description", "description_i18n": "portal_type_dict.service_dict.field_list.recipe.description",
"alternate_name": "service_xml_recipe", "alternate_name": "service_xml_recipe",
"default_value": null, "default_value": null,
"css_class": null, "css_class": null,
...@@ -503,5 +503,218 @@ ...@@ -503,5 +503,218 @@
"i18n": "validation_dict.too_many_chars" "i18n": "validation_dict.too_many_chars"
} }
} }
},
"service_buildout_url": {
"type":"StringField",
"widget": {
"id": "service_buildout_url",
"title": "Buildout Version",
"title_i18n": "portal_type_dict.service_dict.field_list.buildout.title",
"description": "The buildout cfg file for this service installation.",
"description_i18n": "portal_type_dict.service_dict.field_list.buildout.description",
"alternate_name": "service_buildout_url",
"default_value": null,
"css_class": null,
"hidden": null,
"display_width": null,
"maximum_input": null,
"extra": null
},
"properties": {
"enabled": true,
"editable": true,
"external_validator": null,
"required": true,
"preserve_whitespace": null,
"unicode": null,
"maximum_length": null,
"truncate": null
},
"message": {
"external_validator_failed": {
"message": "The input failed the external validator.",
"i18n": "validation_dict.external"
},
"required_not_found": {
"message": "Input required but not found.",
"i18n": "validation_dict.required"
},
"too_long": {
"message": "Too much input give.",
"i18n": "validation_dict.too_much_input"
}
}
},
"service_connection_url": {
"type":"StringField",
"widget": {
"id": "service_connection_url",
"title": "URL",
"title_i18n": "portal_type_dict.service_dict.field_list.connection_url.title",
"description": "The connection URL for this service.",
"description_i18n": "portal_type_dict.service_dict.field_list.connection_url.description",
"alternate_name": "service_connection_url",
"default_value": null,
"css_class": null,
"hidden": null,
"display_width": null,
"maximum_input": null,
"extra": null
},
"properties": {
"enabled": true,
"editable": true,
"external_validator": null,
"required": true,
"preserve_whitespace": null,
"unicode": null,
"maximum_length": null,
"truncate": null
},
"message": {
"external_validator_failed": {
"message": "The input failed the external validator.",
"i18n": "validation_dict.external"
},
"required_not_found": {
"message": "Input required but not found.",
"i18n": "validation_dict.required"
},
"too_long": {
"message": "Too much input give.",
"i18n": "validation_dict.too_much_input"
}
}
},
"service_connection_backend_url": {
"type":"StringField",
"widget": {
"id": "service_connection_backend_url",
"title": "Backend URL",
"title_i18n": "portal_type_dict.service_dict.field_list.connection_backend_url.title",
"description": "The backend connection URL for this installed service.",
"description_i18n": "portal_type_dict.service_dict.field_list.connection_backend_url.description",
"alternate_name": "service_connection_backend_url",
"default_value": null,
"css_class": null,
"hidden": null,
"display_width": null,
"maximum_input": null,
"extra": null
},
"properties": {
"enabled": true,
"editable": true,
"external_validator": null,
"required": true,
"preserve_whitespace": null,
"unicode": null,
"maximum_length": null,
"truncate": null
},
"message": {
"external_validator_failed": {
"message": "The input failed the external validator.",
"i18n": "validation_dict.external"
},
"required_not_found": {
"message": "Input required but not found.",
"i18n": "validation_dict.required"
},
"too_long": {
"message": "Too much input give.",
"i18n": "validation_dict.too_much_input"
}
}
},
"service_connection_password": {
"type":"StringField",
"widget": {
"id": "service_connection_password",
"title": "Password",
"title_i18n": "portal_type_dict.service_dict.field_list.connection_password.title",
"description": "The connection url password for this installed service.",
"description_i18n": "portal_type_dict.service_dict.field_list.connection_password.description",
"alternate_name": "service_connection_password",
"default_value": null,
"css_class": null,
"hidden": null,
"display_width": null,
"maximum_input": null,
"extra": null
},
"properties": {
"enabled": true,
"editable": true,
"external_validator": null,
"required": true,
"preserve_whitespace": null,
"unicode": null,
"maximum_length": null,
"truncate": null
},
"message": {
"external_validator_failed": {
"message": "The input failed the external validator.",
"i18n": "validation_dict.external"
},
"required_not_found": {
"message": "Input required but not found.",
"i18n": "validation_dict.required"
},
"too_long": {
"message": "Too much input give.",
"i18n": "validation_dict.too_much_input"
}
}
},
"service_detail_description": {
"type": "TextareaField",
"widget": {
"id": "service_detail_description",
"title": "Detailed Description",
"title_i18n": "portal_type_dict.service_dict.field_list.detail_description.title",
"description": "The detailed description of this service.",
"description_i18n": "portal_type_dict.service_dict.field_list.detail_description.description",
"alternate_name": "service_detail_description",
"css_class": null,
"hidden": null,
"width":null,
"height":null,
"extra":null
},
"properties": {
"enabled": true,
"editable": true,
"external_validator": null,
"required": null,
"preserve_whitespace": null,
"unicode": null,
"maximum_lines": null,
"maximum_length_of_line": null,
"maximum_characters": null
},
"message": {
"external_validator_failed": {
"message": "The input failed the external validator.",
"i18n": "validation_dict.external"
},
"required_not_found": {
"message": "Input required but not found.",
"i18n": "validation_dict.required"
},
"too_many_lines": {
"message": "You have entered too many lines.",
"i18n": "validation_dict.too_many_lines"
},
"line_too_long": {
"message": "One or more lines you have entered are too long.",
"i18n": "validation_dict.too_long_lines"
},
"too_long": {
"message": "You have entered too many characters.",
"i18n": "validation_dict.too_many_chars"
}
}
} }
} }
\ No newline at end of file
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
"portal_type_source": "Service", "portal_type_source": "Service",
"portal_type_title": "service", "portal_type_title": "service",
"portal_type_fields": "service_fieldlist", "portal_type_fields": "service_fieldlist",
"initial_query": {"include_docs": true, "limit":[0,1]},
"form": true, "form": true,
"id": "service_status", "id": "service_instance_overview",
"property_dict": { "property_dict": {
"dynamic_children": [1], "dynamic_children": [0],
"requires_authentication": true, "requires_authentication": true,
"depends_on": "login_state" "depends_on": "login_state"
}, },
...@@ -29,40 +28,30 @@ ...@@ -29,40 +28,30 @@
"direction": "horizontal" "direction": "horizontal"
}, },
"children": [ "children": [
{"type": "input", "direct": {"value": "Reset", "className": "translate"}, "attributes": {"type": "reset", "data-i18n":"[value]global_dict.common_dict.cancel"}}, {"type": "input", "direct": {"value": "Stop", "className": "action error status translate"}, "attributes": {"type": "button", "data-i18n":"[value]global_dict.common_dict.stop", "data-icon": "ban-circle"}},
{"type": "input", "direct": {"value": "Update", "className": "action translate"}, "attributes": {"type": "submit", "data-action":"store", "data-i18n":"[value]global_dict.common_dict.update", "data-theme": "slapos-black"}} {"type": "input", "direct": {"value": "Update", "className": "action translate"}, "attributes": {"type": "submit", "data-action":"add", "data-i18n":"[value]global_dict.common_dict.update", "data-icon": "ok", "data-theme": "slapos-black"}}
] ]
}], }],
"layout": [ "layout": [
{
"position": "center",
"fieldlist": [
{"type": "input", "direct": {"disabled": true, "className":"progress_notifier", "name": "release_status", "id": "release_status", "value": "Preparing instance..."}, "attributes": {"data-i18n":"[value]page_dict.services.prepare_instance"}}
]
},
{ {
"position": "left", "position": "left",
"fieldlist": [ "fieldlist": [
{"title": "release_title", "overrides": {"properties": {"required": true, "editable":false}}}, {"title": "service_id", "overrides": {"properties": {"editable": false, "required": false}}},
{"title": "release_version", "overrides": {"properties": {"required": true, "editable":false}}}, {"title": "service_title", "overrides": {"widget": {"title": "Software Type", "title_i18n": "page_dict.services.software_type"}, "properties": {"editable":false}}},
{"type": "input", "direct": {"name": "release_id", "id": "release_id", "className": "required"}, "attributes": {"data-enhanced":"true", "type":"text", "readonly": "readonly"}, "logic":{"setValue": "instance_", "label":"Instance ID", "label_i18n":"page_dict.services.instance_id"}}, {"title": "service_status", "overrides": {"properties": {"editable": false, "required": false}}},
{"type":"select", "direct":{"name": "release_reference_computer", "id": "release_reference_computer","className": "required"},"attributes": {"data-enhanced": "true"},"logic": {"label":"Request for Computer", "label_i18n":"page_dict.services.instance_server", "options":[{"value":"", "text": "", "selected": "true"}, {"value": "Cortana", "text": "Cortana"},{"value": "Prof. Simon Wright", "text": "Prof. Simon Wright"},{"value": "HAL", "text": "HAL"},{"value": "Computer", "text": "Computer"},{"value": "Lawnmower", "text": "Lawnmower"}]}}, {"title": "service_reference_computer", "overrides": {"type": "StringField", "properties": {"editable": false, "required": false}}}
{"type":"select", "direct":{"name": "release_reference_network", "id": "release_reference_network", "className": "required"},"attributes": {"data-enhanced": "true"},"logic": {"label":"Request for Network", "label_i18n":"page_dict.services.instance_network", "options":[{"value":"", "text": "", "selected": "true"}, {"value": "Foo-Net", "text": "Foo-Net"},{"value": "Bar-Net", "text": "Bar-Net"},{"value": "Lawn", "text": "Lawn"}]}}
] ]
}, },
{ {
"position": "right", "position": "right",
"fieldlist": [ "fieldlist": [
{"title": "release_image_url"}, {"title": "service_detail_description", "overrides": {"properties": {"editable": false}}}
{"title": "release_image_type", "overrides": {"widget": {"hidden":true}}},
{"title": "release_image_url", "overrides": {"type": "StringField", "widget": {"hidden": true}}},
{"title": "release_detail_description", "overrides": {"properties": {"required": true, "editable":false}}}
] ]
}, },
{ {
"position": "center", "position": "center",
"fieldlist": [ "fieldlist": [
{"type": "textarea", "direct": {"name": "release_xml_recipe", "id": "release_xml_recipe", "className": "required", "value": "<?xml version='1.0' encoding='utf-8'?>\n<instance>\n</instance>"}, "attributes": {"data-enhanced":"true"}, "logic": {"label":"Instance Configuration", "label_i18n":"page_dict.services.instance_recipe"}} {"title": "service_xml_recipe", "overrides": {"widget": {"title": "Instance XML Recipe", "title_i18n": "page_dict.services.recipe"}}}
] ]
} }
] ]
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"id": "service_overview", "id": "service_overview",
"property_dict": { "property_dict": {
"initial_query_url_identifier": "service_reference_computer", "initial_query_url_identifier": "service_reference_computer",
"dynamic_children": [1], "dynamic_children": [2],
"wrap_gadget": 2, "wrap_gadget": 2,
"layout": { "layout": {
"header": [ "header": [
...@@ -40,6 +40,11 @@ ...@@ -40,6 +40,11 @@
}, },
"logic": {"text":"Install new software"} "logic": {"text":"Install new software"}
},{ },{
"generate": "widget",
"type": "controlbar",
"property_dict": {"slot": 1},
"children": [{"type": "p", "direct": {"className": "ui-table-caption translate"},"attributes": {"data-i18n":"page_dict.services.services"},"logic": {"text":"Installed Services"}}]
}, {
"generate": "widget", "generate": "widget",
"type": "table", "type": "table",
"class_list": "table-stroke ui-responsive", "class_list": "table-stroke ui-responsive",
......
...@@ -5,28 +5,34 @@ ...@@ -5,28 +5,34 @@
"form": true, "form": true,
"id": "service_statusbox", "id": "service_statusbox",
"property_dict": { "property_dict": {
"dynamic_children": [0], "dynamic_children": [1],
"wrap_gadget": 2, "wrap_gadget": 2,
"submit_to": "#services",
"layout": { "layout": {
"header": [ "header": [
[ [
{"column": "service_status", "show": true, "priority": 5}, {"column": "service_status", "show": true, "priority": 1},
{"column": "service_title", "show": true, "priority": 5}, {"column": "service_title", "show": true, "priority": 1},
{"column": "service_image_url", "show": true, "priority": 2}, {"column": "service_image_url", "show": true, "priority": 5},
{"column": "service_state", "show": true, "priority": 3} {"column": "service_state", "show": true, "priority": 6}
] ]
], ],
"body": [ "body": [
{"column": "service_status", "show": true, "priority": 5}, {"column": "service_status", "show": true, "priority": 1},
{"column": "service_title", "show": true, "priority": 5}, {"column": "service_title", "show": true, "priority": 1},
{"column": "service_image_url", "show": true, "priority": 2, "image": true}, {"column": "service_image_url", "show": true, "priority": 5, "image": true},
{"column": "service_state", "show": true, "priority": 3} {"column": "service_state", "show": true, "priority": 6}
], ],
"footer": [] "footer": []
}, },
"feature_dict": {} "feature_dict": {}
}, },
"children": [{ "children": [{
"generate": "widget",
"type": "controlbar",
"property_dict": {"slot": 1},
"children": [{"type": "p", "direct": {"className": "ui-table-caption translate"},"attributes": {"data-i18n":"page_dict.services.installations"},"logic": {"text":"Installations"}}]
}, {
"generate": "widget", "generate": "widget",
"type": "table", "type": "table",
"class_list": "table-stroke ui-responsive", "class_list": "table-stroke ui-responsive",
......
...@@ -27,7 +27,18 @@ ...@@ -27,7 +27,18 @@
"theme": "slapos-white", "theme": "slapos-white",
"layout": { "layout": {
"default": [ "default": [
{
"generate": "gadget",
"type": "fieldlist",
"id": "service_instance_status",
"href": "service_instance_status"
},
{
"generate": "gadget",
"type": "listbox",
"id": "service_connection",
"href": "service_connection"
},
{ {
"generate": "gadget", "generate": "gadget",
"type": "listbox", "type": "listbox",
......
...@@ -308,6 +308,15 @@ ...@@ -308,6 +308,15 @@
storage.add(obj); storage.add(obj);
}, },
/**
* Destroy an installation = service object
* @method destroy
* @param {object} obj Action Object
**/
"destroy": function (obj) {
storage.remove(obj);
},
/** /**
* Add a user to the storage * Add a user to the storage
* @method submit * @method submit
...@@ -835,9 +844,10 @@ ...@@ -835,9 +844,10 @@
} }
// required // required
if (prevail.properties.required === true || if (spec.properties.required === true) {
spec.properties.required === true) { if (prevail.properties.required === undefined || prevail.properties.required === true) {
class_list += "required "; class_list += "required ";
}
} }
// maximum_length // maximum_length
...@@ -3964,22 +3974,17 @@ ...@@ -3964,22 +3974,17 @@
storage = {}; storage = {};
/** /**
* add a new item to a storage => form submission, calling post * validate (a form) before submitting to storage
* @method add * @method validate
* @param {object} config Action Object * @return {object} form fields/errors
*/ **/
// NOTE: we always validate! to skip validation test for class on form storage.validate = function (config) {
// TODO: generate common promise handler for add/remove/clone/export/etc var i, pass, form_to_submit, anti_spam, valid, test_time, test_empty,
// TODO: make form validation and captcha generic test_full, form_element, form_elements;
storage.add = function (config) {
var property, replace, i, obj, value, form_elements, form_element, pass,
test_full, test_empty, test_time, form_to_submit, anti_spam, formData,
valid, pass_id, validate_portal_type_fields;
pass = false; pass = false;
form_to_submit = document.getElementById(config.id); form_to_submit = document.getElementById(config.id);
anti_spam = document.getElementById(form_to_submit.id + "_not_a_secret"); anti_spam = document.getElementById(form_to_submit.id + "_not_a_secret");
formData = new FormData();
valid = $(form_to_submit).triggerHandler("submitForm"); valid = $(form_to_submit).triggerHandler("submitForm");
if (valid !== false) { if (valid !== false) {
...@@ -4012,81 +4017,139 @@ ...@@ -4012,81 +4017,139 @@
pass = true; pass = true;
} }
} }
if (pass === true) {
return valid;
}
return undefined;
}
return undefined;
};
// valid form and no spam /**
if (pass) { * remove an item from a storage
replace = form_to_submit.id.split("_")[0] + "_"; * @method remove
obj = {}; * @param {object} config Action Object
**/
storage.remove = function (config) {
var store, items, i;
// force portal_type util.loader("", "global_dict.status_dict.removing");
if (config.gadget.state.force_type) {
config.gadget.state.type = config.gadget.state.force_type;
validate_portal_type_fields = true;
}
for (property in valid) { store = storage.items;
if (valid.hasOwnProperty(property)) {
value = valid[property];
// prepare to store // TODO: find a generic way to determine the id of the element to
if (property !== "undefined") { // be removed, in a single item gadget it should be the underlying id,
// in a multi item gadget, we need to select
// last will be id of element displayed
if (config.state.query.last) {
items = [config.state.query.last];
} else {
util.error({"error": "No items for deletion defined"});
}
// overwrite portal_type if forced if (store && items.length > 0) {
if (config.gadget.state.force_type for (i = 0; i < items.length; i += 1) {
&& property !== "identifier") { store.remove({"_id":items[i]})
obj[ .then(function(x) {
property.replace(property.split("_")[0], if (config.state.callback) {
config.gadget.state.force_type.toLowerCase()) $.mobile.changePage(config.state.callback);
] = value;
} else {
obj[property] = value;
}
} }
})
.fail(util.error);
}
}
};
/**
* add a new item to a storage
* @method add
* @param {object} config Action Object
*/
// NOTE: we always validate! to skip validation test for class on form
// TODO: generate common promise handler for add/remove/clone/export/etc
// TODO: make form validation and captcha generic
storage.add = function (config) {
var property, replace, obj, value, form_to_submit, formData,
valid, pass_id, validate_portal_type_fields;
form_to_submit = document.getElementById(config.id);
formData = new FormData();
valid = storage.validate(config);
if (valid === undefined) {
util.loader("", "validation_dict.general", "ban-circle");
// valid form and no spam
} else {
replace = form_to_submit.id.split("_")[0] + "_";
obj = {};
// prepare for form submit // force portal_type
// NOTE: formData can post CORS! if (config.gadget.state.force_type) {
// formData.append(property.replace(replace, ""), value); config.gadget.state.type = config.gadget.state.force_type;
validate_portal_type_fields = true;
}
for (property in valid) {
if (valid.hasOwnProperty(property)) {
value = valid[property];
// prepare to store
if (property !== "undefined") {
// overwrite portal_type if forced
if (config.gadget.state.force_type
&& property !== "identifier") {
obj[
property.replace(property.split("_")[0],
config.gadget.state.force_type.toLowerCase())
] = value;
} else {
obj[property] = value;
}
} }
}
// force new object to be created // prepare for form submit
if (config.gadget.state.create_new) { // NOTE: formData can post CORS!
delete obj.identifier; // formData.append(property.replace(replace, ""), value);
} }
}
util.loader("", "global_dict.status_dict.saving"); // force new object to be created
if (config.gadget.state.create_new) {
delete obj.identifier;
}
// TODO: a post should always include all required fields util.loader("", "global_dict.status_dict.saving");
// TODO: find a way to set default fields, like timestamp etc
app.store({ // TODO: a post should always include all required fields
"response": [obj], // TODO: find a way to set default fields, like timestamp etc
"pass": { app.store({
"type": config.gadget.state.type, "response": [obj],
"reply": true, "pass": {
"validate_type": validate_portal_type_fields "type": config.gadget.state.type,
"reply": true,
"validate_type": validate_portal_type_fields
}
})
.then(function (answer) {
if (answer.response.result === "success") {
pass_id = answer.response.id;
switch (config.gadget.getAttribute("data-reset")) {
case "login_state":
app.setLoginStatus(answer.response, config.portal_type_source);
break;
}
util.loader("", "global_dict.status_dict.saved", "check");
return pass_id;
} }
}) })
.then(function (answer) { .then(function (id) {
if (answer.response.result === "success") { if (id && config.state.callback) {
pass_id = answer.response.id; $.mobile.changePage(config.state.callback.replace("__id__", id));
switch (config.gadget.getAttribute("data-reset")) { }
case "login_state": })
app.setLoginStatus(answer.response, config.portal_type_source); .fail(util.error);
break;
}
util.loader("", "global_dict.status_dict.saved", "check");
return pass_id;
}
})
.then(function (id) {
if (id && config.state.callback) {
$.mobile.changePage(config.state.callback.replace("__id__", id));
}
})
.fail(util.error);
}
} else {
util.loader("", "validation_dict.general", "ban-circle");
} }
}; };
...@@ -5717,6 +5780,10 @@ ...@@ -5717,6 +5780,10 @@
.fail(util.error); .fail(util.error);
default: default:
// make sure reference is passed!
if (content_dict.reference && content_dict.attributes) {
content_dict.attributes["data-reference"] = content_dict.reference;
}
switch (content_dict.type) { switch (content_dict.type) {
case "input": case "input":
case "select": case "select":
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
"saving": "Saving", "saving": "Saving",
"saved": "Saved", "saved": "Saved",
"failed": "Failed", "failed": "Failed",
"updating": "Updating" "updating": "Updating",
"removing": "Removing"
}, },
"common_dict": { "common_dict": {
"status": "Status", "status": "Status",
...@@ -38,7 +39,8 @@ ...@@ -38,7 +39,8 @@
"create": "Create Instance", "create": "Create Instance",
"install": "Install", "install": "Install",
"request": "Request", "request": "Request",
"update": "Update" "update": "Update",
"stop": "Stop"
}, },
"export_dict": { "export_dict": {
"download": "Download" "download": "Download"
...@@ -102,7 +104,8 @@ ...@@ -102,7 +104,8 @@
"create": "Create new server", "create": "Create new server",
"instance": "Server Instance", "instance": "Server Instance",
"search": "Search your created servers", "search": "Search your created servers",
"subtitle": "Server instances being used" "subtitle": "Server instances being used",
"servers": "Created Servers"
}, },
"services": { "services": {
"add": "Add Service", "add": "Add Service",
...@@ -116,12 +119,18 @@ ...@@ -116,12 +119,18 @@
"instance_server": "Computer", "instance_server": "Computer",
"instance_network": "Network", "instance_network": "Network",
"configuration": "Configuration", "configuration": "Configuration",
"destroy": "Destroy" "destroy": "Destroy",
"connection_param": "Connection parameters",
"software_type": "Software Type",
"recipe": "Instance XML Recipe",
"installations": "Installations",
"services": "Installed Services"
}, },
"networks": { "networks": {
"no_servers": "No servers associated with this network.", "no_servers": "No servers associated with this network.",
"title": "Networks", "title": "Networks",
"subtitle": "Network Administration" "subtitle": "Network Administration",
"networks": "Created Networks"
}, },
"monitoring": { "monitoring": {
"title": "Monitoring", "title": "Monitoring",
...@@ -195,6 +204,26 @@ ...@@ -195,6 +204,26 @@
}, },
"service_dict": { "service_dict": {
"field_list": { "field_list": {
"detail_description": {
"title": "Detail Description",
"description:":"The detailed description of this service."
},
"connection_password": {
"title": "Password",
"description": "The password for the connection url of this service installation."
},
"connection_backend_url": {
"title": "Backend URL",
"description": "The connection backend url of this service installation."
},
"connection_url": {
"title": "URL",
"description": "The connection url of this service installation."
},
"buildout": {
"title": "Buildout",
"description": "The buildout cfg file for this service installation."
},
"state": { "state": {
"title": "State", "title": "State",
"description": "The state of this service." "description": "The state of this service."
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment