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

Added UI controls for remove disks endpoint #3

Merged
Merged
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
43 changes: 42 additions & 1 deletion src/components/AdminBroker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
<input class="form-check-input" type="radio" value="demote" v-model='actionName' :disabled='selectedBrokers.length == 0'>
<label class="form-check-label">Demote Brokers</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" value="remove_disks" v-model='actionName' :disabled='selectedBrokers.length != 0'>
<label class="form-check-label">Remove Disks</label>
</div>
<div class="form-check form-check-inline float-right" v-if='actionName'>
<input class="form-check-input" type="checkbox" v-model='showURL'>
<label class="form-check-label">Show URL</label>
Expand Down Expand Up @@ -531,6 +535,29 @@
</form>
</div>

<!-- Demote disk -->
<div class="alert alert-primary" v-if='actionName === "remove_disks"'>
<h5>Remove Disk Flags</h5>
<hr>
<div class="row">
<div class="col-md-4">
<div class="form-inline">
<label class="form-label"> Disks as broker_id-disk_name separated by comma: </label>
<input type="text" class="form-input" v-model='brokerid_and_logdirs' placeholder=''>
</div>
</div>
<div class="col-md-4">
<div class="form-check form-check-inline">
<input class="form-check-input" type="checkbox" v-model='dryrun'>
<label class="form-check-label">DryRun</label>
</div>
</div>
</div>
<div class="text-right">
<button @click='actionBroker' class="btn btn-primary">Remove Disks</button>
</div>
</div>

<!--
<pre><code v-if='actionURL'>{{ actionURL.replace(/\&/g, "\n\t") }}</code></pre>
-->
Expand Down Expand Up @@ -615,7 +642,8 @@ export default {
posted: false, // true if a POST method is made
posturl: null, // POST url
postResponse: '', // POST response from server
detectedUserTaskId: false // true in case the response has user-task-id
detectedUserTaskId: false, // true in case the response has user-task-id
brokerid_and_logdirs: null // list of broker_id and logdirs
}
},
created () {
Expand Down Expand Up @@ -679,6 +707,19 @@ export default {
params.excluded_topics = vm.excluded_topics
}
}
if (vm.actionName === 'remove_disks') {
// POST /kafkacruisecontrol/remove_disks
// ?brokerid_and_logdirs=[id1-logdir1,id2-logdir2...]
// &skip_hard_goal_check=[true/false]
// &dryrun=[true/false]
if (vm.brokerid_and_logdirs) {
params.brokerid_and_logdirs = vm.brokerid_and_logdirs.replace(', ', '')
}
if (vm.skip_hard_goal_check) {
params.skip_hard_goal_check = vm.skip_hard_goal_check
}
return vm.$helpers.getURL('remove_disks', params)
}
if (vm.actionName === 'remove') {
// POST /kafkacruisecontrol/remove_broker
// ?brokerid=[id1,id2...]
Expand Down