mirror of https://github.com/rancher/ui.git
Upgrade loadbalancer image
This commit is contained in:
parent
204bfd1a6f
commit
7eb2bb45f4
|
|
@ -55,7 +55,7 @@
|
|||
<tr>
|
||||
<td data-title="{{t 'auditLogsPage.table.time'}}:">{{date-from-now log.created}}</td>
|
||||
<td data-title="{{t 'auditLogsPage.table.eventType'}}:" class="force-wrap" title="{{log.eventType}}">
|
||||
{{log.eventType}} <i class="icon icon-info addtl-info-trigger" {{action 'showResponseObjects' log.requestObject log.responseObject }}></i>
|
||||
{{log.eventType}} <i class="icon icon-info service-icon-button" {{action 'showResponseObjects' log.requestObject log.responseObject }}></i>
|
||||
</td>
|
||||
<td data-title="{{t 'auditLogsPage.table.description'}}:">{{#if log.description}}{{log.description}}{{else}}<span class="text-muted">None</span>{{/if}}</td>
|
||||
<td data-title="{{t 'auditLogsPage.table.environment'}}:" class="clip">
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ export default Ember.Component.extend(NewOrEdit, {
|
|||
allHosts : null,
|
||||
allServices : null,
|
||||
allCertificates : null,
|
||||
upgradeImage : null,
|
||||
|
||||
isGlobal : null,
|
||||
isRequestedHost : null,
|
||||
|
|
@ -212,6 +213,10 @@ export default Ember.Component.extend(NewOrEdit, {
|
|||
return false;
|
||||
}
|
||||
|
||||
if ( this.get('upgradeImage')+'' === 'true' ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Label arrays are updated one at a time and make this flap,
|
||||
// so ignore them until they're all set
|
||||
if ( !this.get('labelsReady') ) {
|
||||
|
|
@ -222,9 +227,23 @@ export default Ember.Component.extend(NewOrEdit, {
|
|||
let neu = removeKeys(this.get('service.launchConfig.labels'),C.LABELS_TO_IGNORE);
|
||||
return arrayToStr(old) !== arrayToStr(neu);
|
||||
}.property(
|
||||
'editing',
|
||||
'upgradeImage',
|
||||
'service.launchConfig.labels'
|
||||
),
|
||||
|
||||
upgradeInfo: function() {
|
||||
let from = (this.get('existing.launchConfig.imageUuid')||'').replace(/^docker:/,'');
|
||||
let to = (this.get('service.launchConfig.imageUuid')||'').replace(/^docker:/,'');
|
||||
|
||||
if ( this.get('upgradeImage')+'' === 'true' ) {
|
||||
return Ember.Object.create({
|
||||
from: from,
|
||||
to: to,
|
||||
});
|
||||
}
|
||||
}.property('existing.launchConfig.imageUuid','service.launchConfig.imageUuid'),
|
||||
|
||||
// ----------------------------------
|
||||
// Labels
|
||||
// ----------------------------------
|
||||
|
|
|
|||
|
|
@ -92,5 +92,16 @@
|
|||
</div>
|
||||
{{/select-tab}}
|
||||
|
||||
{{#if upgradeInfo}}
|
||||
<div class="lacsso banner bg-info m-20 p-0">
|
||||
<div class="lacsso banner-icon" style="width: 68px;"><span class="icon icon-2x icon-info"></span></div>
|
||||
<div class="lacsso banner-info">
|
||||
<p class="lacsso p-15 ">
|
||||
{{format-html-message 'servicePage.newBalancer.upgradeImage' from=upgradeInfo.from to=upgradeInfo.to}}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{top-errors errors=errors}}
|
||||
{{save-cancel editing=editing editLabel=editLabel save="save" cancel="cancel"}}
|
||||
|
|
|
|||
|
|
@ -40,9 +40,13 @@ export default Ember.Component.extend({
|
|||
this.get('prefs').set(C.PREFS.EXPANDED_STACKS, list);
|
||||
},
|
||||
|
||||
addtlInfo: function(service) {
|
||||
addtlInfo(service) {
|
||||
this.sendAction('showAddtlInfo', service);
|
||||
},
|
||||
|
||||
upgradeImage(service) {
|
||||
service.send('upgrade','true');
|
||||
}
|
||||
},
|
||||
|
||||
init() {
|
||||
|
|
|
|||
|
|
@ -96,12 +96,19 @@
|
|||
{{#if service.showTransitioningMessage}}
|
||||
<span class="{{service.stateColor}}">({{service.transitioningMessage}})</span>
|
||||
{{/if}}
|
||||
<button type="button" class="btn-link" role="button" {{action 'addtlInfo' service}}>
|
||||
<i class="icon icon-info addtl-info-trigger"/>
|
||||
<button type="button" class="btn-link service-icon-button" role="button" {{action 'addtlInfo' service}}>
|
||||
<i class="icon icon-info"/>
|
||||
</button>
|
||||
{{#if service.isError}}
|
||||
{{#link-to "service.log" service.stackId service.id class="btn-link"}}<i class="icon icon-alert"/>{{/link-to}}
|
||||
{{/if}}
|
||||
{{~#if service.imageUpgradeAvailable~}}
|
||||
{{#tooltip-element type="tooltip-basic" model=(t 'stackSection.upgradeImage') tooltipTemplate="tooltip-static" aria-describedby="tooltip-base" tooltipFor="upgradeImage"}}
|
||||
<button type="button" class="btn-link text-warning service-icon-button r-pl0" role="button" {{action 'upgradeImage' service}}>
|
||||
<i class="icon icon-arrow-circle-up"/>
|
||||
</button>
|
||||
{{/tooltip-element}}
|
||||
{{~/if~}}
|
||||
{{~#if service.isError~}}
|
||||
{{#link-to "service.log" service.stackId service.id class="btn-link service-icon-button"}}<i class="icon icon-alert"/>{{/link-to}}
|
||||
{{~/if~}}
|
||||
</td>
|
||||
<td data-title="{{t 'stackSection.table.dataTitle.details'}}:" class="force-wrap service-detail">{{service.displayDetail}}{{service.displayPorts}}</td>
|
||||
<td data-title="{{t 'stackSection.table.dataTitle.kind'}}:">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,31 @@
|
|||
import Ember from 'ember';
|
||||
import C from 'ui/utils/constants';
|
||||
|
||||
export default Ember.Route.extend({
|
||||
k8s: Ember.inject.service(),
|
||||
|
||||
model() {
|
||||
return this.get('k8s').getServices().then((services) => {
|
||||
let svc = services.find(function(x) {
|
||||
return x && x.metadata && x.metadata.labels && x.metadata.labels[C.LABEL.K8S_DASHBOARD];
|
||||
});
|
||||
|
||||
if ( svc )
|
||||
{
|
||||
let port = svc.spec.ports[0];
|
||||
let dashboard;
|
||||
if ( port ) {
|
||||
dashboard = 'http://' + this.get('k8s.clusterIp') +'/'+ port.nodePort;
|
||||
}
|
||||
|
||||
return Ember.Object.create({
|
||||
dashboardUrl: dashboard,
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
return Ember.RSVP.reject('Unable to find kubernetes-dashbaord service');
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<section class="header">
|
||||
<h1>{{t 'k8sTab.dashboard.header'}}</h1>
|
||||
</section>
|
||||
|
||||
<div class="row r-mt20 r-ml20 r-mr20">
|
||||
<div class="text-center col-md-6 col-md-offset-3 gutter">
|
||||
<div class="well">
|
||||
<div class="row">
|
||||
<img height="55" src="{{app.baseAssets}}assets/images/hexagon-kubernetes.svg" />
|
||||
</div>
|
||||
<h4>{{t 'k8sTab.dashboard.dashboard.header'}}</h4>
|
||||
<p>{{t 'k8sTab.dashboard.dashboard.content'}}</p>
|
||||
{{#if model.dashboardUrl}}
|
||||
<a href="{{model.dashboardUrl}}" target="_blank" rel="noreferrer nofollow" class="btn btn-primary">{{t 'k8sTab.dashboard.dashboard.button'}}</a>
|
||||
{{else}}
|
||||
<button class="btn btn-primary btn-disabled">{{t 'k8sTab.dashboard.dashboard.button'}}</button>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -18,7 +18,9 @@ function specToPort(spec) {
|
|||
|
||||
var LoadBalancerService = Service.extend({
|
||||
type: 'loadBalancerService',
|
||||
intl : Ember.inject.service(),
|
||||
|
||||
intl: Ember.inject.service(),
|
||||
settings: Ember.inject.service(),
|
||||
|
||||
initPorts() {
|
||||
let rules = this.get('lbConfig.portRules')||[];
|
||||
|
|
@ -122,6 +124,12 @@ var LoadBalancerService = Service.extend({
|
|||
|
||||
return out.htmlSafe();
|
||||
}.property('consumedServicesWithNames.@each.{name,service}', 'intl._locale'),
|
||||
|
||||
imageUpgradeAvailable: function() {
|
||||
let cur = this.get('launchConfig.imageUuid').replace(/^docker:/,'');
|
||||
let available = this.get(`settings.${C.SETTING.BALANCER_IMAGE}`);
|
||||
return cur !== available && !!this.get('actionLinks.upgrade');
|
||||
}.property('launchConfig.imageUuid',`settings.${C.SETTING.BALANCER_IMAGE}`,'actionLinks.upgrade'),
|
||||
});
|
||||
|
||||
export default LoadBalancerService;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ var Service = Resource.extend({
|
|||
}
|
||||
},
|
||||
|
||||
upgrade() {
|
||||
upgrade(upgradeImage='false') {
|
||||
var route = 'service.new';
|
||||
if ( (this.get('launchConfig.kind')||'').toLowerCase() === 'virtualmachine') {
|
||||
route = 'service.new-virtualmachine';
|
||||
|
|
@ -90,6 +90,7 @@ var Service = Resource.extend({
|
|||
this.get('application').transitionToRoute(route, {queryParams: {
|
||||
serviceId: this.get('id'),
|
||||
upgrade: true,
|
||||
upgradeImage: upgradeImage,
|
||||
stackId: this.get('stackId'),
|
||||
}});
|
||||
},
|
||||
|
|
@ -386,8 +387,6 @@ var Service = Resource.extend({
|
|||
return Util.formatSi(this.get('launchConfig.memoryReservation'), 1024, 'iB', 'B');
|
||||
}
|
||||
}),
|
||||
|
||||
|
||||
});
|
||||
|
||||
export function activeIcon(service)
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ export default Resource.extend({
|
|||
}
|
||||
|
||||
if ( str === C.LABEL.CERTIFIED_RANCHER && this.get('catalogId') === C.CATALOG.LIBRARY_KEY ) {
|
||||
return 'badge-certified';
|
||||
return 'badge-rancher';
|
||||
} else if ( str === C.LABEL.CERTIFIED_PARTNER ) {
|
||||
return 'badge-partner';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
queryParams: ['stackId','serviceId','tab','upgrade'],
|
||||
queryParams: ['stackId','serviceId','tab','upgrade','upgradeImage'],
|
||||
stackId: null,
|
||||
serviceId: null,
|
||||
tab: 'ssl',
|
||||
upgrade: null,
|
||||
upgradeImage: 'false',
|
||||
|
||||
actions: {
|
||||
done() {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,11 @@ export default Ember.Route.extend({
|
|||
if ( hash.existingService ) {
|
||||
if ( params.upgrade+'' === 'true' ) {
|
||||
service = hash.existingService.clone();
|
||||
|
||||
if ( params.upgradeImage+'' === 'true' ) {
|
||||
service.set('launchConfig.imageUuid', 'docker:' + this.get(`settings.${C.SETTING.BALANCER_IMAGE}`));
|
||||
}
|
||||
|
||||
hash.existing = hash.existingService;
|
||||
} else {
|
||||
service = hash.existingService.cloneForNew();
|
||||
|
|
@ -74,6 +79,7 @@ export default Ember.Route.extend({
|
|||
controller.set('stackId', null);
|
||||
controller.set('serviceId', null);
|
||||
controller.set('upgrade', null);
|
||||
controller.set('upgradeImage', null);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
service=model.service
|
||||
existing=model.existing
|
||||
editing=upgrade
|
||||
upgradeImage=upgradeImage
|
||||
allHosts=model.allHosts
|
||||
allServices=model.allServices
|
||||
allCertificates=model.allCertificates
|
||||
|
|
|
|||
|
|
@ -172,8 +172,9 @@ $lines-to-show: 4;
|
|||
@extend .badge-rancher;
|
||||
background-color: $greenTwo;
|
||||
|
||||
&:after {
|
||||
&:before {
|
||||
border-color: $greenTwo;
|
||||
border-left-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -181,8 +182,9 @@ $lines-to-show: 4;
|
|||
@extend .badge-rancher;
|
||||
background-color: $blueTwo;
|
||||
|
||||
&:after {
|
||||
&:before {
|
||||
border-color: $blueTwo;
|
||||
border-left-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -478,11 +478,10 @@ $light-yellow: #FFBE18;
|
|||
background-image: url('images/hexagon-kubernetes.svg');
|
||||
}
|
||||
|
||||
.addtl-info-trigger {
|
||||
.service-icon-button {
|
||||
cursor: pointer;
|
||||
margin-left: 3px;
|
||||
position: relative;
|
||||
top: 1px;
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
.service-detail {
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ var C = {
|
|||
K8S_POD_NAMESPACE: 'io.kubernetes.pod.namespace',
|
||||
K8S_POD_NAME: 'io.kubernetes.pod.name',
|
||||
K8S_KUBECTL: 'io.rancher.k8s.kubectld',
|
||||
K8S_DASHBOARD: 'io.rancher.k8s.dashboard',
|
||||
K8S_DASHBOARD: 'io.rancher.k8s.kubernetes-dashboard',
|
||||
ORCHESTRATION_SUPPORTED: 'io.rancher.orchestration.supported',
|
||||
CERTIFIED: 'io.rancher.certified',
|
||||
CERTIFIED_RANCHER: 'rancher',
|
||||
|
|
|
|||
|
|
@ -105,6 +105,9 @@ const navTree = [
|
|||
ctx: [getProjectId, getNamespaceId],
|
||||
condition: k8sReady,
|
||||
},
|
||||
{
|
||||
divider: true,
|
||||
},
|
||||
{
|
||||
id: 'k8s-cli',
|
||||
localizedLabel: 'nav.k8s.cli',
|
||||
|
|
@ -113,6 +116,16 @@ const navTree = [
|
|||
ctx: [getProjectId],
|
||||
condition: k8sReady,
|
||||
},
|
||||
/*
|
||||
{
|
||||
id: 'k8s-dashboard',
|
||||
localizedLabel: 'nav.k8s.dashboard',
|
||||
icon: 'icon icon-external-link',
|
||||
route: 'k8s-tab.dashboard',
|
||||
ctx: [getProjectId],
|
||||
condition: k8sReady,
|
||||
},
|
||||
*/
|
||||
{
|
||||
id: 'k8s-notready',
|
||||
icon: 'icon icon-spinner icon-spin',
|
||||
|
|
|
|||
|
|
@ -703,6 +703,13 @@ k8sTab:
|
|||
petset: Pet Set
|
||||
pod: Pod
|
||||
|
||||
dashboard:
|
||||
header: Kubernetes Dashboard
|
||||
dashboard:
|
||||
header: Dashboard
|
||||
content: Kubernetes Dashboard is a general purpose, web-based UI for Kubernetes clusters. It allows users to manage applications running in the cluster and troubleshoot them, as well as manage the cluster itself.
|
||||
button: Kubernetes UI
|
||||
|
||||
kubectl:
|
||||
header: kubectl
|
||||
stepOne:
|
||||
|
|
@ -946,6 +953,7 @@ servicePage:
|
|||
description:
|
||||
placeholder: e.g. Current version of MyApp
|
||||
newBalancer:
|
||||
upgradeImage: "The balancer software image will be upgraded from <code>{from}</code> to <code>{to}</code>."
|
||||
form:
|
||||
name:
|
||||
placeholder: e.g. website
|
||||
|
|
@ -3010,6 +3018,7 @@ stackSection:
|
|||
details: Details
|
||||
containers: Containers
|
||||
actions: Actions
|
||||
upgradeImage: Upgrade Container Image
|
||||
|
||||
|
||||
snapshotSection:
|
||||
|
|
|
|||
Loading…
Reference in New Issue