Files
greenhouse-MyController/www/partials/timers/timer-add-edit.html

186 lines
9.1 KiB
HTML

<!--
Copyright (C) 2015-2016 Jeeva Kandasamy (jkandasa@gmail.com)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<div class="container-fluid"> <!-- Container-fluid -->
<!-- Loading icon disaplay -->
<div ng-hide="resourceTypes.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="resourceTypes.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-add-update.html'"></div>
<div><!-- div-main -->
<form class="form-horizontal" name="mcForm">
<div class="col-md-6">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NAME' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<input class="form-control" placeholder="{{ 'TIMER_NAME' | translate }}" ng-model="timer.name" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ENABLED' | translate }}</label>
<div class="col-sm-10">
<input class="bootstrap-switch" id="bootstrap-switch-state" type="checkbox" ng-model="timer.enabled" checked>
</div>
</div>
<legend><small>{{ 'TYPE' | translate }}</small></legend>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TIMER_TYPE' | translate }}</label>
<div class="col-sm-3 mc-form-fixer-left">
<select class="form-control" pf-select ng-change="timer.frequencyType=rpInterval=rpCount=''" ng-options="tt.id as tt.displayName for tt in timerTypes" ng-model="timer.timerType" required >
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-2 mc-form-fixer" ng-if="timer.timerType === 'Normal' || timer.timerType === 'Before sunrise' || timer.timerType === 'After sunrise' || timer.timerType === 'Before sunset' || timer.timerType === 'After sunset'">
<select class="form-control" pf-select ng-options="tft.displayName as tft.displayName for tft in timerFrequencyTypes" ng-change="updateFrequency()" ng-model="timer.frequencyType" required >
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-5 mc-form-fixer" ng-if="timer.frequencyType === 'Daily'">
<select class="form-control" pf-select multiple ng-options="twd.displayName as twd.displayName for twd in timerWeekDays" ng-model="$parent.dailyFrequencyData" required >
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-3 mc-form-fixer" ng-if="timer.frequencyType === 'Weekly'">
<select class="form-control" pf-select ng-options="twd.displayName as twd.displayName for twd in timerWeekDays" ng-model="$parent.weeklyFrequencyData" required >
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-2 mc-form-fixer" ng-if="timer.frequencyType === 'Monthly'">
<select class="form-control" pf-select ng-options="monthDay for monthDay in monthDays" ng-model="$parent.monthlyFrequencyData" required >
<option value="" ng-hide="true">{{ 'DAY' | translate }}</option>
</select>
</div>
<div class="col-sm-7 mc-form-fixer" ng-if="timer.timerType === 'Cron'">
<input class="form-control" placeholder="{{ 'CRON_EXPRESSION' | translate }}" ng-model="$parent.cronFrequencyData" required />
</div>
<div ng-if="timer.timerType === 'Simple'">
<div class="col-sm-4 mc-form-fixer">
<input class="form-control" placeholder="{{ 'INTERVAL_IN_SECONDS' | translate }}" ng-model="$parent.rpInterval" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div class="col-sm-3 mc-form-fixer">
<input class="form-control" placeholder="{{ 'COUNT' | translate }}" ng-model="$parent.rpCount" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
</div>
<!-- Time -->
<div ng-if="timer.timerType === 'Normal'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TIME_HH_MM_SS' | translate }}</label>
<div class="col-sm-2 mc-form-fixer-left" ng-init="setTriggerTime(false)">
<uib-timepicker ng-model="$parent.lTriggerTime" show-seconds="true" show-spinners="false" second-step="1" ng-change="changed()" hour-step="1" minute-step="1" show-meridian="showMeridian"></uib-timepicker>
</div>
</div>
</div>
<div ng-if="timer.timerType === 'Before sunrise' || timer.timerType === 'Before sunset' || timer.timerType === 'After sunrise' || timer.timerType === 'After sunset'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TIME_OFFSET_HH_MM_SS' | translate }}</label>
<div class="col-sm-2 mc-form-fixer-left" ng-init="setTriggerTime(true)">
<uib-timepicker ng-model="$parent.lTriggerTime" show-seconds="true" show-spinners="false" second-step="1" ng-change="changed()" hour-step="1" minute-step="1" show-meridian="false"></uib-timepicker>
</div>
</div>
</div>
<legend><small>{{ 'VALIDITY' | translate }}</small></legend>
<!-- Validity -->
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-5 mc-form-fixer-left">
<div>
<a class="dropdown-toggle" id="datetime1" role="button" data-toggle="dropdown" data-target="#" href="">
<div class="input-group">
<input type="text" class="form-control mc-show-disabled" data-ng-model="vFromString" ng-readonly="true">
<span class="input-group-addon">
<i class="fa fa-calendar fa-lg"></i>
</span>
</div>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<datetimepicker data-ng-model="vFromDate" data-on-set-time="vFromString = getDateTimeDisplayFormat(newDate)" data-datetimepicker-config="{ dropdownSelector: '#datetime1', minuteStep:1 }"/>
</ul>
</div>
</div>
<div class="col-sm-5 mc-form-fixer">
<div>
<a class="dropdown-toggle" id="datetime2" role="button" data-toggle="dropdown" data-target="#" href="">
<div class="input-group">
<input type="text" class="form-control mc-show-disabled" data-ng-model="vToString" ng-readonly="true">
<span class="input-group-addon">
<i class="fa fa-calendar fa-lg"></i>
</span>
</div>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<datetimepicker data-ng-model="vToDate" data-on-set-time="newDate.setSeconds(newDate.getSeconds() + 59); vToString = getDateTimeDisplayFormat(newDate)"
data-datetimepicker-config="{ dropdownSelector: '#datetime2', minuteStep:1 }"/>
</ul>
</div>
</div>
</div>
<legend><small>{{ 'OPERATIONS' | translate }}</small></legend>
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-10">
<div class="card-pf card-pf-accented">
<div class="card-pf-body">
<div>
<select ng-options="ls.id as ls.displayName for ls in operations" multiple
ng-model="timer.operationIds" bs-duallistbox
move-on-select="false"
filter="true"
select-min-height="200"
></select>
</div>
</div>
</div>
</div>
</div>
<!-- Include save form buttons -->
<div ng-include src="'partials/common-html/save-form.html'"></div>
</div>
</form>
</div><!-- div-main -->
</div> <!-- Main Message -->
</div> <!-- container -->