app/views/scheduleLeaderElection.scala.html
@* * Copyright 2015 Yahoo Inc. Licensed under the Apache License, Version 2.0 * See accompanying LICENSE file. *@ @import scalaz.{/} @(cluster:String, errorOrStatus: kafka.manager.ApiError / kafka.manager.model.ActorModel.TopicList, status: String, timePeriod: Int )(implicit af: features.ApplicationFeatures, messages: play.api.i18n.Messages, menus: models.navigation.Menus, request:RequestHeader) @theMenu = { @views.html.navigation.clusterMenu(cluster,"Schedule Leader Election","",menus.clusterMenus(cluster)( errorOrStatus.map(_.clusterContext.clusterFeatures).getOrElse(kafka.manager.features.ClusterFeatures.default))) } @main( "Schedule Leader Election", menu = theMenu, breadcrumbs=views.html.navigation.breadCrumbs(models.navigation.BreadCrumbs.withViewAndCluster("Schedule Leader Election",cluster))) {
@features.app(features.KMScheduleLeaderElectionFeature) { @if(timePeriod == 0) { @b4.vertical.form(routes.PreferredReplicaElection.handleScheduleRunElection(cluster)) { implicit fc => @b4.submit('class -> "btn btn-primary"){ Schedule Preferred Replica Election } } } else { @b4.vertical.form(routes.PreferredReplicaElection.cancelScheduleRunElection(cluster)) { implicit fc => @b4.submit('class -> "btn btn-primary"){ Cancel Preferred Replica Election } } } }
@if(timePeriod == 0) { @status } else { @status (every @timePeriod minutes) }
}