GUI modifications related to host tags
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/aadb5f4a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/aadb5f4a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/aadb5f4a
Branch: refs/heads/saml2
Commit: aadb5f4ad57b1c77f80ff511f8838911b500c0ab
Parents: 8bc7ae6
Author: seif <se...@gmail.com>
Authored: Mon Aug 18 06:40:16 2014 +0200
Committer: Mike Tutkowski <mi...@solidfire.com>
Committed: Sun Aug 17 23:44:35 2014 -0600
----------------------------------------------------------------------
ui/scripts/system.js | 68 ++++++++++++++++++++++++++++++--
ui/scripts/ui/widgets/detailView.js | 3 +-
2 files changed, 65 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aadb5f4a/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index db1629f..f0e97e5 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -15173,9 +15173,39 @@
//always appear (begin)
hosttags: {
label: 'label.host.tags',
+ isTokenInput: true,
docID: 'helpHostTags',
validation: {
required: false
+ },
+ dataProvider: function(args) {
+ $.ajax({
+ url: createURL("listHostTags"),
+ dataType: "json",
+ success: function(json) {
+ var item = json.listhosttagsresponse.hosttag;
+ var tags = [];
+
+ if (item != null)
+ {
+ tags = $.map(item, function(tag) {
+ return {
+ id: tag.name,
+ name: tag.name
+ };
+ });
+ }
+
+ args.response.success({
+ data: tags
+ });
+ },
+ error: function(XMLHttpResponse) {
+ var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
+
+ args.response.error(errorMsg);
+ }
+ });
}
}
//always appear (end)
@@ -15739,7 +15769,37 @@
},
hosttags: {
label: 'label.host.tags',
- isEditable: true
+ isEditable: true,
+ isTokenInput: true,
+ dataProvider: function(args) {
+ $.ajax({
+ url: createURL("listHostTags"),
+ dataType: "json",
+ success: function(json) {
+ var item = json.listhosttagsresponse.hosttag;
+ var tags = [];
+
+ if (item != null)
+ {
+ tags = $.map(item, function(tag) {
+ return {
+ id: tag.name,
+ name: tag.name
+ };
+ });
+ }
+
+ args.response.success({
+ data: tags
+ });
+ },
+ error: function(XMLHttpResponse) {
+ var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
+
+ args.response.error(errorMsg);
+ }
+ });
+ }
},
hahost: {
label: 'label.ha.enabled',
@@ -16895,7 +16955,7 @@
$.ajax({
url: createURL("listStorageTags"),
dataType: "json",
- success: function (json) {
+ success: function(json) {
var item = json.liststoragetagsresponse.storagetag;
var tags = [];
@@ -16913,7 +16973,7 @@
data: tags
});
},
- error: function (XMLHttpResponse) {
+ error: function(XMLHttpResponse) {
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
args.response.error(errorMsg);
@@ -17272,7 +17332,7 @@
data: tags
});
},
- error: function (XMLHttpResponse) {
+ error: function(XMLHttpResponse) {
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
args.response.error(errorMsg);
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/aadb5f4a/ui/scripts/ui/widgets/detailView.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/detailView.js b/ui/scripts/ui/widgets/detailView.js
index 33d0d14..92f1e2c 100644
--- a/ui/scripts/ui/widgets/detailView.js
+++ b/ui/scripts/ui/widgets/detailView.js
@@ -487,7 +487,7 @@
{
$token = $value;
}
- else if ($input.attr('name') === "tags")
+ else if (($input.attr('name') === "tags") || ($input.attr('name') === "hosttags"))
{
tags_value = $input.attr('value');
}
@@ -570,7 +570,6 @@
}
});
- data['token-input-'] = data['tags'];
$editButton.fadeOut('fast', function() {
$editButton.remove();
});