From 1c9e1340919f05f2e36ce00b131e0e33837fa28c Mon Sep 17 00:00:00 2001 From: benjaminapetersen Date: Thu, 31 Aug 2017 14:08:45 -0400 Subject: [PATCH] Initial stab @ integrating internal notifications with events in the notification drawer --- .../notificationDrawerWrapper.js | 249 +++--- .../notifications/notification-body.html | 18 +- dist/scripts/scripts.js | 800 +++++++++--------- dist/scripts/templates.js | 11 +- 4 files changed, 541 insertions(+), 537 deletions(-) diff --git a/app/scripts/directives/notifications/notificationDrawerWrapper.js b/app/scripts/directives/notifications/notificationDrawerWrapper.js index 46595b124b..bebeab8136 100644 --- a/app/scripts/directives/notifications/notificationDrawerWrapper.js +++ b/app/scripts/directives/notifications/notificationDrawerWrapper.js @@ -45,22 +45,25 @@ // this one is treated separately from the rootScopeWatches as // it may need to be updated outside of the lifecycle of init/destroy var notificationListener; - // our internal notifications - // var clientGeneratedNotifications = []; - var eventsWatcher; - var eventsByNameData = {}; - var eventsMap = {}; - - // TODO: - // include both Notifications & Events, - // rather than destroying the map each time maintain it & add new items + // data + var eventsMap = { + // projName: { events } + }; + var notificationsMap = { + // projName: { notifications } + }; - // final Processed set of notification groups for UI - // IF POSSIBLE, avoid having to convert back to an array. - // var notificationGroupsMap = {}; - var notificationGroups = []; + // internal notifications have different types than API events + var notificationEventTypeMap = { + success: 'Normal', + error: 'Warning' + }; + var iconClassByEventSeverity = { + Normal: 'pficon pficon-info', + Warning: 'pficon pficon-warning-triangle-o' + }; var projects = {}; @@ -73,14 +76,85 @@ }); }; - var ensureProjectGroupExists = function(groups, projectName) { - if(projectName && !groups[projectName]) { - groups[projectName] = { - heading: $filter('displayName')(projects[projectName]) || projectName, - project: projects[projectName], - notifications: [] - }; - } + var makeProjectGroup = function(projectName, notifications) { + return { + heading: $filter('displayName')(projects[projectName]) || projectName, + project: projects[projectName], + notifications: notifications + }; + }; + + // returns a map of filtered events ONLY. + // will worry about unread, actions, etc in render. + var formatAndFilterEvents = function(events) { + return _.reduce( + events, + function(result, event) { + if(EventsService.isImportantEvent(event) && !EventsService.isCleared(event)) { + result[event.metadata.uid] = { + actions: null, + uid: event.metadata.uid, + unread: !EventsService.isRead(event), + event: event + }; + } + return result; + }, {}); + }; + + // Since the events map & internal notifications map are separate + // data and updated asyncronously, they need to be copied/merged + // at some point before being sent to the UI to render. + var mergeAndSortMaps = function(firstMap, secondMap) { + var proj = $routeParams.project; + return _.orderBy( + _.assign({}, firstMap[proj], secondMap[proj]), + ['event.lastTimestamp', 'event.firstTimestamp'], + ['desc', 'desc']); + }; + + + var render = function() { + $rootScope.$evalAsync(function() { + drawer.notificationGroups = [ + makeProjectGroup($routeParams.project, mergeAndSortMaps(eventsMap, notificationsMap)) + ]; + countUnreadNotifications(); + }); + }; + + var eventWatchCallback = function(eventData) { + eventsMap[$routeParams.project] = formatAndFilterEvents(eventData.by('metadata.name')); + render(); + }; + + var notificationWatchCallback = function(event, notification) { + var uid = _.uniqueId('notification-'); + var project = notification.namespace || $routeParams.project; + notificationsMap[project] = notificationsMap[project] || {}; + notificationsMap[project][uid] = { + actions: null, + unread: true, + uid: uid, + // emulating an API event to simplify the template + event: { + lastTimestamp: notification.lastTimestamp || moment.parseZone(new Date()).utc().format(), + message: notification.message, + namespace: project, + type: notificationEventTypeMap[notification.type] || 'Normal' + } + }; + render(); + }; + + + var reset = function() { + getProject($routeParams.project).then(function() { + watchEvents($routeParams.project, eventWatchCallback); + watchNotifications($routeParams.project, notificationWatchCallback); + hideIfNoProject($routeParams.project); + render(); + }); }; var deregisterEventsWatch = function() { @@ -89,6 +163,11 @@ } }; + var deregisterNotificationListener = function() { + notificationListener && notificationListener(); + notificationListener = null; + }; + var watchEvents = function(projectName, cb) { deregisterEventsWatch(); if(projectName) { @@ -96,77 +175,30 @@ } }; - // NotificationService notifications are minimal, they do no necessarily contain projectName info. + // NotificationsService notifications are minimal, they do no necessarily contain projectName info. // ATM tacking this on via watching the current project. - // var watchNotifications = function(projectName, cb) { - // deregisterNotificationListener(); - // if(!projectName) { - // return; - // } - // notificationListener = $rootScope.$on('NotificationsService.onNotificationAdded', cb); - // }; - - var deregisterNotificationListener = function() { - notificationListener && notificationListener(); - notificationListener = null; + var watchNotifications = function(projectName, cb) { + deregisterNotificationListener(); + if(!projectName) { + return; + } + notificationListener = $rootScope.$on('NotificationsService.onNotificationAdded', cb); }; var unread = function(notifications) { return _.filter(notifications, 'unread'); }; - // returns a count for each type of notification, example: - // {Normal: 1, Warning: 5} - // TODO: eliminate this $rootScope.$applyAsync, - // there is a quirk here where the values are not picked up the - // first time the function runs, despite the same $applyAsync - // in the render() function - var countUnreadNotificationsForGroup = function(group) { - $rootScope.$applyAsync(function() { + + // currently we only show 1 at a time anyway + var countUnreadNotifications = function() { + _.each(drawer.notificationGroups, function(group) { group.totalUnread = unread(group.notifications).length; group.hasUnread = !!group.totalUnread; $rootScope.$emit('NotificationDrawerWrapper.count', group.totalUnread); }); }; - // currently we only show 1 at a time anyway - var countUnreadNotificationsForAllGroups = function() { - _.each(notificationGroups, countUnreadNotificationsForGroup); - }; - - var sortNotifications = function(notifications) { - return _.orderBy(notifications, ['event.lastTimestamp', 'event.firstTimestamp'], ['desc', 'desc']); - }; - - var sortNotificationGroups = function(groupsMap) { - // convert the map into a sorted array - var sortedGroups = _.sortBy(groupsMap, function(group) { - return group.heading; - }); - // and sort the notifications under each one - _.each(sortedGroups, function(group) { - group.notifications = sortNotifications(group.notifications); - group.counts = countUnreadNotificationsForGroup(group); - }); - return sortedGroups; - }; - - var formatAndFilterEvents = function(eventMap) { - var filtered = {}; - ensureProjectGroupExists(filtered, $routeParams.project); - _.each(eventMap, function(event) { - if(EventsService.isImportantEvent(event) && !EventsService.isCleared(event)) { - ensureProjectGroupExists(filtered, event.metadata.namespace); - filtered[event.metadata.namespace].notifications.push({ - unread: !EventsService.isRead(event), - event: event, - actions: null - }); - } - }); - return filtered; - }; - var deregisterRootScopeWatches = function() { _.each(rootScopeWatches, function(deregister) { deregister(); @@ -180,45 +212,8 @@ } }; - var render = function() { - $rootScope.$evalAsync(function () { - countUnreadNotificationsForAllGroups(); - // NOTE: we are currently only showing one project in the drawer at a - // time. If we go back to multiple projects, we can eliminate the filter here - // and just pass the whole array as notificationGroups. - // if we do, we will have to handle group.open to keep track of what the - // user is viewing at the time & indicate to the user that the non-active - // project is "asleep"/not being watched. - drawer.notificationGroups = _.filter(notificationGroups, function(group) { - return group.project.metadata.name === $routeParams.project; - }); - }); - }; - - // TODO: follow-on PR to decide which of these events to toast, - // via config in constants.js - var eventWatchCallback = function(eventData) { - eventsByNameData = eventData.by('metadata.name'); - eventsMap = formatAndFilterEvents(eventsByNameData); - // TODO: Update to an intermediate map, so that we can then combine both - // events + notifications into the final notificationGroups output - notificationGroups = sortNotificationGroups(eventsMap); - render(); - }; - - // TODO: Follow-on PR to update & add the internal notifications to the - // var notificationWatchCallback = function(event, notification) { - // // will need to add .event = {} and immitate structure - // if(!notification.lastTimestamp) { - // // creates a timestamp that matches event format: 2017-08-09T19:55:35Z - // notification.lastTimestamp = moment.parseZone(new Date()).utc().format(); - // } - // clientGeneratedNotifications.push(notification); - // }; - - var iconClassByEventSeverity = { - Normal: 'pficon pficon-info', - Warning: 'pficon pficon-warning-triangle-o' + var projectChanged = function(next, current) { + return _.get(next, 'params.project') !== _.get(current, 'params.project'); }; angular.extend(drawer, { @@ -249,19 +244,19 @@ render(); $rootScope.$emit('NotificationDrawerWrapper.onMarkAllRead'); }, - notificationGroups: notificationGroups, + notificationGroups: [], headingInclude: 'views/directives/notifications/header.html', notificationBodyInclude: 'views/directives/notifications/notification-body.html', customScope: { clear: function(notification, index, group) { EventsService.markCleared(notification.event); group.notifications.splice(index, 1); - countUnreadNotificationsForAllGroups(); + countUnreadNotifications(); }, markRead: function(notification) { notification.unread = false; EventsService.markRead(notification.event); - countUnreadNotificationsForAllGroups(); + countUnreadNotifications(); }, getNotficationStatusIconClass: function(event) { return iconClassByEventSeverity[event.type] || iconClassByEventSeverity.info; @@ -275,18 +270,7 @@ } }); - var projectChanged = function(next, current) { - return _.get(next, 'params.project') !== _.get(current, 'params.project'); - }; - var reset = function() { - getProject($routeParams.project).then(function() { - watchEvents($routeParams.project, eventWatchCallback); - //watchNotifications($routeParams.project, notificationWatchCallback); - hideIfNoProject($routeParams.project); - render(); - }); - }; var initWatches = function() { if($routeParams.project) { @@ -322,7 +306,6 @@ deregisterEventsWatch(); deregisterRootScopeWatches(); }; - } })(); diff --git a/app/views/directives/notifications/notification-body.html b/app/views/directives/notifications/notification-body.html index dd0c4227f8..3ff8d24e33 100644 --- a/app/views/directives/notifications/notification-body.html +++ b/app/views/directives/notifications/notification-body.html @@ -52,14 +52,18 @@ ng-class="$ctrl.customScope.getNotficationStatusIconClass(notification.event)"> {{notification.event.type}}
+
- - {{notification.event.reason | humanize}} — {{notification.event.involvedObject.kind | humanize}} + + {{notification.event.reason | humanize}} — {{notification.event.involvedObject.kind | humanize}} - + {{notification.event.involvedObject.name}} + + {{notification.event.message}} +
{{notification.event.count}} times in the last - +
diff --git a/dist/scripts/scripts.js b/dist/scripts/scripts.js index a36e94e624..4561e779b8 100644 --- a/dist/scripts/scripts.js +++ b/dist/scripts/scripts.js @@ -1,6 +1,6 @@ "use strict"; -function OverviewController(e, t, n, a, r, o, i, s, c, l, u, d, m, p, f, g, h, v, y, b, C, S, w, k, j) { +function OverviewController(e, t, n, a, r, o, i, s, c, l, u, d, m, p, g, f, h, v, y, b, C, S, w, k, j) { var P = this, R = t("isIE")() || t("isEdge")(); e.projectName = n.project; var E, T, I = t("annotation"), N = t("buildConfigForBuild"), D = t("deploymentIsInProgress"), A = t("imageObjectRef"), B = t("isJenkinsPipelineStrategy"), L = t("isNewerResource"), U = t("label"), O = t("podTemplate"), F = {}, x = {}, M = {}, V = P.state = { @@ -37,7 +37,7 @@ label: "Name" }, { id: "label", label: "Label" -} ], P.filterBy = g.getLabelSelector().isEmpty() ? "name" : "label", P.viewByOptions = [ { +} ], P.filterBy = f.getLabelSelector().isEmpty() ? "name" : "label", P.viewByOptions = [ { id: "app", label: "Application" }, { @@ -98,9 +98,9 @@ P.deploymentConfigsNoPipeline = _.sortBy(e, "metadata.name"), P.pipelineViewHasO }, ee = function() { P.disableFilter = "pipeline" === P.viewBy && _.isEmpty(P.pipelineBuildConfigs); }, te = function(e) { -return g.getLabelSelector().select(e); +return f.getLabelSelector().select(e); }, ne = [ "metadata.name", "spec.serviceClassName" ], ae = function(e) { -return f.filterForKeywords(e, ne, V.filterKeywords); +return g.filterForKeywords(e, ne, V.filterKeywords); }, re = function(e) { switch (P.filterBy) { case "label": @@ -113,7 +113,7 @@ return e; }, oe = function() { switch (P.filterBy) { case "label": -return !g.getLabelSelector().isEmpty(); +return !f.getLabelSelector().isEmpty(); case "name": return !_.isEmpty(V.filterKeywords); @@ -124,7 +124,7 @@ P.filteredDeploymentConfigs = re(P.deploymentConfigs), P.filteredReplicationCont P.viewBy = localStorage.getItem(se) || "app", e.$watch(function() { return P.viewBy; }, function(e) { -localStorage.setItem(se, e), ee(), ne = "app" === P.viewBy ? [ "metadata.name", "metadata.labels.app" ] : [ "metadata.name" ], ie(), "pipeline" === P.viewBy ? g.setLabelSuggestions(x) : g.setLabelSuggestions(F); +localStorage.setItem(se, e), ee(), ne = "app" === P.viewBy ? [ "metadata.name", "metadata.labels.app" ] : [ "metadata.name" ], ie(), "pipeline" === P.viewBy ? f.setLabelSuggestions(x) : f.setLabelSuggestions(F); }), c.DISABLE_OVERVIEW_METRICS || (v.isAvailable(!0).then(function(e) { V.showMetrics = e; }), e.$on("metrics-connection-failed", function(e, t) { @@ -162,21 +162,21 @@ ue(e, a); } }, pe = function(e) { _.each(e, me); -}, fe = function(e) { +}, ge = function(e) { var t = z(e); return t ? M[t] : null; -}, ge = function(e) { +}, fe = function(e) { var t = z(e); return t ? _.get(P, [ "replicationControllersByDeploymentConfig", t ]) : []; }; P.getPreviousReplicationController = function(e) { -var t = ge(e); +var t = fe(e); return _.size(t) < 2 ? null : t[1]; }; var he = function(e) { -var t = {}, n = fe(e); +var t = {}, n = ge(e); _.assign(t, k.getDeploymentStatusAlerts(e, n), k.getPausedDeploymentAlerts(e)); -var a = ge(e); +var a = fe(e); _.each(a, function(e) { var n = de(e); _.assign(t, n); @@ -201,9 +201,9 @@ e.$evalAsync(function() { Se(), ve(), Ce(); }); }, 500), we = function(e) { -_.isEmpty(e) || (g.addLabelSuggestionsFromResources(e, F), "pipeline" !== P.viewBy && g.setLabelSuggestions(F)); +_.isEmpty(e) || (f.addLabelSuggestionsFromResources(e, F), "pipeline" !== P.viewBy && f.setLabelSuggestions(F)); }, ke = function(e) { -_.isEmpty(e) || (g.addLabelSuggestionsFromResources(e, x), "pipeline" === P.viewBy && g.setLabelSuggestions(x)); +_.isEmpty(e) || (f.addLabelSuggestionsFromResources(e, x), "pipeline" === P.viewBy && f.setLabelSuggestions(x)); }, je = function(e) { return "Succeeded" !== e.status.phase && "Failed" !== e.status.phase && (!U(e, "openshift.io/deployer-pod-for.name") && (!I(e, "openshift.io/build.name") && "slave" !== U(e, "jenkins"))); }, Pe = function() { @@ -334,18 +334,18 @@ return i.sortBuilds(e, !0); k.setGenericQuotaWarning(V.quotas, V.clusterQuotas, n.project, V.alerts); }; P.clearFilter = function() { -g.clear(), P.filterText = ""; +f.clear(), P.filterText = ""; }, e.$watch(function() { return P.filterText; }, _.debounce(function(t, n) { -t !== n && (V.filterKeywords = f.generateKeywords(t), e.$evalAsync(ie)); +t !== n && (V.filterKeywords = g.generateKeywords(t), e.$evalAsync(ie)); }, 50, { maxWait: 250 })), e.$watch(function() { return P.filterBy; }, function(e, t) { e !== t && (P.clearFilter(), ie()); -}), g.onActiveFiltersChanged(function() { +}), f.onActiveFiltersChanged(function() { e.$evalAsync(ie); }), P.startBuild = i.startBuild; var Qe = function() { @@ -1675,8 +1675,8 @@ break; default: var p; if (e.metadata) p = i.objectToResourceGroupVersion(e); else if (_.get(r, "apiVersion")) { -var f = i.kindToResource(t), g = i.parseGroupVersion(r.apiVersion); -g.resource = f, p = i.toResourceGroupVersion(g); +var g = i.kindToResource(t), f = i.parseGroupVersion(r.apiVersion); +f.resource = g, p = i.toResourceGroupVersion(f); } else p = i.toResourceGroupVersion(i.kindToResource(t)); if (!i.apiInfo(p)) return null; c.segment("other").search({ @@ -1830,9 +1830,9 @@ var n = d(e); return t && n ? t + " #" + n : e.metadata.name; }, p = function(e) { return "true" === o(e, "openshift.io/build-config.paused"); -}, f = function(e) { -return e.status.startTimestamp || e.metadata.creationTimestamp; }, g = function(e) { +return e.status.startTimestamp || e.metadata.creationTimestamp; +}, f = function(e) { return _.round(e / 1e3 / 1e3); }, h = e("imageObjectRef"), v = function(e) { var t = o(e, "jenkinsStatus"); @@ -1950,11 +1950,11 @@ t && !t(e) || u(e, n[a]) && (n[a] = e); }, getBuildNumber: d, getBuildDisplayName: m, -getStartTimestsamp: f, +getStartTimestsamp: g, getDuration: function(e) { var t = _.get(e, "status.duration"); -if (t) return g(t); -var n = f(e), a = e.status.completionTimestamp; +if (t) return f(t); +var n = g(e), a = e.status.completionTimestamp; return n && a ? moment(a).diff(moment(n)) : 0; }, incompleteBuilds: function(e) { @@ -2458,14 +2458,14 @@ return e ? e + "/m/stats/query" : e; function l(e) { return o().then(function(t) { var n; -return n = "counter" === e.type ? t + f : t + p, URI.expand(n, { +return n = "counter" === e.type ? t + g : t + p, URI.expand(n, { podUID: e.pod.metadata.uid, containerName: e.containerName, metric: e.metric }).toString(); }); } -var u, d, m, p = "/gauges/{containerName}%2F{podUID}%2F{metric}/data", f = "/counters/{containerName}%2F{podUID}%2F{metric}/data", g = function(e) { +var u, d, m, p = "/gauges/{containerName}%2F{podUID}%2F{metric}/data", g = "/counters/{containerName}%2F{podUID}%2F{metric}/data", f = function(e) { var t = e.split("/"); return { podUID: t[1], @@ -2482,7 +2482,7 @@ Accept: "application/json", } }).then(function(e) { var t = {}, n = function(e, n) { -var a = g(n), o = _.get(r, [ a.podUID, "metadata", "name" ]), s = i(e); +var a = f(n), o = _.get(r, [ a.podUID, "metadata", "name" ]), s = i(e); _.set(t, [ a.descriptor, o ], s); }; return _.each(e.data.counter, n), _.each(e.data.gauge, n), t; @@ -2830,13 +2830,13 @@ isRequestCalculated: l, isLimitCalculated: u, validatePodLimits: function(t, r, o, i) { if (!o || !o.length) return []; -var s = d(t, r, "Pod", i), c = d(t, r, "Container", i), m = 0, p = 0, f = s.min && n(s.min), g = s.max && n(s.max), h = [], v = e("computeResourceLabel")(r, !0); +var s = d(t, r, "Pod", i), c = d(t, r, "Container", i), m = 0, p = 0, g = s.min && n(s.min), f = s.max && n(s.max), h = [], v = e("computeResourceLabel")(r, !0); return angular.forEach(o, function(e) { var t = e.resources || {}, a = t.requests && t.requests[r] || c.defaultRequest; a && (m += n(a)); var o = t.limits && t.limits[r] || c.defaultLimit; o && (p += n(o)); -}), l(r, i) || (f && m < f && h.push(v + " request total for all containers is less than pod minimum (" + a(s.min, r) + ")."), g && m > g && h.push(v + " request total for all containers is greater than pod maximum (" + a(s.max, r) + ").")), u(r, i) || (f && p < f && h.push(v + " limit total for all containers is less than pod minimum (" + a(s.min, r) + ")."), g && p > g && h.push(v + " limit total for all containers is greater than pod maximum (" + a(s.max, r) + ").")), h; +}), l(r, i) || (g && m < g && h.push(v + " request total for all containers is less than pod minimum (" + a(s.min, r) + ")."), f && m > f && h.push(v + " request total for all containers is greater than pod maximum (" + a(s.max, r) + ").")), u(r, i) || (g && p < g && h.push(v + " limit total for all containers is less than pod minimum (" + a(s.min, r) + ")."), f && p > f && h.push(v + " limit total for all containers is greater than pod maximum (" + a(s.max, r) + ").")), h; } }; } ]), angular.module("openshiftConsole").factory("RoutesService", [ "$filter", function(e) { @@ -2944,7 +2944,7 @@ return l(e, "defaultRequest", t, n); return l(e, "defaultLimit", t, n); }, m = function(e, t, a) { return !(!s("cpu", e) && !u("cpu", t, a)) || (!(!c("cpu", e) && !d("cpu", t, e)) || !!n.isLimitCalculated("cpu", a) && (c("memory", e) || d("memory", t, a))); -}, p = e("humanizeKind"), f = e("hasDeploymentConfig"); +}, p = e("humanizeKind"), g = e("hasDeploymentConfig"); return { convertRequestPercentToLimit: function(e, t) { var n = o(t); @@ -2980,7 +2980,7 @@ reason: "NoCPURequest" })), _.size(r) > 1 && a.push({ message: "More than one autoscaler is scaling this resource. This is not recommended because they might compete with each other. Consider removing all but one autoscaler.", reason: "MultipleHPA" -}), "ReplicationController" === e.kind && f(e) && _.some(r, function() { +}), "ReplicationController" === e.kind && g(e) && _.some(r, function() { return _.some(r, function(e) { return "ReplicationController" === _.get(e, "spec.scaleTargetRef.kind"); }); @@ -3455,7 +3455,7 @@ target: "_blank" }; } return null; -}, f = { +}, g = { cpu: "resources.requests.cpu", "requests.cpu": "resources.requests.cpu", "limits.cpu": "resources.limits.cpu", @@ -3464,8 +3464,8 @@ memory: "resources.requests.memory", "limits.memory": "resources.limits.memory", persistentvolumeclaims: "resources.limits.persistentvolumeclaims", "requests.storage": "resources.request.storage" -}, g = function(e, t, n, a) { -var r = e.status.total || e.status, o = f[a], s = 0; +}, f = function(e, t, n, a) { +var r = e.status.total || e.status, o = g[a], s = 0; if (_.each(n.spec.containers, function(e) { var t = _.get(e, o); t && (s += i(t)); @@ -3489,7 +3489,7 @@ var i = t.status.total || t.status; if (("Pod" !== e.kind || "pods" !== r) && !o(i.hard[r])) { var s = p(t, e, r); if (s) n.push(s); else if ("pods" !== r) { -var c = g(t, e, a, r); +var c = f(t, e, a, r); c && n.push(c); } } @@ -3499,13 +3499,13 @@ var r = []; return t && n ? (_.each(t, function(t) { var s = u(t, n), c = u(t, a), l = e.objectToResourceGroupVersion(t); if (l) { -var d = e.kindToResource(t.kind, !0), p = m(t.kind), f = ""; -l.group && (f = l.group + "/"), f += l.resource; -var g = function(e) { +var d = e.kindToResource(t.kind, !0), p = m(t.kind), g = ""; +l.group && (g = l.group + "/"), g += l.resource; +var f = function(e) { var n = e.status.total || e.status; -!o(n.hard[f]) && i(n.hard[f]) <= i(n.used[f]) && r.push({ +!o(n.hard[g]) && i(n.hard[g]) <= i(n.used[g]) && r.push({ type: "error", -message: "You are at your quota of " + n.hard[f] + " " + ("1" === n.hard[f] ? p : d) + " in this project.", +message: "You are at your quota of " + n.hard[g] + " " + ("1" === n.hard[g] ? p : d) + " in this project.", details: "You will not be able to create the " + p + " '" + t.metadata.name + "'.", links: [ { href: "project/" + e.metadata.namespace + "/quota", @@ -3514,7 +3514,7 @@ target: "_blank" } ] }), r = r.concat(h(t, e)); }; -_.each(s, g), _.each(c, g); +_.each(s, f), _.each(c, f); } }), r) : r; }, y = function(e, t, n) { @@ -3619,13 +3619,13 @@ type: "info", message: "This will create additional membership roles within the project.", details: "Admins will be able to grant these custom roles to users, groups, and service accounts." }), u.length) { -var f = _.uniq(_.map(u, function(e) { +var g = _.uniq(_.map(u, function(e) { return a(e.kind); })); o.push({ type: "warning", message: "This will create resources that may have security or project behavior implications.", -details: "Make sure you understand what they do before creating them. The resources being created are: " + f.join(", ") +details: "Make sure you understand what they do before creating them. The resources being created are: " + g.join(", ") }); } return o; @@ -4226,10 +4226,10 @@ controller: !0 }); } }; -}), angular.module("openshiftConsole").controller("LandingPageController", [ "$scope", "$rootScope", "AuthService", "Catalog", "Constants", "DataService", "Navigate", "NotificationsService", "RecentlyViewedServiceItems", "GuidedTourService", "HTMLService", "$timeout", "$q", "$routeParams", "$location", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, f) { -function g() { +}), angular.module("openshiftConsole").controller("LandingPageController", [ "$scope", "$rootScope", "AuthService", "Catalog", "Constants", "DataService", "Navigate", "NotificationsService", "RecentlyViewedServiceItems", "GuidedTourService", "HTMLService", "$timeout", "$q", "$routeParams", "$location", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, g) { +function f() { if (v) if (p.startTour) d(function() { -f.replace(), f.search("startTour", null), e.startGuidedTour(); +g.replace(), g.search("startTour", null), e.startGuidedTour(); }, 500); else if (_.get(h, "auto_launch")) { var n = "openshift/viewedHomePage/" + t.user.metadata.name; "true" !== localStorage.getItem(n) && d(function() { @@ -4273,12 +4273,12 @@ message: n }; s.addNotification(a); } -e.catalogItems = t, g(); +e.catalogItems = t, f(); })); }), e.$on("$destroy", function() { y(); }), v && e.$on("$locationChangeStart", function(t) { -f.search().startTour && (e.startGuidedTour(), t.preventDefault()); +g.search().startTour && (e.startGuidedTour(), t.preventDefault()); }); } ]), angular.module("openshiftConsole").factory("EventsService", [ "BrowserStore", function(e) { var t = e.loadJSON("session", "events") || {}, n = _.get(window, "OPENSHIFT_CONSTANTS.EVENTS_TO_SHOW"); @@ -4301,12 +4301,12 @@ return _.get(t, [ e.metadata.uid, "cleared" ]); } }; } ]), angular.module("openshiftConsole").controller("ProjectsController", [ "$scope", "$filter", "$location", "$route", "$timeout", "AuthService", "DataService", "KeywordService", "Navigate", "Logger", "ProjectsService", function(e, t, n, a, r, o, i, s, c, l, u) { -var d, m, p = [], f = [], g = !1; +var d, m, p = [], g = [], f = !1; e.alerts = e.alerts || {}, e.loading = !0, e.showGetStarted = !1, e.canCreate = void 0, e.search = { text: "" }, e.limitListTo = 250; var h, v = [ "metadata.name", 'metadata.annotations["openshift.io/display-name"]', 'metadata.annotations["openshift.io/description"]', 'metadata.annotations["openshift.io/requester"]' ], y = function() { -e.projects = s.filterForKeywords(m, v, f); +e.projects = s.filterForKeywords(m, v, g); }, b = t("displayName"), C = function() { var t = _.get(e, "sortConfig.currentField.id"); h !== t && (e.sortConfig.isAscending = "metadata.creationTimestamp" !== t); @@ -4353,7 +4353,7 @@ onSortChange: S var w = function(t) { d = _.toArray(t.by("metadata.name")), e.loading = !1, e.showGetStarted = _.isEmpty(d) && !e.isProjectListIncomplete, S(); }, k = function() { -g || u.list().then(w); +f || u.list().then(w); }; e.newProjectPanelShown = !1, e.createProject = function() { e.newProjectPanelShown = !0; @@ -4370,10 +4370,10 @@ e.editProjectPanelShown = !1, k(); }, e.onDeleteProject = k, e.goToProject = function(e) { c.toProjectOverview(e); }, e.$watch("search.text", _.debounce(function(t) { -e.keywords = f = s.generateKeywords(t), e.$applyAsync(y); +e.keywords = g = s.generateKeywords(t), e.$applyAsync(y); }, 350)), o.withUser().then(function() { u.list().then(function(t) { -e.isProjectListIncomplete = u.isProjectListIncomplete(), w(t), !e.isProjectListIncomplete && _.size(d) <= 250 && (p.push(u.watch(e, w)), g = !0); +e.isProjectListIncomplete = u.isProjectListIncomplete(), w(t), !e.isProjectListIncomplete && _.size(d) <= 250 && (p.push(u.watch(e, w)), f = !0); }, function() { e.isProjectListIncomplete = !0, e.loading = !1, d = [], S(); }); @@ -4425,11 +4425,11 @@ title: n.pod type: "warning", message: "This terminal has been disconnected. If you reconnect, your terminal history will be lost." }, e.noContainersYet = !0, e.selectedTab = {}; -var p = [], f = null; +var p = [], g = null; l.isAvailable().then(function(t) { e.metricsAvailable = t; }); -var g = function() { +var f = function() { if (e.pod) { var t = _.find(e.pod.status.containerStatuses, { name: e.logOptions.container @@ -4506,7 +4506,7 @@ name: t.containerName t.containerState = a; }); }, k = t("annotation"), j = function(t, n) { -if (e.loaded = !0, e.pod = t, e.dcName = k(t, "deploymentConfig"), e.rcName = k(t, "deployment"), e.deploymentVersion = k(t, "deploymentVersion"), e.logCanRun = !_.includes([ "New", "Pending", "Unknown" ], t.status.phase), g(), delete e.controllerRef, !e.dcName) { +if (e.loaded = !0, e.pod = t, e.dcName = k(t, "deploymentConfig"), e.rcName = k(t, "deployment"), e.deploymentVersion = k(t, "deploymentVersion"), e.logCanRun = !_.includes([ "New", "Pending", "Unknown" ], t.status.phase), f(), delete e.controllerRef, !e.dcName) { var a = u.getControllerReferences(t); e.controllerRef = _.find(a, function(e) { return "ReplicationController" === e.kind || "ReplicaSet" === e.kind || "Build" === e.kind; @@ -4518,12 +4518,12 @@ message: "This pod has been deleted." }); }; m.get(n.project).then(_.spread(function(a, l) { -f = l, e.project = a, e.projectContext = l, i.get("pods", n.pod, l, { +g = l, e.project = a, e.projectContext = l, i.get("pods", n.pod, l, { errorNotification: !1 }).then(function(t) { j(t); var a = {}; -a[t.metadata.name] = t, e.logOptions.container = n.container || t.spec.containers[0].name, e.containerTerminals = C(), S(t), c.fetchReferencedImageStreamImages(a, e.imagesByDockerReference, e.imageStreamImageRefByDockerReference, f), p.push(i.watchObject("pods", n.pod, l, function(t, n) { +a[t.metadata.name] = t, e.logOptions.container = n.container || t.spec.containers[0].name, e.containerTerminals = C(), S(t), c.fetchReferencedImageStreamImages(a, e.imagesByDockerReference, e.imageStreamImageRefByDockerReference, g), p.push(i.watchObject("pods", n.pod, l, function(t, n) { j(t, n), w(e.containerTerminals), S(t); })); }, function(n) { @@ -4532,7 +4532,7 @@ type: "error", message: "The pod details could not be loaded.", details: t("getErrorDetails")(n) }; -}), e.$watch("logOptions.container", g), p.push(i.watch("imagestreams", l, function(t) { +}), e.$watch("logOptions.container", f), p.push(i.watch("imagestreams", l, function(t) { e.imageStreams = t.by("metadata.name"), c.buildDockerRefMapForImageStreams(e.imageStreams, e.imageStreamImageRefByDockerReference), c.fetchReferencedImageStreamImages(e.pods, e.imagesByDockerReference, e.imageStreamImageRefByDockerReference, l), o.log("imagestreams (subscribe)", e.imageStreams); })), p.push(i.watch("builds", l, function(t) { e.builds = t.by("metadata.name"), o.log("builds (subscribe)", e.builds); @@ -4653,7 +4653,7 @@ a.unwatchAll(i); })); } ]), angular.module("openshiftConsole").controller("MonitoringController", [ "$routeParams", "$location", "$scope", "$filter", "BuildsService", "DataService", "ImageStreamResolver", "KeywordService", "Logger", "MetricsService", "Navigate", "PodsService", "ProjectsService", "$rootScope", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p) { n.projectName = e.project, n.alerts = n.alerts || {}, n.renderOptions = n.renderOptions || {}, n.renderOptions.showEventsSidebar = !0, n.renderOptions.collapseEventsSidebar = "true" === localStorage.getItem("monitoring.eventsidebar.collapsed"); -var f = []; +var g = []; n.kinds = [ { kind: "All" }, { @@ -4691,9 +4691,9 @@ replicaSets: {}, builds: {}, statefulSets: {} }; -var g = a("isNil"); +var f = a("isNil"); n.filters = { -hideOlderResources: g(e.hideOlderResources) || "true" === e.hideOlderResources, +hideOlderResources: f(e.hideOlderResources) || "true" === e.hideOlderResources, text: "" }; var h, v, y, b; @@ -4795,7 +4795,7 @@ resource: "replicasets" }, a, function(e) { n.replicaSets = C(e.by("metadata.name"), !0), n.replicaSetsLoaded = !0, O(), c.log("replicasets", n.replicaSets); }), n.$on("$destroy", function() { -o.unwatchAll(f); +o.unwatchAll(g); }), n.$watch("filters.hideOlderResources", function() { T(), A(), U(), O(), E(); var e = t.search(); @@ -4812,7 +4812,7 @@ e !== t && (localStorage.setItem("monitoring.eventsidebar.collapsed", n.renderOp }); })); } ]), angular.module("openshiftConsole").controller("MembershipController", [ "$filter", "$location", "$routeParams", "$scope", "$timeout", "$uibModal", "AuthService", "AuthorizationService", "DataService", "ProjectsService", "MembershipService", "NotificationsService", "RoleBindingsService", "RolesService", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p) { -var f, g = n.project, h = e("humanizeKind"), v = e("annotation"), y = e("canI"), b = [], C = { +var g, f = n.project, h = e("humanizeKind"), v = e("annotation"), y = e("canI"), b = [], C = { notice: { yourLastRole: _.template('Removing the role "<%= roleName %>" may completely remove your ability to see this project.') }, @@ -4844,7 +4844,7 @@ message: t, details: n }); }, w = function() { -a.disableAddForm = !1, a.newBinding.name = "", a.newBinding.namespace = g, a.newBinding.newRole = null; +a.disableAddForm = !1, a.newBinding.name = "", a.newBinding.namespace = f, a.newBinding.newRole = null; }, k = function(e) { c.list("serviceaccounts", e).then(function(e) { var t = _.keys(e.by("metadata.name")).sort(); @@ -4856,7 +4856,7 @@ e && !_.includes(a.serviceAccounts, e) ? a.serviceAccounts = [ e ].concat(t) : a }); }); }, j = function(e) { -c.list("rolebindings", f, null, { +c.list("rolebindings", g, null, { errorNotification: !1 }).then(function(e) { angular.extend(a, { @@ -4868,7 +4868,7 @@ subjectKindsForUI: u.mapRolebindingsForUI(e.by("metadata.name"), b) e && (a.roleBindings[e.metadata.name] = e, a.subjectKindsForUI = u.mapRolebindingsForUI(a.roleBindings, b)), w(); }); }, P = function(t, n) { -a.disableAddForm = !0, m.create(t, n, g, f).then(function() { +a.disableAddForm = !0, m.create(t, n, f, g).then(function() { j(), S("success", C.update.subject.success({ roleName: t.metadata.name, subjectName: n.name @@ -4882,7 +4882,7 @@ httpErr: e("getErrorDetails")(a) })); }); }, R = function(t, n, r) { -a.disableAddForm = !0, m.addSubject(t, n, r, f).then(function() { +a.disableAddForm = !0, m.addSubject(t, n, r, g).then(function() { j(), S("success", C.update.subject.success({ roleName: t.roleRef.name, subjectName: n.name @@ -4900,7 +4900,7 @@ n.tab && (E[n.tab] = !0); var T = u.getSubjectKinds(); angular.extend(a, { selectedTab: E, -projectName: g, +projectName: f, forms: {}, subjectKinds: T, newBinding: { @@ -4976,10 +4976,10 @@ e && !_.includes(a.projects, e) ? a.projects = [ e ].concat(t) : a.projects = t; } }); }), l.get(n.project).then(_.spread(function(n, r) { -f = r, j(), k(f), angular.extend(a, { +g = r, j(), k(g), angular.extend(a, { project: n, subjectKinds: T, -canUpdateRolebindings: y("rolebindings", "update", g), +canUpdateRolebindings: y("rolebindings", "update", f), confirmRemove: function(n, r, i) { var c = null, l = I(n, r, i, a.user.metadata.name); _.isEqual(n, a.user.metadata.name) && u.isLastRole(a.user.metadata.name, a.roleBindings) && (c = !0), o.open({ @@ -4992,10 +4992,10 @@ return l; } } }).result.then(function() { -m.removeSubject(n, i, a.roleBindings, f).then(function(e) { -c ? t.url("./") : (s.getProjectRules(g, !0).then(function() { +m.removeSubject(n, i, a.roleBindings, g).then(function(e) { +c ? t.url("./") : (s.getProjectRules(f, !0).then(function() { j(e[0]); -var t = y("rolebindings", "update", g); +var t = y("rolebindings", "update", f); angular.extend(a, { canUpdateRolebindings: t, mode: { @@ -5032,7 +5032,7 @@ roleName: n.metadata.name, subjectName: e })) : i ? R(i, o, r) : P(n, o); } -}), p.listAllRoles(f, { +}), p.listAllRoles(g, { errorNotification: !1 }).then(function(e) { b = u.mapRolesForUI(_.head(e).by("metadata.name"), _.last(e).by("metadata.name")); @@ -5082,11 +5082,11 @@ details: "The active filters are hiding all builds." } : delete t.alerts.builds; } t.project = e; -var f = a("isJenkinsPipelineStrategy"); +var g = a("isJenkinsPipelineStrategy"); u.push(n.watch("builds", i, function(e) { -t.builds = _.omitBy(e.by("metadata.name"), f), t.emptyMessage = "No builds to show", m(), r.addLabelSuggestionsFromResources(t.builds, t.labelSuggestions), o.log("builds (subscribe)", t.builds); +t.builds = _.omitBy(e.by("metadata.name"), g), t.emptyMessage = "No builds to show", m(), r.addLabelSuggestionsFromResources(t.builds, t.labelSuggestions), o.log("builds (subscribe)", t.builds); })), u.push(n.watch("buildconfigs", i, function(e) { -t.unfilteredBuildConfigs = _.omitBy(e.by("metadata.name"), f), r.addLabelSuggestionsFromResources(t.unfilteredBuildConfigs, t.labelSuggestions), r.setLabelSuggestions(t.labelSuggestions), t.buildConfigs = r.getLabelSelector().select(t.unfilteredBuildConfigs), m(), p(), o.log("buildconfigs (subscribe)", t.buildConfigs); +t.unfilteredBuildConfigs = _.omitBy(e.by("metadata.name"), g), r.addLabelSuggestionsFromResources(t.unfilteredBuildConfigs, t.labelSuggestions), r.setLabelSuggestions(t.labelSuggestions), t.buildConfigs = r.getLabelSelector().select(t.unfilteredBuildConfigs), m(), p(), o.log("buildconfigs (subscribe)", t.buildConfigs); })), r.onActiveFiltersChanged(function(e) { t.$apply(function() { t.buildConfigs = e.select(t.unfilteredBuildConfigs), m(), p(); @@ -5100,7 +5100,7 @@ n.projectName = t.project, n.alerts = n.alerts || {}, n.buildConfigs = {}; var l = []; c.get(t.project).then(_.spread(function(t, s) { n.project = t; -var c = {}, u = e("buildConfigForBuild"), d = e("isIncompleteBuild"), m = e("isJenkinsPipelineStrategy"), p = e("isNewerResource"), f = function(e, t) { +var c = {}, u = e("buildConfigForBuild"), d = e("isIncompleteBuild"), m = e("isJenkinsPipelineStrategy"), p = e("isNewerResource"), g = function(e, t) { if (!d(t)) { n.statsByConfig[e] || (n.statsByConfig[e] = { count: 0, @@ -5109,19 +5109,19 @@ totalDuration: 0 var a = n.statsByConfig[e]; a.count++, a.totalDuration += o.getDuration(t), a.avgDuration = _.round(a.totalDuration / a.count); } -}, g = function() { +}, f = function() { var e = {}, t = {}; n.statsByConfig = {}, _.each(c, function(a) { if (m(a)) { var r = u(a) || ""; -n.buildConfigs[r] || (n.buildConfigs[r] = null), d(a) ? _.set(e, [ r, a.metadata.name ], a) : p(a, t[r]) && (t[r] = a), f(r, a); +n.buildConfigs[r] || (n.buildConfigs[r] = null), d(a) ? _.set(e, [ r, a.metadata.name ], a) : p(a, t[r]) && (t[r] = a), g(r, a); } }), _.each(t, function(t, n) { _.set(e, [ n, t.metadata.name ], t); }), n.interestingBuildsByConfig = e; }; l.push(i.watch("builds", s, function(e) { -n.buildsLoaded = !0, c = e.by("metadata.name"), g(); +n.buildsLoaded = !0, c = e.by("metadata.name"), f(); })); var h = !1; l.push(i.watch("buildconfigs", s, function(e) { @@ -5135,7 +5135,7 @@ errorNotification: !1 n.createSampleURL = r.createFromTemplateURL(e, n.projectName); }); } -g(); +f(); })), n.startBuild = o.startBuild, n.$on("$destroy", function() { i.unwatchAll(l); }); @@ -5155,13 +5155,13 @@ title: n.buildconfig var t = e.getSession(); t.setOption("tabSize", 2), t.setOption("useSoftTabs", !0), e.$blockScrolling = 1 / 0; }; -var m, p = t("buildConfigForBuild"), f = t("buildStrategy"), g = [], h = function(t) { -e.updatedBuildConfig = angular.copy(t), e.envVars = f(e.updatedBuildConfig).env || []; +var m, p = t("buildConfigForBuild"), g = t("buildStrategy"), f = [], h = function(t) { +e.updatedBuildConfig = angular.copy(t), e.envVars = g(e.updatedBuildConfig).env || []; }; e.compareTriggers = function(e, t) { return _.isNumber(e.value) ? -1 : "ConfigChange" === e.value ? -1 : "ConfigChange" === t.value ? 1 : "ImageChange" === e.value ? -1 : "ImageChange" === t.value ? 1 : e.value.localeCompare(t.value); }, e.saveEnvVars = function() { -l.hideNotification("save-bc-env-error"), e.envVars = _.filter(e.envVars, "name"), f(e.updatedBuildConfig).env = d.compactEntries(angular.copy(e.envVars)), i.update("buildconfigs", n.buildconfig, e.updatedBuildConfig, m).then(function() { +l.hideNotification("save-bc-env-error"), e.envVars = _.filter(e.envVars, "name"), g(e.updatedBuildConfig).env = d.compactEntries(angular.copy(e.envVars)), i.update("buildconfigs", n.buildconfig, e.updatedBuildConfig, m).then(function() { l.addNotification({ type: "success", message: "Environment variables for build config " + e.buildConfigName + " were successfully updated." @@ -5181,7 +5181,7 @@ var v, y = function(n, s) { e.loaded = !0, e.buildConfig = n, e.buildConfigPaused = r.isPaused(e.buildConfig), e.buildConfig.spec.source.images && (e.imageSources = e.buildConfig.spec.source.images, e.imageSourcesPaths = [], e.imageSources.forEach(function(n) { e.imageSourcesPaths.push(t("destinationSourcePair")(n.paths)); })); -var c = _.get(f(n), "from", {}), l = c.kind + "/" + c.name + "/" + (c.namespace || e.projectName); +var c = _.get(g(n), "from", {}), l = c.kind + "/" + c.name + "/" + (c.namespace || e.projectName); v !== l && (_.includes([ "ImageStreamTag", "ImageStreamImage" ], c.kind) ? (v = l, i.get(a.kindToResource(c.kind), c.name, { namespace: c.namespace || e.projectName }, { @@ -5214,14 +5214,14 @@ details: "The active filters are hiding all builds." e.project = a, m = o, i.get("buildconfigs", n.buildconfig, o, { errorNotification: !1 }).then(function(e) { -y(e), g.push(i.watchObject("buildconfigs", n.buildconfig, o, y)); +y(e), f.push(i.watchObject("buildconfigs", n.buildconfig, o, y)); }, function(n) { e.loaded = !0, e.alerts.load = { type: "error", message: 404 === n.status ? "This build configuration can not be found, it may have been deleted." : "The build configuration details could not be loaded.", details: 404 === n.status ? "Any remaining build history for this build will be shown." : t("getErrorDetails")(n) }; -}), g.push(i.watch("builds", o, function(t, a, o) { +}), f.push(i.watch("builds", o, function(t, a, o) { if (e.emptyMessage = "No builds to show", a) { if (p(o) === n.buildconfig) { var i = o.metadata.name; @@ -5255,7 +5255,7 @@ r.startBuild(e.buildConfig); }, e.showJenkinsfileExamples = function() { c.showJenkinsfileExamples(); }, e.$on("$destroy", function() { -i.unwatchAll(g); +i.unwatchAll(f); }); })); } ]), angular.module("openshiftConsole").controller("BuildController", [ "$scope", "$filter", "$routeParams", "BuildsService", "DataService", "ModalsService", "Navigate", "ProjectsService", function(e, t, n, a, r, o, i, s) { @@ -5285,7 +5285,7 @@ s.get(n.project).then(_.spread(function(i, s) { e.project = i, e.projectContext = s, e.logOptions = {}; var p = function() { e.eventObjects = c ? [ e.build, c ] : [ e.build ]; -}, f = function(t, n) { +}, g = function(t, n) { e.loaded = !0, e.build = t, d(t), p(); var a = l(t, "buildNumber"); a && (e.breadcrumbs[2].title = "#" + a), "DELETED" === n && (e.alerts.deleted = { @@ -5298,7 +5298,7 @@ errorNotification: !1 }).then(function(e) { c = e, p(); }); -}, g = function(t, n) { +}, f = function(t, n) { "DELETED" === n && (e.alerts.deleted = { type: "warning", message: "Build configuration " + e.buildConfigName + " has been deleted." @@ -5307,7 +5307,7 @@ message: "Build configuration " + e.buildConfigName + " has been deleted." r.get("builds", n.build, s, { errorNotification: !1 }).then(function(e) { -f(e), u.push(r.watchObject("builds", n.build, s, f)), u.push(r.watchObject("buildconfigs", n.buildconfig, s, g)); +g(e), u.push(r.watchObject("builds", n.build, s, g)), u.push(r.watchObject("buildconfigs", n.buildconfig, s, f)); }, function(n) { e.loaded = !0, e.alerts.load = { type: "error", @@ -5493,14 +5493,14 @@ a.unwatchAll(p); }); })); } ]), angular.module("openshiftConsole").controller("DeploymentController", [ "$scope", "$filter", "$routeParams", "DataService", "DeploymentsService", "HPAService", "ImageStreamResolver", "LabelFilter", "Logger", "ModalsService", "Navigate", "OwnerReferencesService", "ProjectsService", "StorageService", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p) { -var f = {}; +var g = {}; e.projectName = n.project, e.name = n.deployment, e.replicaSetsForDeployment = {}, e.unfilteredReplicaSetsForDeployment = {}, e.labelSuggestions = {}, e.emptyMessage = "Loading...", e.forms = {}, e.alerts = {}, e.imagesByDockerReference = {}, e.breadcrumbs = [ { title: "Deployments", link: "project/" + n.project + "/browse/deployments" }, { title: n.deployment } ], e.healthCheckURL = u.healthCheckURL(n.project, "Deployment", n.deployment, "apps"); -var g = []; +var f = []; m.get(n.project).then(_.spread(function(u, m) { function h() { s.getLabelSelector().isEmpty() || !_.isEmpty(e.replicaSetsForDeployment) || _.isEmpty(e.unfilteredReplicaSetsForDeployment) ? delete e.alerts["filter-hiding-all"] : e.alerts["filter-hiding-all"] = { @@ -5520,15 +5520,15 @@ resource: "deployments" }, n.deployment, m, { errorNotification: !1 }).then(function(t) { -e.loaded = !0, e.deployment = t, y(), g.push(a.watchObject({ +e.loaded = !0, e.deployment = t, y(), f.push(a.watchObject({ group: "apps", resource: "deployments" }, n.deployment, m, function(t, n) { "DELETED" === n && (e.alerts.deleted = { type: "warning", message: "This deployment has been deleted." -}), e.deployment = t, e.updatingPausedState = !1, y(), i.fetchReferencedImageStreamImages([ t.spec.template ], e.imagesByDockerReference, f, m); -})), g.push(a.watch({ +}), e.deployment = t, e.updatingPausedState = !1, y(), i.fetchReferencedImageStreamImages([ t.spec.template ], e.imagesByDockerReference, g, m); +})), f.push(a.watch({ group: "extensions", resource: "replicasets" }, m, function(n) { @@ -5544,16 +5544,16 @@ details: t("getErrorDetails")(n) }; }), a.list("limitranges", m).then(function(e) { v = e.by("metadata.name"), y(); -}), g.push(a.watch("imagestreams", m, function(t) { +}), f.push(a.watch("imagestreams", m, function(t) { var n = t.by("metadata.name"); -i.buildDockerRefMapForImageStreams(n, f), e.deployment && i.fetchReferencedImageStreamImages([ e.deployment.spec.template ], e.imagesByDockerReference, f, m), c.log("imagestreams (subscribe)", e.imageStreams); -})), g.push(a.watch({ +i.buildDockerRefMapForImageStreams(n, g), e.deployment && i.fetchReferencedImageStreamImages([ e.deployment.spec.template ], e.imagesByDockerReference, g, m), c.log("imagestreams (subscribe)", e.imageStreams); +})), f.push(a.watch({ group: "autoscaling", resource: "horizontalpodautoscalers", version: "v1" }, m, function(t) { e.autoscalers = o.filterHPA(t.by("metadata.name"), "Deployment", n.deployment), y(); -})), g.push(a.watch("builds", m, function(t) { +})), f.push(a.watch("builds", m, function(t) { e.builds = t.by("metadata.name"), c.log("builds (subscribe)", e.builds); })), s.onActiveFiltersChanged(function(t) { e.$evalAsync(function() { @@ -5588,10 +5588,10 @@ cancelButtonText: "Cancel" p.removeVolume(e.deployment, t, m); }); }, e.$on("$destroy", function() { -a.unwatchAll(g); +a.unwatchAll(f); }); })); -} ]), angular.module("openshiftConsole").controller("DeploymentConfigController", [ "$scope", "$filter", "$routeParams", "BreadcrumbsService", "DataService", "DeploymentsService", "HPAService", "ImageStreamResolver", "ModalsService", "Navigate", "NotificationsService", "Logger", "ProjectsService", "StorageService", "LabelFilter", "labelNameFilter", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, f, g) { +} ]), angular.module("openshiftConsole").controller("DeploymentConfigController", [ "$scope", "$filter", "$routeParams", "BreadcrumbsService", "DataService", "DeploymentsService", "HPAService", "ImageStreamResolver", "ModalsService", "Navigate", "NotificationsService", "Logger", "ProjectsService", "StorageService", "LabelFilter", "labelNameFilter", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, g, f) { var h = {}; e.projectName = n.project, e.deploymentConfigName = n.deploymentconfig, e.deploymentConfig = null, e.deployments = {}, e.unfilteredDeployments = {}, e.imagesByDockerReference = {}, e.builds = {}, e.labelSuggestions = {}, e.forms = {}, e.alerts = {}, e.breadcrumbs = a.getBreadcrumbs({ name: n.deploymentconfig, @@ -5601,7 +5601,7 @@ namespace: n.project var v = t("mostRecent"), y = t("orderObjectsByDate"), b = []; m.get(n.project).then(_.spread(function(a, l) { function u() { -f.getLabelSelector().isEmpty() || !$.isEmptyObject(e.deployments) || $.isEmptyObject(e.unfilteredDeployments) ? delete e.alerts.deployments : e.alerts.deployments = { +g.getLabelSelector().isEmpty() || !$.isEmptyObject(e.deployments) || $.isEmptyObject(e.unfilteredDeployments) ? delete e.alerts.deployments : e.alerts.deployments = { type: "warning", details: "The active filters are hiding all deployments." }; @@ -5648,11 +5648,11 @@ e.unfilteredDeployments = l[n.deploymentconfig] || {}, angular.forEach(e.unfilte e.causes = t("deploymentCauses")(e); }), e.deploymentConfigDeploymentsInProgress = o.associateRunningDeploymentToDeploymentConfig(l); } -e.deployments = f.getLabelSelector().select(e.unfilteredDeployments), e.orderedDeployments = y(e.deployments, !0), e.deploymentInProgress = !!_.size(e.deploymentConfigDeploymentsInProgress[s]), e.mostRecent = v(e.unfilteredDeployments), u(), f.addLabelSuggestionsFromResources(e.unfilteredDeployments, e.labelSuggestions), f.setLabelSuggestions(e.labelSuggestions); +e.deployments = g.getLabelSelector().select(e.unfilteredDeployments), e.orderedDeployments = y(e.deployments, !0), e.deploymentInProgress = !!_.size(e.deploymentConfigDeploymentsInProgress[s]), e.mostRecent = v(e.unfilteredDeployments), u(), g.addLabelSuggestionsFromResources(e.unfilteredDeployments, e.labelSuggestions), g.setLabelSuggestions(e.labelSuggestions); }, { http: { params: { -labelSelector: g("deploymentConfig") + "=" + e.deploymentConfigName +labelSelector: f("deploymentConfig") + "=" + e.deploymentConfigName } } })), r.list("limitranges", l).then(function(e) { @@ -5668,7 +5668,7 @@ resource: "horizontalpodautoscalers", version: "v1" }, l, function(t) { e.autoscalers = i.filterHPA(t.by("metadata.name"), "DeploymentConfig", n.deploymentconfig), C(); -})), f.onActiveFiltersChanged(function(t) { +})), g.onActiveFiltersChanged(function(t) { e.$apply(function() { e.deployments = t.select(e.unfilteredDeployments), e.orderedDeployments = y(e.deployments, !0), u(); }); @@ -5716,7 +5716,7 @@ p.removeVolume(e.deploymentConfig, t, l); r.unwatchAll(b); }); })); -} ]), angular.module("openshiftConsole").controller("ReplicaSetController", [ "$scope", "$filter", "$routeParams", "AuthorizationService", "BreadcrumbsService", "DataService", "DeploymentsService", "HPAService", "ImageStreamResolver", "Logger", "MetricsService", "ModalsService", "Navigate", "OwnerReferencesService", "PodsService", "ProjectsService", "StorageService", "keyValueEditorUtils", "kind", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, f, g, h, v, y) { +} ]), angular.module("openshiftConsole").controller("ReplicaSetController", [ "$scope", "$filter", "$routeParams", "AuthorizationService", "BreadcrumbsService", "DataService", "DeploymentsService", "HPAService", "ImageStreamResolver", "Logger", "MetricsService", "ModalsService", "Navigate", "OwnerReferencesService", "PodsService", "ProjectsService", "StorageService", "keyValueEditorUtils", "kind", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, g, f, h, v, y) { var b = !1, C = t("annotation"), S = t("humanizeKind")(y), w = t("hasDeployment"); switch (y) { case "ReplicaSet": @@ -5738,8 +5738,8 @@ e.metricsAvailable = t; var P = t("deploymentStatus"), R = function(t) { e.logCanRun = !_.includes([ "New", "Pending" ], P(t)); }, E = t("isIE")() || t("isEdge")(); -g.get(n.project).then(_.spread(function(u, g) { -e.project = u, e.projectContext = g; +f.get(n.project).then(_.spread(function(u, f) { +e.project = u, e.projectContext = f; var v = {}, T = function() { if (e.hpaForRS = s.filterHPA(v, y, n.replicaSet), e.deploymentConfigName && e.isActive) { var t = s.filterHPA(v, "DeploymentConfig", e.deploymentConfigName); @@ -5749,7 +5749,7 @@ var a = s.filterHPA(v, "Deployment", e.deployment.metadata.name); e.autoscalers = e.hpaForRS.concat(a); } else e.autoscalers = e.hpaForRS; }, I = function() { -j.push(o.watch(e.resource, g, function(t) { +j.push(o.watch(e.resource, f, function(t) { var n, a = []; angular.forEach(t.by("metadata.name"), function(t) { (C(t, "deploymentConfig") || "") === e.deploymentConfigName && a.push(t); @@ -5764,7 +5764,7 @@ var r = C(a, "deploymentConfig"); if (r) { b = !0, e.deploymentConfigName = r; var i = C(a, "deploymentVersion"); -i && (e.logOptions.version = i), e.healthCheckURL = m.healthCheckURL(n.project, "DeploymentConfig", r), o.get("deploymentconfigs", r, g, { +i && (e.logOptions.version = i), e.healthCheckURL = m.healthCheckURL(n.project, "DeploymentConfig", r), o.get("deploymentconfigs", r, f, { errorNotification: !1 }).then(function(t) { e.deploymentConfig = t; @@ -5794,11 +5794,11 @@ kind: "Deployment" a && o.get({ group: "apps", resource: "deployments" -}, a.name, g).then(function(t) { +}, a.name, f).then(function(t) { e.deployment = t, e.healthCheckURL = m.healthCheckURL(n.project, "Deployment", t.metadata.name, "apps"), j.push(o.watchObject({ group: "apps", resource: "deployments" -}, t.metadata.name, g, function(t, a) { +}, t.metadata.name, f, function(t, a) { if ("DELETED" === a) return e.alerts["deployment-deleted"] = { type: "warning", message: "The deployment controlling this replica set has been deleted." @@ -5815,7 +5815,7 @@ humanizedKind: "Deployments" })), j.push(o.watch({ group: "extensions", resource: "replicasets" -}, g, function(e) { +}, f, function(e) { var t = e.by("metadata.name"); B = A(t); })); @@ -5823,10 +5823,10 @@ B = A(t); }, U = function() { if (!_.isEmpty(k)) { var t = _.get(e, "replicaSet.spec.template"); -t && c.fetchReferencedImageStreamImages([ t ], e.imagesByDockerReference, k, g); +t && c.fetchReferencedImageStreamImages([ t ], e.imagesByDockerReference, k, f); } }; -o.get(e.resource, n.replicaSet, g, { +o.get(e.resource, n.replicaSet, f, { errorNotification: !1 }).then(function(t) { switch (e.loaded = !0, e.replicaSet = t, R(t), y) { @@ -5839,14 +5839,14 @@ L(); } N(), e.breadcrumbs = r.getBreadcrumbs({ object: t -}), j.push(o.watchObject(e.resource, n.replicaSet, g, function(t, n) { +}), j.push(o.watchObject(e.resource, n.replicaSet, f, function(t, n) { "DELETED" === n && (e.alerts.deleted = { type: "warning", message: "This " + S + " has been deleted." }), e.replicaSet = t, R(t), N(), U(), e.deployment && $(); -})), e.deploymentConfigName && I(), j.push(o.watch("pods", g, function(t) { +})), e.deploymentConfigName && I(), j.push(o.watch("pods", f, function(t) { var n = t.by("metadata.name"); -e.podsForDeployment = f.filterForOwner(n, e.replicaSet); +e.podsForDeployment = g.filterForOwner(n, e.replicaSet); })); }, function(a) { e.loaded = !0, e.alerts.load = { @@ -5858,35 +5858,35 @@ name: n.replicaSet, kind: y, namespace: n.project }); -}), j.push(o.watch(e.resource, g, function(n, a, r) { +}), j.push(o.watch(e.resource, f, function(n, a, r) { e.replicaSets = n.by("metadata.name"), "ReplicationController" === y && (e.deploymentsByDeploymentConfig = i.associateDeploymentsToDeploymentConfig(e.replicaSets)); var o, s; r && (o = C(r, "deploymentConfig"), s = r.metadata.name), e.deploymentConfigDeploymentsInProgress = e.deploymentConfigDeploymentsInProgress || {}, a ? "ADDED" === a || "MODIFIED" === a && t("deploymentIsInProgress")(r) ? (e.deploymentConfigDeploymentsInProgress[o] = e.deploymentConfigDeploymentsInProgress[o] || {}, e.deploymentConfigDeploymentsInProgress[o][s] = r) : "MODIFIED" === a && e.deploymentConfigDeploymentsInProgress[o] && delete e.deploymentConfigDeploymentsInProgress[o][s] : e.deploymentConfigDeploymentsInProgress = i.associateRunningDeploymentToDeploymentConfig(e.deploymentsByDeploymentConfig), r ? "DELETED" !== a && (r.causes = t("deploymentCauses")(r)) : angular.forEach(e.replicaSets, function(e) { e.causes = t("deploymentCauses")(e); }); -})), j.push(o.watch("imagestreams", g, function(e) { +})), j.push(o.watch("imagestreams", f, function(e) { var t = e.by("metadata.name"); c.buildDockerRefMapForImageStreams(t, k), U(), l.log("imagestreams (subscribe)", t); -})), j.push(o.watch("builds", g, function(t) { +})), j.push(o.watch("builds", f, function(t) { e.builds = t.by("metadata.name"), l.log("builds (subscribe)", e.builds); })), j.push(o.watch({ group: "autoscaling", resource: "horizontalpodautoscalers", version: "v1" -}, g, function(e) { +}, f, function(e) { v = e.by("metadata.name"), T(), N(); }, { poll: E, pollInterval: 6e4 -})), o.list("limitranges", g).then(function(t) { +})), o.list("limitranges", f).then(function(t) { e.limitRanges = t.by("metadata.name"), N(); }); -j.push(o.watch("resourcequotas", g, function(t) { +j.push(o.watch("resourcequotas", f, function(t) { e.quotas = t.by("metadata.name"); }, { poll: !0, pollInterval: 6e4 -})), j.push(o.watch("appliedclusterresourcequotas", g, function(t) { +})), j.push(o.watch("appliedclusterresourcequotas", f, function(t) { e.clusterQuotas = t.by("metadata.name"); }, { poll: !0, @@ -5896,11 +5896,11 @@ var O = t("deploymentIsLatest"); e.showRollbackAction = function() { return "Complete" === P(e.replicaSet) && !O(e.replicaSet, e.deploymentConfig) && !e.replicaSet.metadata.deletionTimestamp && a.canI("deploymentconfigrollbacks", "create"); }, e.retryFailedDeployment = function(t) { -i.retryFailedDeployment(t, g, e); +i.retryFailedDeployment(t, f, e); }, e.rollbackToDeployment = function(t, n, a, r) { -i.rollbackToDeployment(t, n, a, r, g, e); +i.rollbackToDeployment(t, n, a, r, f, e); }, e.cancelRunningDeployment = function(e) { -i.cancelRunningDeployment(e, g); +i.cancelRunningDeployment(e, f); }, e.scale = function(n) { var a = e.deployment || e.deploymentConfig || e.replicaSet; i.scale(a, n).then(_.noop, function(n) { @@ -5924,7 +5924,7 @@ okButtonText: "Remove", okButtonClass: "btn-danger", cancelButtonText: "Cancel" }).then(function() { -h.removeVolume(e.replicaSet, n, g); +h.removeVolume(e.replicaSet, n, f); }); }, e.$on("$destroy", function() { o.unwatchAll(j); @@ -6389,7 +6389,7 @@ var p; n.isDuplicateKind = function(e) { return p || (p = _.countBy(n.kinds, "kind")), p[e] > 1; }; -var f = function(e, t) { +var g = function(e, t) { return _.some(n.kinds, function(n) { return n.kind === e && (!n.group && !t || n.group === t); }); @@ -6401,13 +6401,13 @@ resource: l.kindToResource(e.kind), group: e.group || "" }; return !!m(e) && (!!a.checkResource(t.resource) && a.canI(t, "list", n.projectName)); -}), n.project = t, n.context = r, n.kindSelector.disabled = !1, e.kind && f(e.kind, e.group) && (_.set(n, "kindSelector.selected.kind", e.kind), _.set(n, "kindSelector.selected.group", e.group || "")); +}), n.project = t, n.context = r, n.kindSelector.disabled = !1, e.kind && g(e.kind, e.group) && (_.set(n, "kindSelector.selected.kind", e.kind), _.set(n, "kindSelector.selected.group", e.group || "")); })), n.loadKind = d, n.$watch("kindSelector.selected", function() { n.alerts = {}, d(); }); -var g = i("humanizeKind"); +var f = i("humanizeKind"); n.matchKind = function(e, t) { -return -1 !== g(e).toLowerCase().indexOf(t.toLowerCase()); +return -1 !== f(e).toLowerCase().indexOf(t.toLowerCase()); }, s.onActiveFiltersChanged(function(e) { n.$apply(function() { n.resources = e.select(n.unfilteredResources), u(); @@ -6445,7 +6445,7 @@ n.unwatchAll(o); if (a.kind && a.name) { var p = [ "Deployment", "DeploymentConfig", "ReplicaSet", "ReplicationController" ]; if (_.includes(p, a.kind)) { -var f = e("humanizeKind"), g = f(a.kind, !0) + " " + a.name; +var g = e("humanizeKind"), f = g(a.kind, !0) + " " + a.name; r.name = a.name, "ReplicationController" !== a.kind && "ReplicaSet" !== a.kind || (r.showPodWarning = !0), r.renderOptions = { hideFilterWidget: !0 }, r.breadcrumbs = s.getBreadcrumbs({ @@ -6482,14 +6482,14 @@ subpage: "Edit Resource Limits" r.disableInputs = !0, b(), c.update(n, r.name, o, t).then(function() { d.addNotification({ type: "success", -message: g + " was updated." +message: f + " was updated." }), y(); }, function(e) { -r.disableInputs = !1, v(g + " could not be updated.", h(e)); +r.disableInputs = !1, v(f + " could not be updated.", h(e)); }); }; }, function(e) { -v(g + " could not be loaded.", h(e)); +v(f + " could not be loaded.", h(e)); }); var m = function() { r.hideCPU || (r.cpuProblems = l.validatePodLimits(r.limitRanges, "cpu", r.containers, e)), r.memoryProblems = l.validatePodLimits(r.limitRanges, "memory", r.containers, e); @@ -6497,7 +6497,7 @@ r.hideCPU || (r.cpuProblems = l.validatePodLimits(r.limitRanges, "cpu", r.contai c.list("limitranges", t).then(function(e) { r.limitRanges = e.by("metadata.name"), _.isEmpty(r.limitRanges) || r.$watch("containers", m, !0); }); -} else u.toErrorPage("You do not have authority to update " + f(a.kind) + " " + a.name + ".", "access_denied"); +} else u.toErrorPage("You do not have authority to update " + g(a.kind) + " " + a.name + ".", "access_denied"); })); } else u.toErrorPage("Health checks are not supported for kind " + a.kind + "."); } else u.toErrorPage("Kind or name parameter missing."); @@ -6595,14 +6595,14 @@ return "Enter the arguments that will be appended to the script."; } return null; }; -var f = function() { +var g = function() { var t = !_.isEmpty(_.get(e, "buildConfig.spec.postCommit.args")), n = !_.isEmpty(_.get(e, "buildConfig.spec.postCommit.command")), a = !!_.get(e, "buildConfig.spec.postCommit.script"); e.view.hasHooks = t || n || a; var r; r = t && n ? "commandArgs" : t && a ? "scriptArgs" : t ? "args" : a ? "script" : "command", e.buildHookSelection.type = _.find(e.buildHookTypes, { id: r }); -}, g = function() { +}, f = function() { if (e.view.hasHooks) switch (e.buildHookSelection.type.id) { case "script": delete e.updatedBuildConfig.spec.postCommit.command, delete e.updatedBuildConfig.spec.postCommit.args; @@ -6637,7 +6637,7 @@ e.$on("$destroy", b), u.get(a.project).then(_.spread(function(n, r) { e.project = n, e.context = r, i.canI("buildconfigs", "update", a.project) ? s.get("buildconfigs", a.buildconfig, r, { errorNotification: !1 }).then(function(t) { -e.buildConfig = t, f(), e.updatedBuildConfig = angular.copy(e.buildConfig), e.buildStrategy = v(e.updatedBuildConfig), e.strategyType = e.buildConfig.spec.strategy.type, e.envVars = e.buildStrategy.env || [], e.triggers = C(e.triggers, e.buildConfig.spec.triggers), e.sources = E(e.sources, e.buildConfig.spec.source), _.has(t, "spec.strategy.jenkinsPipelineStrategy.jenkinsfile") && (e.jenkinsfileOptions.type = "inline"), s.list("secrets", r).then(function(t) { +e.buildConfig = t, g(), e.updatedBuildConfig = angular.copy(e.buildConfig), e.buildStrategy = v(e.updatedBuildConfig), e.strategyType = e.buildConfig.spec.strategy.type, e.envVars = e.buildStrategy.env || [], e.triggers = C(e.triggers, e.buildConfig.spec.triggers), e.sources = E(e.sources, e.buildConfig.spec.source), _.has(t, "spec.strategy.jenkinsPipelineStrategy.jenkinsfile") && (e.jenkinsfileOptions.type = "inline"), s.list("secrets", r).then(function(t) { var n = m.groupSecretsByType(t), a = _.mapValues(n, function(e) { return _.map(e, "metadata.name"); }); @@ -6850,7 +6850,7 @@ secret: o._generateSecret() }, e.triggers[a + "Webhooks"].push(n); } }, e.save = function() { -switch (e.disableInputs = !0, g(), v(e.updatedBuildConfig).forcePull = e.options.forcePull, e.strategyType) { +switch (e.disableInputs = !0, f(), v(e.updatedBuildConfig).forcePull = e.options.forcePull, e.strategyType) { case "Docker": v(e.updatedBuildConfig).noCache = e.options.noCache; break; @@ -6930,7 +6930,7 @@ details: e("getErrorDetails")(t) r.unwatchAll(l), d(); }); })); -} ]), angular.module("openshiftConsole").controller("EditDeploymentConfigController", [ "$scope", "$filter", "$location", "$routeParams", "$uibModal", "$window", "AuthorizationService", "BreadcrumbsService", "DataService", "EnvironmentService", "Navigate", "NotificationsService", "ProjectsService", "SecretsService", "keyValueEditorUtils", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, f) { +} ]), angular.module("openshiftConsole").controller("EditDeploymentConfigController", [ "$scope", "$filter", "$location", "$routeParams", "$uibModal", "$window", "AuthorizationService", "BreadcrumbsService", "DataService", "EnvironmentService", "Navigate", "NotificationsService", "ProjectsService", "SecretsService", "keyValueEditorUtils", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, g) { e.projectName = a.project, e.deploymentConfig = null, e.alerts = {}, e.view = { advancedStrategyOptions: !1, advancedImageOptions: !1 @@ -6940,7 +6940,7 @@ kind: a.kind, namespace: a.project, subpage: "Edit Deployment Config" }), e.deploymentConfigStrategyTypes = [ "Recreate", "Rolling", "Custom" ]; -var g = t("orderByDisplayName"), h = t("getErrorDetails"), v = function(t, n) { +var f = t("orderByDisplayName"), h = t("getErrorDetails"), v = function(t, n) { e.alerts["from-value-objects"] = { type: "error", message: t, @@ -7015,13 +7015,13 @@ type: "ConfigChange" }), "Custom" !== e.strategyData.type || _.has(e.strategyData, "customParams.environment") || (e.strategyData.customParams.environment = []), c.list("configmaps", r, null, { errorNotification: !1 }).then(function(t) { -b = g(t.by("metadata.name")), e.availableConfigMaps = b, e.valueFromObjects = b.concat(C); +b = f(t.by("metadata.name")), e.availableConfigMaps = b, e.valueFromObjects = b.concat(C); }, function(e) { 403 !== e.code && v("Could not load config maps", h(e)); }), c.list("secrets", r, null, { errorNotification: !1 }).then(function(t) { -C = g(t.by("metadata.name")), e.availableSecrets = C, e.valueFromObjects = C.concat(b); +C = f(t.by("metadata.name")), e.availableSecrets = C, e.valueFromObjects = C.concat(b); var n = p.groupSecretsByType(t), a = _.mapValues(n, function(e) { return _.map(e, "metadata.name"); }); @@ -7112,7 +7112,7 @@ e.save = function() { if (e.disableInputs = !0, _.each(e.containerConfigByName, function(t, n) { _.find(e.updatedDeploymentConfig.spec.template.spec.containers, { name: n -}).env = f.compactEntries(t.env); +}).env = g.compactEntries(t.env); }), w() && delete e.strategyData[S(e.originalStrategy)], "Rolling" === e.strategyData.type) { var a = e.strategyData[e.strategyParamsPropertyName].maxSurge, r = Number(a); "" === a ? e.strategyData[e.strategyParamsPropertyName].maxSurge = null : _.isFinite(r) && (e.strategyData[e.strategyParamsPropertyName].maxSurge = r); @@ -7120,8 +7120,8 @@ var o = e.strategyData[e.strategyParamsPropertyName].maxUnavailable, i = Number( "" === o ? e.strategyData[e.strategyParamsPropertyName].maxUnavailable = null : _.isFinite(i) && (e.strategyData[e.strategyParamsPropertyName].maxUnavailable = i); } "Custom" !== e.strategyData.type && _.each([ "pre", "mid", "post" ], function(t) { -_.has(e.strategyData, [ e.strategyParamsPropertyName, t, "execNewPod", "env" ]) && (e.strategyData[e.strategyParamsPropertyName][t].execNewPod.env = f.compactEntries(e.strategyData[e.strategyParamsPropertyName][t].execNewPod.env)); -}), _.has(e, "strategyData.customParams.environment") && (e.strategyData.customParams.environment = f.compactEntries(e.strategyData.customParams.environment)), e.updatedDeploymentConfig.spec.template.spec.imagePullSecrets = _.filter(e.secrets.pullSecrets, "name"), e.updatedDeploymentConfig.spec.strategy = e.strategyData, e.updatedDeploymentConfig.spec.triggers = P(), R(), c.update("deploymentconfigs", e.updatedDeploymentConfig.metadata.name, e.updatedDeploymentConfig, e.context).then(function() { +_.has(e.strategyData, [ e.strategyParamsPropertyName, t, "execNewPod", "env" ]) && (e.strategyData[e.strategyParamsPropertyName][t].execNewPod.env = g.compactEntries(e.strategyData[e.strategyParamsPropertyName][t].execNewPod.env)); +}), _.has(e, "strategyData.customParams.environment") && (e.strategyData.customParams.environment = g.compactEntries(e.strategyData.customParams.environment)), e.updatedDeploymentConfig.spec.template.spec.imagePullSecrets = _.filter(e.secrets.pullSecrets, "name"), e.updatedDeploymentConfig.spec.strategy = e.strategyData, e.updatedDeploymentConfig.spec.triggers = P(), R(), c.update("deploymentconfigs", e.updatedDeploymentConfig.metadata.name, e.updatedDeploymentConfig, e.context).then(function() { d.addNotification({ type: "success", message: "Deployment config " + e.updatedDeploymentConfig.metadata.name + " was successfully updated." @@ -7143,14 +7143,14 @@ c.unwatchAll(y), R(); }); } ]), angular.module("openshiftConsole").controller("EditAutoscalerController", [ "$scope", "$filter", "$routeParams", "$window", "APIService", "AuthorizationService", "BreadcrumbsService", "DataService", "HPAService", "MetricsService", "Navigate", "NotificationsService", "ProjectsService", "keyValueEditorUtils", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p) { if (n.kind && n.name) { -var f = [ "Deployment", "DeploymentConfig", "HorizontalPodAutoscaler", "ReplicaSet", "ReplicationController" ]; -if (_.includes(f, n.kind)) { +var g = [ "Deployment", "DeploymentConfig", "HorizontalPodAutoscaler", "ReplicaSet", "ReplicationController" ]; +if (_.includes(g, n.kind)) { e.kind = n.kind, e.name = n.name, "HorizontalPodAutoscaler" === n.kind ? e.disableInputs = !0 : (e.targetKind = n.kind, e.targetName = n.name), e.autoscaling = { name: e.name }, e.labels = [], l.isAvailable().then(function(t) { e.metricsWarning = !t; }); -var g = t("getErrorDetails"), h = function() { +var f = t("getErrorDetails"), h = function() { a.history.back(); }; e.cancel = h; @@ -7198,10 +7198,10 @@ e.disableInputs = !1, d.addNotification({ id: "edit-hpa-error", type: "error", message: "An error occurred creating the horizontal pod autoscaler.", -details: g(t) +details: f(t) }); }); -}, f = function(t) { +}, g = function(t) { e.disableInputs = !0, (t = angular.copy(t)).metadata.labels = p.mapEntries(p.compactEntries(e.labels)), t.spec.minReplicas = e.autoscaling.minReplicas, t.spec.maxReplicas = e.autoscaling.maxReplicas, t.spec.targetCPUUtilizationPercentage = e.autoscaling.targetCPU || e.autoscaling.defaultTargetCPU || null, s.update({ resource: "horizontalpodautoscalers", group: "autoscaling" @@ -7215,7 +7215,7 @@ e.disableInputs = !1, d.addNotification({ id: "edit-hpa-error", type: "error", message: "An error occurred creating the horizontal pod autoscaler.", -details: g(t) +details: f(t) }); }); }, y = {}; @@ -7237,7 +7237,7 @@ minReplicas: _.get(r, "spec.minReplicas"), maxReplicas: _.get(r, "spec.maxReplicas"), targetCPU: _.get(r, "spec.targetCPUUtilizationPercentage") }), e.disableInputs = !1, e.save = function() { -f(r); +g(r); }, e.breadcrumbs = i.getBreadcrumbs({ name: e.targetName, kind: e.targetKind, @@ -7273,17 +7273,17 @@ kind: n.kind, namespace: n.project, subpage: "Edit Health Checks" }), a.previousProbes = {}; -var m = e("getErrorDetails"), p = e("upperFirst"), f = function(e, t) { +var m = e("getErrorDetails"), p = e("upperFirst"), g = function(e, t) { l.addNotification({ id: "add-health-check-error", type: "error", message: e, details: t }); -}, g = function() { +}, f = function() { t.url(a.resourceURL); }; -a.cancel = g; +a.cancel = f; var h = function() { l.hideNotification("add-health-check-error"); }; @@ -7307,13 +7307,13 @@ a.disableInputs = !0, h(), s.update(i.kindToResource(n.kind), a.name, r, u).then l.addNotification({ type: "success", message: p(d) + " was updated." -}), g(); +}), f(); }, function(e) { -a.disableInputs = !1, f(p(d) + " could not be updated.", m(e)); +a.disableInputs = !1, g(p(d) + " could not be updated.", m(e)); }); }; }, function(e) { -f(p(d) + " could not be loaded.", m(e)); +g(p(d) + " could not be loaded.", m(e)); }) : c.toErrorPage("You do not have authority to update " + d + ".", "access_denied"); })); } else c.toErrorPage("Health checks are not supported for kind " + n.kind + "."); @@ -7339,7 +7339,7 @@ t.path(a.routeURL); }; a.cancel = d, c.get(n.project).then(_.spread(function(t, c) { if (a.project = t, r.canI("routes", "update", n.project)) { -var m, p = e("orderByDisplayName"), f = function() { +var m, p = e("orderByDisplayName"), g = function() { i.toErrorPage('Editing routes with non-service targets is unsupported. You can edit the route with the "Edit YAML" action instead.'); }; o.get("routes", a.routeName, c).then(function(e) { @@ -7356,15 +7356,15 @@ tls: angular.copy(_.get(m, "spec.tls")) a.loading = !1; var t = e.by("metadata.name"); a.routing.to = m.spec.to, a.routing.alternateServices = [], _.each(_.get(m, "spec.alternateBackends"), function(e) { -if ("Service" !== e.kind) return f(), !1; +if ("Service" !== e.kind) return g(), !1; a.routing.alternateServices.push(e); }), a.services = p(t); }); -} else f(); +} else g(); }, function() { i.toErrorPage("Could not load route " + a.routeName + "."); }); -var g = function() { +var f = function() { var e = angular.copy(m), t = _.get(a, "routing.to.name"); _.set(e, "spec.to.name", t); var n = _.get(a, "routing.to.weight"); @@ -7383,7 +7383,7 @@ weight: e.weight a.updateRoute = function() { if (a.form.$valid) { u(), a.disableInputs = !0; -var t = g(); +var t = f(); o.update("routes", a.routeName, t, c).then(function() { s.addNotification({ type: "success", @@ -7416,7 +7416,7 @@ e.modified = !1, a.returnURL ? n.url(a.returnURL) : r.history.back(); e.$watch("resource", function(t, n) { t !== n && (e.modified = !0); }); -var f = []; +var g = []; d.get(a.project).then(_.spread(function(n, r) { var s = { resource: o.kindToResource(a.kind), @@ -7463,7 +7463,7 @@ message: "Cannot change resource kind (original: " + i.kind + ", modified: " + ( }; }, e.cancel = function() { p(); -}, f.push(c.watchObject(s, e.name, r, function(t, n) { +}, g.push(c.watchObject(s, e.name, r, function(t, n) { e.resourceChanged = l(t) !== l(i), e.resourceDeleted = "DELETED" === n; }, { errorNotification: !1 @@ -7471,7 +7471,7 @@ errorNotification: !1 }, function(e) { l.toErrorPage("Could not load " + m(a.kind) + " '" + a.name + "'. " + t("getErrorDetails")(e)); }), e.$on("$destroy", function() { -c.unwatchAll(f); +c.unwatchAll(g); })) : l.toErrorPage("You do not have authority to update " + m(a.kind) + " " + a.name + ".", "access_denied"); })); } else l.toErrorPage("Kind or name parameter missing."); @@ -7494,16 +7494,16 @@ return !1; }), a; }, m = i.CATALOG_CATEGORIES, p = "none" === r.category ? "" : r.category; if (e.category = d(m, p), e.category) { -var f, g; -!r.subcategory || (f = e.category, p = "none" === r.subcategory ? "" : r.subcategory, g = _.get(e.category, "subcategories", []), e.category = d(g, p), e.category) ? (e.alerts = e.alerts || {}, e.breadcrumbs = [ { +var g, f; +!r.subcategory || (g = e.category, p = "none" === r.subcategory ? "" : r.subcategory, f = _.get(e.category, "subcategories", []), e.category = d(f, p), e.category) ? (e.alerts = e.alerts || {}, e.breadcrumbs = [ { title: "Add to Project", link: "project/" + e.projectName + "/create" }, { title: "Catalog", link: "project/" + e.projectName + "/create?tab=fromCatalog" -} ], f && e.breadcrumbs.push({ -title: f.label, -link: "project/" + e.projectName + "/create/category/" + f.id +} ], g && e.breadcrumbs.push({ +title: g.label, +link: "project/" + e.projectName + "/create/category/" + g.id }), e.breadcrumbs.push({ title: e.category.label }), u.get(r.project).then(_.spread(function(t, n) { @@ -7526,7 +7526,7 @@ e.projectTemplates = t.by("metadata.name"); })); }))) : l.toErrorPage("Catalog category " + r.category + "/" + r.subcategory + " not found."); } else l.toErrorPage("Catalog category " + r.category + " not found."); -} ]), angular.module("openshiftConsole").controller("CreateFromImageController", [ "$scope", "$filter", "$parse", "$q", "$routeParams", "$uibModal", "APIService", "ApplicationGenerator", "DataService", "HPAService", "ImagesService", "LimitRangesService", "Logger", "MetricsService", "Navigate", "NotificationsService", "ProjectsService", "QuotaService", "SOURCE_URL_PATTERN", "SecretsService", "TaskList", "failureObjectNameFilter", "keyValueEditorUtils", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, f, g, h, v, y, b, C, S, w) { +} ]), angular.module("openshiftConsole").controller("CreateFromImageController", [ "$scope", "$filter", "$parse", "$q", "$routeParams", "$uibModal", "APIService", "ApplicationGenerator", "DataService", "HPAService", "ImagesService", "LimitRangesService", "Logger", "MetricsService", "Navigate", "NotificationsService", "ProjectsService", "QuotaService", "SOURCE_URL_PATTERN", "SecretsService", "TaskList", "failureObjectNameFilter", "keyValueEditorUtils", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p, g, f, h, v, y, b, C, S, w) { var k = t("displayName"), j = t("humanize"); e.projectName = r.project, e.sourceURLPattern = y; var P = r.imageStream; @@ -7545,8 +7545,8 @@ var E = { name: "app", value: "" }, T = t("orderByDisplayName"), I = t("getErrorDetails"), N = {}, D = function() { -g.hideNotification("create-builder-list-config-maps-error"), g.hideNotification("create-builder-list-secrets-error"), _.each(N, function(e) { -!e.id || "error" !== e.type && "warning" !== e.type || g.hideNotification(e.id); +f.hideNotification("create-builder-list-config-maps-error"), f.hideNotification("create-builder-list-secrets-error"), _.each(N, function(e) { +!e.id || "error" !== e.type && "warning" !== e.type || f.hideNotification(e.id); }); }; e.$on("$destroy", D), h.get(r.project).then(_.spread(function(t, n) { @@ -7611,7 +7611,7 @@ errorNotification: !1 }).then(function(t) { o = T(t.by("metadata.name")), e.valueFromObjects = o.concat(i); }, function(e) { -403 !== e.code && g.addNotification({ +403 !== e.code && f.addNotification({ id: "create-builder-list-config-maps-error", type: "error", message: "Could not load config maps.", @@ -7628,7 +7628,7 @@ e.secretsByType = _.each(a, function(e) { e.unshift(""); }); }, function(e) { -403 !== e.code && g.addNotification({ +403 !== e.code && f.addNotification({ id: "create-builder-list-secrets-error", type: "error", message: "Could not load secrets.", @@ -7652,10 +7652,10 @@ label: t.targetPort + "/" + t.protocol }; }), a.routing.targetPort = a.routing.portOptions[0].port); }, function() { -f.toErrorPage("Cannot create from source: the specified image could not be retrieved."); +g.toErrorPage("Cannot create from source: the specified image could not be retrieved."); }); }, function() { -f.toErrorPage("Cannot create from source: the specified image could not be retrieved."); +g.toErrorPage("Cannot create from source: the specified image could not be retrieved."); }); }(e); var $, A = function() { @@ -7687,7 +7687,7 @@ alerts: a, hasErrors: r }); }), t.promise; -}), f.toNextSteps(e.name, e.projectName, { +}), g.toNextSteps(e.name, e.projectName, { usingSampleRepo: e.usingSampleRepo(), breadcrumbTitle: R }); @@ -7712,7 +7712,7 @@ cancelButtonText: "Cancel" D(), N = t.quotaAlerts || [], e.nameTaken || _.some(N, { type: "error" }) ? (e.disableInputs = !1, _.each(N, function(e) { -e.id = _.uniqueId("create-builder-alert-"), g.addNotification(e); +e.id = _.uniqueId("create-builder-alert-"), f.addNotification(e); })) : _.isEmpty(N) ? A() : (B(N), e.disableInputs = !1); }; e.projectDisplayName = function() { @@ -7729,12 +7729,12 @@ return e.nameTaken = t.nameTaken, r; a.then(o, o).then(L, L); }; })), e.cancel = function() { -f.toProjectOverview(e.projectName); +g.toProjectOverview(e.projectName); }; -} else f.toErrorPage("Cannot create from source: a base image tag was not specified"); else f.toErrorPage("Cannot create from source: a base image was not specified"); +} else g.toErrorPage("Cannot create from source: a base image tag was not specified"); else g.toErrorPage("Cannot create from source: a base image was not specified"); } ]), angular.module("openshiftConsole").controller("NextStepsController", [ "$scope", "$http", "$routeParams", "DataService", "$q", "$location", "TaskList", "$parse", "Navigate", "Logger", "$filter", "imageObjectRefFilter", "failureObjectNameFilter", "ProjectsService", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p) { u("displayName"); -var f = []; +var g = []; e.alerts = [], e.loginBaseUrl = a.openshiftAPIBaseUrl(), e.buildConfigs = {}, e.projectName = n.project, e.fromSampleRepo = n.fromSample, e.breadcrumbs = [ { title: "Add to Project", link: "project/" + e.projectName + "/create" @@ -7743,10 +7743,10 @@ title: n.breadcrumbTitle || n.name }, { title: "Next Steps" } ], p.get(n.project).then(_.spread(function(t, r) { -e.project = t, f.push(a.watch("buildconfigs", r, function(t) { +e.project = t, g.push(a.watch("buildconfigs", r, function(t) { e.buildConfigs = t.by("metadata.name"), e.createdBuildConfig = e.buildConfigs[n.name], l.log("buildconfigs (subscribe)", e.buildConfigs); })), e.$on("$destroy", function() { -a.unwatchAll(f); +a.unwatchAll(g); }); })); } ]), angular.module("openshiftConsole").controller("NewFromTemplateController", [ "$filter", "$location", "$parse", "$routeParams", "$scope", "CachedTemplateService", "DataService", "Navigate", "NotificationsService", "ProjectsService", function(e, t, n, a, r, o, i, s, c, l) { @@ -7763,7 +7763,7 @@ for (var t = [], n = w.exec(e); n; ) t.push(n[1]), n = w.exec(e); return t; } function m() { -var e = g(); +var e = f(); r.templateImages = _.map(k, function(t) { return _.isEmpty(t.usesParameters) ? t : { name: _.template(t.name, { @@ -7780,7 +7780,7 @@ var a = n.image, r = u(e, n); r && (a = r), a && t.push(a); }), t; } -function f(e) { +function g(e) { k = []; var t = [], n = {}; angular.forEach(e.objects, function(e) { @@ -7801,7 +7801,7 @@ usesParameters: d(e) }); }), k = _.uniqBy(k, "name"); } -function g() { +function f() { var e = {}; return _.each(r.template.parameters, function(t) { e[t.name] = t.value; @@ -7835,7 +7835,7 @@ l.get(a.project).then(_.spread(function(n) { if (r.project = n, v) i.get("templates", h, { namespace: v || r.project.metadata.name }).then(function(t) { -r.template = t, r.breadcrumbs[2].title = e("displayName")(t), f(t); +r.template = t, r.breadcrumbs[2].title = e("displayName")(t), g(t); _.some(k, function(e) { return !_.isEmpty(e.usesParameters); }) ? (r.parameterDisplayNames = {}, _.each(t.parameters, function(e) { @@ -8008,44 +8008,44 @@ type: "error", message: "The templateParamsMap is not valid JSON. " + t }; } -}, m = window.OPENSHIFT_CONSTANTS.CREATE_FROM_URL_WHITELIST, p = [ "namespace", "name", "imageStream", "imageTag", "sourceURI", "sourceRef", "contextDir", "template", "templateParamsMap" ], f = _.pickBy(t, function(e, t) { +}, m = window.OPENSHIFT_CONSTANTS.CREATE_FROM_URL_WHITELIST, p = [ "namespace", "name", "imageStream", "imageTag", "sourceURI", "sourceRef", "contextDir", "template", "templateParamsMap" ], g = _.pickBy(t, function(e, t) { return _.includes(p, t) && _.isString(e); }); -f.namespace = f.namespace || "openshift"; -_.includes(m, f.namespace) ? f.imageStream && f.template ? e.alerts.invalidResource = { +g.namespace = g.namespace || "openshift"; +_.includes(m, g.namespace) ? g.imageStream && g.template ? e.alerts.invalidResource = { type: "error", message: "Image streams and templates cannot be combined." -} : f.imageStream || f.template ? f.name && !function(e) { +} : g.imageStream || g.template ? g.name && !function(e) { return _.size(e) < 25 && /^[a-z]([-a-z0-9]*[a-z0-9])?$/.test(e); -}(f.name) ? function(t) { +}(g.name) ? function(t) { e.alerts.invalidImageStream = { type: "error", message: 'The app name "' + t + "\" is not valid. An app name is an alphanumeric (a-z, and 0-9) string with a maximum length of 24 characters, where the first character is a letter (a-z), and the '-' character is allowed anywhere except the first or last character." }; -}(f.name) : (f.imageStream && o.get("imagestreams", f.imageStream, { -namespace: f.namespace +}(g.name) : (g.imageStream && o.get("imagestreams", g.imageStream, { +namespace: g.namespace }, { errorNotification: !1 }).then(function(t) { -e.imageStream = t, o.get("imagestreamtags", t.metadata.name + ":" + f.imageTag, { -namespace: f.namespace +e.imageStream = t, o.get("imagestreamtags", t.metadata.name + ":" + g.imageTag, { +namespace: g.namespace }, { errorNotification: !1 }).then(function(t) { -e.imageStreamTag = t, e.validationPassed = !0, e.resource = t, f.displayName = a("displayName")(t); +e.imageStreamTag = t, e.validationPassed = !0, e.resource = t, g.displayName = a("displayName")(t); }, function() { -l(f.imageTag); +l(g.imageTag); }); }, function() { -c(f.imageStream); -}), f.template && o.get("templates", f.template, { -namespace: f.namespace +c(g.imageStream); +}), g.template && o.get("templates", g.template, { +namespace: g.namespace }, { errorNotification: !1 }).then(function(t) { e.template = t, d() && (e.validationPassed = !0, e.resource = t); }, function() { -u(f.template); +u(g.template); })) : e.alerts.resourceRequired = { type: "error", message: "An image stream or template is required." @@ -8054,11 +8054,11 @@ e.alerts.invalidNamespace = { type: "error", message: 'Resources from the namespace "' + t + '" are not permitted.' }; -}(f.namespace), angular.extend(e, { -createDetails: f, +}(g.namespace), angular.extend(e, { +createDetails: g, createWithProject: function(a) { a = a || e.selected.project.metadata.name; -var r = t.imageStream ? i.createFromImageURL(e.imageStream, f.imageTag, a, f) : i.createFromTemplateURL(e.template, a, f); +var r = t.imageStream ? i.createFromImageURL(e.imageStream, g.imageTag, a, g) : i.createFromTemplateURL(e.template, a, g); n.url(r); } }), e.projects = {}, e.canCreateProject = void 0, s.list().then(function(t) { @@ -8131,18 +8131,18 @@ a.history.back(); }; n.cancel = m, l.get(t.project).then(_.spread(function(a, l) { if (n.project = a, o.canI("routes", "create", t.project)) { -var p, f = e("orderByDisplayName"); +var p, g = e("orderByDisplayName"); n.routing.to = { kind: "Service", name: n.serviceName, weight: 1 }; -var g, h = function() { -var e = g, t = _.get(n, "routing.to.name"); -g = _.get(p, [ t, "metadata", "labels" ], {}); -var a = u.mapEntries(u.compactEntries(n.labels)), r = _.assign(a, g); +var f, h = function() { +var e = f, t = _.get(n, "routing.to.name"); +f = _.get(p, [ t, "metadata", "labels" ], {}); +var a = u.mapEntries(u.compactEntries(n.labels)), r = _.assign(a, f); e && (r = _.omitBy(r, function(t, n) { -return e[n] && !g[n]; +return e[n] && !f[n]; })), n.labels = _.map(r, function(e, t) { return { name: t, @@ -8151,7 +8151,7 @@ value: e }); }; i.list("services", l).then(function(e) { -p = e.by("metadata.name"), n.services = f(p), n.$watch("routing.to.name", h); +p = e.by("metadata.name"), n.services = g(p), n.$watch("routing.to.name", h); }), n.createRoute = function() { if (n.createRouteForm.$valid) { d(), n.disableInputs = !0; @@ -8181,8 +8181,8 @@ details: e("getErrorDetails")(t) })); } ]), angular.module("openshiftConsole").controller("AttachPVCController", [ "$filter", "$routeParams", "$scope", "$window", "APIService", "AuthorizationService", "BreadcrumbsService", "DataService", "QuotaService", "Navigate", "NotificationsService", "ProjectsService", "StorageService", "RELATIVE_PATH_PATTERN", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p) { if (t.kind && t.name) { -var f = [ "Deployment", "DeploymentConfig", "ReplicaSet", "ReplicationController" ], g = e("humanizeKind"); -if (_.includes(f, t.kind)) { +var g = [ "Deployment", "DeploymentConfig", "ReplicaSet", "ReplicationController" ], f = e("humanizeKind"); +if (_.includes(g, t.kind)) { var h = { resource: r.kindToResource(t.kind), group: t.group @@ -8200,7 +8200,7 @@ namespace: t.project, subpage: "Add Storage" }), d.get(t.project).then(_.spread(function(r, d) { if (n.project = r, o.canI(h, "update", t.project)) { -var p = e("orderByDisplayName"), f = e("getErrorDetails"), v = e("generateName"), y = function(e, t) { +var p = e("orderByDisplayName"), g = e("getErrorDetails"), v = e("generateName"), y = function(e, t) { n.disableInputs = !0, u.addNotification({ id: "attach-pvc-error", type: "error", @@ -8231,7 +8231,7 @@ subpage: "Add Storage" var t = _.get(e, "spec.template"); n.existingVolumeNames = m.getVolumeNames(t); }, function(e) { -y(t.name + " could not be loaded.", f(e)); +y(t.name + " could not be loaded.", g(e)); }), s.list("persistentvolumeclaims", d).then(function(e) { n.pvcs = p(e.by("metadata.name")), _.isEmpty(n.pvcs) || n.attach.persistentVolumeClaim || (n.attach.persistentVolumeClaim = _.head(n.pvcs)); }), s.list("resourcequotas", { @@ -8257,23 +8257,23 @@ a.spec.volumes || (a.spec.volumes = []), a.spec.volumes.push(p), s.update(h, e.m var e; i || (e = "No mount path was provided. The volume reference was added to the configuration, but it will not be mounted into running pods."), u.addNotification({ type: "success", -message: "Persistent volume claim " + r.metadata.name + " added to " + g(t.kind) + " " + t.name + ".", +message: "Persistent volume claim " + r.metadata.name + " added to " + f(t.kind) + " " + t.name + ".", details: e }), C(); }, function(e) { -y("An error occurred attaching the persistent volume claim to the " + g(t.kind) + ".", f(e)), n.disableInputs = !1; +y("An error occurred attaching the persistent volume claim to the " + f(t.kind) + ".", g(e)), n.disableInputs = !1; }); } }; -} else l.toErrorPage("You do not have authority to update " + g(t.kind) + " " + t.name + ".", "access_denied"); +} else l.toErrorPage("You do not have authority to update " + f(t.kind) + " " + t.name + ".", "access_denied"); })); -} else l.toErrorPage("Storage is not supported for kind " + g(t.kind) + "."); +} else l.toErrorPage("Storage is not supported for kind " + f(t.kind) + "."); } else l.toErrorPage("Kind or name parameter missing."); } ]), angular.module("openshiftConsole").controller("AddConfigVolumeController", [ "$filter", "$location", "$routeParams", "$scope", "$window", "APIService", "AuthorizationService", "BreadcrumbsService", "DataService", "Navigate", "NotificationsService", "ProjectsService", "StorageService", "RELATIVE_PATH_PATTERN", function(e, t, n, a, r, o, i, s, c, l, u, d, m, p) { if (n.kind && n.name) { -var f = [ "Deployment", "DeploymentConfig", "ReplicaSet", "ReplicationController" ]; -if (_.includes(f, n.kind)) { -var g = { +var g = [ "Deployment", "DeploymentConfig", "ReplicaSet", "ReplicationController" ]; +if (_.includes(g, n.kind)) { +var f = { resource: o.kindToResource(n.kind), group: n.group }; @@ -8314,9 +8314,9 @@ a.attach.items.push({}), v(); }, a.removeItem = function(e) { a.attach.items.splice(e, 1), v(); }, d.get(n.project).then(_.spread(function(t, r) { -if (a.project = t, i.canI(g, "update", n.project)) { +if (a.project = t, i.canI(f, "update", n.project)) { var o = e("orderByDisplayName"), d = e("getErrorDetails"), p = e("generateName"); -c.get(g, n.name, r, { +c.get(f, n.name, r, { errorNotification: !1 }).then(function(e) { a.targetObject = e, a.breadcrumbs = s.getBreadcrumbs({ @@ -8339,11 +8339,11 @@ a.secrets = o(e.by("metadata.name")); }, function(e) { 403 !== e.code ? b("Could not load secrets", d(e)) : a.secrets = []; }); -var f = function(e) { +var g = function(e) { return a.attach.allContainers || a.attach.containers[e.name]; }, v = function() { var e = _.get(a, "targetObject.spec.template"); -a.existingMountPaths = m.getMountPaths(e, f); +a.existingMountPaths = m.getMountPaths(e, g); }; a.$watchGroup([ "targetObject", "attach.allContainers" ], v), a.$watch("attach.containers", v, !0); a.$watch("attach.items", function() { @@ -8356,7 +8356,7 @@ name: s, mountPath: _.get(a, "attach.mountPath") }; "Secret" === o.kind && (l.readOnly = !0), _.each(i.spec.containers, function(e) { -f(e) && (e.volumeMounts = e.volumeMounts || [], e.volumeMounts.push(l)); +g(e) && (e.volumeMounts = e.volumeMounts || [], e.volumeMounts.push(l)); }); var m, h = { name: s @@ -8377,7 +8377,7 @@ items: m } i.spec.volumes = i.spec.volumes || [], i.spec.volumes.push(h), a.disableInputs = !0, C(); var v = e("humanizeKind"), S = v(o.kind), w = v(n.kind); -c.update(g, t.metadata.name, a.targetObject, r).then(function() { +c.update(f, t.metadata.name, a.targetObject, r).then(function() { u.addNotification({ type: "success", message: "Successfully added " + S + " " + o.metadata.name + " to " + w + " " + n.name + "." @@ -8798,11 +8798,11 @@ scope: a }).result.then(function() { var e = a.kind, t = a.resourceName, r = a.typeDisplayName || n("humanizeKind")(e), s = _.capitalize(r) + " '" + (a.displayName ? a.displayName : t) + "'", u = "Project" === a.kind ? {} : { namespace: a.projectName -}, f = {}; -a.options.deleteImmediately && (f.gracePeriodSeconds = 0, f.propagationPolicy = null), "servicecatalog.k8s.io" === a.group && (f.propagationPolicy = null), i.delete({ +}, g = {}; +a.options.deleteImmediately && (g.gracePeriodSeconds = 0, g.propagationPolicy = null), "servicecatalog.k8s.io" === a.group && (g.propagationPolicy = null), i.delete({ resource: o.kindToResource(e), group: a.group -}, t, u, f).then(function() { +}, t, u, g).then(function() { c.addNotification({ type: "success", message: s + " was marked for deletion." @@ -8895,18 +8895,18 @@ var n = e.sortConfig.isAscending ? "asc" : "desc"; c = _.orderBy(e.events, [ t ], [ n ]); }, m = [], p = function() { e.filterExpressions = m = a.generateKeywords(_.get(e, "filter.text")); -}, f = [ "reason", "message", "type" ]; -e.resourceKind && e.resourceName || f.splice(0, 0, "involvedObject.name", "involvedObject.kind"); -var g = function() { -e.filteredEvents = a.filterForKeywords(c, f, m); +}, g = [ "reason", "message", "type" ]; +e.resourceKind && e.resourceName || g.splice(0, 0, "involvedObject.name", "involvedObject.kind"); +var f = function() { +e.filteredEvents = a.filterForKeywords(c, g, m); }; e.$watch("filter.text", _.debounce(function() { -p(), e.$evalAsync(g); +p(), e.$evalAsync(f); }, 50, { maxWait: 250 })); var h = function() { -d(), g(); +d(), f(); }, v = _.debounce(function() { t && e.$evalAsync(function() { e.events = s(t), h(); @@ -9032,12 +9032,12 @@ isDialog: "=" }, templateUrl: "views/directives/from-file.html", controller: [ "$scope", function(p) { -function f(e) { +function g(e) { return !!e.kind || (p.error = { message: "Resource is missing kind field." }, !1); } -function g(e) { +function f(e) { return !!p.isList || (e.metadata ? e.metadata.name ? !e.metadata.namespace || e.metadata.namespace === p.input.selectedProject.metadata.name || (p.error = { message: e.kind + " " + e.metadata.name + " can't be created in project " + e.metadata.namespace + ". Can't create resource in different projects." }, !1) : (p.error = { @@ -9261,14 +9261,14 @@ var t = p.input.selectedProject.metadata.name, a = p.input.selectedProject.metad return m.create(t, a, r); }; p.create = function() { -if (delete p.error, f(p.resource) && (p.resourceKind = p.resource.kind, p.resourceKind.endsWith("List") ? p.isList = !0 : p.isList = !1, g(p.resource))) { +if (delete p.error, g(p.resource) && (p.resourceKind = p.resource.kind, p.resourceKind.endsWith("List") ? p.isList = !0 : p.isList = !1, f(p.resource))) { p.isList ? (p.resourceList = p.resource.items, p.resourceName = "") : (p.resourceList = [ p.resource ], p.resourceName = p.resource.metadata.name, "Template" === p.resourceKind && (p.templateOptions = { process: !0, add: !1 })), p.updateResources = [], p.createResources = []; var e = []; p.errorOccurred = !1, _.forEach(p.resourceList, function(t) { -if (!g(t)) return p.errorOccurred = !0, !1; +if (!f(t)) return p.errorOccurred = !0, !1; e.push(C(t)); }), D().then(function(t) { p.input.selectedProject = t, n.all(e).then(function() { @@ -10090,22 +10090,22 @@ restrict: "EA", templateUrl: "views/directives/header/header.html", link: function(r, p) { r.currentProject = l[a.project]; -var f = function(e, t) { +var g = function(e, t) { var a; _.set(n, "nav.collapsed", e), t && (a = e ? "true" : "false", localStorage.setItem("openshift/vertical-nav-collapsed", a)); }; !function() { var e = "true" === localStorage.getItem("openshift/vertical-nav-collapsed"); -f(e); +g(e); }(); -var g = function() { +var f = function() { return _.get(n, "nav.collapsed", !1); }, h = function(e) { _.set(n, "nav.showMobileNav", e); }; r.toggleNav = function() { -var e = g(); -f(!e, !0); +var e = f(); +g(!e, !0); }, r.toggleMobileNav = function() { var e = _.get(n, "nav.showMobileNav"); h(!e); @@ -10806,7 +10806,7 @@ if (a) return d(a); } return null; } -function f(e) { +function g(e) { var t = _.head(e.datasets); if (t.total) { var n, r = { @@ -10822,7 +10822,7 @@ $ || (E[t.id] = c3.generate(n)); })); } } -function g(e) { +function f(e) { if (!_.some(e.datasets, function(e) { return !e.data; })) { @@ -10861,7 +10861,7 @@ containerName: e.containerMetric ? m.options.selectedContainer.name : "pod" } function C() { $ || (U = 0, _.each(m.metrics, function(e) { -g(e), f(e); +f(e), g(e); })); } function S(e) { @@ -11100,7 +11100,7 @@ return 60 * t.options.timeRange.value * 1e3; function p() { return w ? "1mn" : Math.floor(m() / S) + "ms"; } -function f() { +function g() { var e = _.find(t.pods, "metadata.namespace"); if (e) { var n = { @@ -11111,7 +11111,7 @@ bucketDuration: p() return w || (n.containerName = t.options.selectedContainer.name), n.start = j || d(), n; } } -function g(e) { +function f(e) { if (!k) if (N++, t.noData) t.metricsError = { status: _.get(e, "status", 0), details: _.get(e, "data.errorMsg") || _.get(e, "statusText") || "Status code " + _.get(e, "status", 0) @@ -11144,8 +11144,8 @@ _.set(R, [ e, n ], i); function y() { if (!E && h()) { P = Date.now(); -var e = f(); -c.getPodMetrics(e).then(u, g).finally(function() { +var e = g(); +c.getPodMetrics(e).then(u, f).finally(function() { t.loaded = !0; }); } @@ -11238,7 +11238,7 @@ e.destroy(); } }; } ]), angular.module("openshiftConsole").directive("logViewer", [ "$sce", "$timeout", "$window", "$filter", "$q", "AuthService", "APIService", "APIDiscovery", "DataService", "HTMLService", "ModalsService", "logLinks", "BREAKPOINTS", function(e, t, n, a, r, o, i, s, c, l, u, d) { -var m = $(window), p = $('').get(0), f = function(e, t) { +var m = $(window), p = $('').get(0), g = function(e, t) { var n = p.cloneNode(!0); n.firstChild.setAttribute("data-line-number", e); var a = ansi_up.escape_for_html(t), r = ansi_up.ansi_to_html(a), o = l.linkify(r, "_blank", !0); @@ -11261,14 +11261,14 @@ empty: "=?", run: "=?" }, controller: [ "$scope", function(t) { -var l, u, p, g = document.documentElement; +var l, u, p, f = document.documentElement; t.logViewerID = _.uniqueId("log-viewer"), t.empty = !0; var h, v; "ReplicationController" === t.object.kind ? (h = "deploymentconfigs/log", v = a("annotation")(t.object, "deploymentConfig")) : (h = i.kindToResource(t.object.kind) + "/log", v = t.object.metadata.name); var y, b = function() { t.$apply(function() { var e = l.getBoundingClientRect(); -t.fixedHeight ? t.showScrollLinks = e && e.height > t.fixedHeight : t.showScrollLinks = e && (e.top < 0 || e.bottom > g.clientHeight); +t.fixedHeight ? t.showScrollLinks = e && e.height > t.fixedHeight : t.showScrollLinks = e && (e.top < 0 || e.bottom > f.clientHeight); }); }, C = !1, S = function() { C ? C = !1 : t.$evalAsync(function() { @@ -11336,7 +11336,7 @@ follow: !0, tailLines: 5e3, limitBytes: 10485760 }, t.options), n = 0, a = function(e) { -n++, N.appendChild(f(n, e)), D(); +n++, N.appendChild(g(n, e)), D(); }; (T = c.createStream(h, v, t.context, e)).onMessage(function(r, o, i) { t.$evalAsync(function() { @@ -11669,7 +11669,7 @@ e.showQuotaWarning = _.some(t, a) || _.some(n, a); }); var p = function() { return e.deploymentConfig || e.deployment || e.rc; -}, f = function() { +}, g = function() { if (s = !1, angular.isNumber(e.desiredReplicas)) { var a = p(); return r.scale(a, e.desiredReplicas).then(_.noop, function(e) { @@ -11682,13 +11682,13 @@ details: t("getErrorDetails")(e) }), n.reject(e); }); } -}, g = _.debounce(f, 650); +}, f = _.debounce(g, 650); e.viewPodsForDeployment = function(t) { _.isEmpty(e.pods) || c.toPodsForDeployment(t, e.pods); }, e.scaleUp = function() { -e.scalable && (e.desiredReplicas = e.getDesiredReplicas(), e.desiredReplicas++, g(), s = !0); +e.scalable && (e.desiredReplicas = e.getDesiredReplicas(), e.desiredReplicas++, f(), s = !0); }, e.scaleDown = function() { -e.scalable && (e.desiredReplicas = e.getDesiredReplicas(), 0 !== e.desiredReplicas && (1 !== e.desiredReplicas ? (e.desiredReplicas--, g()) : a.open({ +e.scalable && (e.desiredReplicas = e.getDesiredReplicas(), 0 !== e.desiredReplicas && (1 !== e.desiredReplicas ? (e.desiredReplicas--, f()) : a.open({ animation: !0, templateUrl: "views/modals/confirmScale.html", controller: "ConfirmScaleController", @@ -11701,7 +11701,7 @@ return d(e.rc) ? "deployment" : "replication controller"; } } }).result.then(function() { -e.desiredReplicas = e.getDesiredReplicas() - 1, g(), s = !0; +e.desiredReplicas = e.getDesiredReplicas() - 1, f(), s = !0; }))); }, e.getDesiredReplicas = function() { return angular.isDefined(e.desiredReplicas) && null !== e.desiredReplicas ? e.desiredReplicas : e.rc && e.rc.spec && angular.isDefined(e.rc.spec.replicas) ? e.rc.spec.replicas : 1; @@ -11710,7 +11710,7 @@ return !_.get(e.rc, "spec.replicas") && !!(e.deploymentConfig ? t("annotation")( }, function(t) { e.isIdled = !!t; }), e.unIdle = function() { -e.desiredReplicas = t("unidleTargetReplicas")(e.deploymentConfig || e.rc, e.hpa), f().then(function() { +e.desiredReplicas = t("unidleTargetReplicas")(e.deploymentConfig || e.rc, e.hpa), g().then(function() { e.isIdled = !1; }); }; @@ -11908,14 +11908,14 @@ var t = e("isIncompleteBuild"); angular.forEach(o.builds, function(e) { t(e) || o.completeBuilds.push(e); }); -}, f = !1, g = function() { -u && f ? l.ygrids([ { +}, g = !1, f = function() { +u && g ? l.ygrids([ { value: u, class: "build-trends-avg-line" } ]) : l.ygrids.remove(); }; o.toggleAvgLine = function() { -f = !f, g(); +g = !g, f(); }; o.$watch(function() { return p(), o.completeBuilds.length; @@ -11946,15 +11946,15 @@ var n = {}; angular.forEach(i.json, function(e) { n[e.phase] = !0; }), t ? (u = e / t, o.averageDurationText = c(u)) : (u = null, o.averageDurationText = null); -var p = [], f = []; +var p = [], g = []; angular.forEach(s, function(e) { -n[e] ? p.push(e) : f.push(e); -}), i.keys.value = p, i.groups = [ p ], l ? (i.unload = f, i.done = function() { +n[e] ? p.push(e) : g.push(e); +}), i.keys.value = p, i.groups = [ p ], l ? (i.unload = g, i.done = function() { setTimeout(function() { l.flush(); }, d() + 25); -}, l.load(i), g()) : (m.data = angular.extend(i, m.data), a(function() { -l = c3.generate(m), g(); +}, l.load(i), f()) : (m.data = angular.extend(i, m.data), a(function() { +l = c3.generate(m), f(); })); }), o.$on("destroy", function() { l && (l = l.destroy()); @@ -12249,9 +12249,9 @@ _.each(d.serviceInstances, function(n) { var a = "True" === _.get(m(n, "Ready"), "status"); a && (!e || n.metadata.creationTimestamp > e.metadata.creationTimestamp) && (e = n), a || t && !(n.metadata.creationTimestamp > t.metadata.creationTimestamp) || (t = n); }), d.serviceToBind = e || t; -}, f = function() { -d.serviceClasses && d.serviceInstances && (d.serviceInstances = a.filterBindableServiceInstances(d.serviceInstances, d.serviceClasses), d.orderedServiceInstances = a.sortServiceInstances(d.serviceInstances, d.serviceClasses), d.serviceToBind || p()); }, g = function() { +d.serviceClasses && d.serviceInstances && (d.serviceInstances = a.filterBindableServiceInstances(d.serviceInstances, d.serviceClasses), d.orderedServiceInstances = a.sortServiceInstances(d.serviceInstances, d.serviceClasses), d.serviceToBind || p()); +}, f = function() { if (i && s && c && l && u) { var e = [].concat(i).concat(s).concat(c).concat(l).concat(u); d.applications = _.sortBy(e, [ "metadata.name", "kind" ]), d.bindType = d.applications.length ? "application" : "secret-only"; @@ -12267,24 +12267,24 @@ var e = { namespace: _.get(d.target, "metadata.namespace") }; n.list("deploymentconfigs", e).then(function(e) { -i = _.toArray(e.by("metadata.name")), g(); +i = _.toArray(e.by("metadata.name")), f(); }), n.list("replicationcontrollers", e).then(function(e) { -c = _.reject(e.by("metadata.name"), t("hasDeploymentConfig")), g(); +c = _.reject(e.by("metadata.name"), t("hasDeploymentConfig")), f(); }), n.list({ group: "apps", resource: "deployments" }, e).then(function(e) { -s = _.toArray(e.by("metadata.name")), g(); +s = _.toArray(e.by("metadata.name")), f(); }), n.list({ group: "extensions", resource: "replicasets" }, e).then(function(e) { -l = _.reject(e.by("metadata.name"), t("hasDeployment")), g(); +l = _.reject(e.by("metadata.name"), t("hasDeployment")), f(); }), n.list({ group: "apps", resource: "statefulsets" }, e).then(function(e) { -u = _.toArray(e.by("metadata.name")), g(); +u = _.toArray(e.by("metadata.name")), f(); }); }, b = function() { var e = { @@ -12294,7 +12294,7 @@ n.list({ group: "servicecatalog.k8s.io", resource: "instances" }, e).then(function(e) { -d.serviceInstances = e.by("metadata.name"), f(); +d.serviceInstances = e.by("metadata.name"), g(); }); }; d.$onInit = function() { @@ -12314,7 +12314,7 @@ onShow: v group: "servicecatalog.k8s.io", resource: "serviceclasses" }, {}).then(function(e) { -d.serviceClasses = e.by("metadata.name"), "Instance" === d.target.kind && (d.serviceClass = d.serviceClasses[d.target.spec.serviceClassName], d.serviceClassName = d.target.spec.serviceClassName), f(); +d.serviceClasses = e.by("metadata.name"), "Instance" === d.target.kind && (d.serviceClass = d.serviceClasses[d.target.spec.serviceClassName], d.serviceClassName = d.target.spec.serviceClassName), g(); }), "Instance" === d.target.kind ? (d.bindType = "secret-only", d.appToBind = null, d.serviceToBind = d.target, y()) : (d.bindType = "application", d.appToBind = d.target, b()); }, d.$onChanges = function(e) { e.project && !e.project.isFirstChange() && (d.projectDisplayName = t("displayName")(d.project)); @@ -12411,7 +12411,7 @@ i ? ((o = a[i[1]] || {}).title = e.annotations[r], a[i[1]] = o) : (i = r.match(n } return a; } -function f() { +function g() { h.prefillParameters && _.each(h.template.parameters, function(e) { h.prefillParameters[e.name] && (e.value = h.prefillParameters[e.name]); }), h.labels = _.map(h.template.labels, function(e, t) { @@ -12424,9 +12424,9 @@ name: "app", value: h.template.metadata.name }); } -var g, h = this, v = e("displayName"), y = e("humanize"); +var f, h = this, v = e("displayName"), y = e("humanize"); h.$onInit = function() { -h.labels = [], h.template = angular.copy(h.template), h.templateDisplayName = v(h.template), h.selectedProject = h.project, f(); +h.labels = [], h.template = angular.copy(h.template), h.templateDisplayName = v(h.template), h.selectedProject = h.project, g(); }; var b, C = function() { var e = { @@ -12436,7 +12436,7 @@ failure: "Failed to create " + h.templateDisplayName + " in project " + v(h.sele }, a = p(h.template); d.clear(), d.add(e, a, h.selectedProject.metadata.name, function() { var e = t.defer(); -return r.batch(b, g).then(function(t) { +return r.batch(b, f).then(function(t) { var n = [], a = !1; t.failure.length > 0 ? (a = !0, t.failure.forEach(function(e) { n.push({ @@ -12497,10 +12497,10 @@ return c.create(n, a, r); }; h.createFromTemplate = function() { h.disableInputs = !0, P().then(function(e) { -h.selectedProject = e, g = { +h.selectedProject = e, f = { namespace: h.selectedProject.metadata.name -}, h.template.labels = m.mapEntries(m.compactEntries(h.labels)), r.create("processedtemplates", null, h.template, g).then(function(e) { -s.setTemplateData(e.parameters, h.template.parameters, e.message), b = e.objects, l.getLatestQuotaAlerts(b, g).then(j); +}, h.template.labels = m.mapEntries(m.compactEntries(h.labels)), r.create("processedtemplates", null, h.template, f).then(function(e) { +s.setTemplateData(e.parameters, h.template.parameters, e.message), b = e.objects, l.getLatestQuotaAlerts(b, f).then(j); }, function(e) { h.disableInputs = !1; var t; @@ -12833,11 +12833,11 @@ e && (r = Date.now(), a.getPodMetrics(e).then(d, m)); o.updateInView = function(e) { i = !e, e && (!r || Date.now() > r + n.getDefaultUpdateInterval()) && p(); }; -var f; +var g; o.$onInit = function() { -f = e(p, n.getDefaultUpdateInterval(), !1), p(); +g = e(p, n.getDefaultUpdateInterval(), !1), p(); }, o.$onDestroy = function() { -f && (e.cancel(f), f = null); +g && (e.cancel(g), g = null); }; } ], controllerAs: "metricsSummary", @@ -12857,7 +12857,7 @@ var m = _.throttle(function() { e.$evalAsync(function() { c.lines = _.clone(d); }); -}, 200), p = 0, f = function(e) { +}, 200), p = 0, g = function(e) { if (e) { var t = ansi_up.escape_for_html(e), n = ansi_up.ansi_to_html(t), a = r.linkify(n, "_blank", !0); p++, d.push({ @@ -12865,21 +12865,21 @@ markup: a, id: p }), d.length > u && (d = _.takeRight(d, u)), m(); } -}, g = function() { +}, f = function() { s && (s.stop(), s = null); }, h = function() { var e = { follow: !0, tailLines: u }; -(s = a.createStream(i, o, c.context, e)).start(), s.onMessage(f), s.onClose(function() { +(s = a.createStream(i, o, c.context, e)).start(), s.onMessage(g), s.onClose(function() { s = null; }); }; c.$onInit = function() { "ReplicationController" === c.apiObject.kind ? (i = "deploymentconfigs/log", o = l(c.apiObject, "deploymentConfig")) : (i = n.kindToResource(c.apiObject.kind) + "/log", o = c.apiObject.metadata.name), h(); }, c.$onDestroy = function() { -g(); +f(); }; } ], bindings: { @@ -12941,15 +12941,15 @@ angular.module("openshiftConsole").component("overviewListRow", { controller: [ "$filter", "$uibModal", "APIService", "BuildsService", "CatalogService", "DeploymentsService", "ListRowUtils", "Navigate", "NotificationsService", function(e, t, n, a, r, o, i, s, c) { var l = this; _.extend(l, i.ui); -var u = e("canI"), d = e("deploymentIsInProgress"), m = e("isBinaryBuild"), p = e("enableTechPreviewFeature"), f = function(e) { +var u = e("canI"), d = e("deploymentIsInProgress"), m = e("isBinaryBuild"), p = e("enableTechPreviewFeature"), g = function(e) { var t = _.get(e, "spec.triggers"); _.isEmpty(t) || (l.imageChangeTriggers = _.filter(t, function(e) { return "ImageChange" === e.type && _.get(e, "imageChangeParams.automatic"); })); -}, g = function(e) { +}, f = function(e) { e && !l.current && "DeploymentConfig" !== e.kind && "Deployment" !== e.kind && (l.current = e); }, h = function(e) { -l.rgv = n.objectToResourceGroupVersion(e), g(e), f(e); +l.rgv = n.objectToResourceGroupVersion(e), f(e), g(e); }; l.$onChanges = function(e) { e.apiObject && h(e.apiObject.currentValue); @@ -13299,7 +13299,7 @@ selectedProject: n.project name: "app", value: "" } ]; -var f = e("orderByDisplayName"), g = e("getErrorDetails"), h = {}, v = function() { +var g = e("orderByDisplayName"), f = e("getErrorDetails"), h = {}, v = function() { c.hideNotification("deploy-image-list-config-maps-error"), c.hideNotification("deploy-image-list-secrets-error"), _.each(h, function(e) { !e.id || "error" !== e.type && "warning" !== e.type || c.hideNotification(e.id); }); @@ -13361,26 +13361,26 @@ namespace: n.input.selectedProject.metadata.name }, null, { errorNotification: !1 }).then(function(r) { -t = f(r.by("metadata.name")), n.valueFromNamespace[e.metadata.name] = t.concat(a); +t = g(r.by("metadata.name")), n.valueFromNamespace[e.metadata.name] = t.concat(a); }, function(e) { 403 !== e.code && c.addNotification({ id: "deploy-image-list-config-maps-error", type: "error", message: "Could not load config maps.", -details: g(e) +details: f(e) }); }), o.list("secrets", { namespace: n.input.selectedProject.metadata.name }, null, { errorNotification: !1 }).then(function(r) { -a = f(r.by("metadata.name")), n.valueFromNamespace[e.metadata.name] = a.concat(t); +a = g(r.by("metadata.name")), n.valueFromNamespace[e.metadata.name] = a.concat(t); }, function(e) { 403 !== e.code && c.addNotification({ id: "deploy-image-list-secrets-error", type: "error", message: "Could not load secrets.", -details: g(e) +details: f(e) }); }); } @@ -13461,7 +13461,7 @@ c.addNotification({ id: "deploy-image-create-project-error", type: "error", message: "An error occurred creating project", -details: g(e) +details: f(e) }), n.disableInputs = !1; }); }, n.$on("newAppFromDeployImage", n.create), n.$on("$destroy", v); @@ -13759,7 +13759,7 @@ bottom: n.offsetBottom } ]), function() { angular.module("openshiftConsole").component("editEnvironmentVariables", { controller: [ "$filter", "APIService", "DataService", "EnvironmentService", "NotificationsService", function(e, t, n, a, r) { -var o, i, s, c, l = this, u = !1, d = [], m = [], p = !1, f = e("canI"), g = e("getErrorDetails"), h = e("humanizeKind"), v = e("orderByDisplayName"), y = function(e, t) { +var o, i, s, c, l = this, u = !1, d = [], m = [], p = !1, g = e("canI"), f = e("getErrorDetails"), h = e("humanizeKind"), v = e("orderByDisplayName"), y = function(e, t) { u || (l.form && !l.form.$pristine && l.updatedObject ? a.isEnvironmentEqual(e, t) ? l.updatedObject = a.mergeEdits(e, t) : (u = !0, r.addNotification({ type: "warning", message: "The environment variables for the " + o + " have been updated in the background.", @@ -13772,7 +13772,7 @@ namespace: l.apiObject.metadata.namespace d = v(e.by("metadata.name")), l.valueFromObjects = d.concat(m); }); }, C = function() { -f("secrets", "list") && n.list("secrets", { +g("secrets", "list") && n.list("secrets", { namespace: l.apiObject.metadata.namespace }).then(function(e) { m = v(e.by("metadata.name")), l.valueFromObjects = d.concat(m); @@ -13780,7 +13780,7 @@ m = v(e.by("metadata.name")), l.valueFromObjects = d.concat(m); }, S = function() { p || (p = !0, b(), C()); }, _ = function(e, n) { -o = h(e.kind), i = e.metadata.name, s = t.objectToResourceGroupVersion(e), l.canIUpdate = f(s, "update"), c ? c.finally(function() { +o = h(e.kind), i = e.metadata.name, s = t.objectToResourceGroupVersion(e), l.canIUpdate = g(s, "update"), c ? c.finally(function() { y(e, n); }) : y(e, n), l.containers = a.getContainers(l.updatedObject), l.disableValueFrom || l.ngReadonly || !l.canIUpdate || S(); }; @@ -13800,7 +13800,7 @@ r.addNotification({ id: e, type: "error", message: "An error occurred updating environment variables for " + o + " " + i + ".", -details: g(t) +details: f(t) }); }).finally(function() { c = null; @@ -13862,13 +13862,13 @@ n.$emit("NotificationDrawerWrapper.toggle"); }; var p = function(e, t) { r.showUnreadNotificationsIndicator = !!t; -}, f = function(e, t) { +}, g = function(e, t) { return _.get(e, "params.project") !== _.get(t, "params.project"); -}, g = function() { +}, f = function() { l(t.project, p), m(t.project); }, h = function() { -g(), s.push(n.$on("$routeChangeSuccess", function(e, t, n) { -f(t, n) && g(); +f(), s.push(n.$on("$routeChangeSuccess", function(e, t, n) { +g(t, n) && f(); })), s.push(n.$on("NotificationDrawerWrapper.onMarkAllRead", function() { r.showUnreadNotificationsIndicator = !1; })); @@ -13884,73 +13884,87 @@ u(), d(); angular.module("openshiftConsole").component("notificationDrawerWrapper", { templateUrl: "views/directives/notifications/notification-drawer-wrapper.html", controller: [ "$filter", "$interval", "$location", "$timeout", "$routeParams", "$rootScope", "Constants", "DataService", "NotificationsService", "EventsService", function(e, t, n, a, r, o, i, s, c, l) { -var u, d, m = _.get(i, "DISABLE_GLOBAL_EVENT_WATCH"), p = e("isIE")() || e("isEdge")(), f = this, g = [], h = {}, v = {}, y = [], b = {}, C = function(e) { +var u, d, m = _.get(i, "DISABLE_GLOBAL_EVENT_WATCH"), p = e("isIE")() || e("isEdge")(), g = this, f = [], h = {}, v = {}, y = { +success: "Normal", +error: "Warning" +}, b = { +Normal: "pficon pficon-info", +Warning: "pficon pficon-warning-triangle-o" +}, C = {}, S = function(e) { return s.get("projects", e, {}, { errorNotification: !1 }).then(function(e) { -return b[e.metadata.name] = e, e; +return C[e.metadata.name] = e, e; }); -}, S = function(t, n) { -n && !t[n] && (t[n] = { -heading: e("displayName")(b[n]) || n, -project: b[n], -notifications: [] +}, w = function(t, n) { +return { +heading: e("displayName")(C[t]) || t, +project: C[t], +notifications: n +}; +}, k = function(e) { +return _.reduce(e, function(e, t) { +return l.isImportantEvent(t) && !l.isCleared(t) && (e[t.metadata.uid] = { +actions: null, +uid: t.metadata.uid, +unread: !l.isRead(t), +event: t +}), e; +}, {}); +}, j = function(e, t) { +var n = r.project; +return _.orderBy(_.assign({}, e[n], t[n]), [ "event.lastTimestamp", "event.firstTimestamp" ], [ "desc", "desc" ]); +}, P = function() { +o.$evalAsync(function() { +g.notificationGroups = [ w(r.project, j(h, v)) ], B(); }); -}, w = function() { +}, R = function(e) { +h[r.project] = k(e.by("metadata.name")), P(); +}, E = function(e, t) { +var n = _.uniqueId("notification-"), a = t.namespace || r.project; +v[a] = v[a] || {}, v[a][n] = { +actions: null, +unread: !0, +uid: n, +event: { +lastTimestamp: t.lastTimestamp || moment.parseZone(new Date()).utc().format(), +message: t.message, +namespace: a, +type: y[t.type] || "Normal" +} +}, P(); +}, T = function() { +S(r.project).then(function() { +D(r.project, R), $(r.project, E), U(r.project), P(); +}); +}, I = function() { d && s.unwatch(d); -}, k = function(e, t) { -w(), e && (d = s.watch("events", { +}, N = function() { +u && u(), u = null; +}, D = function(e, t) { +I(), e && (d = s.watch("events", { namespace: e }, _.debounce(t, 400), { skipDigest: !0 })); -}, j = function() { -u && u(), u = null; -}, P = function(e) { +}, $ = function(e, t) { +N(), e && (u = o.$on("NotificationsService.onNotificationAdded", t)); +}, A = function(e) { return _.filter(e, "unread"); -}, R = function(e) { -o.$applyAsync(function() { -e.totalUnread = P(e.notifications).length, e.hasUnread = !!e.totalUnread, o.$emit("NotificationDrawerWrapper.count", e.totalUnread); -}); -}, E = function() { -_.each(y, R); -}, T = function(e) { -return _.orderBy(e, [ "event.lastTimestamp", "event.firstTimestamp" ], [ "desc", "desc" ]); -}, I = function(e) { -var t = _.sortBy(e, function(e) { -return e.heading; +}, B = function() { +_.each(g.notificationGroups, function(e) { +e.totalUnread = A(e.notifications).length, e.hasUnread = !!e.totalUnread, o.$emit("NotificationDrawerWrapper.count", e.totalUnread); }); -return _.each(t, function(e) { -e.notifications = T(e.notifications), e.counts = R(e); -}), t; -}, N = function(e) { -var t = {}; -return S(t, r.project), _.each(e, function(e) { -l.isImportantEvent(e) && !l.isCleared(e) && (S(t, e.metadata.namespace), t[e.metadata.namespace].notifications.push({ -unread: !l.isRead(e), -event: e, -actions: null -})); -}), t; -}, D = function() { -_.each(g, function(e) { +}, L = function() { +_.each(f, function(e) { e(); -}), g = []; -}, $ = function(e) { -e || (f.drawerHidden = !0); -}, A = function() { -o.$evalAsync(function() { -E(), f.notificationGroups = _.filter(y, function(e) { -return e.project.metadata.name === r.project; -}); -}); -}, B = function(e) { -h = e.by("metadata.name"), v = N(h), y = I(v), A(); -}, L = { -Normal: "pficon pficon-info", -Warning: "pficon pficon-warning-triangle-o" +}), f = []; +}, U = function(e) { +e || (g.drawerHidden = !0); +}, O = function(e, t) { +return _.get(e, "params.project") !== _.get(t, "params.project"); }; -angular.extend(f, { +angular.extend(g, { drawerHidden: !0, allowExpand: !0, drawerExpanded: !1, @@ -13959,56 +13973,50 @@ hasUnread: !1, showClearAll: !0, showMarkAllRead: !0, onClose: function() { -f.drawerHidden = !0; +g.drawerHidden = !0; }, onMarkAllRead: function(e) { _.each(e.notifications, function(e) { e.unread = !1, l.markRead(e.event); -}), A(), o.$emit("NotificationDrawerWrapper.onMarkAllRead"); +}), P(), o.$emit("NotificationDrawerWrapper.onMarkAllRead"); }, onClearAll: function(e) { _.each(e.notifications, function(e) { l.markRead(e.event), l.markCleared(e.event); -}), e.notifications = [], A(), o.$emit("NotificationDrawerWrapper.onMarkAllRead"); +}), e.notifications = [], P(), o.$emit("NotificationDrawerWrapper.onMarkAllRead"); }, -notificationGroups: y, +notificationGroups: [], headingInclude: "views/directives/notifications/header.html", notificationBodyInclude: "views/directives/notifications/notification-body.html", customScope: { clear: function(e, t, n) { -l.markCleared(e.event), n.notifications.splice(t, 1), E(); +l.markCleared(e.event), n.notifications.splice(t, 1), B(); }, markRead: function(e) { -e.unread = !1, l.markRead(e.event), E(); +e.unread = !1, l.markRead(e.event), B(); }, getNotficationStatusIconClass: function(e) { -return L[e.type] || L.info; +return b[e.type] || b.info; }, getStatusForCount: function(e) { -return L[e] || L.info; +return b[e] || b.info; }, close: function() { -f.drawerHidden = !0; +g.drawerHidden = !0; } } }); -var U = function(e, t) { -return _.get(e, "params.project") !== _.get(t, "params.project"); -}, O = function() { -C(r.project).then(function() { -k(r.project, B), $(r.project), A(); -}); -}, F = function() { -r.project && O(), g.push(o.$on("$routeChangeSuccess", function(e, t, n) { -U(t, n) && (f.customScope.projectName = r.project, O()); -})), g.push(o.$on("NotificationDrawerWrapper.toggle", function() { -f.drawerHidden = !f.drawerHidden; +var F = function() { +r.project && T(), f.push(o.$on("$routeChangeSuccess", function(e, t, n) { +O(t, n) && (g.customScope.projectName = r.project, T()); +})), f.push(o.$on("NotificationDrawerWrapper.toggle", function() { +g.drawerHidden = !g.drawerHidden; })); }; -f.$onInit = function() { +g.$onInit = function() { m || p || F(); -}, f.$onDestroy = function() { -j(), w(), D(); +}, g.$onDestroy = function() { +N(), I(), L(); }; } ] }); diff --git a/dist/scripts/templates.js b/dist/scripts/templates.js index c5f3cf8b26..4b73717dc7 100644 --- a/dist/scripts/templates.js +++ b/dist/scripts/templates.js @@ -7495,17 +7495,20 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( "\n" + "{{notification.event.type}}\n" + "