...
|
...
|
@@ -10608,17 +10608,20 @@ scope:!1,
|
10608
|
10608
|
templateUrl:"views/directives/from-file.html",
|
10609
|
10609
|
controller:[ "$scope", function(l) {
|
10610
|
10610
|
function m(a) {
|
10611
|
|
-return a.kind ? a.metadata ? a.metadata.name || a.kind.endsWith("List") ? !a.metadata.namespace || a.metadata.namespace === l.projectName || (l.error = {
|
|
10611
|
+return !!a.kind || (l.error = {
|
|
10612
|
+message:"Resource is missing kind field."
|
|
10613
|
+}, !1);
|
|
10614
|
+}
|
|
10615
|
+function n(a) {
|
|
10616
|
+return !!l.isList || (a.metadata ? a.metadata.name ? !a.metadata.namespace || a.metadata.namespace === l.projectName || (l.error = {
|
10612
|
10617
|
message:a.kind + " " + a.metadata.name + " can't be created in project " + a.metadata.namespace + ". Can't create resource in different projects."
|
10613
|
10618
|
}, !1) :(l.error = {
|
10614
|
10619
|
message:"Resource name is missing in metadata field."
|
10615
|
10620
|
}, !1) :(l.error = {
|
10616
|
10621
|
message:"Resource is missing metadata field."
|
10617
|
|
-}, !1) :(l.error = {
|
10618
|
|
-message:"Resource is missing kind field."
|
10619
|
|
-}, !1);
|
|
10622
|
+}, !1));
|
10620
|
10623
|
}
|
10621
|
|
-function n() {
|
|
10624
|
+function o() {
|
10622
|
10625
|
var a = b.open({
|
10623
|
10626
|
animation:!0,
|
10624
|
10627
|
templateUrl:"views/modals/process-template.html",
|
...
|
...
|
@@ -10626,10 +10629,10 @@ controller:"ProcessTemplateModalController",
|
10626
|
10626
|
scope:l
|
10627
|
10627
|
});
|
10628
|
10628
|
a.result.then(function() {
|
10629
|
|
-l.templateOptions.add ? p() :(e.setTemplate(l.resourceList[0]), q());
|
|
10629
|
+l.templateOptions.add ? q() :(e.setTemplate(l.resourceList[0]), r());
|
10630
|
10630
|
});
|
10631
|
10631
|
}
|
10632
|
|
-function o() {
|
|
10632
|
+function p() {
|
10633
|
10633
|
var a = b.open({
|
10634
|
10634
|
animation:!0,
|
10635
|
10635
|
templateUrl:"views/modals/confirm-replace.html",
|
...
|
...
|
@@ -10637,27 +10640,27 @@ controller:"ConfirmReplaceModalController",
|
10637
|
10637
|
scope:l
|
10638
|
10638
|
});
|
10639
|
10639
|
a.result.then(function() {
|
10640
|
|
-k.getLatestQuotaAlerts(l.createResources, l.context).then(B);
|
|
10640
|
+k.getLatestQuotaAlerts(l.createResources, l.context).then(C);
|
10641
|
10641
|
});
|
10642
|
10642
|
}
|
10643
|
|
-function p() {
|
|
10643
|
+function q() {
|
10644
|
10644
|
var b = l.createResources.length, c = l.updateResources.length;
|
10645
|
10645
|
if (l.resourceKind.endsWith("List")) {
|
10646
|
10646
|
var d = [];
|
10647
|
|
-c > 0 && d.push(u()), b > 0 && d.push(t()), a.all(d).then(q);
|
10648
|
|
-} else s();
|
|
10647
|
+c > 0 && d.push(v()), b > 0 && d.push(u()), a.all(d).then(r);
|
|
10648
|
+} else t();
|
10649
|
10649
|
}
|
10650
|
|
-function q() {
|
|
10650
|
+function r() {
|
10651
|
10651
|
var a;
|
10652
|
10652
|
if ("Template" === l.resourceKind && l.templateOptions.process && !l.errorOccured) {
|
10653
|
10653
|
var b = l.templateOptions.add || l.updateResources.length > 0 ? l.projectName :"";
|
10654
|
|
-a = g.createFromTemplateURL(z, l.projectName, {
|
|
10654
|
+a = g.createFromTemplateURL(A, l.projectName, {
|
10655
|
10655
|
namespace:b
|
10656
|
10656
|
});
|
10657
|
10657
|
} else a = g.projectOverviewURL(l.projectName);
|
10658
|
10658
|
c.url(a);
|
10659
|
10659
|
}
|
10660
|
|
-function r(a) {
|
|
10660
|
+function s(a) {
|
10661
|
10661
|
var b = j.objectToResourceGroupVersion(a);
|
10662
|
10662
|
return b ? j.apiInfo(b) ? i.get(b, a.metadata.name, l.context, {
|
10663
|
10663
|
errorNotification:!1
|
...
|
...
|
@@ -10672,7 +10675,7 @@ message:j.unsupportedObjectKindOrVersion(a)
|
10672
|
10672
|
message:j.invalidObjectKindOrVersion(a)
|
10673
|
10673
|
}));
|
10674
|
10674
|
}
|
10675
|
|
-function s() {
|
|
10675
|
+function t() {
|
10676
|
10676
|
var a;
|
10677
|
10677
|
_.isEmpty(l.createResources) ? (a = _.head(l.updateResources), i.update(j.kindToResource(a.kind), a.metadata.name, a, {
|
10678
|
10678
|
namespace:l.projectName
|
...
|
...
|
@@ -10683,11 +10686,11 @@ data:{
|
10683
|
10683
|
type:"success",
|
10684
|
10684
|
message:a.kind + " " + a.metadata.name + " was successfully updated."
|
10685
|
10685
|
}
|
10686
|
|
-}), q();
|
|
10686
|
+}), r();
|
10687
|
10687
|
}, function(b) {
|
10688
|
10688
|
l.alerts["update" + a.metadata.name] = {
|
10689
|
10689
|
type:"error",
|
10690
|
|
-message:"Unable to update the " + w(a.kind) + " '" + a.metadata.name + "'.",
|
|
10690
|
+message:"Unable to update the " + x(a.kind) + " '" + a.metadata.name + "'.",
|
10691
|
10691
|
details:d("getErrorDetails")(b)
|
10692
|
10692
|
};
|
10693
|
10693
|
})) :(a = _.head(l.createResources), i.create(j.kindToResource(a.kind), null, a, {
|
...
|
...
|
@@ -10699,16 +10702,16 @@ data:{
|
10699
|
10699
|
type:"success",
|
10700
|
10700
|
message:a.kind + " " + a.metadata.name + " was successfully created."
|
10701
|
10701
|
}
|
10702
|
|
-}), q();
|
|
10702
|
+}), r();
|
10703
|
10703
|
}, function(b) {
|
10704
|
10704
|
l.alerts["create" + a.metadata.name] = {
|
10705
|
10705
|
type:"error",
|
10706
|
|
-message:"Unable to create the " + w(a.kind) + " '" + a.metadata.name + "'.",
|
|
10706
|
+message:"Unable to create the " + x(a.kind) + " '" + a.metadata.name + "'.",
|
10707
|
10707
|
details:d("getErrorDetails")(b)
|
10708
|
10708
|
};
|
10709
|
10709
|
}));
|
10710
|
10710
|
}
|
10711
|
|
-function t() {
|
|
10711
|
+function u() {
|
10712
|
10712
|
var b = {
|
10713
|
10713
|
started:"Creating resources in project " + l.projectName,
|
10714
|
10714
|
success:"Creating resources in project " + l.projectName,
|
...
|
...
|
@@ -10721,17 +10724,17 @@ var c = [], d = !1;
|
10721
|
10721
|
if (a.failure.length > 0) d = !0, l.errorOccured = !0, a.failure.forEach(function(a) {
|
10722
|
10722
|
c.push({
|
10723
|
10723
|
type:"error",
|
10724
|
|
-message:"Cannot create " + w(a.object.kind) + ' "' + a.object.metadata.name + '". ',
|
|
10724
|
+message:"Cannot create " + x(a.object.kind) + ' "' + a.object.metadata.name + '". ',
|
10725
|
10725
|
details:a.data.message
|
10726
|
10726
|
});
|
10727
|
10727
|
}), a.success.forEach(function(a) {
|
10728
|
10728
|
c.push({
|
10729
|
10729
|
type:"success",
|
10730
|
|
-message:"Created " + w(a.kind) + ' "' + a.metadata.name + '" successfully. '
|
|
10730
|
+message:"Created " + x(a.kind) + ' "' + a.metadata.name + '" successfully. '
|
10731
|
10731
|
});
|
10732
|
10732
|
}); else {
|
10733
|
10733
|
var e;
|
10734
|
|
-e = l.isList ? "All items in list were created successfully." :w(l.resourceKind) + " " + l.resourceName + " was successfully created.", c.push({
|
|
10734
|
+e = l.isList ? "All items in list were created successfully." :x(l.resourceKind) + " " + l.resourceName + " was successfully created.", c.push({
|
10735
|
10735
|
type:"success",
|
10736
|
10736
|
message:e
|
10737
|
10737
|
});
|
...
|
...
|
@@ -10743,7 +10746,7 @@ hasErrors:d
|
10743
|
10743
|
}), b.promise;
|
10744
|
10744
|
});
|
10745
|
10745
|
}
|
10746
|
|
-function u() {
|
|
10746
|
+function v() {
|
10747
|
10747
|
var b = {
|
10748
|
10748
|
started:"Updating resources in project " + l.projectName,
|
10749
|
10749
|
success:"Updated resources in project " + l.projectName,
|
...
|
...
|
@@ -10756,17 +10759,17 @@ var c = [], d = !1;
|
10756
|
10756
|
if (a.failure.length > 0) d = !0, l.errorOccured = !0, a.failure.forEach(function(a) {
|
10757
|
10757
|
c.push({
|
10758
|
10758
|
type:"error",
|
10759
|
|
-message:"Cannot update " + w(a.object.kind) + ' "' + a.object.metadata.name + '". ',
|
|
10759
|
+message:"Cannot update " + x(a.object.kind) + ' "' + a.object.metadata.name + '". ',
|
10760
|
10760
|
details:a.data.message
|
10761
|
10761
|
});
|
10762
|
10762
|
}), a.success.forEach(function(a) {
|
10763
|
10763
|
c.push({
|
10764
|
10764
|
type:"success",
|
10765
|
|
-message:"Updated " + w(a.kind) + ' "' + a.metadata.name + '" successfully. '
|
|
10765
|
+message:"Updated " + x(a.kind) + ' "' + a.metadata.name + '" successfully. '
|
10766
|
10766
|
});
|
10767
|
10767
|
}); else {
|
10768
|
10768
|
var e;
|
10769
|
|
-e = l.isList ? "All items in list were updated successfully." :w(l.resourceKind) + " " + l.resourceName + " was successfully updated.", c.push({
|
|
10769
|
+e = l.isList ? "All items in list were updated successfully." :x(l.resourceKind) + " " + l.resourceName + " was successfully updated.", c.push({
|
10770
|
10770
|
type:"success",
|
10771
|
10771
|
message:e
|
10772
|
10772
|
});
|
...
|
...
|
@@ -10787,27 +10790,27 @@ alerts:c
|
10787
|
10787
|
}), b.promise;
|
10788
|
10788
|
});
|
10789
|
10789
|
}
|
10790
|
|
-var v, w = d("humanizeKind");
|
|
10790
|
+var w, x = d("humanizeKind");
|
10791
|
10791
|
h.clear(), l.aceLoaded = function(a) {
|
10792
|
|
-v = a.getSession(), v.setOption("tabSize", 2), v.setOption("useSoftTabs", !0), a.setDragDelay = 0, a.$blockScrolling = 1 / 0;
|
|
10792
|
+w = a.getSession(), w.setOption("tabSize", 2), w.setOption("useSoftTabs", !0), a.setDragDelay = 0, a.$blockScrolling = 1 / 0;
|
10793
|
10793
|
};
|
10794
|
|
-var x = function() {
|
10795
|
|
-var a = v.getAnnotations();
|
|
10794
|
+var y = function() {
|
|
10795
|
+var a = w.getAnnotations();
|
10796
|
10796
|
l.editorErrorAnnotation = _.some(a, {
|
10797
|
10797
|
type:"error"
|
10798
|
10798
|
});
|
10799
|
|
-}, y = _.debounce(function() {
|
|
10799
|
+}, z = _.debounce(function() {
|
10800
|
10800
|
try {
|
10801
|
|
-JSON.parse(l.editorContent), v.setMode("ace/mode/json");
|
|
10801
|
+JSON.parse(l.editorContent), w.setMode("ace/mode/json");
|
10802
|
10802
|
} catch (a) {
|
10803
|
10803
|
try {
|
10804
|
|
-jsyaml.safeLoad(l.editorContent), v.setMode("ace/mode/yaml");
|
|
10804
|
+jsyaml.safeLoad(l.editorContent), w.setMode("ace/mode/yaml");
|
10805
|
10805
|
} catch (a) {}
|
10806
|
10806
|
}
|
10807
|
|
-l.$apply(x);
|
|
10807
|
+l.$apply(y);
|
10808
|
10808
|
}, 300);
|
10809
|
|
-l.aceChanged = y;
|
10810
|
|
-var z, A = function(a) {
|
|
10809
|
+l.aceChanged = z;
|
|
10810
|
+var A, B = function(a) {
|
10811
|
10811
|
var c = b.open({
|
10812
|
10812
|
animation:!0,
|
10813
|
10813
|
templateUrl:"views/modals/confirm.html",
|
...
|
...
|
@@ -10824,34 +10827,34 @@ cancelButtonText:"Cancel"
|
10824
|
10824
|
}
|
10825
|
10825
|
}
|
10826
|
10826
|
});
|
10827
|
|
-c.result.then(p);
|
10828
|
|
-}, B = function(a) {
|
|
10827
|
+c.result.then(q);
|
|
10828
|
+}, C = function(a) {
|
10829
|
10829
|
var b = a.quotaAlerts || [], c = _.filter(b, {
|
10830
|
10830
|
type:"error"
|
10831
|
10831
|
});
|
10832
|
|
-c.length ? (l.disableInputs = !1, l.alerts = b) :b.length ? (A(b), l.disableInputs = !1) :p();
|
|
10832
|
+c.length ? (l.disableInputs = !1, l.alerts = b) :b.length ? (B(b), l.disableInputs = !1) :q();
|
10833
|
10833
|
};
|
10834
|
10834
|
l.create = function() {
|
10835
|
10835
|
l.alerts = {}, delete l.error;
|
10836
|
10836
|
try {
|
10837
|
|
-z = JSON.parse(l.editorContent);
|
|
10837
|
+A = JSON.parse(l.editorContent);
|
10838
|
10838
|
} catch (b) {
|
10839
|
10839
|
try {
|
10840
|
|
-z = jsyaml.safeLoad(l.editorContent);
|
|
10840
|
+A = jsyaml.safeLoad(l.editorContent);
|
10841
|
10841
|
} catch (b) {
|
10842
|
10842
|
return void (l.error = b);
|
10843
|
10843
|
}
|
10844
|
10844
|
}
|
10845
|
|
-if (m(z)) {
|
10846
|
|
-l.resourceKind = z.kind, l.resourceKind.endsWith("List") ? (l.isList = !0, l.resourceList = z.items, l.resourceName = "") :(l.resourceList = [ z ], l.resourceName = z.metadata.name, "Template" === l.resourceKind && (l.templateOptions = {
|
|
10845
|
+if (m(A) && (l.resourceKind = A.kind, l.resourceKind.endsWith("List") ? l.isList = !0 :l.isList = !1, n(A))) {
|
|
10846
|
+l.isList ? (l.resourceList = A.items, l.resourceName = "") :(l.resourceList = [ A ], l.resourceName = A.metadata.name, "Template" === l.resourceKind && (l.templateOptions = {
|
10847
|
10847
|
process:!0,
|
10848
|
10848
|
add:!1
|
10849
|
10849
|
})), l.updateResources = [], l.createResources = [];
|
10850
|
10850
|
var c = [];
|
10851
|
10851
|
l.errorOccured = !1, _.forEach(l.resourceList, function(a) {
|
10852
|
|
-return m(a) ? void c.push(r(a)) :(l.errorOccured = !0, !1);
|
|
10852
|
+return n(a) ? void c.push(s(a)) :(l.errorOccured = !0, !1);
|
10853
|
10853
|
}), a.all(c).then(function() {
|
10854
|
|
-l.errorOccured || (1 === l.createResources.length && "Template" === l.resourceList[0].kind ? n() :_.isEmpty(l.updateResources) ? k.getLatestQuotaAlerts(l.createResources, l.context).then(B) :(l.updateTemplate = 1 === l.updateResources.length && "Template" === l.updateResources[0].kind, l.updateTemplate ? n() :o()));
|
|
10854
|
+l.errorOccured || (1 === l.createResources.length && "Template" === l.resourceList[0].kind ? o() :_.isEmpty(l.updateResources) ? k.getLatestQuotaAlerts(l.createResources, l.context).then(C) :(l.updateTemplate = 1 === l.updateResources.length && "Template" === l.updateResources[0].kind, l.updateTemplate ? o() :p()));
|
10855
|
10855
|
});
|
10856
|
10856
|
}
|
10857
|
10857
|
};
|
...
|
...
|
@@ -25665,11 +25668,11 @@ var _scriptsTemplatesJs = []byte(`angular.module('openshiftConsoleTemplates', []
|
25665
|
25665
|
$templateCache.put('views/modals/confirm-replace.html',
|
25666
|
25666
|
"<div class=\"modal-resource-action\">\n" +
|
25667
|
25667
|
"<div class=\"modal-body\">\n" +
|
25668
|
|
- "<div ng-if=\"resourceList.length === 1\">\n" +
|
25669
|
|
- "<h1>{{resourceKind | humanizeKind}} '<strong>{{resourceName}}</strong>' already exists</h1>\n" +
|
|
25668
|
+ "<div ng-if=\"!isList\">\n" +
|
|
25669
|
+ "<h1>{{resourceKind}} '<strong>{{resourceName}}</strong>' already exists</h1>\n" +
|
25670
|
25670
|
"<p>Do you want to replace with the new content?</p>\n" +
|
25671
|
25671
|
"</div>\n" +
|
25672
|
|
- "<div ng-if=\"resourceList.length > 1\">\n" +
|
|
25672
|
+ "<div ng-if=\"isList\">\n" +
|
25673
|
25673
|
"<h1>Some items already exist:</h1>\n" +
|
25674
|
25674
|
"<dl class=\"dl-horizontal\">\n" +
|
25675
|
25675
|
"<dt ng-repeat-start=\"resource in updateResources\">{{resource.kind}}</dt>\n" +
|