Peter Piela 669f9fa7bf Fix Javascript unassignable errors
Replaced several instances of the action directive with HTML list-item/
anchor equivalents. Because the action uses two-way bound scope
variables for "callback" and "item" arguments you cannot specify a
literal value as an argument to the callback function. Two-way bound
variables must be assignable. In my mind there is some question as
to whether the action directive should have been implemented in this
way, but for now I am proposing to use an ng-click directive within
an anchor to implement callback functionality when a literal argument
is needed.

Change-Id: I2baf17c2784faeb92da362544c53e444e6d01afc
2017-05-17 08:46:59 -04:00

70 lines
2.5 KiB
HTML

<div class="detail-page"
ng-controller="horizon.dashboard.admin.ironic.NodeDetailsController as ctrl">
<div class="pull-right">
<button class="btn btn-default btn-sm"
style="margin-right:10px;"
ng-click="ctrl.refresh()">
<span translate>Refresh</span>
</button>
<action-list uib-dropdown>
<action button-type="split-button"
action-classes="'btn btn-default btn-sm'"
callback="ctrl.editNode">
{$ ::'Edit' | translate $}
</action>
<menu>
<li role="presentation"
ng-repeat="transition in ctrl.nodePowerTransitions">
<a role="menuitem"
ng-click="ctrl.actions.setPowerState(
[ctrl.node],
transition.state,
transition.soft);
$event.stopPropagation();
$event.preventDefault()">
<span>{$ transition.label $}</span>
</a>
</li>
<li role="presentation">
<a role="menuitem"
ng-click="ctrl.maintenanceService.setMaintenance(
[ctrl.node],
!ctrl.node.maintenance);
$event.stopPropagation();
$event.preventDefault()">
<span>{$ ctrl.node.maintenance ?
"Maintenance off" : "Maintenance on" | translate $}</span>
</a>
</li>
<li role="presentation"
ng-repeat="transition in ctrl.nodeStateTransitions">
<a role="menuitem"
ng-click="ctrl.actions.setProvisionState({
node: ctrl.node,
verb: transition.verb});
$event.stopPropagation();
$event.preventDefault()">
<span>{$ transition.label $}</span>
</a>
</li>
<action button-type="menu-item"
disabled="isDefined(ctrl.nodeValidationMap.console)
&& ctrl.nodeValidationMap.console.result===false"
callback="ctrl.toggleConsoleMode">
{$ ctrl.node.console_enabled ? 'Disable console' : 'Enable console' | translate $}
</action>
</menu>
</action-list>
</div>
<div class="clearfix"></div>
<uib-tabset>
<uib-tab ng-repeat="section in ctrl.sections"
heading="{$ section.heading $}">
<ng-include src="section.templateUrl"></ng-include>
</uib-tab>
</uib-tabset>
</div>