Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UI with new cluster replacement feature #1226

Merged
merged 5 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deploy-board/deploy_board/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
TELETRAAN_TRANSFER_OWNERSHIP_URL = os.getenv("TELETRAAN_TRANSFER_OWNERSHIP_URL", None)
TELETRAAN_RESOURCE_OWNERSHIP_WIKI_URL = os.getenv("TELETRAAN_RESOURCE_OWNERSHIP_WIKI_URL", None)
TELETRAAN_PROJECT_URL_FORMAT = os.getenv("TELETRAAN_PROJECT_URL_FORMAT", None)
RODIMUS_CLUSTER_REPLACEMENT_WIKI_URL = os.getenv("RODIMUS_CLUSTER_REPLACEMENT_WIKI_URL", None)

# use Rodimus if present
RODIMUS_SERVICE_URL = os.getenv("RODIMUS_SERVICE_URL", None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,74 +75,6 @@ Vue.component('clone-cluster', {
}
});


/**
* Cluster Replace buttons. Depending on the cluster state, it can show different buttons:
* Cluster State:
* Normal: Replace button
* Replace: Cancel Button and Pause Button
* Pause: Pause Button and Resume Button
*/
Vue.component('replace-cluster', {
template: '<div>\
<side-button-modal-confirm v-show="showreplace" confirmDiaglog="#replaceClusterDialogId" \
text="Replace Cluster" title="Click to replace cluster with new launch configuration" styleclass="glyphicon glyphicon-random">\
</side-button-modal-confirm>\
<modal title="Replace Cluster Confirm" id="replaceClusterDialogId" v-on:input="replaceClickDialog">\
<div slot="body">\
Are you sure to <strong>REPLACE</strong> every host in this cluster?\
</div>\
</modal>\
<side-button-modal-confirm v-show="showpause" confirmDiaglog="#pauseClusterDialogId" \
text="Pause Replacement" title="Click to pause ongoing cluster replacement" styleclass="glyphicon glyphicon-pause">\
</side-button-modal-confirm>\
<modal title="Pause Ongoing Cluster Replacement Confirm" id="pauseClusterDialogId" v-on:input="pauseClickDialog">\
<div slot="body">\
Are you sure to pause cluster replacement?\
</div>\
</modal>\
<side-button-modal-confirm v-show="showcancel" confirmDiaglog="#cancelClusterDialogId" \
text="Cancel Replacement" title="Click to cancel ongoing cluster replacement" styleclass="glyphicon glyphicon-step-backward">\
</side-button-modal-confirm>\
<modal title="Cancel Ongoing Cluster Replacement Confirm" id="cancelClusterDialogId" v-on:input="cancelClickDialog">\
<div slot="body">\
Are you sure to cancel ongoing cluster replacement?\
</div>\
</modal>\
<side-button-modal-confirm v-show="showresume" confirmDiaglog="#resumeClusterDialogId" \
text="Resume Replacement" title="Click to resume ongoing cluster replacement" styleclass="glyphicon glyphicon-play">\
</side-button-modal-confirm>\
<modal title="Resume Ongoing Cluster Replacement Confirm" id="resumeClusterDialogId" v-on:input="resumeClickDialog">\
<div slot="body">\
Are you sure to resume cluster replacement?\
</div>\
</modal>\
</div>',
props: ['clusterstate'],
data: function () {
return {
showreplace: this.clusterstate === "NORMAL",
showcancel: this.clusterstate === "REPLACE" || this.clusterstate === "PAUSE",
showpause: this.clusterstate === "REPLACE",
showresume: this.clusterstate === "PAUSE",
}
},
methods: {
replaceClickDialog: function (value) {
this.$emit('input', { action: 'replace', value });
},
pauseClickDialog: function (value) {
this.$emit('input', { action: 'pause', value });
},
cancelClickDialog: function (value) {
this.$emit('input', { action: 'cancel', value });
},
resumeClickDialog: function (value) {
this.$emit('input', { action: 'resume', value });
},
}
});

/**
* This component represents the heading of the cluster capacity panel where replace buttons are shown
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{% extends 'environs/env_base.html' %}

{% load utils %}

{% block breadcrumb-items %}
<ul class="breadcrumb">
<li><a href="/">Home</a></li>
<li><a href="/envs">Environments</a></li>
<li><a href="/env/{{ env.envName }}/{{ env.stageName }}">{{ env.envName }} ({{ env.stageName }})</a></li>
<li class="active">Cluster Replacement Details</li>
</ul>
{% endblock %}

{% block new-builds-panel %}
{% endblock %}
{% block new-pred-deploys-panel %}
{% endblock %}

{% block main %}

<div id="replacementDetails" v-show="show" class="panel panel-default">
<div class="panel-heading clearfix">
<h4 class="panel-title pull-left">Replacement Detail</h4>
</div>
<div id="replacementDetails" class="collapse in panel-body">
<div class="container-fluid" style="height:500px;overflow:auto;">
<table id="replacementDetails" class="table table-condensed table-striped table-hover">
<tr>
<th>ID</th>
<td>
{{ replace_summary.id }}
</td>
</tr>
<tr>
<th>Start Time</th>
<td>
{{ replace_summary.startTime|convertTimestamp }}
</td>
</tr>
<tr>
<th>End Time</th>
<td>
{{ replace_summary.endTime|convertTimestamp }}
</td>
</tr>
<tr>
<th>Completion Percentage</th>
<td>
{{ replace_summary.percentageComplete }}%
</td>
</tr>
<tr>
<th>Instances to Update</th>
<td>
{{ replace_summary.instancesToUpdate }}
</td>
</tr>
<tr>
<th>Status</th>
<td>
<span class="replaceToolTip pointer-cursor {{ replace_summary.status|replaceStatusIcon }}">
</span>
<small>{{ replace_summary.status }}</small>
</td>
</tr>
<tr>
<th>Reason</th>
<td>
{% if replace_summary.statusReason %}
{{ replace_summary.statusReason }}
{% endif %}
</td>
</tr>
<tr>
<th>Min Healthy Percentage</th>
<td>
{{ replace_summary.rollingUpdateConfig.minHealthyPercentage }}%
</td>
</tr>
<tr>
<th>Skip Matching</th>
<td>
{{ replace_summary.rollingUpdateConfig.skipMatching }}
</td>
</tr>
<tr>
<th>Replace Protected Instances</th>
<td>
{{ replace_summary.rollingUpdateConfig.scaleInProtectedInstances }}
</td>
</tr>
<tr>
<th>Checkpoint Percentages</th>
<td>
{{ replace_summary.rollingUpdateConfig.checkpointPercentages }}
</td>
</tr>
<tr>
<th>Checkpoint Delay</th>
<td>
{{ replace_summary.rollingUpdateConfig.checkpointDelay }} second(s)
</td>
</tr>
<tr>
<th>Desired Launch Template Name</th>
<td>
{{ replace_summary.desiredClusterConfig.launchTemplateName }}
</td>
</tr>
<tr>
<th>Desired Launch Template ID</th>
<td>
{{ replace_summary.desiredClusterConfig.launchTemplateId }}
</td>
</tr>
<tr>
<th>Desired Launch Template Version</th>
<td>
{{ replace_summary.desiredClusterConfig.version }}
</td>
</tr>
</table>
</div>
</div>
</div>

{% endblock %}
Loading
Loading