Skip to content

Commit aadb5f4

Browse files
SeifjeMike Tutkowski
authored andcommitted
GUI modifications related to host tags
1 parent 8bc7ae6 commit aadb5f4

2 files changed

Lines changed: 65 additions & 6 deletions

File tree

ui/scripts/system.js

Lines changed: 64 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15173,9 +15173,39 @@
1517315173
//always appear (begin)
1517415174
hosttags: {
1517515175
label: 'label.host.tags',
15176+
isTokenInput: true,
1517615177
docID: 'helpHostTags',
1517715178
validation: {
1517815179
required: false
15180+
},
15181+
dataProvider: function(args) {
15182+
$.ajax({
15183+
url: createURL("listHostTags"),
15184+
dataType: "json",
15185+
success: function(json) {
15186+
var item = json.listhosttagsresponse.hosttag;
15187+
var tags = [];
15188+
15189+
if (item != null)
15190+
{
15191+
tags = $.map(item, function(tag) {
15192+
return {
15193+
id: tag.name,
15194+
name: tag.name
15195+
};
15196+
});
15197+
}
15198+
15199+
args.response.success({
15200+
data: tags
15201+
});
15202+
},
15203+
error: function(XMLHttpResponse) {
15204+
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
15205+
15206+
args.response.error(errorMsg);
15207+
}
15208+
});
1517915209
}
1518015210
}
1518115211
//always appear (end)
@@ -15739,7 +15769,37 @@
1573915769
},
1574015770
hosttags: {
1574115771
label: 'label.host.tags',
15742-
isEditable: true
15772+
isEditable: true,
15773+
isTokenInput: true,
15774+
dataProvider: function(args) {
15775+
$.ajax({
15776+
url: createURL("listHostTags"),
15777+
dataType: "json",
15778+
success: function(json) {
15779+
var item = json.listhosttagsresponse.hosttag;
15780+
var tags = [];
15781+
15782+
if (item != null)
15783+
{
15784+
tags = $.map(item, function(tag) {
15785+
return {
15786+
id: tag.name,
15787+
name: tag.name
15788+
};
15789+
});
15790+
}
15791+
15792+
args.response.success({
15793+
data: tags
15794+
});
15795+
},
15796+
error: function(XMLHttpResponse) {
15797+
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
15798+
15799+
args.response.error(errorMsg);
15800+
}
15801+
});
15802+
}
1574315803
},
1574415804
hahost: {
1574515805
label: 'label.ha.enabled',
@@ -16895,7 +16955,7 @@
1689516955
$.ajax({
1689616956
url: createURL("listStorageTags"),
1689716957
dataType: "json",
16898-
success: function (json) {
16958+
success: function(json) {
1689916959
var item = json.liststoragetagsresponse.storagetag;
1690016960
var tags = [];
1690116961

@@ -16913,7 +16973,7 @@
1691316973
data: tags
1691416974
});
1691516975
},
16916-
error: function (XMLHttpResponse) {
16976+
error: function(XMLHttpResponse) {
1691716977
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
1691816978

1691916979
args.response.error(errorMsg);
@@ -17272,7 +17332,7 @@
1727217332
data: tags
1727317333
});
1727417334
},
17275-
error: function (XMLHttpResponse) {
17335+
error: function(XMLHttpResponse) {
1727617336
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
1727717337

1727817338
args.response.error(errorMsg);

ui/scripts/ui/widgets/detailView.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@
487487
{
488488
$token = $value;
489489
}
490-
else if ($input.attr('name') === "tags")
490+
else if (($input.attr('name') === "tags") || ($input.attr('name') === "hosttags"))
491491
{
492492
tags_value = $input.attr('value');
493493
}
@@ -570,7 +570,6 @@
570570
}
571571
});
572572

573-
data['token-input-'] = data['tags'];
574573
$editButton.fadeOut('fast', function() {
575574
$editButton.remove();
576575
});

0 commit comments

Comments
 (0)