feat(settings): allow hide container with label with no value (#1860) (#1872)

Also add ability to submit form by pressing "Enter" key

Fixes #1860
pull/1876/head
Konstantin Azizov 2018-05-08 07:46:07 +02:00 committed by Anthony Lapenna
parent 55a96767bb
commit 284f2b7752
1 changed files with 3 additions and 3 deletions

View File

@ -135,7 +135,7 @@
<rd-widget> <rd-widget>
<rd-widget-header icon="fa-tags" title="Hidden containers"></rd-widget-header> <rd-widget-header icon="fa-tags" title="Hidden containers"></rd-widget-header>
<rd-widget-body> <rd-widget-body>
<form class="form-horizontal"> <form class="form-horizontal" ng-submit="addFilteredContainerLabel()" name="addTagForm">
<div class="form-group"> <div class="form-group">
<span class="col-sm-12 text-muted small"> <span class="col-sm-12 text-muted small">
You can hide containers with specific labels from Portainer UI. You need to specify the label name and value. You can hide containers with specific labels from Portainer UI. You need to specify the label name and value.
@ -144,14 +144,14 @@
<div class="form-group"> <div class="form-group">
<label for="header_name" class="col-sm-1 control-label text-left">Name</label> <label for="header_name" class="col-sm-1 control-label text-left">Name</label>
<div class="col-sm-11 col-md-4"> <div class="col-sm-11 col-md-4">
<input type="text" class="form-control" id="header_name" ng-model="formValues.labelName" placeholder="e.g. com.example.foo"> <input type="text" required class="form-control" id="header_name" name="label_name" ng-model="formValues.labelName" placeholder="e.g. com.example.foo">
</div> </div>
<label for="header_value" class="col-sm-1 margin-sm-top control-label text-left">Value</label> <label for="header_value" class="col-sm-1 margin-sm-top control-label text-left">Value</label>
<div class="col-sm-11 col-md-4 margin-sm-top"> <div class="col-sm-11 col-md-4 margin-sm-top">
<input type="text" class="form-control" id="header_value" ng-model="formValues.labelValue" placeholder="e.g. bar"> <input type="text" class="form-control" id="header_value" ng-model="formValues.labelValue" placeholder="e.g. bar">
</div> </div>
<div class="col-sm-12 col-md-2 margin-sm-top"> <div class="col-sm-12 col-md-2 margin-sm-top">
<button type="button" class="btn btn-primary btn-sm" ng-click="addFilteredContainerLabel()" ng-disabled="!formValues.labelValue || !formValues.labelName"><i class="fa fa-plus space-right" aria-hidden="true"></i>Add filter</button> <button type="submit" class="btn btn-primary btn-sm" ng-disabled="!formValues.labelName"><i class="fa fa-plus space-right" aria-hidden="true"></i>Add filter</button>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">