Initial setup of mycontroller

This commit is contained in:
2019-11-28 09:16:11 -06:00
parent 62d71e30c1
commit 665eb783be
504 changed files with 212034 additions and 0 deletions

View File

@@ -0,0 +1,161 @@
<!--
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>
<!-- Loading icon disaplay -->
<div ng-hide="queryResponse.$resolved && !dataLoading">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved && !dataLoading"> <!-- Main Message -->
<!-- top tool bar -->
<div class="col-md-12 mc-top-space" ng-show="queryResponse.query.totalItems > 0">
<div pf-toolbar id="sensorsDataToolbar" config="sensorsToolbarConfig"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- list view -->
<div class="col-md-12" ng-if="viewType == 'listView'" > <!-- items container -->
<div class="data-list-pf"> <!-- data-list-pf -->
<div class="list-group-item mc-list-align" dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.filteredCount" current-page="currentPage"> <!-- ng-repeat -->
<div class="list-row"><!-- list-row -->
<!-- Sensor name -->
<div class="col-md-3">
<span><i class="fa fa-plug"></i> {{item.node.gateway.name}} <i class="fa fa-chevron-right"></i>
<i class="fa fa-sitemap"></i> {{item.node.eui}}:{{item.node.name}} <i class="fa fa-chevron-right"></i> <i class="fa fa-eye"></i> {{item.sensorId}}: <strong>{{item.name}}</strong></span>
</div>
<!-- Sensor type -->
<div class="col-md-1">
<span><i class="mc-icon-2x" ng-class="cs.getSensorIcon(item.type.en)"></i><span>{{item.type.locale ? item.type.locale : 'Undefined'}}</span></span>
</div>
<!-- Last seen -->
<div class="col-md-1" uib-tooltip="{{item.lastSeen | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="left">
<span class="text-left">
<i class="fa fa-clock-o mc-icon-lg" ></i><span am-time-ago="item.lastSeen"></span>
</span>
</div>
<!-- Variables, selects only one-->
<div ng-repeat="variable in item.variables | limitTo:6"> <!-- variables ng-repeat -->
<div class="col-md-1">
<!-- Sensor variables -->
<div ng-include src="'partials/common-html/sensor-actions-items.html'"></div>
</div>
</div><!-- variables ng-repeat -->
<!-- fill empty space -->
<div ng-if="item.variables.length < 6" class="col-md-{{(6 - item.variables.length)*1}}">
<span></span>
</div>
<!-- Quick access buttons -->
<div class="col-md-1">
<div class=" pull-right">
<a class="btn btn-link mc-padding" ng-model="radioModel" ng-click="refreshSensor(item)"><i class="fa fa-refresh mc-icon-lg mc-inline-editer-ab" tooltip="{{ 'REFRESH' | translate }}" tooltip-placement="left"></i></a>
<a class="btn btn-link mc-padding" ui-sref="sensorsDetail({id:item.id})"><i class="fa fa-chevron-circle-right mc-icon-lg" tooltip="{{ 'VIEW_DETAILS' | translate }}" tooltip-placement="left"></i></a>
</div>
</div>
</div><!-- list-row -->
</div><!-- ng-repeat -->
</div><!-- data-list-pf -->
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)">
</dir-pagination-controls>
</div><!-- items container -->
<!-- box view -->
<div class="col-md-12 container-cards-pf" ng-if="viewType == 'cardView'">
<div class="row row-cards-pf" >
<!-- sensors ng-repeat -->
<div dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.filteredCount" current-page="currentPage">
<div class="col-xs-12 col-sm-6 col-md-4" ng-class="{'col-lg-3': colLg3, 'col-lg-2': !colLg3}">
<div class="card-pf card-pf-aggregate-status card-pf-accented mc-sensor-action-tiles">
<!-- card title -->
<div class="card-pf-title col-md-12">
<i tooltip-enable="item.name.length > 21" uib-tooltip="{{item.name}}" class="fa fa-eye"> {{item.sensorId}}: <strong>{{item.name ? item.name : '-' | limitTo:21}}{{item.name.length > 21 ? '...' : ''}}</strong></i>
</div>
<!-- card body -->
<div class="card-pf-body col-md-12">
<!-- node name -->
<div class="mc-sa-tiles-variable col-md-12">
<span tooltip-enable="(item.node.gateway.name.length + item.node.name.length) > 25" uib-tooltip-html="'[G]:'+item.node.gateway.name+' >> [N]:'+item.node.eui+':'+item.node.name | mcResourceRepresentation">
<i class="fa fa-plug"></i> {{item.node.gateway.name ? item.node.gateway.name : '-' | limitTo:25}}{{item.node.gateway.name.length > 25 ? '...' : ''}}
<span ng-show="item.node.gateway.name.length < 25"> <i class="fa fa-chevron-right"></i><i class="fa fa-sitemap"></i> {{item.node.eui}}:{{item.node.name ? item.node.name : '-' | limitTo:(25-item.node.gateway.name.length)}}{{item.node.name.length > (25-item.node.gateway.name.length) ? '...' : ''}}</span>
</span>
</div>
<!-- Sensor type, Last seen -->
<div class="mc-sa-tiles-variable col-md-12">
<span class="mc-padding"><i class="mc-icon-lg" ng-class="cs.getSensorIcon(item.type.en)"></i><span>{{item.type.locale ? item.type.locale : 'Undefined'}}</span></span>
<span uib-tooltip="{{item.lastSeen | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="top"><span class="text-left"><i class="fa fa-clock-o fa-lg" ></i> <span am-time-ago="item.lastSeen"></span></span></span>
</div>
<legend style="margin:3px" ng-init="variableMaxSize=200"></legend>
<!-- Variables, selects only one-->
<div ng-repeat="variable in item.variables | limitTo:6" ng-init="vItems = cs.getMin(6,item.variables.length)" class="col-md-12 mc-sa-tiles-variable" style="height:{{variableMaxSize/vItems}}px;vertical-align: middle;line-height: {{variableMaxSize/vItems}}px;"> <!-- variables ng-repeat -->
<!-- Sensor variables -->
<div ng-include src="'partials/common-html/sensor-actions-items.html'"></div>
</div><!-- variables ng-repeat -->
<!-- if there is no variable add this one -->
<div ng-if="item.variables == 0" class="col-md-12 mc-sa-tiles-variable" style="height: {{variableMaxSize}}px;vertical-align: middle;line-height: {{variableMaxSize}}px;">
</div>
<legend style="margin:3px"></legend>
<!-- buttons-->
<div class="col-md-12">
<a class="btn btn-link mc-padding pull-left" ng-model="radioModel" ng-click="refreshSensor(item)"><i class="fa fa-refresh mc-icon-lg mc-inline-editer-ab" tooltip="Refresh" tooltip-placement="right"></i></a>
<a class="btn btn-link mc-padding pull-right" ui-sref="sensorsDetail({id:item.id})"><i class="fa fa-chevron-circle-right mc-icon-lg" tooltip="View details" tooltip-placement="left"></i></a>
</div>
</div>
</div>
</div>
</div>
</div>
<legend style="margin:0px"></legend>
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div><!-- items display container -->
</div>

View File

@@ -0,0 +1,71 @@
<!--
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-if="!additionalHeaders.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-if="additionalHeaders.$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-7">
<!-- CSS Files -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'CSS_FILES' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" rows="4" style="resize:none" ng-model="additionalHeaders.links" ng-list="&#10;" ng-trim="false"></textarea>
</div>
</div>
<!-- Java script Files -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SCRIPT_FILES' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" rows="4" style="resize:none" ng-model="additionalHeaders.scripts" ng-list="&#10;" ng-trim="false"></textarea>
</div>
</div>
<!-- Additional AngularJS modules to load -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ADDITIONAL_ANGULARJS_MODULES_TO_LOAD' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" rows="4" style="resize:none" ng-model="additionalHeaders.additionalAngularjsModulesToLoad" ng-list="&#10;" ng-trim="false"></textarea>
</div>
</div>
<!-- Angular custom controllers -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ANGULARJS_CUSTOM_CONTROLLERS' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" rows="21" style="resize:none" ng-model="additionalHeaders.angularjsCustomControllers"></textarea>
</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 -->

View File

@@ -0,0 +1,63 @@
<!--
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.
-->
<span id="badge">
<!-- Should update this logo <img src="images/mc_logo_.gif" alt="MyController.org logo" /> -->
</span>
<div class="container" >
<div class="row">
<div class="col-sm-12">
<div id="brand">
<h1 ng-bind-html="'APP.LOG_IN_TO_MESSAGE' | translate"></h1>
</div><!--/#brand-->
</div><!--/.col-*-->
<div class="col-sm-7 col-md-6 col-lg-6 login">
<div class="alert alert-danger" ng-show="">
<span class="pficon pficon-error-circle-o"></span>
<p class="mc-text-red">{{ 'INVALID_USERNAME_OR_PASSWORD' | translate }}</p>
</div>
<form class="form-horizontal" name="mcLoginForm" role="form" ng-submit="login()">
<div class="form-group">
<label for="inputUsername" class="col-sm-2 col-md-2 control-label">{{ 'USERNAME' | translate }}</label>
<div class="col-sm-10 col-md-10">
<input type="text" class="form-control" name="username" id="username" ng-model="username" placeholder="{{ 'USERNAME' | translate }}" tabindex="1" required>
</div>
</div>
<div class="form-group">
<label for="inputPassword" class="col-sm-2 col-md-2 control-label">{{ 'PASSWORD' | translate }}</label>
<div class="col-sm-10 col-md-10">
<input type="password" class="form-control" name="password" id="password" ng-model="password" placeholder="{{ 'PASSWORD' | translate }}" tabindex="2" required>
</div>
</div>
<div class="form-group">
<div class="col-xs-8 col-sm-offset-2 col-sm-6 col-md-offset-2 col-md-6">
</div>
<div class="col-xs-4 col-sm-4 col-md-4 submit">
<button type="submit" ng-disabled="mcLoginForm.$invalid || dataLoading" class="btn btn-primary btn-lg" tabindex="4">{{ 'LOG_IN' | translate }}</button>
<span ng-if="dataLoading" class="spinner spinner-inverse spinner-inline mc-align-center"></span>
</div>
</div>
</form>
</div><!--/.col-*-->
<div class="col-sm-5 col-md-6 col-lg-6 details">
<p ng-bind-html="'APP.WELCOME_MESSAGE' | translate"></p>
<p>{{ 'VERSION' | translate }}: <strong>{{loginSettings.appVersion}}</strong></p>
<p ng-bind-html="loginSettings.loginMessage"></p>
</div><!--/.col-*-->
</div><!--/.row-->
</div><!--/.container-->

View File

@@ -0,0 +1,117 @@
<!--
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 mc-top-space-1x"> <!-- Container-fluid -->
<!-- Loading icon disaplay -->
<div ng-hide="item.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="item.$resolved"> <!-- Main Message -->
<!-- Email settings -->
<div class="col-md-12">
<div class="card-pf card-pf-accented">
<div class="card-pf-heading"><h2 class="card-pf-title"><i class="fa fa-database"></i> {{ 'BACKUP_SETTINGS' | translate }}</h2></div>
<div class="card-pf-body">
<form class="form-horizontal" name="mcBackupSettingsForm">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'BACKUP_LOCATION' | translate }}</label>
<div class="col-sm-7">
<input ng-show="editEnable.backupSettings" class="form-control" placeholder="{{ 'BACKUP_LOCATION' | translate }}" ng-model="item.backupLocation" required />
<div ng-hide="editEnable.backupSettings">{{item.backupLocation}}</div>
</div>
</div>
<legend><small>{{ 'AUTOMATIC_BACKUP_SETTINGS' | translate }}</small></legend>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'STATUS' | translate }}</label>
<div class="col-sm-5">
<input bs-switch ng-change="editEnable.backupSettings = true" ng-model="item.enabled" type="checkbox"
switch-animate="true" switch-handle-width="50px" switch-label-width="3px"
switch-off-color="default" switch-on-color="primary" ng-true-value="true"
ng-false-value="false" switch-on-text="{{ 'ON' | translate }}" switch-off-text="{{ 'OFF' | translate }}">
</div>
</div>
<div ng-if="item.enabled">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'BACKUP_FILE_PREFIX' | translate }}</label>
<div class="col-sm-7">
<input ng-show="editEnable.backupSettings" class="form-control" placeholder="{{ 'BACKUP_FILE_PREFIX' | translate }}" ng-model="item.prefix" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
<div ng-hide="editEnable.backupSettings">{{item.prefix}}</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'BACKUP_EVERY' | translate }}</label>
<div class="col-sm-4" ng-show="editEnable.backupSettings">
<input ng-show="editEnable.backupSettings" class="form-control" placeholder="{{ 'BACKUP_EVERY' | translate }}" ng-model="$parent.intervalLocal" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div ng-if="!editEnable.backupSettings" class="col-sm-7">
<div>{{$parent.intervalLocal}} {{$parent.intervalTimeConstantString}}</div>
</div>
<div class="col-sm-3" ng-show="editEnable.backupSettings" >
<select class="form-control" pf-select ng-model="$parent.intervalTimeConstant" required>
<option value="" ng-hide="true"></option>
<option value="60000">{{ 'MINUTES' | translate }}</option>
<option value="3600000">{{ 'HOURS' | translate }}</option>
<option value="86400000">{{ 'DAYS' | translate }}</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RETAIN_MAX' | translate }}</label>
<div class="col-sm-7">
<input ng-show="editEnable.backupSettings" class="form-control" placeholder="{{ 'RETAIN_MAX' | translate }}" ng-model="item.retainMax" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
<div ng-hide="editEnable.backupSettings">{{item.retainMax}}</div>
</div>
</div>
</div>
<div ng-if="item.enabled && !editEnable.backupSettings">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NEXT_EXECUTION' | translate }}</label>
<div class="col-sm-7">
<div><span>{{item.nextFire | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}</span></div>
</div>
</div>
</div>
</form>
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.backupSettings" ng-click="editEnable.backupSettings = true">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.backupSettings" ng-click="resetSettings();editEnable.backupSettings = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-primary" ng-click="save()" ng-show="editEnable.backupSettings" ng-disabled="saveProgress || mcBackupSettingsForm.$invalid">
<div ng-show="saveProgress" class="spinner spinner-xs"></div>
{{ 'SAVE' | translate }}
</button>
</div>
</div>
</div>
</div>
</div> <!-- Main Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,95 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<!-- Single button -->
<div class="btn-group" ng-if="filteredList.length > 0">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || restoreItemFn()" class="text-default"><i class="fa fa-lg fa-undo"></i> {{ 'RESTORE' | translate }}</a></li>
</ul>
</div>
<!-- Single button -->
<div class="btn-group" role="group">
<a class="btn btn-default" type="button" ui-sref="settingsBackupAuto">{{ 'SETTINGS' | translate }}</a></a>
</div>
<!-- Single button -->
<div class="btn-group" role="group">
<a class="btn btn-primary" ng-disabled="disableRunBackup" type="button" ng-click="backupNow()">{{ 'RUN_BACKUP' | translate }}</a></a>
</div>
</div>
<!-- for now always hide sort by. this moment this feature not supported -->
<div class="pull-right mc-v-margin" ng-show="false">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'FILE_NAME' | translate }}</th>
<th>{{ 'FILE_SIZE' | translate }}</th>
<th>{{ 'BACKUP_ON' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.name) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.name) != -1"></td>
<td>{{item.name}}</td>
<td>{{item.size | byteToFriendlyConvertor}}</td>
<td><span uib-tooltip="{{item.timestamp | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="left" am-time-ago="item.timestamp"></span></td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,36 @@
<!--
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>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="cancel()">
<span class="pficon pficon-close"></span>
</button>
<div class="modal-title"><b>{{header}}</b></div>
</div>
<div class="modal-body modal-body-text-only">
<small ng-bind-html="rebootMsg"></small>
</div>
<div class="modal-footer">
<button class="btn btn-default" ng-click="cancel()"><i class="fa fa-close"></i> {{ 'CANCEL' | translate }}</button>
<button class="btn btn-danger" ng-click="restore()"><i class="fa fa-undo"></i> {{ 'RESTORE' | translate }}</button>
</div>
</div>

View File

@@ -0,0 +1,37 @@
<!--
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>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="cancel()">
<span class="pficon pficon-close"></span>
</button>
<div class="modal-title"><b>{{header}}</b></div>
</div>
<div class="modal-body modal-body-text-only">
<p ng-bind-html="deleteMsg"></p>
</div>
<div class="modal-footer">
<b><p ng-bind-html="'WARNING' | translate" class="text-danger pull-left"></p><b>
<button class="btn btn-default" ng-click="cancel()"><i class="fa fa-close"></i> {{ 'CANCEL' | translate }}</button>
<button class="btn btn-danger" ng-click="remove()"><i class="fa fa-trash"></i> {{ 'DELETE' | translate }}</button>
</div>
</div>

View File

@@ -0,0 +1,37 @@
<!--
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>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="cancel()">
<span class="pficon pficon-close"></span>
</button>
<div class="modal-title"><b>{{header}}</b></div>
</div>
<div class="modal-body modal-body-text-only">
<small ng-bind-html="message"></small>
</div>
<div class="modal-footer">
<b><p ng-bind-html="'WARNING' | translate" class="text-danger pull-left"></p><b>
<button class="btn btn-default" ng-click="cancel()"><i class="fa fa-close"></i> {{ 'CANCEL' | translate }}</button>
<button class="btn btn-danger" ng-click="continute()"><i class="fa fa-check"></i> {{ 'CONTINUE' | translate }}</button>
</div>
</div>

View File

@@ -0,0 +1,23 @@
<!--
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="blank-slate-pf">
<div class="blank-slate-pf-icon">
<i class="fa fa-times-circle-o"></i>
</div>
<h2>{{ 'ERROR_ITEMS_NOT_AVAILABLE' | translate }}</h2>
</div>

View File

@@ -0,0 +1,21 @@
<!--
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="mc-top-space-header">
<legend ng-hide="showHeaderUpdate">{{headerStringAdd}}</legend>
<legend ng-show="showHeaderUpdate">{{headerStringUpdate}}</legend>
</div>

View File

@@ -0,0 +1,21 @@
<!--
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.
-->
<!-- header list -->
<div class="mc-top-space-header">
<legend>{{headerStringList}}</legend>
</div>

View File

@@ -0,0 +1,21 @@
<!--
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="text-center mc-align-center">
<div class="spinner spinner"></div>
<p class="hk-spinner-legend-below">{{ 'LOADING' | translate }}</p>
</div>

View File

@@ -0,0 +1,21 @@
<!--
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="text-center mc-align-center mc-spinner-container-alone">
<div class="spinner spinner-lg"></div>
<p class="hk-spinner-legend-below">{{ 'LOADING' | translate }}</p>
</div>

View File

@@ -0,0 +1,23 @@
<!--
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="blank-slate-pf">
<div class="blank-slate-pf-icon">
<i class="fa fa-exclamation-triangle"></i>
</div>
<h2>{{ 'NO_ITEMS_SETUP' | translate }}</h2>
</div>

View File

@@ -0,0 +1,26 @@
<!--
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 ng-show="queryResponse.query.totalItems > 0 && queryResponse.data.length == 0">
<legend></legend>
<div class="blank-slate-pf" >
<div class="blank-slate-pf-icon">
<i class="fa fa-exclamation-triangle"></i>
</div>
<h1>{{ 'NO_ITEMS_IN_FILTER' | translate }}</h1>
</div>
</div>

View File

@@ -0,0 +1,25 @@
<!--
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 ng-show="queryResponse.$resolved && queryResponse.query.totalItems == 0" class="mc-top-space-2x">
<div class="blank-slate-pf">
<div class="blank-slate-pf-icon">
<i class="{{noItemsSystemIcon}}"></i>
</div>
<h1>{{noItemsSystemMsg}}</h1>
</div>
</div>

View File

@@ -0,0 +1,25 @@
<!--
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="form-actions mc-form-actions-separator text-right">
<a type="button" class="btn btn-default" ui-sref="{{cancelButtonState}}" class="button">{{ 'CANCEL' | translate }}</a>
<button type="button" class="btn btn-primary" ng-click="save()" ng-disabled="saveProgress || isSettingChange || mcForm.$invalid"
uib-tooltip="{{saveButtonTooltip}}" tooltip-placement="left">
<div ng-show="saveProgress" class="spinner spinner-xs hk-modal-spinner"></div>
{{saveProgress? (savingButtonName? savingButtonName: 'SAVING' | translate):(saveButtonName? saveButtonName: 'SAVE' | translate)}}
</button>
</div>

View File

@@ -0,0 +1,273 @@
<!--
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.
-->
<!-- Status -->
<div ng-if="variable.type.en === 'Status'">
<span tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}">
<input class="onoffswitch" bs-switch ng-change="updateVariable(variable)" ng-model="variable.value" ng-init="variable.value = cs.getInteger(variable.value)" type="checkbox"
switch-animate="{{cs.mcbStyle.animate}}" switch-handle-width="{{cs.mcbStyle.stateHandleWidth}}" switch-label-width="{{cs.mcbStyle.labelWidth}}"
switch-off-color="default" switch-on-color="primary" switch-size="{{cs.mcbStyle.size}}" switch-readonly="variable.readOnly"
ng-true-value="1" ng-false-value="0" switch-on-text="ON" switch-off-text="OFF"
>
</span>
</div>
<!-- Temperature -->
<div ng-if="variable.type.en === 'Temperature'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no" onbeforesave="updateVariable(variable)" editable-text="variable.value">
<span ng-hide="hideVariableName"><i class="wi wi-thermometer mc-icon-2x"></i></span>
<span class="mc-style-ab">{{variable.value ||"-"}} {{variable.unit}}</span>
</span>
</div>
<!-- Percentage -->
<div ng-if="variable.type.en === 'Percentage'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no" onbeforesave="updateVariable(variable)" editable-text="variable.value">
<span class="mc-style-ab">{{variable.value ||"-"}} {{variable.unit}}</span>
</span>
</div>
<!-- Humidity -->
<div ng-if="variable.type.en === 'Humidity'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no" onbeforesave="updateVariable(variable)" editable-text="variable.value">
<span ng-hide="hideVariableName"><i class="wi wi-humidity mc-icon-2x"></i></span>
<span class="mc-style-ab">{{variable.value ||"-"}} {{variable.unit}}</span>
</span>
</div>
<!-- Pressure -->
<div ng-if="variable.type.en === 'Pressure'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no" onbeforesave="updateVariable(variable)" editable-text="variable.value">
<span ng-hide="hideVariableName"><i class="wi wi-barometer mc-icon-2x"></i></span>
<span class="mc-style-ab">{{variable.value ||"-"}} {{variable.unit}}</span>
</span>
</div>
<!-- Forecast -->
<div ng-if="variable.type.en === 'Forecast'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab mc-style-ab" buttons="no" onbeforesave="updateVariable(variable)" editable-text="variable.value">
<i class="wi wi-{{cs.getForecastValue(variable.value)}} mc-icon-2x"></i>
</span>
</div>
<!-- Watt -->
<div ng-if="variable.type.en === 'Watt'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no" onbeforesave="updateVariable(variable)" editable-text="variable.value">
<span ng-hide="hideVariableName"><i class="fa fa-bolt mc-icon-2x"></i></span>
<span class="mc-style-ab">{{variable.value ||"-"}} {{variable.unit}}</span>
</span>
</div>
<!-- Weight -->
<div ng-if="variable.type.en === 'Weight'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no" onbeforesave="updateVariable(variable)" editable-text="variable.value">
<i class="fa fa-balance-scale mc-icon-2x"></i>
<span class="mc-style-ab">{{variable.value ||"-"}} {{variable.unit}}</span>
</span>
</div>
<!-- Stop -->
<div ng-if="variable.type.en === 'Stop'">
<span ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab">
<i ng-init="variable.value = 1" class="fa fa-stop mc-icon-2x" ng-click="updateVariable(variable)"></i>
</span>
</div>
<!-- Up -->
<div ng-if="variable.type.en === 'Up'">
<span ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab">
<i ng-init="variable.value = 1" class="fa fa-arrow-up mc-icon-2x" ng-click="updateVariable(variable)"></i>
</span>
</div>
<!-- Down -->
<div ng-if="variable.type.en === 'Down'">
<span ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab">
<i ng-init="variable.value = 1" class="fa fa-arrow-down mc-icon-2x" ng-click="updateVariable(variable)"></i>
</span>
</div>
<!-- Rain -->
<div ng-if="variable.type.en === 'Rain'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no" onbeforesave="updateVariable(variable)" editable-text="variable.value">
<i class="wi wi-raindrops mc-icon-2x"></i>
<span class="mc-style-ab">{{variable.value ||"-"}} {{variable.unit}}</span>
</span>
</div>
<!-- Rain rate-->
<div ng-if="variable.type.en === 'Rain rate'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no" onbeforesave="updateVariable(variable)" editable-text="variable.value">
<i class="wi wi-raindrops mc-icon-2x">r</i>
<span class="mc-style-ab">{{variable.value ||"-"}} {{variable.unit}}</span>
</span>
</div>
<!-- Distance-->
<div ng-if="variable.type.en === 'Distance'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no" onbeforesave="updateVariable(variable)" editable-text="variable.value">
<i class="fa fa-binoculars mc-icon-2x"></i>
<span class="mc-style-ab">{{variable.value ||"-"}} {{variable.unit}}</span>
</span>
</div>
<!-- Current-->
<div ng-if="variable.type.en === 'Current'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no" onbeforesave="updateVariable(variable)" editable-text="variable.value">
<span ng-hide="hideVariableName"><i class="fa mc-icon-2x">I</i></span>
<span class="mc-style-ab">{{variable.value ||"-"}} {{variable.unit}}</span>
</span>
</div>
<!-- Voltage-->
<div ng-if="variable.type.en === 'Voltage'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no" onbeforesave="updateVariable(variable)" editable-text="variable.value">
<span ng-hide="hideVariableName"><i class="fa mc-icon-2x">V</i></span>
<span class="mc-style-ab">{{variable.value ||"-"}} {{variable.unit}}</span>
</span>
</div>
<!-- Impedance-->
<div ng-if="variable.type.en === 'Impedance'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no"
onbeforesave="updateVariable(variable)" editable-text="variable.value">
<span ng-hide="hideVariableName"><i class="fa mc-icon-2x">Ohm</i></span>
<span class="mc-style-ab">{{variable.value ||"-"}} {{variable.unit}}</span>
</span>
</div>
<!-- Armed -->
<div ng-if="variable.type.en === 'Armed'">
<span tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}">
<input bs-switch ng-change="updateVariable(variable)" ng-model="variable.value" ng-init="variable.value = cs.getInteger(variable.value)"type="checkbox"
switch-animate="{{cs.mcbStyle.animate}}" switch-handle-width="{{cs.mcbStyle.handleWidth}}" switch-label-width="{{cs.mcbStyle.labelWidth}}"
switch-off-color="default" switch-on-color="primary" switch-size="{{cs.mcbStyle.size}}" switch-readonly="variable.readOnly"
ng-true-value="1" ng-false-value="0" switch-on-text="Armed" switch-off-text="Bypassed">
</span>
</div>
<!-- Tripped -->
<div ng-if="variable.type.en === 'Tripped'">
<span tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}">
<input bs-switch ng-change="updateVariable(variable)" ng-model="variable.value" ng-init="variable.value = cs.getInteger(variable.value)"type="checkbox"
switch-animate="{{cs.mcbStyle.animate}}" switch-handle-width="{{cs.mcbStyle.handleWidth}}" switch-label-width="{{cs.mcbStyle.labelWidth}}"
switch-off-color="default" switch-on-color="primary" switch-size="{{cs.mcbStyle.size}}" switch-readonly="variable.readOnly"
ng-true-value="1" ng-false-value="0" switch-on-text="Tripped" switch-off-text="Untripped">
</span>
</div>
<!-- Lock status -->
<div ng-if="variable.type.en === 'Lock status'">
<span tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}">
<input bs-switch ng-change="updateVariable(variable)" ng-model="variable.value" ng-init="variable.value = cs.getInteger(variable.value)" type="checkbox"
switch-animate="{{cs.mcbStyle.animate}}" switch-handle-width="{{cs.mcbStyle.handleWidth}}" switch-label-width="{{cs.mcbStyle.labelWidth}}"
switch-off-color="danger" switch-on-color="primary" switch-size="{{cs.mcbStyle.size}}" switch-readonly="variable.readOnly"
ng-true-value="1" ng-false-value="0" switch-on-text="Locked" switch-off-text="Unlocked">
</span>
</div>
<!-- HVAC flow mode -->
<div ng-if="variable.type.en === 'HVAC flow mode'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-sab-dropdown mc-inline-editer-ab mc-icon-md-1"
onbeforesave="updateVariable(variable)" buttons="no" editable-select="variable.value" e-ng-options="hvac.id as hvac.displayName for hvac in hvacOptionsFlowMode">
<span class="mc-style-ab">{{variable.value || "not set"}}</span>
</span>
</div>
<!-- HVAC flow state -->
<div ng-if="variable.type.en === 'HVAC flow state'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab mc-icon-md-1"
onbeforesave="updateVariable(variable)" buttons="no" editable-select="variable.value" e-ng-options="hvac.id as hvac.displayName for hvac in hvacOptionsFlowState">
<span class="mc-style-ab">{{variable.value || "not set"}}</span>
</span>
</div>
<!-- HVAC fan speed -->
<div ng-if="variable.type.en === 'HVAC speed'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab mc-icon-md-1"
onbeforesave="updateVariable(variable)" e-style="height: 22px;" buttons="no" editable-select="variable.value" e-ng-options="hvac.id as hvac.displayName for hvac in hvacOptionsFanSpeed">
<span class="mc-style-ab">{{variable.value || "not set"}}</span>
</span>
</div>
<!-- HVAC Heat set point -->
<div ng-if="variable.type.en === 'HVAC setpoint heat'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no"
onbeforesave="updateVariable(variable)" editable-text="variable.value">
<i class="wi wi-thermometer mc-icon-2x">h</i>
<span class="mc-style-ab">{{variable.value ||"-"}} {{variable.unit}}</span>
</span>
</div>
<!-- HVAC Cool set point -->
<div ng-if="variable.type.en === 'HVAC setpoint cool'">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no"
onbeforesave="updateVariable(variable)" editable-text="variable.value">
<i class="wi wi-thermometer mc-icon-2x">c</i>
<span class="mc-style-ab">{{variable.value ||"-"}} {{variable.unit}}</span>
</span>
</div>
<!-- Variable 1,2,3,4,5 -->
<div ng-if="variable.type.en.indexOf('Variable ') > -1" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no"
onbeforesave="updateVariable(variable)" editable-text="variable.value">
<span class="mc-style-ab">
<span ng-hide="hideVariableName">{{variable.name ? variable.name.length > 12 ? variable.name.substring(0,9)+'.. ' : variable.name : variable.type.en.replace('Variable ','V')}}: </span>
{{variable.value ||"-"}} {{variable.unit}}
</span>
</span>
</div>
<!-- Volume -->
<div ng-if="variable.type.en === 'Volume'" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no"
onbeforesave="updateVariable(variable)" editable-text="variable.value">
<span class="mc-style-ab">
<span ng-hide="hideVariableName">{{variable.name ? variable.name.length > 12 ? variable.name.substring(0,9)+'.. ' : variable.name : 'Vol'}}: </span>
{{variable.value ||"-"}} {{variable.unit}}
</span>
</span>
</div>
<!-- RGB color picker -->
<div ng-if="variable.type.en === 'RGB'">
<span tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}">
<button style="background-color:{{variable.value}};width:70px;color:white;" class="btn btn-sm" colorpicker="hex" colorpicker-position="top"
ng-disabled="variable.readOnly" ng-change="updateVariable(variable)" ng-model="variable.value">{{variable.value || "-"}}</button>
</span>
</div>
<!-- RGBW color picker -->
<div ng-if="variable.type.en === 'RGBW'">
<span tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" ng-disabled="variable.readOnly">
<button style="background-color:{{variable.rgba}};width:70px;color:white;" class="btn btn-sm" colorpicker="rgba" colorpicker-position="top" ng-disabled="variable.readOnly"
ng-init="variable.rgba = cs.hex2rgba(variable.value)" ng-change="updateRgba(variable)" ng-model="variable.rgba">{{variable.value || "-"}}</button>
</span>
</div>
<!-- Default, if non selected -->
<div ng-if="definedVariableTypes.indexOf(variable.type.en) == -1">
<span e-ng-disabled="variable.readOnly" tooltip-enable="{{tooltipEnabled}}" uib-tooltip="{{variable.type.locale}}{{variable.name?' ('+variable.name+')':''}}" tooltip-placement="{{tooltipPlacement}}" class="mc-inline-editer-ab" buttons="no"
onbeforesave="updateVariable(variable)" editable-text="variable.value">
<span class="mc-style-ab">
<span ng-hide="hideVariableName">{{variable.name ? variable.name.length > 12 ? variable.name.substring(0,9)+'.. ' : variable.name : variable.type.en}}: </span>
{{variable.value ||"-"}} {{variable.unit}}
</span>
</span>
</div>

View File

@@ -0,0 +1,36 @@
<!--
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.
-->
<legend>
<span style="font-size: 16px" class="pull-right">
<a href="" ng-if="editMode" uib-tooltip="{{ 'ADD_NEW_WIDGET' | translate }}" tooltip-placement="left" ng-click="addWidgetDialog()">
<i class="glyphicon glyphicon-plus-sign"></i>
</a>
<a href="" ng-if="editMode" uib-tooltip="{{ 'EDIT_DASHBOARD' | translate }}" tooltip-placement="left" ng-click="editDashboardDialog()">
<i class="glyphicon glyphicon-cog"></i>
</a>
<a href="" ng-if="editMode" uib-tooltip="{{'SAVE_CHANGES' | translate}}" tooltip-placement="left" ng-click="toggleEditMode()">
<i class="glyphicon glyphicon-saved"></i>
</a>
<a href="" ng-if="!editMode" uib-tooltip="{{'ENABLE_EDIT_MODE' | translate}}" tooltip-placement="left" ng-click="toggleEditMode()">
<i class="glyphicon glyphicon-edit"></i>
</a>
<a href="" ng-if="editMode" uib-tooltip="{{ 'UNDO_CHANGES' | translate }}" tooltip-placement="left" ng-click="cancelEditMode()">
<i class="glyphicon glyphicon-repeat adf-flip"></i>
</a>
</span>
</legend>

View File

@@ -0,0 +1,44 @@
<!--
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 row mc-top-space">
<!-- Loading icon disaplay -->
<div ng-show="showLoadingMain">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-if="!showLoadingMain"> <!-- Main Message -->
<ul class="nav nav-tabs nav-tabs-pf">
<li ng-repeat="item in dashboards | orderBy:'title'" ng-class="{'active' : item.id === dId}"><a href="" ng-click="changeDashboard(item)">{{item.title}}</a></li>
<li ng-if="!mchelper.userSettings.hideMenu" class="pull-right" uib-tooltip="{{ 'NEW_DASHBOARD' | translate }}" tooltip-placement="left"><span ng-disabled="dashboards.length >= mchelper.cfg.dashboardLimit" class="btn btn-primary mc-margin" style="margin-top:5px;" type="button" ng-click="createNewDashboad()"><i class="fa fa-plus"></i> {{ 'NEW' | translate }}</span></li>
<li ng-if="!mchelper.userSettings.hideMenu" class="pull-right" uib-tooltip="{{ 'DELETE_DASHBOARD' | translate }}" tooltip-placement="left"><span ng-disabled="dashboards.length == 1 && dId" class="btn btn-danger mc-margin" style="margin-top:5px;" type="button" ng-click="deleteDashboad()"><i class="fa fa-trash"></i> {{ 'DELETE' | translate }}</span></li>
</ul>
<!-- Loading icon disaplay -->
<div ng-show="showLoading">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-hide="showLoading">
<div ng-if="model" adf-dashboard name="{{model.name}}" collapsible="true" enableConfirmDelete="false" adf-model="model"></div>
</div>
</div>
</div>

View File

@@ -0,0 +1,301 @@
<!--
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-if="!types.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-if="types.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-add-update.html'"></div>
<div>
<form class="form-horizontal" name="mcForm">
<div class="col-md-5">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NAME' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" ng-model="item.name" placeholder="{{ 'NAME' | translate }}" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ENABLED' | translate }}</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="item.enabled" checked>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TYPE' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-change="updateTypeChange()"
ng-options="type.id as type.displayName for type in types | orderBy:'displayName'" ng-model="item.type" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<!-- Emoncms.org Server -->
<div ng-if="item.type === 'Emoncms.org'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'URL' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'URL' | translate }}" ng-model="item.url" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRUST_HOST' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-options="type.id as type.displayName for type in trustHostTypes | orderBy:'displayName'" ng-model="item.trustHostType" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'WRITE_API_KEY' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'WRITE_API_KEY' | translate }}" ng-model="item.writeApiKey" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'KEY_FORMAT' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'KEY_FORMAT' | translate }}" ng-model="item.keyFormat" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
</div>
<!-- Sparkfun [phant.io] server -->
<div ng-if="item.type === 'Sparkfun [phant.io]'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'URL' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'URL' | translate }}" ng-model="item.url" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRUST_HOST' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-options="type.id as type.displayName for type in trustHostTypes | orderBy:'displayName'" ng-model="item.trustHostType" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PUBLIC_KEY' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'PUBLIC_KEY' | translate }}" ng-model="item.publicKey" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PRIVATE_KEY' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'PRIVATE_KEY' | translate }}" ng-model="item.privateKey" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'KEY_FORMAT' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'KEY_FORMAT' | translate }}" ng-model="item.keyFormat" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
</div>
<!-- Influxdb server -->
<div ng-if="item.type === 'Influxdb'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'URL' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'URL' | translate }}" ng-model="item.url" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRUST_HOST' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-options="type.id as type.displayName for type in trustHostTypes | orderBy:'displayName'" ng-model="item.trustHostType" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'USERNAME' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'USERNAME' | translate }}" ng-model="item.username" pf-validation="cs.isContainsSpace(input)" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PASSWORD' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'PASSWORD' | translate }}" ng-model="item.password" pf-validation="cs.isContainsSpace(input)" ng-required="item.username"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'DATABASE' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'DATABASE' | translate }}" ng-model="item.database" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'MEASUREMENT' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'KEY_FORMAT' | translate }}" ng-model="item.keyFormat" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TAGS' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'TAGS' | translate }}" ng-model="item.tags" pf-validation="cs.isContainsSpace(input)" />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
</div>
<!-- MQTT client server -->
<div ng-if="item.type === 'MQTT'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'BROKET_HOST' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'MQTT_BROKER_HOST_EXAMPLE' | translate }}" ng-model="item.url" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRUST_HOST' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-options="type.id as type.displayName for type in trustHostTypes | orderBy:'displayName'" ng-model="item.trustHostType" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'USERNAME' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'USERNAME' | translate }}" ng-model="item.username" pf-validation="cs.isContainsSpace(input)" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PASSWORD' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'PASSWORD' | translate }}" ng-model="item.password" pf-validation="cs.isContainsSpace(input)" ng-required="item.username"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TOPIC_PUBLISH' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'KEY_FORMAT' | translate }}" ng-model="item.keyFormat" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
</div>
<!-- WUnderground Server -->
<div ng-if="item.type === 'WUnderground'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'URL' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'URL' | translate }}" ng-model="item.url" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRUST_HOST' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-options="type.id as type.displayName for type in trustHostTypes | orderBy:'displayName'" ng-model="item.trustHostType" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'STATION_ID' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'STATION_ID' | translate }}" ng-model="item.stationId" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'STATION_PASSWORD' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'STATION_PASSWORD' | translate }}" ng-model="item.stationPassword" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
</div>
<div ng-if="item.type !== 'WUnderground'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ALPHABETICAL_KEY_CASE' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-model="item.keyCase" required >
<option value="" ng-hide="true"></option>
<option value="DEFAULT">{{ 'DEFAULT' | translate }}</option>
<option value="UPPER">{{ 'UPPER' | translate }}</option>
<option value="LOWER">{{ 'LOWER' | translate }}</option>
</select>
</div>
</div>
</div>
<!-- Include save form buttons -->
<div ng-include src="'partials/common-html/save-form.html'"></div>
</div>
</form>
</div>
</div> <!-- Main Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,100 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || enable()" class="text-default"><i class="fa fa-lg fa-circle"></i> {{ 'ENABLE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || disable()" class="text-danger"><i class="fa fa-lg fa-circle-thin"></i> {{ 'DISABLE' | translate }}</a></li>
</ul>
</div>
</div>
<div ng-show="mchelper.user.permission === 'Super admin'" class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="externalServersAddEdit">{{ 'ADD_EXTERNAL_SERVER' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="exampleSimpleSort" config="sortConfig"></div>
</div>
<div pf-filter id="externalServersFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'ENABLED' | translate }}</th>
<th>{{ 'NAME' | translate }}</th>
<th>{{ 'TYPE' | translate }}</th>
<th>{{ 'DETAILS' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td class="text-center">
<i ng-show="item.enabled" class="text-success fa fa-circle fa-lg" uib-tooltip="{{ 'ENABLED' | translate }}"></i>
<i ng-hide="item.enabled" class="text-danger fa fa-circle-o fa-lg" uib-tooltip="{{ 'DISABLED' | translate }}"></i>
</td>
<td>{{item.name}}</td>
<td>{{item.type}}</td>
<td>{{item.serverDetail}}</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,79 @@
<!--
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="firmwareVersions.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="firmwareVersions.$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-5">
<!-- type -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TYPE' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-options="item.id as item.displayName for item in firmwareTypes" ng-model="item.type.id" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<!-- version -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'VERSION' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-options="item.id as item.displayName for item in firmwareVersions" ng-model="item.version.id" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<!-- Firmware -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'FILE' | translate }}</label>
<div class="col-sm-10">
<input type="file" class="form-control" id="firmware.file" on-read-file="displayFileContents(contents, fileExtension)" ng-accept="'.hex'" ng-model="file">
</div>
</div>
<!-- Firmware list -->
<div class="form-group" ng-if="item.fileType === 'Hex'">
<label class="col-sm-2 control-label">{{ 'CONTENT' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" rows="21" style="resize:none" ng-model="item.fileString" readonly required></textarea>
</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 -->

View File

@@ -0,0 +1,99 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-default" type="button" ui-sref="firmwaresTypeList">{{ 'TYPES' | translate }}</a>
<a class="btn btn-default" type="button" ui-sref="firmwaresVersionList">{{ 'VERSIONS' | translate }}</a>
<a class="btn btn-default" ng-disabled="true" type="button" ui-sref="firmwaresList">{{ 'FIRMWARES' | translate }}</a>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="firmwaresAddEdit">{{ 'ADD_FIRMWARE' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'TYPE' | translate }}</th>
<th>{{ 'VERSION' | translate }}</th>
<th>{{ 'PROPERTIES' | translate }}</th>
<th>{{ 'UPLOADED_ON' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td>{{item.type.name}}</td>
<td>{{item.version.version}}</td>
<td><span ng-repeat="(key, value) in item.properties track by $index">{{$index != 0 ? ', ' : ''}}{{key}}: {{ value }}</span></td>
<td>{{item.timestamp | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,58 @@
<!--
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="firmwareType.$resolved || !ftypeId">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="firmwareType.$resolved || !ftypeId"> <!-- 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-5">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ID' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'AUTO_GENERATE' | translate }}" ng-model="firmwareType.newId" pf-validation="cs.isNumber(input)" />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NAME' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'FIRMWARE_TYPE_NAME' | translate }}" ng-model="firmwareType.name" required />
</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 -->

View File

@@ -0,0 +1,95 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-default" ng-disabled="true" type="button" ui-sref="firmwaresTypeList">{{ 'TYPES' | translate }}</a>
<a class="btn btn-default" type="button" ui-sref="firmwaresVersionList">{{ 'VERSIONS' | translate }}</a>
<a class="btn btn-default" type="button" ui-sref="firmwaresList">{{ 'FIRMWARES' | translate }}</a>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="firmwaresTypeAddEdit">{{ 'ADD_FIRMWARE_TYPE' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'TYPE_ID' | translate }}</th>
<th>{{ 'NAME' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center col-md-1"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td class="col-md-1">{{item.id}}</td>
<td>{{item.name}}</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,59 @@
<!--
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="item.$resolved || !itemId">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="item.$resolved || !itemId"> <!-- 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-5">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ID' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'AUTO_GENERATE' | translate }}" ng-model="item.newId" pf-validation="cs.isNumber(input)" />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'VERSION' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'FIRMWARE_VERSION' | translate }}" ng-model="item.version" required />
</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 -->

View File

@@ -0,0 +1,94 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> Delete</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> Edit</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-default" type="button" ui-sref="firmwaresTypeList">{{ 'TYPES' | translate }}</a>
<a class="btn btn-default" ng-disabled="true" type="button" ui-sref="firmwaresVersionList">{{ 'VERSIONS' | translate }}</a>
<a class="btn btn-default" type="button" ui-sref="firmwaresList">{{ 'FIRMWARES' | translate }}</a>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="firmwaresVersionAddEdit">{{ 'ADD_FIRMWARE_VERSION' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'VERSION_ID' | translate }}</th>
<th>{{ 'VERSION' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center col-md-1"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td class="col-md-1">{{item.id}}</td>
<td>{{item.version}}</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,72 @@
<!--
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="resources.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="resources.$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-5">
<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="fpayload.enabled" checked>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SOURCE' | translate }}</label>
<div class="col-sm-10">
<select class="form-control" pf-select data-live-search="true" ng-model="fpayload.source.id" required >
<option value="" ng-hide="true"></option>
<option ng-repeat="res in resources" ng-bind-html="res.displayName | mcResourceRepresentation" value="{{res.id}}" ng-selected="res.id == fpayload.source.id"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'DESTINATION' | translate }}</label>
<div class="col-sm-10">
<select class="form-control" pf-select data-live-search="true" ng-model="fpayload.destination.id" required >
<option value="" ng-hide="true"></option>
<option ng-repeat="res in resources" ng-bind-html="res.displayName | mcResourceRepresentation" value="{{res.id}}" ng-selected="res.id == fpayload.destination.id"></option>
</select>
</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 -->

View File

@@ -0,0 +1,99 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || enable()" class="text-default"><i class="fa fa-lg fa-circle"></i> {{ 'ENABLE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || disable()" class="text-danger"><i class="fa fa-lg fa-circle-thin"></i> {{ 'DISABLE' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="forwardPayloadAddEdit"><i class="fa fa-plus"></i> {{ 'ADD' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'ENABLED' | translate }}</th>
<th>{{ 'SOURCE' | translate }}</th>
<th>{{ 'DESTINATION' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td class="text-center">
<i ng-show="item.enabled" class="text-success fa fa-circle fa-lg" uib-tooltip="{{ 'ENABLED' | translate }}"></i>
<i ng-hide="item.enabled" class="text-danger fa fa-circle-o fa-lg" uib-tooltip="{{ 'DISABLED' | translate }}"></i>
</td>
<td ng-bind-html="item.source.name | mcResourceRepresentation"></td>
<td ng-bind-html="item.destination.name | mcResourceRepresentation"></td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,366 @@
<!--
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="gatewaySerialDrivers.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="gatewaySerialDrivers.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-add-update.html'"></div>
<div>
<form class="form-horizontal" name="mcForm">
<div class="col-md-5">
<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="gateway.enabled" checked>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NAME' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'GATEWAY_NAME' | translate }}" ng-model="gateway.name" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RECONNECT_DELAY' | translate }}({{ 'SECONDS' | translate }})</label>
<div class="col-sm-5">
<input class="form-control" ng-model="gateway.reconnectDelay" placeholder="{{ 'SECONDS' | translate }}" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRANSMIT_DELAY' | translate }}({{ 'MILLISECONDS' | translate }})</label>
<div class="col-sm-5">
<input class="form-control" ng-model="gateway.txDelay" placeholder="{{ 'MILLISECONDS' | translate }}" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ACK_ENABLED' | translate }}</label>
<div class="col-sm-10">
<input class="bootstrap-switch" id="bootstrap-switch-state" type="checkbox" ng-model="gateway.ackEnabled" >
</div>
</div>
<div class="form-group" ng-if="gateway.ackEnabled">
<label class="col-sm-2 control-label">{{ 'STREAM_ACK_ENABLED' | translate }}</label>
<div class="col-sm-10">
<input class="bootstrap-switch" id="bootstrap-switch-state" type="checkbox" ng-model="gateway.streamAckEnabled" >
</div>
</div>
<div class="form-group" ng-if="gateway.ackEnabled">
<label class="col-sm-2 control-label">{{ 'FAILED_RETRY_COUNT' | translate }}</label>
<div class="col-sm-5">
<input class="form-control" ng-model="gateway.failedRetryCount" placeholder="{{ 'FAILED_RETRY_COUNT' | translate }}" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
<div class="form-group" ng-if="gateway.ackEnabled">
<label class="col-sm-2 control-label">{{ 'ACK_WAIT_TIME' | translate }}({{ 'MILLISECONDS' | translate }})</label>
<div class="col-sm-5">
<input class="form-control" ng-model="gateway.ackWaitTime" placeholder="{{ 'MILLISECONDS' | translate }}" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NETWORK_TYPE' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-change="updateGatewayTypes()"
ng-options="gatewayNetworkType.id as gatewayNetworkType.displayName for gatewayNetworkType in gatewayNetworkTypes | orderBy:'displayName'" ng-model="gateway.networkType" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group" ng-if="gateway.networkType">
<label class="col-sm-2 control-label">{{ 'TYPE' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-options="gatewayType.id as gatewayType.displayName for gatewayType in gatewayTypes | orderBy:'displayName'" ng-model="gateway.type" ng-change="updateTypeChange()" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<!-- Serial Gateway -->
<div ng-if="gateway.type === 'Serial'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'DRIVER' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-options="gatewaySerialDriver.id as gatewaySerialDriver.displayName for gatewaySerialDriver in gatewaySerialDrivers" ng-model="gateway.driver" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PORT_NAME' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'SERIAL_PORT_NAME_EXAMPLE' | translate }}" ng-model="gateway.portName" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'BAUD_RATE' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'SERIAL_BAUD_RATE_EXAMPLE' | translate }}" ng-model="gateway.baudRate" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
</div>
<!-- Ethernet Gateway -->
<div ng-if="gateway.type === 'Ethernet'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'HOST_NAME' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'ETHERNET_HOST_NAME_EXAMPLE' | translate }}" ng-model="gateway.host" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PORT' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'ETHERNET_PORT_EXAMPLE' | translate }}" ng-model="gateway.port" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ALIVE_TEST_FREQUENCY' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'ETHERNET_ALIVE_TEST_FREQUENCY_EXAMPLE' | translate }}" ng-model="gateway.aliveFrequency" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
</div>
<!-- MQTT Gateway -->
<div ng-if="gateway.type === 'MQTT'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'QOS' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-model="gateway.qos" convert-to-number required>
<option value="0">{{ 'QOS_0' | translate }}</option>
<option value="1">{{ 'QOS_1' | translate }}</option>
<option value="2">{{ 'QOS_2' | translate }}</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'BROKET_HOST' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'MQTT_BROKER_HOST_EXAMPLE' | translate }}" ng-model="gateway.brokerHost" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'CLIENT_ID' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'MQTT_CLIENT_ID_EXAMPLE' | translate }}" ng-model="gateway.clientId" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TOPIC_PUBLISH' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'MQTT_TOPIC_PUBLISH_EXAMPLE' | translate }}" ng-model="gateway.topicsPublish" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TOPIC_SUBSCRIBE' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'MQTT_TOPIC_SUBSCRIBE_EXAMPLE' | translate }}" ng-model="gateway.topicsSubscribe" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'USERNAME' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'USERNAME' | translate }}" ng-model="gateway.username"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PASSWORD' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'PASSWORD' | translate }}" ng-model="gateway.password"/>
</div>
</div>
</div>
<!-- Sparkfun [phant.io] Gateway -->
<div ng-if="gateway.type === 'Sparkfun [phant.io]'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'URL' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'URL' | translate }}" ng-model="gateway.url" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRUST_HOST' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-options="type.id as type.displayName for type in trustHostTypes | orderBy:'displayName'" ng-model="gateway.trustHostType" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PUBLIC_KEY' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'PUBLIC_KEY' | translate }}" ng-model="gateway.publicKey" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PRIVATE_KEY' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'PRIVATE_KEY' | translate }}" ng-model="gateway.privateKey" pf-validation="cs.isContainsSpace(input)" />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'POLL_FREQUENCY_MINUTES' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'POLL_FREQUENCY_MINUTES' | translate }}" ng-model="gateway.pollFrequency" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RECORDS_LIMIT' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'RECORDS_LIMIT' | translate }}" ng-model="gateway.recordsLimit" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
</div>
<!-- Philips Hue Gateway -->
<div ng-if="gateway.type === 'Hue bridge'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'URL' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'URL' | translate }}" ng-model="gateway.url" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'AUTORIZED_USER' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'AUTORIZED_USER' | translate }}" ng-model="gateway.authorizedUser" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'POLL_FREQUENCY_MINUTES' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'POLL_FREQUENCY_MINUTES' | translate }}" ng-model="gateway.pollFrequency" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
</div>
<!-- Weather Underground Gateway -->
<div ng-if="gateway.type === 'Weather Underground'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRUST_HOST' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-options="type.id as type.displayName for type in trustHostTypes | orderBy:'displayName'" ng-model="gateway.trustHostType" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'MERGE_STATIONS' | translate }}</label>
<div class="col-sm-10">
<input class="bootstrap-switch" id="bootstrap-switch-state" type="checkbox" ng-model="gateway.mergeAllStations">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'KEY' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'KEY' | translate }}" ng-model="gateway.apiKey" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'LOCATION' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'LOCATION' | translate }}" ng-model="gateway.location" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'LOCATION_IP' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'LOCATION_IP' | translate }}" ng-model="gateway.geoIp" pf-validation="cs.isContainsSpace(input)" />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'POLL_FREQUENCY_MINUTES' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'POLL_FREQUENCY_MINUTES' | translate }}" ng-model="gateway.pollFrequency" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
</div>
<!-- Include save form buttons -->
<div ng-include src="'partials/common-html/save-form.html'"></div>
</div>
</form>
</div>
</div> <!-- Main Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,114 @@
<!--
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">
<!-- Loading icon disaplay -->
<div ng-hide="resourceCount.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="resourceCount.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class=" container-fluid row"><!-- row1 -->
<div class="row-cards-pf ">
<div class="col-xs-6 col-sm-6 col-lg-6">
<div class="card-pf card-pf-utilization card-pf-accented">
<div class="card-pf-heading">
<h2 class="card-pf-title">{{ 'DETAILS' | translate }} <a class="btn btn-link pull-right" ui-sref="gatewaysAddEdit({ id: item.id })"><i class="fa fa-edit"></i> {{ 'EDIT' | translate }} </a></h2>
</div>
<div class="card-pf-body">
<dl class="dl-horizontal">
<dt>{{ 'NAME' | translate }}</dt> <dd>{{item.name}}</dd>
<dt>{{ 'ENABLED' | translate }}</dt> <dd>{{item.enabled? 'ENABLED' : 'DISABLED' | translate }}</dd>
<dt>{{ 'TRANSMIT_DELAY' | translate }}</dt><dd>{{item.txDelay}} {{ 'MILLISECONDS_SHORT' | translate }}</dd>
<dt>{{ 'ACK_ENABLED' | translate }}</dt> <dd>{{item.ackEnabled? 'ENABLED' : 'DISABLED' | translate }}</dd>
<span ng-if="item.ackEnabled">
<dt>{{ 'STREAM_ACK_ENABLED' | translate }}</dt> <dd>{{item.streamAckEnabled? 'ENABLED' : 'DISABLED' | translate }}</dd>
<dt>{{ 'FAILED_RETRY_COUNT' | translate }}</dt><dd>{{item.failedRetryCount}}</dd>
<dt>{{ 'ACK_WAIT_TIME' | translate }}</dt><dd>{{item.ackWaitTime}} {{ 'MILLISECONDS_SHORT' | translate }}</dd>
</span>
<dt>{{ 'TYPE' | translate }}</dt> <dd>{{item.type}}</dd>
<dt>{{ 'NETWORK_TYPE' | translate }}</dt> <dd>{{item.networkType}}</dd>
<dt>{{ 'CONNECTION_DETAILS' | translate }}</dt> <dd>{{item.connectionDetails}}</dd>
<dt>{{ 'STATUS' | translate }}</dt>
<dd>
<span class="card-pf-aggregate-status-notification">
<span ng-show="item.state.toLowerCase() === 'up'">
{{ 'UP' | translate }} <i class="fa fa-arrow-circle-o-up text-color-green fa-lg"></i>
</span>
<span ng-show="item.state.toLowerCase() === 'down'">
{{ 'DOWN' | translate }} <i class="fa fa-arrow-circle-o-down text-color-red fa-lg"></i>
</span>
<span ng-show="item.state.toLowerCase() === 'unavailable'">
{{ 'UNAVAILABLE' | translate }} <i class="fa fa-question-circle text-color-gray fa-lg"></i>
</span>
</span>
</dd>
<dt>{{ 'STATUS_SINCE' | translate }}</dt> <dd><span uib-tooltip="{{item.statusSince | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="right" am-time-ago="item.statusSince"></span></dd>
<dt>{{ 'STATUS_MESSAGE' | translate }}</dt> <dd>{{item.statusMessage}}</dd>
<dt>{{ 'TOPOLOGY' | translate }}</dt> <dd><a class="mc-inline-editer-ab" ui-sref="dashboardTopology({ resourceType: 'Gateway', resourceId: item.id})"><span class="pficon pficon-topology mc-icon-lg"></span></a></dd>
<legend><small>{{ 'RESOURCES' | translate }}</small></legend>
<dt><span class="fa fa-sitemap mc-icon-md-3"></span>{{ 'NODES' | translate }}</dt>
<dd>
<a class="mc-inline-editer-ab" ng-if="resourceCount.nodes > 0" ui-sref="nodesList({ gatewayId: item.id})">{{resourceCount.nodes}}</a>
<span ng-if="resourceCount.nodes == 0">{{resourceCount.nodes}}</span>
</dd>
<dt><span class="fa fa-eye mc-icon-md-3"></span>{{ 'SENSORS' | translate }}</dt>
<dd>
<span>{{resourceCount.sensors}}</span>
</dd>
<dt><span class="pficon pficon-replicator mc-icon-md-3"></span>{{ 'RESOURCES_GROUPS' | translate }}</dt>
<dd>
<a class="mc-inline-editer-ab" ng-if="resourceCount.resourcesGroups > 0" ui-sref="resourcesGroupList({ resourceType:resourceCount.resourceType, resourceId: resourceCount.resourceId})">{{resourceCount.resourcesGroups}}</a>
<span ng-if="resourceCount.resourcesGroups == 0">{{resourceCount.resourcesGroups}}</span>
</dd>
</dl>
</div>
</div>
</div>
<div class="col-xs-6 col-sm-6 col-lg-6">
<div class="card-pf card-pf-utilization card-pf-accented">
<div class="card-pf-heading">
<h2 class="card-pf-title">{{ 'STATISTICS' | translate }}</h2>
</div>
<div class="card-pf-body">
<dl class="dl-horizontal">
<dt>{{ 'AVERAGE_TIME' | translate }}</dt> <dd>{{statistics.timeAverage | number: 2}} {{ 'MILLISECONDS_SHORT' | translate }}</dd>
<dt>{{ 'LAST_MINUTE_AVERAGE' | translate }}</dt> <dd>{{statistics.timeAverageLastMinute | number: 2}} {{ 'MILLISECONDS_SHORT' | translate }}</dd>
<dt>{{ 'LAST_MESSAGE' | translate }}</dt> <dd>{{statistics.timeLastMessage}} {{ 'MILLISECONDS_SHORT' | translate }} <span ng-if="statistics.timestamp != 0">| </span><span uib-tooltip="{{item.statusSince | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="right" am-time-ago="statistics.timestamp"></span></dd>
<dt>{{ 'LAST_MINUTE_RATE' | translate }}</dt> <dd>{{statistics.countLastMinute}}</dd>
<dt>{{ 'COUNT' | translate }} ({{ 'TOTAL' | translate }} | Tx)</dt><dd>{{statistics.count}} | {{statistics.txCount}}</dd>
<dt>{{ 'FAILURE_COUNT' | translate }}</dt><dd>{{statistics.countFailure}} | {{statistics.percentageFailure | number: 2}}%</dd>
<dt>{{ 'MESSAGES_IN_QUEUE' | translate }}</dt> <dd>{{statistics.sizeQueue}}</dd>
</dl>
</div>
</div>
</div>
</div>
</div><!-- /row1 -->
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,118 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || enable()" class="text-default"><i class="fa fa-lg fa-circle"></i> {{ 'ENABLE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || disable()" class="text-danger"><i class="fa fa-lg fa-circle-thin"></i> {{ 'DISABLE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || reload()" class="text-danger"><i class="fa fa-lg fa-retweet"></i> {{ 'RELOAD' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || discover()" class="text-default"><i class="fa fa-lg fa-search"></i> {{ 'DISCOVER' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || refreshNodesInfo()" class="text-default"><i class="fa fa-lg fa-refresh"></i> {{ 'REFRESH_NODES_INFO' | translate }}</a></li>
</ul>
</div>
</div>
<div ng-show="mchelper.user.permission === 'Super admin'" class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="gatewaysAddEdit"><i class="fa fa-plus"></i> {{ 'ADD' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'ENABLED' | translate }}</th>
<th>{{ 'NAME' | translate }}</th>
<th>{{ 'TYPE' | translate }}</th>
<th>{{ 'NETWORK_TYPE' | translate }}</th>
<th>{{ 'CONNECTION_DETAILS' | translate }}</th>
<th>{{ 'STATUS' | translate }}</th>
<th>{{ 'STATUS_SINCE' | translate }}</th>
<th>{{ 'STATUS_MESSAGE' | translate }}</th>
<th></th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td class="text-center">
<i ng-show="item.enabled" class="text-success fa fa-circle fa-lg" uib-tooltip="{{ 'ENABLED' | translate }}"></i>
<i ng-hide="item.enabled" class="text-danger fa fa-circle-o fa-lg" uib-tooltip="{{ 'DISABLED' | translate }}"></i>
</td>
<td>{{item.name}}</td>
<td>{{item.type}}</td>
<td>{{item.networkType}}</td>
<td>{{item.connectionDetails}}</td>
<td class="text-center">
<i uib-tooltip="{{ 'DOWN' | translate }}" ng-show="item.state == 'Down'" class="pficon pficon-error-circle-o fa-lg"></i>
<i uib-tooltip="{{ 'UNAVAILABLE' | translate }}" ng-show="item.state == 'Unavailable'" class="pficon pficon-help text-color-gray fa-lg"></i>
<i uib-tooltip="{{ 'UP' | translate }}" ng-show="item.state == 'Up'" class="pficon pficon-ok fa-lg"></i>
</td>
<td><span uib-tooltip="{{item.statusSince | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="left" am-time-ago="item.statusSince"></span></td>
<td>{{item.statusMessage}}</td>
<td class="mc-align-center">
<a class="btn btn-link" ui-sref="gatewaysDetail({'id':item.id})"><i class="fa fa-chevron-circle-right fa-lg" tooltip="{{ 'VIEW_DETAILS' | translate }}" tooltip-trigger tooltip-placement="top"></i></a>
</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,122 @@
<!--
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="firmwares.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-if="firmwares.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-add-update.html'"></div>
<div>
<form class="form-horizontal" name="mcForm">
<div class="col-md-5">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'GATEWAY' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-model="node.gateway.id" ng-disabled="node.id" required >
<option value="" ng-hide="true"></option>
<option ng-repeat="gateway in gateways | orderBy:'displayName'" ng-bind-html="gateway.displayName | mcResourceRepresentation" value="{{gateway.id}}" ng-selected="gateway.id == node.gateway.id"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TYPE' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-options="nodeType.id as nodeType.displayName for nodeType in nodeTypes | orderBy:'displayName'" ng-model="node.type">
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SMART_SLEEP_ENABLED' | translate }}</label>
<div class="col-sm-10">
<input class="bootstrap-switch" id="bootstrap-switch-state" type="checkbox" ng-model="node.smartSleepEnabled" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NAME' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" ng-model="node.name" placeholder="{{ 'NODE_NAME' | translate }}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'REGISTRATION_STATUS' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-options="nodeRstatus.id as nodeRstatus.displayName for nodeRstatus in nodeRstatuses | orderBy:'displayName'" ng-model="node.registrationState">
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'EUI' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" ng-model="node.eui" placeholder="{{ 'EUI' | translate }}" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'VERSION' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" ng-model="node.version" placeholder="{{ 'VERSION' | translate }}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'LIBRARY_VERSION' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" ng-model="node.libVersion" placeholder="{{ 'LIBRARY_VERSION' | translate }}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'FIRMWARE' | translate }}</label>
<div class="col-sm-10">
<select class="form-control" pf-select data-live-search="true" ng-options="firmware.id as firmware.displayName for firmware in firmwares | orderBy:'displayName'" ng-model="node.firmware.id">
<option value="" ng-hide="false">{{ 'NOTHING_SELECTED' | translate }}</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PROPERTIES' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'PROPERTIES' | translate }}" ng-model="node.altproperties" pf-validation="cs.isJsonString(input)" required />
<span class="help-block">{{ 'SYNTAX_ERROR' | translate }}</span>
</div>
</div>
<!-- Include save form buttons -->
<div ng-include src="'partials/common-html/save-form.html'"></div>
</div>
</form>
</div>
</div> <!-- Main Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,146 @@
<!--
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">
<!-- Loading icon disaplay -->
<div ng-hide="resourceCount.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="resourceCount.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="container-cards-pf"><!-- row -->
<div class="row row-cards-pf"> <!-- row-details -->
<div class="col-xs-5 col-sm-5 col-md-4 col-lg-4">
<div class="card-pf card-pf-utilization card-pf-accented" style="min-height:488px">
<div class="card-pf-heading">
<h2 class="card-pf-title">{{ 'DETAILS' | translate }} <a class="btn btn-link pull-right" ui-sref="nodesAddEdit({ id: item.id })"><i class="fa fa-edit"></i> {{ 'EDIT' | translate }} </a></h2>
</div>
<div class="card-pf-body">
<dl class="dl-horizontal">
<dt>{{ 'NAME' | translate }}</dt> <dd>{{item.name}}</dd>
<dt>{{ 'REGISTRATION_STATUS' | translate }}</dt> <dd>{{item.registrationState}}</dd>
<dt>{{ 'EUI' | translate }}</dt> <dd>{{item.eui}}</dd>
<dt>{{ 'PARENT_NODE_EUI' | translate }}</dt> <dd>{{item.parentNodeEui}}</dd>
<dt>{{ 'TYPE' | translate }}</dt> <dd>{{item.type}}</dd>
<dt>{{ 'GATEWAY_NAME' | translate }}</dt> <dd>{{item.gateway.name}}</dd>
<dt>{{ 'GATEWAY_TYPE' | translate }}</dt> <dd>{{item.gateway.type}}</dd>
<dt>{{ 'NETWORK' | translate }}</dt> <dd>{{item.gateway.networkType}}</dd>
<dt>{{ 'RSSI' | translate }}</dt> <dd>{{item.rssi}}</dd>
<dt>{{ 'LIBRARY_VERSION' | translate }}</dt> <dd>{{item.libVersion}}</dd>
<dt>{{ 'VERSION' | translate }}</dt> <dd>{{item.version}}</dd>
<dt>{{ 'STATUS' | translate }}</dt>
<dd>
<span class="card-pf-aggregate-status-notification">
<span ng-show="item.state.toLowerCase() === 'up'">
{{ 'UP' | translate }} <i class="fa fa-arrow-circle-o-up text-color-green fa-lg"></i>
</span>
<span ng-show="item.state.toLowerCase() === 'down'">
{{ 'DOWN' | translate }} <i class="fa fa-arrow-circle-o-down text-color-red fa-lg"></i>
</span>
<span ng-show="item.state.toLowerCase() === 'unavailable'">
{{ 'UNAVAILABLE' | translate }} <i class="fa fa-question-circle text-color-gray fa-lg"></i>
</span>
</span>
</dd>
<dt>{{ 'BATTERY' | translate }}</dt>
<dd>
<span ng-show="item.batteryLevel"><i class="fa fa-lg fa-battery-{{(item.batteryLevel/22) >= 4 ? 4 : (item.batteryLevel/22) | number:0}}"></i> {{item.batteryLevel}} %</span>
<span ng-hide="item.batteryLevel">-</span>
</dd>
<dt>{{ 'FIRMWARE' | translate }}</dt> <dd>{{item.firmware.firmwareName}}</dd>
<dt>{{ 'LAST_SEEN' | translate }}</dt> <dd><span uib-tooltip="{{item.lastSeen | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="right" am-time-ago="item.lastSeen"></span></dd>
<dt>{{ 'TOPOLOGY' | translate }}</dt> <dd><a class="mc-inline-editer-ab" ui-sref="dashboardTopology({ resourceType: 'Node', resourceId: item.id})"><span class="pficon pficon-topology mc-icon-lg"></span></a></dd>
<!-- Firmware status -->
<div ng-if="item.properties.fwBksTotal">
<legend><small>{{ 'FIRMWARE_OTA_STATUS' | translate }}</small></legend>
<dt>{{ 'BLOCKS_SENT' | translate }}</dt> <dd>{{item.properties.fwBksSent}} of {{item.properties.fwBksTotal}} ({{(item.properties.fwBksSent / item.properties.fwBksTotal) * 100 | number: 0}}%)</dd>
<dt>{{ 'TIME_TAKEN_LAST_UPDATE' | translate }}</dt> <dd><span ng-if="item.properties.fwOpLastDuration">{{(item.properties.fwOpLastDuration / 1000) | number: 0}} {{ 'SECONDS' | translate }}</span></dd>
</div>
<!-- Resources -->
<legend><small>{{ 'RESOURCES' | translate }}</small></legend>
<dt><span class="fa fa-eye mc-icon-md-3"></span>Sensors</dt>
<dd>
<a class="mc-inline-editer-ab" ng-if="resourceCount.sensors > 0" ui-sref="sensorsList({ nodeId: item.id})">{{resourceCount.sensors}}</a>
<span ng-if="resourceCount.sensors == 0">{{resourceCount.sensors}}</span>
</dd>
<dt><span class="pficon pficon-replicator mc-icon-md-3"></span>{{ 'RESOURCES_GROUPS' | translate }}</dt>
<dd>
<a class="mc-inline-editer-ab" ng-if="resourceCount.resourcesGroups > 0" ui-sref="resourcesGroupList({ resourceType:resourceCount.resourceType, resourceId: resourceCount.resourceId})">{{resourceCount.resourcesGroups}}</a>
<span ng-if="resourceCount.resourcesGroups == 0">{{resourceCount.resourcesGroups}}</span>
</dd>
<!-- Properties -->
<legend><small>{{ 'PROPERTIES' | translate }}</small></legend>
<span ng-repeat="(key, value) in item.properties"><dt>{{ key}}</dt> <dd>{{value}}</dd></span>
</dl>
</div>
</div>
</div>
<!-- custom buttons -->
<div class="col-xs-7 col-sm-7 col-md-8 col-lg-8">
<div class="card-pf card-pf-accented" style="min-height:350px">
<div class="card-pf-heading">
<div ng-if="item.batteryLevel" class="dropdown card-pf-time-frame-filter">
<input bs-switch ng-change="updateChart()" ng-model="$parent.chartEnableMinMax" type="checkbox"
switch-animate="true" switch-off-color="default" switch-on-color="primary" switch-size="" switch-label-width="70px"
switch-label="{{ 'MIN_MAX' | translate }}" ng-true-value="true" ng-false-value="false" switch-on-text="{{ 'ENABLED' | translate }}" switch-off-text="{{ 'DISABLED' | translate }}" >
<select pf-select ng-model="$parent.chartFromTimestamp" ng-change="updateChart()">
<option value="" ng-hide="true"></option>
<option value="300000">{{ 'LAST_5_MINUTES' | translate }}</option>
<option value="3600000">{{ 'LAST_HOUR' | translate }}</option>
<option value="21600000">{{ 'LAST_6_HOURS' | translate }}</option>
<option value="43200000">{{ 'LAST_12_HOURS' | translate }}</option>
<option value="86400000">{{ 'LAST_DAY' | translate }}</option>
<option value="604800000">{{ 'LAST_WEEK' | translate }}</option>
<option value="2419200000">{{ 'LAST_MONTH' | translate }}</option>
<option value="31536000000">{{ 'LAST_YEAR' | translate }}</option>
<option value="0" ng-hide="true">{{ 'CUSTOM' | translate }}</option>
</select>
</div>
<h2 class="card-pf-title"><i class="fa fa-battery-full"></i> {{ 'BATTERY_USAGE' | translate }}</h2>
</div>
<div class="card-pf-body">
<div class="blank-slate-pf" ng-if="!item.batteryLevel">
<div class="blank-slate-pf-icon">
<i class="fa fa-exclamation-triangle"></i>
</div>
<h1>{{ 'DATA_UNAVAILABLE' | translate }}</h1>
</div>
<div ng-show="item.batteryLevel">
<nvd3 options='chartOptions' data="batteryChartData.chartData" id="fetching"></nvd3>
</div>
</div>
</div>
</div>
</div><!-- /row -->
</div><!-- /container -->
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,36 @@
<!--
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>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="cancel()">
<span class="pficon pficon-close"></span>
</button>
<div class="modal-title"><b>{{header}}</b></div>
</div>
<div class="modal-body modal-body-text-only">
<small ng-bind-html="eraseMsg"></small>
</div>
<div class="modal-footer">
<button class="btn btn-default" ng-click="cancel()"><i class="fa fa-close"></i> {{ 'CANCEL' | translate }}</button>
<button class="btn btn-primary" ng-click="eraseNodeConfiguration()"><i class="fa fa-eraser"></i> {{ 'ERASE_CONFIGURATION' | translate }}</button>
</div>
</div>

View File

@@ -0,0 +1,36 @@
<!--
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>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="cancel()">
<span class="pficon pficon-close"></span>
</button>
<div class="modal-title"><b>{{header}}</b></div>
</div>
<div class="modal-body modal-body-text-only">
<small ng-bind-html="rebootMsg"></small>
</div>
<div class="modal-footer">
<button class="btn btn-default" ng-click="cancel()"><i class="fa fa-close"></i> {{ 'CANCEL' | translate }}</button>
<button class="btn btn-primary" ng-click="reboot()"><i class="fa fa-undo"></i> {{ 'REBOOT' | translate }}</button>
</div>
</div>

View File

@@ -0,0 +1,128 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || eraseConfiguration()" class="text-default"><i class="fa fa-lg fa-eraser"></i> {{ 'ERASE_CONFIGURATION' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || reboot()" class="text-default"><i class="fa fa-lg fa-undo"></i> {{ 'REBOOT' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || uploadFirmware()" class="text-default"><i class="fa fa-lg fa-upload"></i> {{ 'UPLOAD_FIRMWARE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || refreshNodesInfo()" class="text-default"><i class="fa fa-lg fa-refresh"></i> {{ 'REFRESH_NODES_INFO' | translate }}</a></li>
</ul>
</div>
</div>
<div ng-show="mchelper.user.permission === 'Super admin'" class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="nodesAddEdit"><i class="fa fa-plus"></i> {{ 'ADD' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="exampleSimpleSort" config="sortConfig"></div>
</div>
<div pf-filter id="nodesFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'STATUS' | translate }}</th>
<th>{{ 'GATEWAY' | translate }}</th>
<th>{{ 'NETWORK' | translate }}</th>
<th>{{ 'REGISTRATION_STATUS' | translate }}</th>
<th>{{ 'EUI' | translate }}</th>
<th>{{ 'NAME' | translate }}</th>
<th>{{ 'TYPE' | translate }}</th>
<th>{{ 'RSSI' | translate }}</th>
<th>{{ 'BATTERY_LEVEL' | translate }}</th>
<th>{{ 'LIBRARY_VERSION' | translate }}</th>
<th>{{ 'VERSION' | translate }}</th>
<th>{{ 'FIRMWARE' | translate }}</th>
<th>{{ 'LAST_SEEN' | translate }}</th>
<th></th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.filteredCount" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td class="text-center">
<i ng-show="item.state.toLowerCase() === 'unavailable'" class="pficon pficon-help text-color-gray fa-lg" uib-tooltip="{{ 'UNAVAILABLE' | translate }}"></i>
<i ng-show="item.state.toLowerCase() === 'down'" class="pficon pficon-error-circle-o fa-lg" uib-tooltip="{{ 'DOWN' | translate }}"></i>
<i ng-show="item.state.toLowerCase() === 'up'" class="pficon pficon-ok fa-lg" uib-tooltip="{{ 'UP' | translate }}"></i>
</td>
<td>{{item.gateway.name}} [{{item.gateway.type}}]</td>
<td>{{item.gateway.networkType}}</td>
<td>{{item.registrationState}}</td>
<td>{{item.eui}}</td>
<td>{{item.name}}</td>
<td>{{item.type}}</td>
<td>{{item.rssi}}</td>
<td>
<span ng-show="item.batteryLevel"><i class="fa fa-lg fa-battery-{{(item.batteryLevel/22) >= 4 ? 4 : (item.batteryLevel/22) | number:0}}"></i> {{item.batteryLevel}} %</span>
<label ng-hide="item.batteryLevel">-</label>
</td>
<td>{{item.libVersion}}</td>
<td>{{item.version}}</td>
<td>{{item.firmware.firmwareName}}</td>
<td><span uib-tooltip="{{item.lastSeen | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="left" am-time-ago="item.lastSeen"></span></td>
<td class="mc-align-center">
<a class="btn btn-link" ui-sref="nodesDetail({id:item.id})"><i class="fa fa-chevron-circle-right fa-lg" tooltip="{{ 'VIEW_DETAILS' | translate }}" tooltip-placement="top"></i></a>
</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,259 @@
<!--
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="operationTypes.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-if="operationTypes.$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-7">
<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="{{ 'OPERATION_NAME' | translate }}" ng-model="item.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="item.enabled" checked>
</div>
</div>
<legend><small>{{ 'OPERATION' | translate }}</small></legend>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TYPE' | translate }}</label>
<div class="col-sm-4 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="nt.displayName as nt.displayName for nt in operationTypes | orderBy : 'id'" ng-model="item.type" required>
<option value="" ng-hide="true"></option>
</select>
</div>
<!-- Execute script Operation -->
<div class="col-sm-6 mc-form-fixer" ng-if="item.type === 'Execute script'">
<select class="form-control" pf-select ng-options="rT as rT for rT in scriptsList" ng-model="item.scriptFile" required>
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div ng-if="item.type === 'Execute script' && item.scriptFile">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SCRIPT_BINDINGS' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<input class="form-control" placeholder="{{ 'SCRIPT_BINDINGS' | translate }}" ng-model="item.altScriptBindings" pf-validation="cs.isJsonString(input)" required />
<span class="help-block">{{ 'SYNTAX_ERROR' | translate }}</span>
</div>
</div>
</div>
<!-- email Operation -->
<div ng-if="item.type === 'Send email'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SUBJECT' | translate }}</label>
<div class="col-sm-10 ">
<input class="form-control" placeholder="{{ 'SUBJECT' | translate }}" ng-model="item.emailSubject" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'EMAILS' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" placeholder="{{ 'EMAIL_ADDRESSES_COMMA_SEPARATED' | translate }}" ng-model="item.toEmailAddresses" rows="4" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TEMPLATE' | translate }}</label>
<div class="col-sm-10">
<select class="form-control" pf-select ng-options="rT as rT for rT in templatesList" ng-model="item.template" required>
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TEMPLATE_BINDINGS' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'TEMPLATE_BINDINGS' | translate }}" ng-model="item.altTemplateBindings" pf-validation="cs.isJsonString(input)" required />
<span class="help-block">{{ 'SYNTAX_ERROR' | translate }}</span>
</div>
</div>
</div>
<!-- SMS Operation -->
<div ng-if="item.type === 'Send SMS'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PHONE_NUMBERS' | translate }}</label>
<div class="col-sm-10 ">
<input class="form-control" placeholder="{{ 'PHONE_NUMBERS_COMMA_SEPARATED' | translate }}" ng-model="item.toPhoneNumbers" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'CUSTOM_MESSAGE' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" placeholder="{{ 'CUSTOM_MESSAGE' | translate }}" ng-model="item.customMessage" rows="4"/>
</div>
</div>
</div>
<!-- TelegramBot Operation -->
<div ng-if="item.type === 'Send telegram bot message'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'CHANNEL_USERNAME' | translate }}</label>
<div class="col-sm-10 ">
<input class="form-control" placeholder="{{ 'CHANNEL_USERNAME' | translate }}" ng-model="item.chatId" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PARSE_MODE' | translate }}</label>
<div class="col-sm-10">
<select pf-select ng-model="item.parseMode">
<option value="" ng-hide="true"></option>
<option value="Text">{{ 'TEXT' | translate }}</option>
<option value="HTML">{{ 'HTML' | translate }}</option>
<option value="Markdown">{{ 'MARKDOWN' | translate }}</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'CUSTOM_MESSAGE' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" placeholder="{{ 'CUSTOM_MESSAGE' | translate }}" ng-model="item.customMessage" rows="4"/>
</div>
</div>
</div>
<!-- Pushbullet Operation -->
<div ng-if="item.type === 'Send pushbullet note'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'DEVICE_IDENS' | translate }}</label>
<div class="col-sm-10 ">
<input class="form-control" placeholder="{{ 'DEVICE_IDENS_COMMA_SEPARATED' | translate }}" ng-model="item.idens" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'EMAILS' | translate }}</label>
<div class="col-sm-10 ">
<input class="form-control" placeholder="{{ 'EMAIL_ADDRESSES_COMMA_SEPARATED' | translate }}" ng-model="item.emails" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'CHANNEL_TAGS' | translate }}</label>
<div class="col-sm-10 ">
<input class="form-control" placeholder="{{ 'CHANNEL_TAGS_COMMA_SEPARATED' | translate }}" ng-model="item.channelTags" />
</div>
</div>
<legend></legend>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TITLE' | translate }}</label>
<div class="col-sm-10 ">
<input class="form-control" placeholder="{{ 'TITLE' | translate }}" ng-model="item.title" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'CUSTOM_MESSAGE' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" placeholder="{{ 'CUSTOM_MESSAGE' | translate }}" ng-model="item.body" rows="4"/>
</div>
</div>
</div>
<!-- Send payload Operation -->
<div ng-if="item.type === 'Send payload'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RESOURCE' | translate }}</label>
<div class="col-sm-4 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="rT.displayName as rT.displayName for rT in spResourceTypes | orderBy : 'id'"
ng-change="plResourcesList = getResources(item.resourceType);updatePayloadOperations(item.resourceType);" ng-model="item.resourceType" required>
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-6 mc-form-fixer" ng-hide="item.resourceType === ''"><!-- List Resource -->
<select class="form-control" pf-select data-live-search="true" ng-model="item.resourceId" required>
<option value="" ng-hide="true"></option>
<option ng-repeat="res in plResourcesList" ng-bind-html="res.displayName | mcResourceRepresentation" value="{{res.id}}" ng-selected="res.id == item.resourceId"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PAYLOAD_DELAY' | translate }}</label>
<div class="col-sm-4 mc-form-fixer-left" ng-if="item.resourceType === 'Sensor variable'">
<input class="form-control" placeholder="{{ 'PAYLOAD' | translate }}" ng-model="item.payload" required />
</div>
<div class="col-sm-4 mc-form-fixer-left" ng-if="item.resourceType !== 'Sensor variable'">
<select class="form-control" pf-select ng-options="pos.id as pos.displayName for pos in payloadOperations" ng-model="item.payload" required>
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-6 mc-form-fixer">
<input class="form-control" placeholder="{{ 'DELAY_TIME_IN_SECONDS' | translate }}" ng-model="item.dt" pf-validation="cs.isNumber(input)" />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
</div>
<!-- Request payload Operation -->
<div ng-if="item.type === 'Request payload'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RESOURCE' | translate }}</label>
<div class="col-sm-4 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="rT.displayName as rT.displayName for rT in reqPlResourceTypes"
ng-change="plResourcesList = getResources(item.resourceType);updatePayloadOperations(item.resourceType);" ng-model="item.resourceType" required>
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-6 mc-form-fixer" ng-hide="item.resourceType === ''"><!-- List Resource -->
<select class="form-control" pf-select data-live-search="true" ng-model="item.resourceId" required>
<option value="" ng-hide="true"></option>
<option ng-repeat="res in plResourcesList" ng-bind-html="res.displayName | mcResourceRepresentation" value="{{res.id}}" ng-selected="res.id == item.resourceId"></option>
</select>
</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 -->

View File

@@ -0,0 +1,102 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || clone()" class="text-default"><i class="fa fa-lg fa-files-o"></i> {{ 'CLONE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || enable()" class="text-default"><i class="fa fa-lg fa-circle"></i> {{ 'ENABLE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || disable()" class="text-danger"><i class="fa fa-lg fa-circle-thin"></i> {{ 'DISABLE' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="operationsAddEdit"><i class="fa fa-plus"></i> {{ 'ADD' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'ENABLED' | translate }}</th>
<th>{{ 'NAME' | translate }}</th>
<th>{{ 'OPERATION' | translate }}</th>
<th>{{ 'LAST_EXECUTION' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td class="text-center">
<i ng-if="item.enabled" class="text-success fa fa-circle fa-lg" uib-tooltip="{{ 'ENABLED' | translate }}"></i>
<i ng-if="!item.enabled" class="text-danger fa fa-circle-o fa-lg" uib-tooltip="{{ 'DISABLED' | translate }}"></i>
</td>
<td>{{item.name}}</td>
<td ng-bind-html="item.operationString | mcResourceRepresentation"></td>
<td>
<span uib-tooltip="{{item.lastExecution | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="left" am-time-ago="item.lastExecution"></span>
</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,85 @@
<!--
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-if="!resourceTypes.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-if="resourceTypes.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-add-update.html'"></div>
<div>
<form class="form-horizontal" name="mcForm">
<div class="col-md-6">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ENABLED' | translate }}</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="item.enabled" checked>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RESOURCE' | translate }}</label>
<div class="col-sm-4 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="rT.displayName as rT.displayName for rT in resourceTypes"
ng-change="resourcesList = getResources(item.resourceType);item.resourceId=''" ng-model="item.resourceType" required>
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-6 mc-form-fixer" ng-hide="item.resourceType === ''"><!-- List Resource -->
<select class="form-control" pf-select data-live-search="true" ng-model="item.resourceId" required>
<option value="" ng-hide="true"></option>
<option ng-repeat="res in resourcesList" ng-bind-html="res.displayName | mcResourceRepresentation" value="{{res.id}}" ng-selected="res.id == item.resourceId"></option>
</select>
</div>
</div>
<legend><small>{{ 'EXTERNAL_SERVERS' | 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="es.id as es.displayName for es in externalServers" multiple
ng-model="item.externalServers" 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 Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,98 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || enable()" class="text-default"><i class="fa fa-lg fa-circle"></i> {{ 'ENABLE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || disable()" class="text-danger"><i class="fa fa-lg fa-circle-thin"></i> {{ 'DISABLE' | translate }}</a></li>
</ul>
</div>
</div>
<div ng-show="mchelper.user.permission === 'Super admin'" class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="resourcesDataAddEdit">{{ 'ADD_RESOURCE' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="exampleSimpleSort" config="sortConfig"></div>
</div>
<div pf-filter id="externalServersFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'ENABLED' | translate }}</th>
<th>{{ 'RESOURCE' | translate }}</th>
<th>{{ 'EXTERNAL_SERVERS' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td class="text-center">
<i ng-show="item.enabled" class="text-success fa fa-circle fa-lg" uib-tooltip="{{ 'ENABLED' | translate }}"></i>
<i ng-hide="item.enabled" class="text-danger fa fa-circle-o fa-lg" uib-tooltip="{{ 'DISABLED' | translate }}"></i>
</td>
<td ng-bind-html="item.resourceName | mcResourceRepresentation"></td>
<td>{{item.externalServersList.join(', ')}}</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,56 @@
<!--
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="group.$resolved || !$scope.id">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="group.$resolved || !$scope.id"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-add-update.html'"></div>
<div>
<form class="form-horizontal" name="mcForm">
<div class="col-md-5">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NAME' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" ng-model="group.name" placeholder="{{ 'GROUP_NAME' | translate }}" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'DESCRIPTION' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" ng-model="group.description" placeholder="{{ 'DESCRIPTION' | translate }}" rows="5"></textarea>
</div>
</div>
<!-- Include save form buttons -->
<div ng-include src="'partials/common-html/save-form.html'"></div>
</div>
</form>
</div>
</div> <!-- Main Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,108 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || turnOn()" class="text-default"><i class="fa fa-lg fa-toggle-on"></i> {{ 'TURN_ON' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || turnOff()" class="text-default"><i class="fa fa-lg fa-toggle-off"></i> {{ 'TURN_OFF' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="resourcesGroupAddEdit"><i class="fa fa-plus"></i> {{ 'ADD' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'STATUS' | translate }}</th>
<th>{{ 'NAME' | translate }}</th>
<th>{{ 'DESCRIPTION' | translate }}</th>
<th>{{ 'STATUS_SINCE' | translate }}</th>
<th></th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td class="text-center col-sm-1">
<input bs-switch ng-change="changeMystate(item, state)" ng-init="state = item.state === 'On'? true:false" ng-model="state" type="checkbox"
switch-animate="true" switch-handle-width="35px" switch-label-width="7px"
switch-off-color="default" switch-on-color="primary" switch-size="small"
ng-true-value="true" ng-false-value="false" switch-on-text="{{ 'ON' | translate }}" switch-off-text="{{ 'OFF' | translate }}" >
</td>
<td>{{item.name}}</td>
<td>{{item.description}}</td>
<td>
<span uib-tooltip="{{item.stateSince.timestamp | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="left">{{item.stateSince.inString || 'Never'}}</span>
</td>
<td class="mc-align-center">
<a class="btn btn-link" ui-sref="resourcesGroupMapList({id:item.id})"><i class="fa fa-chevron-circle-right fa-lg" tooltip="{{ 'VIEW_DETAILS' | translate }}" tooltip-placement="top"></i></a>
</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,76 @@
<!--
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>
<form class="form-horizontal" name="mcForm">
<div class="col-md-6">
<legend><small>{{ 'RESOURCE' | translate }}</small></legend>
<div class="form-group"><!-- List Resource -->
<label class="col-sm-2 control-label">{{ 'RESOURCE' | translate }}</label>
<div class="col-sm-3 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="rT.displayName as rT.displayName for rT in resourceTypes"
ng-change="dspResources = getResources(groupMap.resourceType); groupMap.resourceId = ''" ng-model="groupMap.resourceType" required >
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-7 mc-form-fixer" ng-show="groupMap.resourceType === 'Gateway' || groupMap.resourceType === 'Node' || groupMap.resourceType === 'Sensor' || groupMap.resourceType === 'Sensor variable'">
<select class="form-control" pf-select data-live-search="true" ng-model="groupMap.resourceId" required >
<option value="" ng-hide="true"></option>
<option ng-repeat="res in dspResources" ng-bind-html="res.displayName | mcResourceRepresentation" value="{{res.id}}" ng-selected="res.id == groupMap.resourceId"></option>
</select>
</div>
</div><!-- List Resource -->
<legend><small>{{ 'PAYLOAD' | translate }}</small></legend>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ON' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<input class="form-control" placeholder="{{ 'PAYLOAD_ON' | translate }}" ng-model="groupMap.payloadOn" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'OFF' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<input class="form-control" placeholder="{{ 'PAYLOAD_OFF' | translate }}" ng-model="groupMap.payloadOff" required />
</div>
</div>
<!-- Include save form buttons -->
<div ng-include src="'partials/common-html/save-form.html'"></div>
</div>
</form>
</div>
</div> <!-- Main Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,93 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="resourcesGroupMapAddEdit({groupId:query.groupId})">{{ 'ADD_RESOURCE' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'RESOURCE' | translate }}</th>
<th>{{ 'PAYLOAD_ON' | translate }}</th>
<th>{{ 'PAYLOAD_OFF' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td ng-bind-html="item.resource | mcResourceRepresentation"></td>
<td>{{item.payloadOn}}</td>
<td>{{item.payloadOff}}</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,120 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0 && mchelper.user.permission === 'Super admin'">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<!-- Number of items per page -->
<div class="btn-group mc-side-space">
<select pf-select ng-model="itemsPerPage" ng-change="updateItemsPerPage(itemsPerPage)">
<option value="" ng-hide="true"></option>
<option value="10">10 items per page</option>
<option value="25">25 items per page</option>
<option value="50">50 items per page</option>
<option value="100">100 items per page</option>
<option value="250">250 items per page</option>
<option value="500">500 items per page</option>
</select>
</div>
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
</ul>
</div>
</div>
<div ng-show="mchelper.user.permission === 'Super admin'" class="btn-group" role="group" ng-show="queryResponse.query.totalItems > 0">
<a class="btn btn-primary" type="button" ui-sref="resourcesLogsPurge">{{ 'PURGE' | translate }}</a>
</div>
<div ng-show="mchelper.user.permission === 'Super admin'" class="btn-group" role="group" ng-show="queryResponse.query.totalItems > 0">
<button class="btn btn-default" type="button" ng-click="getAllItems()">
<i class="fa fa-refresh"></i> {{ 'REFRESH' | translate }}</button>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'TIME' | translate }}</th>
<th>{{ 'LEVEL' | translate }}</th>
<th>{{ 'TYPE' | translate }}</th>
<th>{{ 'RESOURCE' | translate }}</th>
<th>{{ 'DIRECTION' | translate }}</th>
<th>{{ 'MESSAGE_TYPE' | translate }}</th>
<th>{{ 'MESSAGE' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.filteredCount" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td class="mc-single-row">{{item.timestamp | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}</td>
<td>{{item.logLevel}}</td>
<td>{{item.resourceType}}</td>
<td ng-bind-html="item.resource | mcResourceRepresentation"></td>
<td>{{item.logDirection}}</td>
<td>{{item.messageType}}</td>
<td ng-bind-html="item.message | mcResourceRepresentation"></td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,115 @@
<!--
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">
<div class="col-md-5">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RESOURCE' | translate }}</label>
<div class="col-sm-4 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="rT.displayName as rT.displayName for rT in resourceTypes"
ng-change="resourcesList = getResources(resourcesLogs.resourceType);resourcesLogs.resourceId=''" ng-model="resourcesLogs.resourceType">
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-6 mc-form-fixer" ng-hide="resourcesLogs.resourceType === null || resourcesLogs.resourceType === undefined || resourcesLogs.resourceType === ''"><!-- List Resource -->
<select class="form-control" pf-select data-live-search="true" ng-model="resourcesLogs.resourceId">
<option value="" ng-hide="true"></option>
<option ng-repeat="res in resourcesList" ng-bind-html="res.displayName | mcResourceRepresentation" value="{{res.id}}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'MESSAGE_TYPE' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="mt.displayName as mt.displayName for mt in messageTypes" ng-model="resourcesLogs.messageType">
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'LOG_DIRECTION' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="ld.displayName as ld.displayName for ld in logDirections" ng-model="resourcesLogs.logDirection">
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'LOG_LEVEL' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="ll.displayName as ll.displayName for ll in logLevels" ng-model="resourcesLogs.logLevel">
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'MESSAGE_CONTAINS' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<input class="form-control" placeholder="Message contains" ng-model="resourcesLogs.message"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PURGE_BEFORE' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<div class="dropdown">
<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="pBeforeString" 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="purgeBefore" data-on-set-time="pBeforeString = getDateTimeDisplayFormat(newDate)" data-datetimepicker-config="{ dropdownSelector: '#datetime1', minuteStep:1 }"/>
</ul>
</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 -->

View File

@@ -0,0 +1,86 @@
<!--
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="item.room.$resolved || !$scope.id">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="item.room.$resolved || !$scope.id"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-add-update.html'"></div>
<div>
<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">
<input class="form-control" ng-model="item.room.name" placeholder="{{ 'ROOM_NAME' | translate }}" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'DESCRIPTION' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" ng-model="item.room.description" placeholder="{{ 'DESCRIPTION' | translate }}" rows="5"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PARENT' | translate }}</label>
<div class="col-sm-10">
<select class="form-control" pf-select data-live-search="true" ng-model="item.room.parentId" >
<option value="">{{ 'NOTHING_SELECTED' | translate }}</option>
<option ng-repeat="room in rooms | orderBy:'displayName'" ng-bind-html="room.displayName | mcResourceRepresentation" value="{{room.id}}" ng-selected="room.id == item.room.parentId"></option>
</select>
</div>
</div>
<legend><small>{{ 'SENSORS' | 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 sensors" multiple
ng-model="item.sensorIds" bs-duallistbox
move-on-select="true"
filter="false"
select-min-height="230"
></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 Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,93 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="roomsAddEdit"><i class="fa fa-plus"></i> {{ 'ADD' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center col-md-1"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'NAME' | translate }}</th>
<th>{{ 'FULL_PATH' | translate }}</th>
<th>{{ 'DESCRIPTION' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td>{{item.name}}</td>
<td ng-bind-html="item.fullPath | mcResourceRepresentation"></td>
<td>{{item.description}}</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,84 @@
<!--
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-if="showLoading">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-if="!showLoading"> <!-- Main Message -->
<!-- Rooms Header -->
<div class="mc-top-space-header">
<legend>
<a class="fa fa-object-group fa-lg mc-pointer" ng-click="getRoomRoot()"></a> <span ng-bind-html="roomHeader | mcResourceRepresentation"></span>
</legend>
</div>
<!-- Display No Items on system -->
<div ng-if="showNoRoomsSetup" ng-include src="'partials/common-html/no-items-system.html'"></div>
<div class="container-cards-pf" ng-if="queryResponse.data.length > 0">
<div class="row row-cards-pf">
<div class="col-xs-12 col-sm-6 col-md-3 mc-pointer" ng-repeat="room in queryResponse.data" ng-click="getRoom(room)">
<div class="card-pf card-pf-accented card-pf-aggregate-status card-pf-aggregate-status-mini">
<h2 class="card-pf-title">
<span class="fa fa-object-group"></span>
<span class="card-pf-aggregate-status-count">{{room.name}}</span>
<span>{{room.description || "-"}}</span>
</h2>
</div>
</div>
</div><!-- /row -->
</div><!-- /container -->
<!-- Sensors Header -->
<div ng-if="queryResponse.data.length > 0 && sensorsList.length > 0">
<legend></legend>
</div>
<div class="container-cards-pf">
<div class="row row-cards-pf">
<div class="col-xs-12 col-sm-6 col-md-4" ng-repeat="item in sensorsList">
<div class="card-pf card-pf-aggregate-status card-pf-with-action card-pf-accented" style="height:80px;">
<h2 class="card-pf-title">
<span uib-tooltip="{{item.type.locale ? item.type.locale : 'Undefined'}}">
<span class="mc-icon-lg" ng-class="cs.getSensorIcon(item.type.en)"></span>
<span class="card-pf-aggregate-status-count">{{item.sensorId}}: {{item.name || "-"}}</span>
</span>
<span class="pull-right">
<a class="btn btn-link" ui-sref="sensorsDetail({id:item.id})">
<i class="fa fa-chevron-circle-right fa-lg" tooltip="{{ 'VIEW_DETAILS' | translate }}" tooltip-placement="left"></i>
</a>
</span>
<hr class="mc-sensors-hr">
</h2>
<div class="card-pf-body mc-sensors-room">
<!-- variables ng-repeat --> <!-- Sensor variables -->
<span class="card-pf-aggregate-status-notification mc-side-space" ng-include src="'partials/common-html/sensor-actions-items.html'" ng-repeat="variable in item.variables"></span>
</div>
</div>
</div>
</div><!-- /row -->
</div><!-- /container -->
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,333 @@
<!--
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-if="!ruleConditionTypes.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-if="ruleConditionTypes.$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-7">
<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="{{ 'RULE_NAME' | translate }}" ng-model="item.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="item.enabled" checked>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'IGNORE_DUPLICATE' | translate }}</label>
<div class="col-sm-10">
<input class="bootstrap-switch" id="bootstrap-switch-state" type="checkbox" ng-model="item.ignoreDuplicate" checked>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'DISABLE_WHEN_TRIGGER' | translate }}</label>
<div class="col-sm-10">
<input class="bootstrap-switch" id="bootstrap-switch-state" type="checkbox" ng-model="item.disableWhenTrigger">
</div>
</div>
<div ng-if="item.disableWhenTrigger">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RE_ENABLE' | translate }}</label>
<div class="col-sm-1 mc-form-fixer-left">
<input class="bootstrap-switch" type="checkbox" ng-model="item.reEnable" checked>
</div>
<div ng-if="item.reEnable">
<div class="col-sm-1 mc-form-fixer mc-align-center">
<label class="control-label">{{ 'AFTER' | translate }}</label>
</div>
<div class="col-sm-3 mc-form-fixer">
<input class="form-control" placeholder="{{ 'TIME' | translate }}" ng-model="item.reEnableDelayReadable" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div class="col-sm-3 mc-form-fixer">
<select class="form-control" pf-select ng-model="item.reEnableDelayConstant" required>
<option value="" ng-hide="true"></option>
<option value="60000">{{ 'MINUTES' | translate }}</option>
<option value="3600000">{{ 'HOURS' | translate }}</option>
<option value="86400000">{{ 'DAYS' | translate }}</option>
</select>
</div>
</div>
</div>
</div>
<legend><small>{{ 'CONDITION' | translate }}</small></legend>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'CONDITION_TYPE' | translate }}</label>
<div class="col-sm-4 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="rT.displayName as rT.displayName for rT in ruleConditionTypes | orderBy:'displayName'" ng-model="item.conditionType" ng-change="updateOnConditionTypChange()" required>
<option value="" ng-hide="true"></option>
</select>
</div>
<!-- Threshold, Threshold range, Compare, String -->
<div ng-if="item.conditionType === 'Threshold' || item.conditionType === 'Threshold range' || item.conditionType === 'Compare' || item.conditionType === 'String'">
<div class="col-sm-6 mc-form-fixer">
<select ng-init="item.resourceType = 'Sensor variable'" class="form-control" pf-select data-live-search="true" ng-model="item.resourceId" required>
<option value="" ng-hide="true"></option>
<option ng-repeat="res in sensorVariablesList | orderBy:'displayName'" ng-bind-html="res.displayName | mcResourceRepresentation" value="{{res.id}}" ng-selected="res.id == item.resourceId"></option>
</select>
</div>
</div>
<!-- State -->
<div ng-if="item.conditionType === 'State'">
<div class="col-sm-6 mc-form-fixer">
<select class="form-control" pf-select ng-options="rT.displayName as rT.displayName for rT in resourceTypes | orderBy:'displayName'" ng-model="item.resourceType"
ng-change="$parent.stateResourcesList = getResources(item.resourceType, 'Binary');updateStateTypes(item.resourceType);" required>
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<!-- Script -->
<div ng-if="item.conditionType === 'Script'">
<div class="col-sm-6 mc-form-fixer">
<select class="form-control" pf-select ng-options="rT as rT for rT in scriptsList" ng-model="item.scriptFile" required>
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
</div>
<div ng-if="item.conditionType === 'Script' && item.scriptFile">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SCRIPT_BINDINGS' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<input class="form-control" placeholder="{{ 'SCRIPT_BINDINGS' | translate }}" ng-model="item.altScriptBindings" pf-validation="cs.isJsonString(input)" required />
<span class="help-block">{{ 'SYNTAX_ERROR' | translate }}</span>
</div>
</div>
</div>
<!-- Threshold -->
<div ng-if="item.conditionType === 'Threshold'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRIGGER_WHEN' | translate }}</label>
<div class="col-sm-2 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="at.displayName as at.displayName for at in ruleOperatorTypes | orderBy:'displayName'" ng-model="item.operator" required>
<option value="" ng-hide="true">{{ 'SELECT' | translate }}</option>
</select>
</div>
<div class="col-sm-2 mc-form-fixer">
<select class="form-control" pf-select ng-options="at.displayName as at.displayName for at in ruleThresholdDataTypes" ng-change="item.data=''" ng-model="item.dataType" required>
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-6 mc-form-fixer" ng-if="item.dataType === 'Value'">
<input class="form-control" placeholder="{{ 'THRESHOLD_VALUE' | translate }}" ng-model="item.data" required/>
</div>
<div class="col-sm-6 mc-form-fixer" ng-if="item.dataType === 'Sensor variable'">
<select class="form-control" pf-select data-live-search="true" ng-model="item.data" required>
<option value="" ng-hide="true"></option>
<option ng-repeat="res in sensorVariablesList" ng-bind-html="res.displayName | mcResourceRepresentation" value="{{res.id}}" ng-selected="res.id == item.data"></option>
</select>
</div>
</div>
</div>
<!-- Threshold Range-->
<div ng-if="item.conditionType === 'Threshold range'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRIGGER_WHEN' | translate }}</label>
<div class="col-sm-2 mc-form-fixer-left">
<label class="mc-padding">
<input type="checkbox" value="inRange" ng-model="item.inRange" /> {{ 'IN_RANGE' | translate }}
</label>
</div>
<div class="col-sm-2 mc-form-fixer">
<label class="mc-padding">
<input type="checkbox" value="includeOperatorLow" ng-model="item.includeOperatorLow" /> {{ 'INCLUDE_THRESHOLD_LOW' | translate }}
</label>
</div>
<div class="col-sm-2 mc-form-fixer">
<label class="mc-padding">
<input type="checkbox" value="includeOperatorHigh" ng-model="item.includeOperatorHigh" /> {{ 'INCLUDE_THRESHOLD_HIGH' | translate }}
</label>
</div>
<div class="col-sm-2 mc-form-fixer">
<input class="form-control" placeholder="{{ 'THRESHOLD_VALUE_LOW' | translate }}" ng-model="item.thresholdLow" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div class="col-sm-2 mc-form-fixer-left">
<input class="form-control" placeholder="{{ 'THRESHOLD_VALUE_HIGH' | translate }}" ng-model="item.thresholdHigh" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
</div>
<!-- Compare-->
<div ng-if="item.conditionType === 'Compare'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRIGGER_WHEN' | translate }}</label>
<div class="col-sm-2 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="at.displayName as at.displayName for at in ruleOperatorTypes" ng-model="item.operator" required>
<option value="" ng-hide="true">{{ 'SELECT' | translate }}</option>
</select>
</div>
<div class="col-sm-2 mc-form-fixer">
<input class="form-control" placeholder="{{ 'PERCENTAGE' | translate }}" ng-model="item.data2Multiplier" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div class="col-sm-6 mc-form-fixer">
<select class="form-control" ng-init="item.targetResourceType='Sensor variable'" pf-select data-live-search="true" ng-model="item.data2ResourceId" required>
<option value="" ng-hide="true"></option>
<option ng-repeat="res in sensorVariablesList" ng-bind-html="res.displayName | mcResourceRepresentation" value="{{res.id}}" ng-selected="res.id == item.data2ResourceId"></option>
</select>
</div>
</div>
</div>
<!-- State-->
<div ng-if="item.conditionType === 'State'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRIGGER_WHEN' | translate }}</label>
<div class="col-sm-6 mc-form-fixer-left">
<select class="form-control" pf-select data-live-search="true" ng-model="item.resourceId" required>
<option value="" ng-hide="true"></option>
<option ng-repeat="res in stateResourcesList" ng-bind-html="res.displayName | mcResourceRepresentation" value="{{res.id}}" ng-selected="res.id == item.resourceId"></option>
</select>
</div>
<div class="col-sm-2 mc-form-fixer">
<select class="form-control" pf-select ng-options="at.displayName as at.displayName for at in ruleOperatorTypes" ng-model="item.operator" required>
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-2 mc-form-fixer">
<select class="form-control" pf-select ng-options="at.displayName as at.displayName for at in stateTypes" ng-model="item.state" required>
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
</div>
<!-- String -->
<div ng-if="item.conditionType === 'String'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRIGGER_WHEN' | translate }}</label>
<div class="col-sm-2 mc-form-fixer-left">
<label class="mc-padding">
<input type="checkbox" value="ignoreCase" ng-model="item.ignoreCase" /> {{ 'IGNORE_CASE' | translate }}
</label>
</div>
<div class="col-sm-2 mc-form-fixer">
<select class="form-control" pf-select ng-options="at.displayName as at.displayName for at in ruleOperatorTypes" ng-model="item.operator" required>
<option value="" ng-hide="true">{{ 'SELECT' | translate }}</option>
</select>
</div>
<div class="col-sm-6 mc-form-fixer">
<input class="form-control" placeholder="{{ 'PATTERN' | translate }}" ng-model="item.pattern" required />
</div>
</div>
</div>
<div ng-hide="item.resourceType === null || item.resourceType === undefined">
<legend><small>{{ 'DAMPENING' | translate }}</small></legend>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'DAMPENING' | translate }}</label>
<div class="col-sm-4 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="adt.displayName as adt.displayName for adt in dampeningTypes" ng-model="item.dampeningType" required>
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-3 mc-form-fixer" ng-if="item.dampeningType === 'Consecutive'">
<input class="form-control" placeholder="{{ 'OCCURRENCES' | translate }}" ng-model="item.dampening.consecutiveMax" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div ng-if="item.dampeningType === 'Last N evaluations'">
<div class="col-sm-3 mc-form-fixer" >
<input class="form-control" placeholder="{{ 'OCCURRENCES' | translate }}" ng-model="item.dampening.occurrencesMax" 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="{{ 'EVALUATIONS' | translate }}" ng-model="item.dampening.evaluationsMax" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
<div ng-if="item.dampeningType === 'Active time'">
<div class="col-sm-3 mc-form-fixer">
<input class="form-control" placeholder="{{ 'TIME' | translate }}" ng-model="item.dampening.activeTimeReadable" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div class="col-sm-3 mc-form-fixer">
<select class="form-control" pf-select ng-model="item.dampening.activeTimeConstant" required>
<option value="" ng-hide="true"></option>
<option value="1000" >{{ 'SECONDS' | translate }}</option>
<option value="60000">{{ 'MINUTES' | translate }}</option>
<option value="3600000">{{ 'HOURS' | translate }}</option>
<option value="86400000">{{ 'DAYS' | translate }}</option>
</select>
</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="item.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 -->

View File

@@ -0,0 +1,107 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || clone()" class="text-default"><i class="fa fa-lg fa-files-o"></i> {{ 'CLONE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || enable()" class="text-default"><i class="fa fa-lg fa-circle"></i> {{ 'ENABLE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || disable()" class="text-danger"><i class="fa fa-lg fa-circle-thin"></i> {{ 'DISABLE' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="rulesAddEdit"><i class="fa fa-plus"></i> {{ 'ADD' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'ENABLED' | translate }}</th>
<th>{{ 'NAME' | translate }}</th>
<th>{{ 'CONDITION' | translate }}</th>
<th>{{ 'DAMPENING' | translate }}</th>
<th>{{ 'OPERATIONS' | translate }}</th>
<th>{{ 'LAST_TRIGGER' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td class="text-center">
<i ng-show="item.enabled" class="text-success fa fa-circle fa-lg" uib-tooltip="{{ 'ENABLED' | translate }}"></i>
<i ng-hide="item.enabled" class="text-danger fa fa-circle-o fa-lg" uib-tooltip="{{ 'DISABLED' | translate }}"></i>
</td>
<td>{{item.name}}</td>
<td ng-bind-html="item.conditionString | mcResourceRepresentation"></td>
<td>{{item.dampening.dampeningString}}</td>
<!-- <td ng-bind-html="item.notificationString | mcResourceRepresentation"></td> -->
<td>{{item.operations.join(', ')}}</td>
<td>
<span uib-tooltip="{{item.lastTrigger | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="left" am-time-ago="item.lastTrigger"></span>
</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,56 @@
<!--
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>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="cancel()">
<span class="pficon pficon-close"></span>
</button>
<div class="modal-title"><b>{{header}}</b></div>
</div>
<div class="modal-body modal-body-text-only">
<form class="form-horizontal" name="mcForm">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SCRIPT' | translate }}</label>
<div class="col-sm-10">
<label>{{request.script}}</label>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SCRIPT_BINDINGS' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'SCRIPT_BINDINGS' | translate }}" ng-model="request.bindings" pf-validation="cs.isJsonString(input)" required />
<span class="help-block">{{ 'SYNTAX_ERROR' | translate }}</span>
</div>
</div>
</form>
<div ng-if="scriptResult">
<legend><small>{{ 'RESULT' | translate }}</small></legend>
<pre class="pre-scrollable">{{scriptResult}}</pre>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default" ng-click="cancel()"><i class="fa fa-close"></i> {{ 'CANCEL' | translate }}</button>
<button class="btn btn-primary" ng-click="runNow()" ng-disabled="runningInProgress || mcForm.$invalid">
<div ng-if="runningInProgress" class="spinner spinner-xs"></div>
<i class="fa fa-play"></i> {{runningInProgress ? ('RUNNING' | translate):('RUN' | translate)}}</button>
</div>
</div>

View File

@@ -0,0 +1,92 @@
<!--
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="showData">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-if="showData"> <!-- 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-7">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NAME' | translate }}</label>
<div class="col-sm-10">
<input ng-if="!editMode" class="form-control" placeholder="{{ 'FILE_NAME' | translate }}" ng-model="item.name" required />
<span ng-if="editMode" >{{item.name}}</span>
</div>
</div>
<!-- extension -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'EXTENSION' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-model="item.extension" ng-disabled="editMode" required >
<option value="" ng-hide="true"></option>
<option value="js">Java script</option>
<option value="groovy">Groovy</option>
<option value="py">Python</option>
<option value="rb">Ruby</option>
</select>
</div>
</div>
<!-- type -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TYPE' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-model="item.type" ng-disabled="editMode" required >
<option value="" ng-hide="true"></option>
<option value="Condition">Condition</option>
<option value="Operation">Operation</option>
</select>
</div>
</div>
<!-- File -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'FILE' | translate }}</label>
<div class="col-sm-5">
<input type="file" class="form-control" id="firmware.file" on-read-file="displayFileContents(contents)" ng-accept="'.*'" ng-model="file">
</div>
</div>
<!-- File content list -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'CONTENT' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" rows="21" style="resize:none" ng-model="item.data" required ></textarea>
</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 -->

View File

@@ -0,0 +1,98 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || runNow()" class="text-default"><i class="pficon fa-lg pficon-running"></i> {{ 'RUN_NOW' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="scriptsAddEdit">{{ 'ADD_SCRIPT' | translate }}</a>
</div>
</div>
<!-- for now always hide sort by. this moment this feature not supported -->
<div class="pull-right mc-v-margin" ng-show="false">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'NAME' | translate }}</th>
<th>{{ 'EXTENSION' | translate }}</th>
<th>{{ 'TYPE' | translate }}</th>
<th>{{ 'FILE_SIZE' | translate }}</th>
<th>{{ 'LAST_MODIFIED' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.name) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.name) != -1"></td>
<td>{{item.name}}</td>
<td>{{item.extension}}</td>
<td>{{item.type}}</td>
<td>{{item.size | byteToFriendlyConvertor}}</td>
<td><span uib-tooltip="{{item.lastModified | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="left" am-time-ago="item.lastModified"></span></td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,97 @@
<!--
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="gateways.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="gateways.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-add-update.html'"></div>
<div>
<form class="form-horizontal" name="mcForm">
<div class="col-md-5">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'GATEWAY' | translate }}</label>
<div class="col-sm-5 mc-form-fixer-left">
<select class="form-control" pf-select data-live-search="true" ng-model="message.gatewayId" required >
<option value="" ng-hide="true"></option>
<option ng-repeat="resource in gateways | orderBy:'displayName'" ng-bind-html="resource.displayName | mcResourceRepresentation"
value="{{resource.id}}" ng-selected="resource.id == message.gatewayId"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NODE_EUI' | translate }}/ {{ 'SENSOR_ID' | translate }}</label>
<div class="col-sm-5 mc-form-fixer-left">
<input class="form-control" ng-model="message.nodeEui" placeholder="{{ 'NODE_EUI' | translate }}" required />
</div>
<div class="col-sm-5 mc-form-fixer">
<input class="form-control" ng-model="message.sensorId" placeholder="{{ 'SENSOR_ID' | translate }}" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TYPE' | translate }}/ {{ 'SUB_TYPE' | translate }}</label>
<div class="col-sm-5 mc-form-fixer-left">
<select class="form-control" pf-select data-live-search="true" ng-options="type.id as type.displayName for type in messageTypes | orderBy:'displayName'"
ng-change="updateSubTypes(message.type)" ng-model="message.type" required >
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-5 mc-form-fixer">
<select class="form-control" pf-select data-live-search="true" ng-options="subType.id as subType.displayName for subType in subTypes | orderBy:'displayName'"
ng-model="message.subType" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ACKNOWLEDGE' | translate }}/ {{ 'PAYLOAD' | translate }}</label>
<div class="col-sm-3 mc-form-fixer-left">
<select class="form-control" pf-select ng-model="message.ack" required >
<option value="" ng-hide="true"></option>
<option value="0">{{ 'NO_ACK' | translate }}</option>
<option value="1">{{ 'ACK_REQUEST' | translate }}</option>
<option value="2">{{ 'ACK_RESPONSE' | translate }}</option>
</select>
</div>
<div class="col-sm-7 mc-form-fixer">
<input class="form-control" ng-model="message.payload" placeholder="{{ 'PAYLOAD' | translate }}" />
</div>
</div>
<div class="form-actions mc-form-actions-separator text-right">
<button type="button" class="btn btn-primary" ng-click="send()" ng-disabled="sendProgress || mcForm.$invalid">
<div ng-show="saveProgress" class="spinner spinner-xs hk-modal-spinner"></div>
{{sendProgress? ('SENDING' | translate):( 'SEND' | translate)}}
</button>
</div>
</div>
</form>
</div>
</div> <!-- Main Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,105 @@
<!--
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="nodes.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="nodes.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-add-update.html'"></div>
<div>
<form class="form-horizontal" name="mcForm">
<div class="col-md-5">
<!--
<div class="form-group">
<label class="col-sm-2 control-label">Gateway</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-change="updateNodes(sensor.node.gateway.id)" ng-model="sensor.node.gateway.id">
<option value="" ng-hide="true"></option>
<option ng-repeat="gateway in gateways" ng-bind-html="gateway.displayName | mcResourceRepresentation" value="{{gateway.id}}" ng-selected="gateway.id == sensor.node.gateway.id"></option>
</select>
</div>
</div>
-->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NODE' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select data-live-search="true" ng-model="sensor.node.id" ng-disabled="sensor.id" required >
<option value="" ng-hide="true"></option>
<option ng-repeat="node in nodes | orderBy:'displayName'" ng-bind-html="node.displayName | mcResourceRepresentation" value="{{node.id}}" ng-selected="node.id == sensor.node.id"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TYPE' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select data-live-search="true" ng-options="sensorType.id as sensorType.displayName for sensorType in sensorTypes | orderBy:'displayName'"
ng-change="refreshVariableTypes(sensor.type.en)" ng-model="sensor.type.en">
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'VARIABLE_TYPES' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" multiple pf-select ng-options="sensorVariableType.id as sensorVariableType.displayName for sensorVariableType in sensorVariableTypes" ng-model="sensor.variableTypes">
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ROOM' | translate }}</label>
<div class="col-sm-10">
<select class="form-control" pf-select data-live-search="true" ng-model="sensor.room.id" >
<option value="">{{ 'NOTHING_SELECTED' | translate }}</option>
<option ng-repeat="room in rooms | orderBy:'displayName'" ng-bind-html="room.displayName | mcResourceRepresentation" value="{{room.id}}" ng-selected="room.id == sensor.room.id"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NAME' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" ng-model="sensor.name" placeholder="{{ 'SENSOR_NAME' | translate }}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SENSOR_ID' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" ng-model="sensor.sensorId" placeholder="{{ 'SENSOR_ID' | translate }}" required />
</div>
</div>
<!-- Include save form buttons -->
<div ng-include src="'partials/common-html/save-form.html'"></div>
</div>
</form>
</div>
</div> <!-- Main Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,211 @@
<!--
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="metricTypes.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="metricTypes.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-add-update.html'"></div>
<div>
<form class="form-horizontal" name="mcForm">
<div class="col-md-6">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SENSOR' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<label ng-bind-html="sensorVariable.resourceName | mcResourceRepresentation" ></label>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TYPE' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<span>{{ sensorVariable.type.locale}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NAME' | translate }}</label>
<div class="col-sm-5 mc-form-fixer-left">
<input class="form-control" placeholder="{{ 'NAME' | translate }}" ng-model="sensorVariable.properties.name" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'READ_ONLY' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<input type="checkbox" ng-model="sensorVariable.readOnly">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'METRIC_TYPE' | translate }}</label>
<div class="col-sm-5 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="mType.id as mType.id for mType in metricTypes" ng-model="sensorVariable.metricType">
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'UNIT' | translate }}</label>
<div class="col-sm-5 mc-form-fixer-left">
<select class="form-control" data-live-search="true" pf-select ng-options="uType.id as uType.displayName for uType in unitTypes" ng-model="sensorVariable.unitType">
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group" ng-if="sensorVariable.metricType === 'Double'">
<label class="col-sm-2 control-label">{{ 'OFFSET' | translate }}</label>
<div class="col-sm-5 mc-form-fixer-left">
<input class="form-control" placeholder="{{ 'OFFSET' | translate }}" ng-model="sensorVariable.offset" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PRIORITY' | translate }}</label>
<div class="col-sm-5 mc-form-fixer-left">
<input class="form-control" placeholder="{{ 'PRIORITY' | translate }}" ng-model="sensorVariable.priority" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
<div class="form-group" ng-if="sensorVariable.properties.ignoreDuplicate != undefined">
<label class="col-sm-2 control-label">{{ 'IGNORE_DUPLICATE' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<input type="checkbox" ng-model="sensorVariable.properties.ignoreDuplicate">
</div>
</div>
<legend><small>{{ 'GRAPH_SETTINGS' | translate }}</small></legend>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'USE_GLOBAL' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<input type="checkbox" ng-model="sensorVariable.properties.useGlobal">
</div>
</div>
<div ng-if="!sensorVariable.properties.useGlobal">
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-3 mc-form-fixer-left">
<select class="form-control" pf-select ng-model="sensorVariable.properties.type">
<option value="" ng-hide="true"></option>
<option value="lineChart">{{ 'LINE_CHART' | translate }}</option>
<option value="historicalBarChart">{{ 'HISTORICAL_BAR_CHART' | translate }}</option>
<option value="stackedAreaChart">{{ 'STACKED_AREA_CHART' | translate }}</option>
</select>
</div>
<div class="col-sm-3 mc-form-fixer">
<select class="form-control" pf-select ng-model="sensorVariable.properties.interpolate">
<option value="" ng-hide="true"></option>
<option value="linear">{{ 'LINEAR' | translate }}</option>
<option value="basis">{{ 'BASIS' | translate }}</option>
<option value="cardinal">{{ 'CARDINAL' | translate }}</option>
<option value="monotone">{{ 'MONOTONE' | translate }}</option>
<option value="bundle">{{ 'BUNDLE' | translate }}</option>
<option value="step-before">{{ 'STEP_BEFORE' | translate }}</option>
<option value="step-after">{{ 'STEP_AFTER' | translate }}</option>
<option value="basis-open">{{ 'BASIS_OPEN' | translate }}</option>
<option value="basis-closed">{{ 'BASIS_CLOSED' | translate }}</option>
<option value="cardinal-open">{{ 'CARDINAL_OPEN' | translate }}</option>
<option value="cardinal-closed">{{ 'CARDINAL_CLOSED' | translate }}</option>
</select>
</div>
<div class="col-sm-1 mc-form-fixer">
<button class="form-control" id="color-{{sensorVariable.id}}" style="background-color:{{sensorVariable.properties.color}};width:70px;color:white;" class="btn btn-sm" colorpicker="hex" colorpicker-position="top"
ng-model="sensorVariable.properties.color">{{sensorVariable.properties.color || "-"}}</button>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"></label>
<div class="col-sm-3 mc-form-fixer-left">
<label class="mc-padding">
<input id="area-{{sensorVariable.id}}" type="radio" value="line" ng-model="sensorVariable.properties.subType" /> {{ 'LINE' | translate }}
</label>
<label class="mc-padding">
<input id="area-{{sensorVariable.id}}" type="radio" value="area" ng-model="sensorVariable.properties.subType" /> {{ 'AREA' | translate }}
</label>
<label class="mc-padding">
<input id="bar-{{sensorVariable.id}}"type="radio" value="bar" ng-model="sensorVariable.properties.subType" /> {{ 'BAR' | translate }}
</label>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'MARGIN' | translate }}</label>
<div class="col-sm-5 mc-form-fixer-left">
<table class="adf-table">
<tr>
<td>
<label>{{ 'LEFT' | translate }}</label>
</td>
<td>
<input class="form-control" type="number" id="left" placeholder="{{'LEFT' | translate}}" ng-model="sensorVariable.properties.marginLeft" pf-validation="cs.isNumber(input)" required>
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</td>
<td>
<label class="mc-margin-right">{{ 'RIGHT' | translate }}</label>
</td>
<td>
<input class="form-control" type="number" id="right" placeholder="{{'RIGHT' | translate}}" ng-model="sensorVariable.properties.marginRight" pf-validation="cs.isNumber(input)" required>
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</td>
</tr>
<tr>
<td>
<label>{{ 'TOP' | translate }}</label>
</td>
<td>
<input class="form-control" type="number" id="top" placeholder="{{'TOP' | translate}}" ng-model="sensorVariable.properties.marginTop" pf-validation="cs.isNumber(input)" required>
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</td>
<td>
<label>{{ 'BOTTOM' | translate }}</label>
</td>
<td>
<input class="form-control" type="number" id="bottom" placeholder="{{'BOTTOM' | translate}}" ng-model="sensorVariable.properties.marginBottom" pf-validation="cs.isNumber(input)" required>
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</td>
</tr>
</table>
</div>
</div>
</div>
<!-- Include save form buttons -->
<div ng-include src="'partials/common-html/save-form.html'"></div>
</div>
</form>
</div>
</div> <!-- Main Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,102 @@
<!--
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="sensorVariable.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="sensorVariable.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-add-update.html'"></div>
<div>
<form class="form-horizontal" name="mcForm">
<div class="col-md-6">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SENSOR' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<label ng-bind-html="sensorVariable.resourceName | mcResourceRepresentation" ></label>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TYPE' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<span>{{ sensorVariable.type.locale}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'VALUE' | translate }}</label>
<div class="col-sm-10 mc-form-fixer-left">
<input class="form-control" placeholder="{{ 'PURGE_VALUE_RANGE_EXAMPLE' | translate }}" ng-model="item.value"/>
</div>
</div>
<legend><small>{{ 'DATE_RANGE' | 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" uib-tooltip="{{ 'FROM' | translate}}" tooltip-placement="top">
<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="purgeFrom" 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" uib-tooltip="{{ 'TO' | translate}}" tooltip-placement="top">
<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="purgeTo" data-on-set-time="newDate.setSeconds(newDate.getSeconds() + 59); vToString = getDateTimeDisplayFormat(newDate)"
data-datetimepicker-config="{ dropdownSelector: '#datetime2', minuteStep:1 }"/>
</ul>
</div>
</div>
</div>
<!-- Include save form buttons -->
<div ng-include src="'partials/common-html/save-form.html'"></div>
</div>
</form>
</div>
</div> <!-- Main Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,162 @@
<!--
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">
<!-- Loading icon disaplay -->
<div ng-hide="resourceCount.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="resourceCount.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="container-cards-pf"><!-- row -->
<div class="row row-cards-pf"> <!-- row-details -->
<!-- details -->
<div class="col-xs-5 col-sm-5 col-md-4 col-lg-4">
<div class="card-pf card-pf-utilization card-pf-accented">
<div class="card-pf-heading">
<h2 class="card-pf-title">{{ 'DETAILS' | translate }} <a class="btn btn-link pull-right" ui-sref="sensorsAddEdit({ id: item.id })"><i class="fa fa-edit"></i> {{ 'EDIT' | translate }} </a></h2>
</div>
<div class="card-pf-body">
<dl class="dl-horizontal">
<dt>{{ 'NAME' | translate }}</dt> <dd>{{item.name}}</dd>
<dt>{{ 'SENSOR_ID' | translate }}</dt> <dd>{{item.sensorId}}</dd>
<dt>{{ 'TYPE' | translate }}</dt> <dd>{{item.type.locale}}</dd>
<dt>{{ 'VARIABLE_TYPES' | translate }}</dt> <dd>{{getSensorVariableTypes(item.variables)}}</dd>
<dt>{{ 'NODE_EUI' | translate }}</dt> <dd>{{item.node.eui}}</dd>
<dt>{{ 'NODE_NAME' | translate }}</dt> <dd>{{item.node.name}}</dd>
<dt>{{ 'NODE_TYPE' | translate }}</dt> <dd>{{item.node.type}}</dd>
<dt>{{ 'GATEWAY_NAME' | translate }}</dt> <dd>{{item.node.gateway.name}}</dd>
<dt>{{ 'GATEWAY_TYPE' | translate }}</dt> <dd>{{item.node.gateway.type}}</dd>
<dt>{{ 'NETWORK' | translate }}</dt> <dd>{{item.node.gateway.networkType}}</dd>
<dt>{{ 'ROOM' | translate }}</dt> <dd>{{item.room.name}}</dd>
<dt>{{ 'LAST_SEEN' | translate }}</dt> <dd><span uib-tooltip="{{item.lastSeen | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="right" am-time-ago="item.lastSeen"></span></dd>
<dt>{{ 'TOPOLOGY' | translate }}</dt> <dd><a class="mc-inline-editer-ab" ui-sref="dashboardTopology({ resourceType: 'Sensor', resourceId: item.id})"><span class="pficon pficon-topology mc-icon-lg"></span></a></dd>
<legend><small>{{ 'RESOURCES' | translate }}</small></legend>
<dt><span class="pficon pficon-replicator mc-icon-md-3"></span>{{ 'RESOURCES_GROUPS' | translate }}</dt>
<dd>
<a class="mc-inline-editer-ab" ng-if="resourceCount.resourcesGroups > 0" ui-sref="resourcesGroupList({ resourceType:resourceCount.resourceType, resourceId: resourceCount.resourceId})">{{resourceCount.resourcesGroups}}</a>
<span ng-if="resourceCount.resourcesGroups == 0">{{resourceCount.resourcesGroups}}</span>
</dd>
</dl>
</div>
</div>
</div>
<!-- custom buttons -->
<!-- yet to implement
<div class="col-xs-7 col-sm-7 col-md-8 col-lg-8">
<div class="card-pf card-pf-accented ">
<div class="card-pf-heading">
<div class="dropdown card-pf-time-frame-filter">
<select pf-select ng-model="customButtonVariable" ng-options="variable.id as variable.type for variable in item.variables">
<option value="" ng-hide="true"></option>
</select>
<select pf-select ng-model="timeRange">
<option value="" ng-hide="true"></option>
</select>
</div>
<h2 class="card-pf-title">
Custom buttons
</h2>
</div>
<div class="card-pf-body">
Yet to implement
</div>
</div>
</div>
-->
<!-- variables ng-repeat -->
<div ng-repeat="variable in item.variables">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2">
<div class="card-pf card-pf-aggregate-status card-pf-with-action card-pf-accented mc-sensor-variable-detail">
<h2 class="card-pf-title">{{variable.name ? variable.name : variable.type.locale}}</h2>
<div class="card-pf-body">
<!-- Sensor variables -->
<div ng-init="variable.showVariable = true">
<div ng-show="variable.showVariable" ng-include src="'partials/common-html/sensor-actions-items.html'"></div>
<span class="pull-right">
<span style="margin-right:9px;" >
<a ui-sref="sensorVariablePurge({ id: variable.id })">
<i uib-tooltip="{{ 'PURGE' | translate}}" tooltip-placement="left" class="fa fa-trash"></i>
</a>
</span>
<span>
<a ui-sref="sensorVariableEdit({ id: variable.id })">
<i uib-tooltip="{{ 'EDIT' | translate}}" tooltip-placement="left" class="fa fa-edit"></i>
</a>
</span>
</span>
</div>
</div>
</div>
</div>
</div>
</div> <!-- /row-details -->
</div><!-- /row -->
<div class="container-cards-pf" ng-show="chartData.length > 0">
<div class="row row-cards-pf">
<div class="col-lg-12">
<div class="card-pf card-pf-accented ">
<div class="card-pf-heading">
<div class="dropdown card-pf-time-frame-filter">
<input bs-switch ng-change="updateChart()" ng-model="chartEnableMinMax" type="checkbox"
switch-animate="true" switch-off-color="default" switch-on-color="primary" switch-size="" switch-label-width="70px"
switch-label="{{ 'MIN_MAX' | translate }}" ng-true-value="true" ng-false-value="false" switch-on-text="{{ 'ENABLED' | translate }}" switch-off-text="{{ 'DISABLED' | translate }}" >
<select pf-select ng-model="chartFromTimestamp" ng-change="updateChart()">
<option value="" ng-hide="true"></option>
<option value="300000">{{ 'LAST_5_MINUTES' | translate }}</option>
<option value="3600000">{{ 'LAST_HOUR' | translate }}</option>
<option value="21600000">{{ 'LAST_6_HOURS' | translate }}</option>
<option value="43200000">{{ 'LAST_12_HOURS' | translate }}</option>
<option value="86400000">{{ 'LAST_DAY' | translate }}</option>
<option value="604800000">{{ 'LAST_WEEK' | translate }}</option>
<option value="2419200000">{{ 'LAST_MONTH' | translate }}</option>
<option value="31536000000">{{ 'LAST_YEAR' | translate }}</option>
<option value="0" ng-hide="true">{{ 'CUSTOM' | translate }}</option>
</select>
</div>
<h2 class="card-pf-title">
<i class="fa fa-area-chart fa-lg"></i> {{ 'VARIABLES_GRAPHICAL_VIEW' | translate }}
</h2>
</div>
<div class="card-pf-body">
<div ng-repeat="chData in chartData">
<legend><small>{{chData.variableType}}</small></legend>
<!-- Refer this one https://github.com/krispo/angular-nvd3/issues/40 -->
<nvd3 options='chOptions' data="chData.chartData" ng-init="chOptions = updateChartOptions(chData)"></nvd3>
</div>
</div>
</div>
</div><!-- /row -->
</div><!-- /container -->
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,112 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
</ul>
</div>
</div>
<div ng-show="mchelper.user.permission === 'Super admin'" class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="sensorsAddEdit"><i class="fa fa-plus"></i> {{ 'ADD' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'NETWORK_TYPE' | translate }}</th>
<th>{{ 'GATEWAY' | translate }}</th>
<th>{{ 'NODE_NAME' | translate }}</th>
<th>{{ 'NODE_EUI' | translate }}</th>
<th>{{ 'SENSOR_ID' | translate }}</th>
<th>{{ 'NAME' | translate }}</th>
<th>{{ 'TYPE' | translate }}</th>
<th>{{ 'VARIABLE_TYPES' | translate }}</th>
<th>{{ 'ROOM' | translate }}</th>
<th>{{ 'LAST_SEEN' | translate }}</th>
<th></th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.filteredCount" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td>{{item.node.gateway.networkType}}</td>
<td>{{item.node.gateway.name}} [{{item.node.gateway.type}}]</td>
<td>{{item.node.name}}</td>
<td>{{item.node.eui}}</td>
<td>{{item.sensorId}}</td>
<td>{{item.name}}</td>
<td>{{item.type.locale}}</td>
<td>{{getSensorVariableTypes(item.variables)}}</td>
<td ng-bind-html="item.room.fullPath | mcResourceRepresentation"></td>
<td><span uib-tooltip="{{item.lastSeen | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="left" am-time-ago="item.lastSeen"></span></td>
<td class="mc-align-center">
<a class="btn btn-link" ui-sref="sensorsDetail({id:item.id})"><i class="fa fa-chevron-circle-right fa-lg" tooltip="{{ 'VIEW_DETAILS' | translate }}" tooltip-trigger tooltip-placement="top"></i></a>
</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,540 @@
<!--
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 mc-top-space-1x">
<!-- Loading icon disaplay -->
<div ng-hide="metricsSettings.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="metricsSettings.$resolved"> <!-- Settings -->
<!-- Units -->
<div class="col-md-12">
<div class="card-pf card-pf-accented">
<div >
<ul ng-init="tabSelection='graph'" class="nav nav-tabs nav-tabs-pf">
<li ng-class="{'active' : tabSelection==='graph'}"><a ng-click="tabSelection='graph'" href=""><i class="fa fa-area-chart fa-lg"></i> {{ 'GRAPHS_SETTINGS' | translate }}</i></a></li>
<li ng-class="{'active' : tabSelection==='engine'}"><a ng-click="tabSelection='engine'" href=""><i class="fa fa-database fa-lg"></i> {{ 'METRIC_ENGINE' | translate }}</i></a></li>
<li ng-class="{'active' : tabSelection==='retention'}"><a ng-click="tabSelection='retention'" href=""><i class="fa fa-database fa-lg"></i> {{ 'DATA_RETENTION_SETTINGS' | translate }}</i></a></li>
</ul>
</div>
<div ng-if="tabSelection==='graph'"> <!-- Metrics Graph settings -->
<div class="card-pf-body">
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.metrics" ng-click="editEnable.metrics = true">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.metrics" ng-click="updateSettingsMetrics();editEnable.metrics = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-primary" ng-click="saveMetrics()" ng-show="editEnable.metrics" ng-disabled="saveProgress.metrics">
<div ng-show="saveProgress.metrics" class="spinner spinner-xs"></div>
{{saveProgress.metrics ? 'SAVING' : 'SAVE' | translate}}
</button>
</div>
<form class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ENABLE_MIN_MAX' | translate }}</label>
<div class="col-sm-10">
<input ng-change="editEnable.metrics = true" bs-switch ng-change="updateChart()" ng-model="metricsSettings.enabledMinMax" type="checkbox"
switch-animate="true" switch-off-color="default" switch-on-color="primary" switch-size="60px" switch-label-width="5px"
ng-true-value="true" ng-false-value="false" switch-on-text="{{ 'ENABLED' | translate }}" switch-off-text="{{ 'DISABLED' | translate }}" >
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'DEFAULT_TIME_RANGE' | translate }}</label>
<div class="col-sm-10">
<select ng-disabled="!editEnable.metrics" pf-select ng-model="metricsSettings.defaultTimeRange">
<option value="" ng-hide="true"></option>
<option value="300000">{{ 'LAST_5_MINUTES' | translate }}</option>
<option value="3600000">{{ 'LAST_HOUR' | translate }}</option>
<option value="21600000">{{ 'LAST_6_HOURS' | translate }}</option>
<option value="43200000">{{ 'LAST_12_HOURS' | translate }}</option>
<option value="86400000">{{ 'LAST_DAY' | translate }}</option>
<option value="604800000">{{ 'LAST_WEEK' | translate }}</option>
<option value="2419200000">{{ 'LAST_MONTH' | translate }}</option>
<option value="31536000000">{{ 'LAST_YEAR' | translate }}</option>
</select>
</div>
</div>
<!-- Battery -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'BATTERY' | translate }}</label>
<div class="col-sm-3">
<select ng-disabled="!editEnable.metrics" pf-select ng-model="metricsSettings.battery.type">
<option value="" ng-hide="true"></option>
<option value="lineChart">{{ 'LINE_CHART' | translate }}</option>
<option value="historicalBarChart">{{ 'HISTORICAL_BAR_CHART' | translate }}</option>
<option value="stackedAreaChart">{{ 'STACKED_AREA_CHART' | translate }}</option>
</select>
</div>
<div class="col-sm-3">
<select ng-disabled="!editEnable.metrics" pf-select ng-model="metricsSettings.battery.interpolate">
<option value="" ng-hide="true"></option>
<option value="linear">{{ 'LINEAR' | translate }}</option>
<option value="basis">{{ 'BASIS' | translate }}</option>
<option value="cardinal">{{ 'CARDINAL' | translate }}</option>
<option value="monotone">{{ 'MONOTONE' | translate }}</option>
<option value="bundle">{{ 'BUNDLE' | translate }}</option>
<option value="step-before">{{ 'STEP_BEFORE' | translate }}</option>
<option value="step-after">{{ 'STEP_AFTER' | translate }}</option>
<option value="basis-open">{{ 'BASIS_OPEN' | translate }}</option>
<option value="basis-closed">{{ 'BASIS_CLOSED' | translate }}</option>
<option value="cardinal-open">{{ 'CARDINAL_OPEN' | translate }}</option>
<option value="cardinal-closed">{{ 'CARDINAL_CLOSED' | translate }}</option>
</select>
</div>
<div class="col-sm-1">
<button ng-show="editEnable.metrics" style="background-color:{{metricsSettings.battery.color}};width:70px;color:white;" class="btn btn-sm" colorpicker="hex" colorpicker-position="top" ng-model="metricsSettings.battery.color">{{metricsSettings.battery.color || "-"}}</button>
<span ng-hide="editEnable.metrics" style="background-color:{{metricsSettings.battery.color}};width:70px;color:white;" class="btn btn-sm">{{metricsSettings.battery.color}}</span>
</div>
<div class="col-sm-3">
<label class="mc-padding">
<input ng-disabled="!editEnable.metrics" id="area-{{item.id}}" type="radio" value="line" ng-model="metricsSettings.battery.subType" /> {{ 'LINE' | translate }}
</label>
<label class="mc-padding">
<input ng-disabled="!editEnable.metrics" id="area-{{item.id}}" type="radio" value="area" ng-model="metricsSettings.battery.subType" /> {{ 'AREA' | translate }}
</label>
<label class="mc-padding">
<input ng-disabled="!editEnable.metrics" id="bar-{{item.id}}"type="radio" value="bar" ng-model="metricsSettings.battery.subType" /> {{ 'BAR' | translate }}
</label>
</div>
</div>
<legend>{{ 'INDIVIDUAL_SETTINGS' | translate }}</legend>
<div ng-repeat="item in metricsSettings.metrics">
<div class="form-group">
<label class="col-sm-2 control-label">{{item.metricName}}</label>
<div class="col-sm-3">
<select ng-disabled="!editEnable.metrics" pf-select ng-model="item.type">
<option value="" ng-hide="true"></option>
<option value="lineChart">{{ 'LINE_CHART' | translate }}</option>
<option value="historicalBarChart">{{ 'HISTORICAL_BAR_CHART' | translate }}</option>
<option value="stackedAreaChart">{{ 'STACKED_AREA_CHART' | translate }}</option>
</select>
</div>
<div class="col-sm-3">
<select ng-disabled="!editEnable.metrics" pf-select ng-model="item.interpolate">
<option value="" ng-hide="true"></option>
<option value="linear">{{ 'LINEAR' | translate }}</option>
<option value="basis">{{ 'BASIS' | translate }}</option>
<option value="cardinal">{{ 'CARDINAL' | translate }}</option>
<option value="monotone">{{ 'MONOTONE' | translate }}</option>
<option value="bundle">{{ 'BUNDLE' | translate }}</option>
<option value="step-before">{{ 'STEP_BEFORE' | translate }}</option>
<option value="step-after">{{ 'STEP_AFTER' | translate }}</option>
<option value="basis-open">{{ 'BASIS_OPEN' | translate }}</option>
<option value="basis-closed">{{ 'BASIS_CLOSED' | translate }}</option>
<option value="cardinal-open">{{ 'CARDINAL_OPEN' | translate }}</option>
<option value="cardinal-closed">{{ 'CARDINAL_CLOSED' | translate }}</option>
</select>
</div>
<div class="col-sm-1">
<button ng-show="editEnable.metrics" id="color-{{item.id}}" style="background-color:{{item.color}};width:70px;color:white;" class="btn btn-sm" colorpicker="hex" colorpicker-position="top" ng-model="item.color">{{item.color || "-"}}</button>
<span ng-hide="editEnable.metrics" style="background-color:{{item.color}};width:70px;color:white;" class="btn btn-sm">{{item.color}}</span>
</div>
<div class="col-sm-3">
<label class="mc-padding">
<input ng-disabled="!editEnable.metrics" id="area-{{item.id}}" type="radio" value="line" ng-model="item.subType" /> {{ 'LINE' | translate }}
</label>
<label class="mc-padding">
<input ng-disabled="!editEnable.metrics" id="area-{{item.id}}" type="radio" value="area" ng-model="item.subType" /> {{ 'AREA' | translate }}
</label>
<label class="mc-padding">
<input ng-disabled="!editEnable.metrics" id="bar-{{item.id}}"type="radio" value="bar" ng-model="item.subType" /> {{ 'BAR' | translate }}
</label>
</div>
</div>
</div>
</form>
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.metrics" ng-click="editEnable.metrics = true">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.metrics" ng-click="updateSettingsMetrics();editEnable.metrics = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-primary" ng-click="saveMetrics()" ng-show="editEnable.metrics" ng-disabled="saveProgress.metrics">
<div ng-show="saveProgress.metrics" class="spinner spinner-xs"></div>
{{saveProgress.metrics ? 'SAVING' : 'SAVE' | translate}}
</button>
</div>
</div>
</div><!-- Metrics Graph settings -->
<div ng-if="tabSelection==='engine'"> <!-- Metrics engine settings -->
<div class="card-pf-body">
<form class="form-horizontal" name="mcFormEngine">
<!-- engine type -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TYPE' | translate }}</label>
<div class="col-sm-4">
<select class="form-control" pf-select ng-disabled="!editEnable.metricsEngine"
ng-options="type.id as type.displayName for type in engineTypes | orderBy:'displayName'" ng-model="metricsEngine.type" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<!-- Influxdb server -->
<div ng-if="metricsEngine.type === 'InfluxDB'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRUST_HOST' | translate }}</label>
<div class="col-sm-4">
<select class="form-control" ng-disabled="!editEnable.metricsEngine"
pf-select ng-options="type.id as type.displayName for type in trustHostTypes | orderBy:'displayName'" ng-model="metricsEngine.trustHostType" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'URL' | translate }}</label>
<div ng-if="!editEnable.metricsEngine" class="col-sm-8">
<div>{{metricsEngine.url}}</div>
</div>
<div class="col-sm-8" ng-show="editEnable.metricsEngine">
<input class="form-control" placeholder="{{ 'URL' | translate }}" ng-model="metricsEngine.url" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'USERNAME' | translate }}</label>
<div ng-if="!editEnable.metricsEngine" class="col-sm-8">
<div>{{metricsEngine.username}}</div>
</div>
<div class="col-sm-8" ng-show="editEnable.metricsEngine">
<input class="form-control" placeholder="{{ 'USERNAME' | translate }}" ng-model="metricsEngine.username" pf-validation="cs.isContainsSpace(input)" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PASSWORD' | translate }}</label>
<div ng-if="!editEnable.metricsEngine" class="col-sm-8">
<div>{{metricsEngine.password ? "******" : ""}}</div>
</div>
<div class="col-sm-8" ng-show="editEnable.metricsEngine">
<input type="password" class="form-control" placeholder="{{ 'PASSWORD' | translate }}" ng-model="metricsEngine.password" pf-validation="cs.isContainsSpace(input)" ng-required="metricsEngine.username"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'DATABASE' | translate }}</label>
<div ng-if="!editEnable.metricsEngine" class="col-sm-8">
<div>{{metricsEngine.database}}</div>
</div>
<div class="col-sm-8" ng-show="editEnable.metricsEngine">
<input class="form-control" placeholder="{{ 'DATABASE' | translate }}" ng-model="metricsEngine.database" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
</div><!-- InfluxDb settings -->
<!-- Hawkular server -->
<div ng-if="metricsEngine.type === 'Hawkular'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TRUST_HOST' | translate }}</label>
<div class="col-sm-4">
<select class="form-control" ng-disabled="!editEnable.metricsEngine"
pf-select ng-options="type.id as type.displayName for type in trustHostTypes | orderBy:'displayName'" ng-model="metricsEngine.trustHostType" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'URL' | translate }}</label>
<div ng-if="!editEnable.metricsEngine" class="col-sm-8">
<div>{{metricsEngine.url}}</div>
</div>
<div class="col-sm-8" ng-show="editEnable.metricsEngine">
<input class="form-control" placeholder="{{ 'URL' | translate }}" ng-model="metricsEngine.url" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'USERNAME' | translate }}</label>
<div ng-if="!editEnable.metricsEngine" class="col-sm-8">
<div>{{metricsEngine.username}}</div>
</div>
<div class="col-sm-8" ng-show="editEnable.metricsEngine">
<input class="form-control" placeholder="{{ 'USERNAME' | translate }}" ng-model="metricsEngine.username" pf-validation="cs.isContainsSpace(input)" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PASSWORD' | translate }}</label>
<div ng-if="!editEnable.metricsEngine" class="col-sm-8">
<div>{{metricsEngine.password ? "******" : ""}}</div>
</div>
<div class="col-sm-8" ng-show="editEnable.metricsEngine">
<input type="password" class="form-control" placeholder="{{ 'PASSWORD' | translate }}" ng-model="metricsEngine.password" pf-validation="cs.isContainsSpace(input)" ng-required="metricsEngine.username"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TENANT' | translate }}</label>
<div ng-if="!editEnable.metricsEngine" class="col-sm-8">
<div>{{metricsEngine.tenant}}</div>
</div>
<div class="col-sm-8" ng-show="editEnable.metricsEngine">
<input class="form-control" placeholder="{{ 'DATABASE' | translate }}" ng-model="metricsEngine.tenant" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
</div>
</div>
</div><!-- Hawkular settings -->
<!-- Purge everything -->
<div class="form-group" ng-if="editEnable.metricsEngine">
<label class="col-sm-2 control-label">{{ 'PURGE_EXISTING_DATA' | translate }}</label>
<div class="col-sm-8">
<input type="checkbox" ng-model="metricsEngine.purgeEveryThing">
</div>
</div>
</form>
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.metricsEngine" ng-click="engineChnageWarning()">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.metricsEngine" ng-click="updateSettingsMetricsEngine();editEnable.metricsEngine = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-primary" ng-click="saveMetricsEngine()" ng-show="editEnable.metricsEngine" ng-disabled="saveProgress.metricsEngine || mcFormEngine.$invalid">
<div ng-show="saveProgress.metricsEngine" class="spinner spinner-xs"></div>
{{saveProgress.metricsEngine ? 'SAVING' : 'SAVE' | translate}}
</button>
</div>
</div>
</div><!-- Metrics engine settings -->
<div ng-if="tabSelection==='retention'"> <!-- Metrics data retention settings -->
<div class="card-pf-body">
<form class="form-horizontal" name="mcFormRetention">
<legend>{{ 'DATA' | translate }}: {{ 'DOUBLE' | translate }}, {{ 'COUNTER' | translate }}</legend>
<!-- retain raw data -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RAW_DATA' | translate }}</label>
<div class="col-sm-4" ng-show="editEnable.metricsDataRetention">
<input ng-show="editEnable.metricsDataRetention" class="form-control mc-form-fixer" placeholder="{{ 'RAW_DATA' | translate }}" ng-model="$parent.rRawData.timestamp" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div ng-if="!editEnable.metricsDataRetention" class="col-sm-6">
<div>{{$parent.rRawData.timestamp}} {{$parent.rRawData.timeConstantString}}</div>
</div>
<div class="col-sm-2 mc-form-fixer" ng-show="editEnable.metricsDataRetention" >
<select class="form-control" pf-select ng-model="$parent.rRawData.timeConstant" required>
<option value="" ng-hide="true"></option>
<option value="60000">{{ 'MINUTES' | translate }}</option>
<option value="3600000">{{ 'HOURS' | translate }}</option>
<option value="86400000">{{ 'DAYS' | translate }}</option>
<option value="31536000000">{{ 'YEARS' | translate }}</option>
</select>
</div>
</div>
<!-- retain one minute data -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ONE_MINUTE_DATA' | translate }}</label>
<div class="col-sm-4" ng-show="editEnable.metricsDataRetention">
<input ng-show="editEnable.metricsDataRetention" class="form-control mc-form-fixer" placeholder="{{ 'ONE_MINUTE_DATA' | translate }}" ng-model="$parent.rOneMinute.timestamp" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div ng-if="!editEnable.metricsDataRetention" class="col-sm-6">
<div>{{$parent.rOneMinute.timestamp}} {{$parent.rOneMinute.timeConstantString}}</div>
</div>
<div class="col-sm-2 mc-form-fixer" ng-show="editEnable.metricsDataRetention" >
<select class="form-control" pf-select ng-model="$parent.rOneMinute.timeConstant" required>
<option value="" ng-hide="true"></option>
<option value="60000">{{ 'MINUTES' | translate }}</option>
<option value="3600000">{{ 'HOURS' | translate }}</option>
<option value="86400000">{{ 'DAYS' | translate }}</option>
<option value="31536000000">{{ 'YEARS' | translate }}</option>
</select>
</div>
</div>
<!-- retain five minutes data -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'FIVE_MINUTES_DATA' | translate }}</label>
<div class="col-sm-4" ng-show="editEnable.metricsDataRetention">
<input ng-show="editEnable.metricsDataRetention" class="form-control mc-form-fixer" placeholder="{{ 'FIVE_MINUTES_DATA' | translate }}" ng-model="$parent.rFiveMinutes.timestamp" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div ng-if="!editEnable.metricsDataRetention" class="col-sm-6">
<div>{{$parent.rFiveMinutes.timestamp}} {{$parent.rFiveMinutes.timeConstantString}}</div>
</div>
<div class="col-sm-2 mc-form-fixer" ng-show="editEnable.metricsDataRetention" >
<select class="form-control" pf-select ng-model="$parent.rFiveMinutes.timeConstant" required>
<option value="" ng-hide="true"></option>
<option value="60000">{{ 'MINUTES' | translate }}</option>
<option value="3600000">{{ 'HOURS' | translate }}</option>
<option value="86400000">{{ 'DAYS' | translate }}</option>
<option value="31536000000">{{ 'YEARS' | translate }}</option>
</select>
</div>
</div>
<!-- retain one hour data -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ONE_HOUR_DATA' | translate }}</label>
<div class="col-sm-4" ng-show="editEnable.metricsDataRetention">
<input ng-show="editEnable.metricsDataRetention" class="form-control mc-form-fixer" placeholder="{{ 'ONE_HOUR_DATA' | translate }}" ng-model="$parent.rOneHour.timestamp" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div ng-if="!editEnable.metricsDataRetention" class="col-sm-6">
<div>{{$parent.rOneHour.timestamp}} {{$parent.rOneHour.timeConstantString}}</div>
</div>
<div class="col-sm-2 mc-form-fixer" ng-show="editEnable.metricsDataRetention" >
<select class="form-control" pf-select ng-model="$parent.rOneHour.timeConstant" required>
<option value="" ng-hide="true"></option>
<option value="60000">{{ 'MINUTES' | translate }}</option>
<option value="3600000">{{ 'HOURS' | translate }}</option>
<option value="86400000">{{ 'DAYS' | translate }}</option>
<option value="31536000000">{{ 'YEARS' | translate }}</option>
</select>
</div>
</div>
<!-- retain six hours data -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SIX_HOURS_DATA' | translate }}</label>
<div class="col-sm-4" ng-show="editEnable.metricsDataRetention">
<input ng-show="editEnable.metricsDataRetention" class="form-control mc-form-fixer" placeholder="{{ 'SIX_HOURS_DATA' | translate }}" ng-model="$parent.rSixHours.timestamp" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div ng-if="!editEnable.metricsDataRetention" class="col-sm-6">
<div>{{$parent.rSixHours.timestamp}} {{$parent.rSixHours.timeConstantString}}</div>
</div>
<div class="col-sm-2 mc-form-fixer" ng-show="editEnable.metricsDataRetention" >
<select class="form-control" pf-select ng-model="$parent.rSixHours.timeConstant" required>
<option value="" ng-hide="true"></option>
<option value="60000">{{ 'MINUTES' | translate }}</option>
<option value="3600000">{{ 'HOURS' | translate }}</option>
<option value="86400000">{{ 'DAYS' | translate }}</option>
<option value="31536000000">{{ 'YEARS' | translate }}</option>
</select>
</div>
</div>
<!-- retain twelve hours data -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TWELVE_HOURS_DATA' | translate }}</label>
<div class="col-sm-4" ng-show="editEnable.metricsDataRetention">
<input ng-show="editEnable.metricsDataRetention" class="form-control mc-form-fixer" placeholder="{{ 'TWELVE_HOURS_DATA' | translate }}" ng-model="$parent.rTwelveHours.timestamp" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div ng-if="!editEnable.metricsDataRetention" class="col-sm-6">
<div>{{$parent.rTwelveHours.timestamp}} {{$parent.rTwelveHours.timeConstantString}}</div>
</div>
<div class="col-sm-2 mc-form-fixer" ng-show="editEnable.metricsDataRetention" >
<select class="form-control" pf-select ng-model="$parent.rTwelveHours.timeConstant" required>
<option value="" ng-hide="true"></option>
<option value="60000">{{ 'MINUTES' | translate }}</option>
<option value="3600000">{{ 'HOURS' | translate }}</option>
<option value="86400000">{{ 'DAYS' | translate }}</option>
<option value="31536000000">{{ 'YEARS' | translate }}</option>
</select>
</div>
</div>
<!-- retain twelve hours data -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ONE_DAY_DATA' | translate }}</label>
<div class="col-sm-4" ng-show="editEnable.metricsDataRetention">
<input ng-show="editEnable.metricsDataRetention" class="form-control mc-form-fixer" placeholder="{{ 'ONE_DAY_DATA' | translate }}" ng-model="$parent.rOneDay.timestamp" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div ng-if="!editEnable.metricsDataRetention" class="col-sm-6">
<div>{{$parent.rOneDay.timestamp}} {{$parent.rOneDay.timeConstantString}}</div>
</div>
<div class="col-sm-2 mc-form-fixer" ng-show="editEnable.metricsDataRetention" >
<select class="form-control" pf-select ng-model="$parent.rOneDay.timeConstant" required>
<option value="" ng-hide="true"></option>
<option value="60000">{{ 'MINUTES' | translate }}</option>
<option value="3600000">{{ 'HOURS' | translate }}</option>
<option value="86400000">{{ 'DAYS' | translate }}</option>
<option value="31536000000">{{ 'YEARS' | translate }}</option>
</select>
</div>
</div>
<!-- retain binary data -->
<legend>{{ 'OTHERS' | translate }}</legend>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'BINARY_DATA' | translate }}</label>
<div class="col-sm-4" ng-show="editEnable.metricsDataRetention">
<input ng-show="editEnable.metricsDataRetention" class="form-control mc-form-fixer" placeholder="{{ 'BINARY_DATA' | translate }}" ng-model="$parent.rBinary.timestamp" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div ng-if="!editEnable.metricsDataRetention" class="col-sm-6">
<div>{{$parent.rBinary.timestamp}} {{$parent.rBinary.timeConstantString}}</div>
</div>
<div class="col-sm-2 mc-form-fixer" ng-show="editEnable.metricsDataRetention" >
<select class="form-control" pf-select ng-model="$parent.rBinary.timeConstant" required>
<option value="" ng-hide="true"></option>
<option value="60000">{{ 'MINUTES' | translate }}</option>
<option value="3600000">{{ 'HOURS' | translate }}</option>
<option value="86400000">{{ 'DAYS' | translate }}</option>
<option value="31536000000">{{ 'YEARS' | translate }}</option>
</select>
</div>
</div>
<!-- retain gps data -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'GPS_DATA' | translate }}</label>
<div class="col-sm-4" ng-show="editEnable.metricsDataRetention">
<input ng-show="editEnable.metricsDataRetention" class="form-control mc-form-fixer" placeholder="{{ 'GPS_DATA' | translate }}" ng-model="$parent.rGPS.timestamp" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div ng-if="!editEnable.metricsDataRetention" class="col-sm-6">
<div>{{$parent.rGPS.timestamp}} {{$parent.rGPS.timeConstantString}}</div>
</div>
<div class="col-sm-2 mc-form-fixer" ng-show="editEnable.metricsDataRetention" >
<select class="form-control" pf-select ng-model="$parent.rGPS.timeConstant" required>
<option value="" ng-hide="true"></option>
<option value="60000">{{ 'MINUTES' | translate }}</option>
<option value="3600000">{{ 'HOURS' | translate }}</option>
<option value="86400000">{{ 'DAYS' | translate }}</option>
<option value="31536000000">{{ 'YEARS' | translate }}</option>
</select>
</div>
</div>
</form>
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.metricsDataRetention" ng-click="retentionWarning()">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.metricsDataRetention" ng-click="updateSettingsMetricsRetention();editEnable.metricsDataRetention = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-primary" ng-click="saveMetricsRetention()" ng-show="editEnable.metricsDataRetention" ng-disabled="saveProgress.metricsDataRetention || mcFormRetention.$invalid">
<div ng-show="saveProgress.metricsDataRetention" class="spinner spinner-xs"></div>
{{saveProgress.metricsDataRetention ? 'SAVING' : 'SAVE' | translate}}
</button>
</div>
</div>
</div><!-- Metrics retention settings -->
</div>
</div>
</div> <!-- Settings -->
</div> <!-- Container -->

View File

@@ -0,0 +1,99 @@
<!--
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 mc-top-space-1x">
<!-- Loading icon disaplay -->
<div ng-hide="mqttBrokerSettings.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="mqttBrokerSettings.$resolved"> <!-- Main Message -->
<!-- MySensors -->
<div class="col-md-12">
<div class="card-pf card-pf-accented">
<div class="card-pf-heading"><h2 class="card-pf-title"><i class="fa fa-star-o fa-lg"></i> {{ 'MQTT_BROKER' | translate }}</h2></div>
<div class="card-pf-body">
<form class="form-horizontal" name="mcFormMqttBroker">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'STATUS' | translate }}</label>
<div class="col-sm-10">
<div ng-if="!mqttBrokerSettings.enabledOnBackend" class="text-warning" ng-bind-html="'MQTT_BROKER_DISABLED_BACKEND' | translate"></div>
<input ng-if="mqttBrokerSettings.enabledOnBackend" bs-switch ng-change="editEnable.mqttBroker = true" ng-model="mqttBrokerSettings.enabled" type="checkbox"
switch-animate="true" switch-handle-width="55px" switch-label-width="3px"
switch-off-color="default" switch-on-color="primary" ng-true-value="true"
ng-false-value="false" switch-on-text="{{ 'ENABLED' | translate }}" switch-off-text="{{ 'DISABLED' | translate }}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ALLOW_ANONYMOUS' | translate }}</label>
<div class="col-sm-5">
<div ng-if="!mqttBrokerSettings.enabledOnBackend">{{ mqttBrokerSettings.allowAnonymous ? 'YES' : 'NO' | translate }}</div>
<input ng-if="mqttBrokerSettings.enabledOnBackend" bs-switch ng-change="editEnable.mqttBroker = true" ng-model="mqttBrokerSettings.allowAnonymous" type="checkbox"
switch-animate="true" switch-handle-width="55px" switch-label-width="3px"
switch-off-color="default" switch-on-color="danger" ng-true-value="true"
ng-false-value="false" switch-on-text="{{ 'YES' | translate }}" switch-off-text="{{ 'NO' | translate }}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'BIND_ADDRESS' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.mqttBroker" class="form-control" ng-model="mqttBrokerSettings.bindAddress" pf-validation="cs.isContainsSpace(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NO_SPACE_ALLOWED' | translate }}</span>
<div ng-hide="editEnable.mqttBroker">{{ mqttBrokerSettings.bindAddress }}</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'MQTT_PORT' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.mqttBroker" class="form-control" ng-model="mqttBrokerSettings.mqttPort" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
<div ng-hide="editEnable.mqttBroker">{{ mqttBrokerSettings.mqttPort }}</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'WEBSOCKET_PORT' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.mqttBroker" class="form-control" ng-model="mqttBrokerSettings.websocketPort" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
<div ng-hide="editEnable.mqttBroker">{{mqttBrokerSettings.websocketPort}}</div>
</div>
</div>
</form>
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.mqttBroker" ng-click="editEnable.mqttBroker = true" ng-disabled="!mqttBrokerSettings.enabledOnBackend">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.mqttBroker" ng-click="updateSettingsMqttBroker();editEnable.mqttBroker = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-primary" ng-click="saveSettings()" ng-show="editEnable.mqttBroker" ng-disabled="saveProgress.mqttBroker || mcFormMqttBroker.$invalid">
<div ng-show="saveProgress.mqttBroker" class="spinner spinner-xs"></div>
{{saveProgress.mqttBroker ? 'SAVING' : 'SAVE' | translate}}
</button>
</div>
</div>
</div>
</div>
</div> <!-- Main Message -->
</div> <!-- Container -->

View File

@@ -0,0 +1,72 @@
<!--
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 mc-top-space-1x">
<!-- Loading icon disaplay -->
<div ng-hide="mySensorsSettings.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="mySensorsSettings.$resolved"> <!-- Main Message -->
<!-- MySensors -->
<div class="col-md-12">
<div class="card-pf card-pf-accented">
<div class="card-pf-heading"><h2 class="card-pf-title"><i class="fa fa-star-o fa-lg"></i> {{ 'MY_SENSORS' | translate }}</h2></div>
<div class="card-pf-body">
<form class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'DEFAULT_FIRMWARE' | translate }}</label>
<div class="col-sm-5">
<span ng-hide="editEnable.mySensors">{{defaultFirmware || 'NOT_SET' | translate }}</span>
<div ng-show="editEnable.mySensors">
<select class="form-control" pf-select data-live-search="true" ng-options="firmware.id as firmware.displayName for firmware in firmwares" ng-model="mySensorsSettings.defaultFirmware">
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label" uib-tooltip="{{ 'ENABLE_DEFAULT_ON_NO_FIRMWARE_TOOLTIP' | translate }}" tooltip-placement="bottom">{{ 'ENABLE_DEFAULT_ON_NO_FIRMWARE' | translate }}</label>
<div class="col-sm-5">
<input bs-switch ng-change="editEnable.mySensors = true" ng-model="mySensorsSettings.enbaledDefaultOnNoFirmware" type="checkbox"
switch-animate="true" switch-handle-width="55px" switch-label-width="3px"
switch-off-color="default" switch-on-color="primary" ng-true-value="true"
ng-false-value="false" switch-on-text="{{ 'ENABLED' | translate }}" switch-off-text="{{ 'DISABLED' | translate }}">
</div>
</div>
</form>
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.mySensors" ng-click="editEnable.mySensors = true">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.mySensors" ng-click="updateSettingsMySensors();editEnable.mySensors = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-primary" ng-click="saveMySensors()" ng-show="editEnable.mySensors" ng-disabled="saveProgress.mySensors">
<div ng-show="saveProgress.mySensors" class="spinner spinner-xs"></div>
{{saveProgress.mySensors ? 'SAVING' : 'SAVE' | translate}}
</button>
</div>
</div>
</div>
</div>
</div> <!-- Main Message -->
</div> <!-- Container -->

View File

@@ -0,0 +1,292 @@
<!--
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 mc-top-space-1x">
<!-- Loading icon disaplay -->
<div ng-hide="smsSettings.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="smsSettings.$resolved"> <!-- Main Message -->
<!-- Email settings -->
<div class="col-md-12">
<div class="card-pf card-pf-accented">
<div class="card-pf-heading"><h2 class="card-pf-title"><i class="fa fa-envelope-o fa-lg"></i> {{ 'EMAIL' | translate }}</h2></div>
<div class="card-pf-body">
<form class="form-horizontal" name="mcFormEmailNotification">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SMTP_HOST' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.email" class="form-control" ng-model="emailSettings.smtpHost" required />
<span ng-hide="editEnable.email">{{emailSettings.smtpHost}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SMTP_PORT' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.email" class="form-control" ng-model="emailSettings.smtpPort" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
<div ng-hide="editEnable.email">{{emailSettings.smtpPort}}</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'FROM_ADDRESS' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.email" class="form-control" ng-model="emailSettings.fromAddress" required />
<span ng-hide="editEnable.email">{{emailSettings.fromAddress}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ENABLE_SSL' | translate }}</label>
<div class="col-sm-5">
<input bs-switch ng-change="editEnable.email = true" ng-model="emailSettings.enableSsl" type="checkbox"
switch-animate="true" switch-handle-width="55px" switch-label-width="3px"
switch-off-color="default" switch-on-color="primary" ng-true-value="true"
ng-false-value="false" switch-on-text="{{ 'ENABLED' | translate }}" switch-off-text="{{ 'DISABLED' | translate }}">
</div>
</div>
<div class="form-group" ng-if="emailSettings.enableSsl">
<label class="col-sm-2 control-label">{{ 'USE' | translate }}</label>
<div class="col-sm-5">
<label class="mc-margin-right"><input ng-disabled="!editEnable.email" type="radio" ng-model="emailSettings.useStartTLS"data-ng-value="false"> SSL</label>
<label><input ng-disabled="!editEnable.email" type="radio" ng-model="emailSettings.useStartTLS" data-ng-value="true"> STARTTLS</label>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SMTP_USERNAME' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.email" class="form-control" ng-model="emailSettings.smtpUsername"/>
<span ng-hide="editEnable.email">{{emailSettings.smtpUsername}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SMTP_PASSWORD' | translate }}</label>
<div class="col-sm-5">
<input type="password" ng-show="editEnable.email" class="form-control" ng-model="emailSettings.smtpPassword"/>
<span ng-hide="editEnable.email">**********</span>
</div>
</div>
</form>
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.email" ng-click="editEnable.email = true">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.email" ng-click="updateSettingsEmail();editEnable.email = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.email" ng-click="sendTestEmail()"
ng-disabled="saveProgress.email || mcFormEmailNotification.$invalid">
<div ng-if="testing.email" class="spinner spinner-xs"></div>
{{testing.email ? 'TESTING' : 'TEST_CONNECTION' | translate}}
</button>
<button type="button" class="btn btn-primary" ng-click="saveEmail()" ng-show="editEnable.email" ng-disabled="saveProgress.email || mcFormEmailNotification.$invalid">
<div ng-show="saveProgress.email" class="spinner spinner-xs"></div>
{{saveProgress.email ? 'SAVING' : 'SAVE' | translate}}
</button>
</div>
</div>
</div>
</div>
<!-- Pushbullet settings -->
<div class="col-md-12">
<div class="card-pf card-pf-accented">
<div class="card-pf-heading"><h2 class="card-pf-title"><i class="fa fa-mobile fa-lg"></i> {{ 'PUSHBULLET' | translate }}</h2></div>
<div class="card-pf-body">
<form class="form-horizontal" name="mcFormPushbulletNotification">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ACCESS_TOKEN' | translate }}</label>
<div class="col-sm-7">
<input ng-show="editEnable.pushbullet" class="form-control" ng-model="pushbulletSettings.accessToken" required />
<span ng-hide="editEnable.pushbullet">**********</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'IDEN' | translate }}</label>
<div class="col-sm-7">
<span>{{pushbulletSettings.iden}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ACTIVE' | translate }}</label>
<div class="col-sm-7">
<span>{{pushbulletSettings.active}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NAME' | translate }}</label>
<div class="col-sm-7">
<span>{{pushbulletSettings.name}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'EMAIL' | translate }}</label>
<div class="col-sm-7">
<span>{{pushbulletSettings.email}}</span>
</div>
</div>
</form>
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.pushbullet" ng-click="editEnable.pushbullet = true">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.pushbullet" ng-click="updateSettingsPushbullet();editEnable.pushbullet = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-primary" ng-click="savePushbullet()" ng-show="editEnable.pushbullet" ng-disabled="saveProgress.pushbullet || mcFormPushbulletNotification.$invalid">
<div ng-show="saveProgress.pushbullet" class="spinner spinner-xs"></div>
{{saveProgress.pushbullet ? 'SAVING' : 'SAVE' | translate}}
</button>
</div>
</div>
</div>
</div>
<!-- TelegramBot settings -->
<div class="col-md-12">
<div class="card-pf card-pf-accented">
<div class="card-pf-heading"><h2 class="card-pf-title"><i class="fa fa-telegram fa-lg"></i> {{ 'TELEGRAM_BOT' | translate }}</h2></div>
<div class="card-pf-body">
<form class="form-horizontal" name="mcFormTelegramBotNotification">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TOKEN' | translate }}</label>
<div class="col-sm-7">
<input ng-show="editEnable.telegramBot" class="form-control" ng-model="telegramBotSettings.token" required />
<span ng-hide="editEnable.telegramBot">**********</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ID' | translate }}</label>
<div class="col-sm-7">
<span>{{telegramBotSettings.id}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'IS_BOT' | translate }}</label>
<div class="col-sm-7">
<span>{{telegramBotSettings.isBot}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'FIRST_NAME' | translate }}</label>
<div class="col-sm-7">
<span>{{telegramBotSettings.firstName}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'USERNAME' | translate }}</label>
<div class="col-sm-7">
<span>{{telegramBotSettings.username}}</span>
</div>
</div>
</form>
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.telegramBot" ng-click="editEnable.telegramBot = true">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.telegramBot" ng-click="updateSettingsTelegramBot();editEnable.telegramBot = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-primary" ng-click="saveTelegramBot()" ng-show="editEnable.telegramBot" ng-disabled="saveProgress.telegramBot || mcFormTelegramBotNotification.$invalid">
<div ng-show="saveProgress.telegramBot" class="spinner spinner-xs"></div>
{{saveProgress.telegramBot ? 'SAVING' : 'SAVE' | translate}}
</button>
</div>
</div>
</div>
</div>
<!-- SMS settings -->
<div class="col-md-12">
<div class="card-pf card-pf-accented">
<div class="card-pf-heading"><h2 class="card-pf-title"><i class="fa fa-mobile fa-lg"></i> {{ 'SMS' | translate }}</h2></div>
<div class="card-pf-body">
<form class="form-horizontal" name="mcFormSMSNotification">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'VENDOR' | translate }}</label>
<div class="col-sm-5">
<div ng-show="editEnable.sms">
<select class="form-control" pf-select ng-model="smsSettings.vendor" required>
<option value="" ng-hide="true"></option>
<option value="Plivo">{{ 'PLIVO' | translate }}</option>
<option value="Twilio">{{ 'TWILIO' | translate }}</option>
</select>
</div>
<span ng-hide="editEnable.sms">{{smsSettings.vendor}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'AUTH_ID_SID' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.sms" class="form-control" ng-model="smsSettings.authSid" required />
<span ng-hide="editEnable.sms">{{smsSettings.authSid}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'AUTH_TOKEN' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.sms" class="form-control" ng-model="smsSettings.authToken" required />
<span ng-hide="editEnable.sms">**********</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'FROM_PHONE_NUMBER' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.sms" class="form-control" ng-model="smsSettings.fromNumber" required />
<span ng-hide="editEnable.sms">{{smsSettings.fromNumber}}</span>
</div>
</div>
</form>
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.sms" ng-click="editEnable.sms = true">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.sms" ng-click="updateSettingsSms();editEnable.sms = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-primary" ng-click="saveSms()" ng-show="editEnable.sms" ng-disabled="saveProgress.sms || mcFormSMSNotification.$invalid">
<div ng-show="saveProgress.sms" class="spinner spinner-xs"></div>
{{saveProgress.sms ? 'SAVING' : 'SAVE' | translate}}
</button>
</div>
</div>
</div>
</div>
</div> <!-- Main Message -->
</div> <!-- Container -->

View File

@@ -0,0 +1,361 @@
<!--
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 mc-top-space-1x">
<!-- Loading icon disaplay -->
<div ng-hide="controllerSettings.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="controllerSettings.$resolved"> <!-- Main Message -->
<!-- Location settings -->
<div class="col-md-12">
<div class="card-pf card-pf-accented">
<div class="card-pf-heading"><h2 class="card-pf-title"><i class="fa fa-map-marker fa-lg"></i> {{ 'LOCATION' | translate }}</h2></div>
<div class="card-pf-body">
<form class="form-horizontal" name="mcForm">
<div class="form-group">
<label class="col-sm-2 control-label"><i class="wi wi-sunrise mc-icon-2x" uib-tooltip="{{ 'SUNRISE' | translate }}" tooltip-placement="left"></i></label>
<div class="col-sm-10">
<span class="mc-icon">{{locationSettings.sunriseTime | date:mchelper.cfg.timeFormatWithoutSeconds : mchelper.cfg.timezone}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label"><i class="wi wi-sunset mc-icon-2x" uib-tooltip="{{ 'SUNSET' | translate }}" tooltip-placement="left"></i></label>
<div class="col-sm-10">
<span class="mc-icon">{{locationSettings.sunsetTime | date:mchelper.cfg.timeFormatWithoutSeconds : mchelper.cfg.timezone}}</span>
</div>
</div>
<div class="form-group" ng-show="editEnable.location">
<label class="col-sm-2 control-label">{{ 'LOCATION' | translate }}</label>
<div class="col-sm-2">
<button type="button" class="btn btn-default" class="button" ng-click="updateGeoLocation()"><i class="fa fa-map-marker fa-lg"></i> {{ 'UPDATE' | translate }}</button>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'LATITUDE' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.location" class="form-control" ng-model="locationSettings.latitude" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
<div ng-hide="editEnable.location">{{locationSettings.latitude}}</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'LONGITUDE' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.location" class="form-control" ng-model="locationSettings.longitude" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
<div ng-hide="editEnable.location">{{locationSettings.longitude}}</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'LOCATION_NAME' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.location" class="form-control" ng-model="locationSettings.name" required />
<div ng-hide="editEnable.location">{{locationSettings.name}}</div>
</div>
</div>
</form>
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.location" ng-click="editEnable.location = true">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.location" ng-click="updateSettingsLocation();editEnable.location = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-primary" ng-click="saveLocation()" ng-show="editEnable.location" ng-disabled="saveProgress.location || mcForm.$invalid">
<div ng-show="saveProgress.location" class="spinner spinner-xs"></div>
{{saveProgress.location ? 'SAVING' : 'SAVE' | translate}}
</button>
</div>
</div>
</div>
</div>
<!-- Controller settings -->
<div class="col-md-12">
<div class="card-pf card-pf-accented">
<div class="card-pf-heading"><h2 class="card-pf-title"><i class="fa fa-star-o fa-lg"></i> {{ 'MY_CONTROLLER' | translate }}</h2></div>
<div class="card-pf-body">
<form class="form-horizontal" name="mcFormController">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NODES_ALIVE_CHECK_INTERVAL' | translate }}</label>
<div class="col-sm-5" ng-hide="editEnable.controller">
<span>{{aliveCheckMinutes}} {{ 'MINUTES' | translate }}</span>
</div>
<div ng-show="editEnable.controller">
<div class="col-sm-2">
<input class="form-control" ng-model="aliveCheckMinutes" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div class="col-sm-3 mc-form-fixer">
<span>{{ 'MINUTES' | translate }}</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'EXECUTE_DISCOVER_INTERVAL' | translate }}</label>
<div class="col-sm-5" ng-hide="editEnable.controller">
<span>{{executeDiscoverMinutes}} {{ 'MINUTES' | translate }}</span>
</div>
<div ng-show="editEnable.controller">
<div class="col-sm-2">
<input class="form-control" ng-model="executeDiscoverMinutes" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div class="col-sm-3 mc-form-fixer">
<span>{{ 'MINUTES' | translate }}</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'UNITS_CONFIGURATION' | translate }}</label>
<div class="col-sm-5">
<div ng-show="editEnable.controller">
<select class="form-control" pf-select ng-model="controllerSettings.unitConfig">
<option value="Metric">{{ 'METRIC' | translate }}</option>
<option value="Imperial">{{ 'IMPERIAL' | translate }}</option>
</select>
</div>
<span ng-hide="editEnable.controller">{{controllerSettings.unitConfig.toUpperCase() | translate}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RESOURCES_LOG_LEVEL' | translate }}</label>
<div class="col-sm-5">
<div ng-show="editEnable.controller">
<select class="form-control" pf-select ng-options="ll.displayName as ll.displayName for ll in logLevels" ng-model="controllerSettings.resourcesLogLevel">
<option value="" ng-hide="true"></option>
</select>
</div>
<span ng-hide="editEnable.controller">{{controllerSettings.resourcesLogLevel}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RESOURCES_LOG_RETENTION_DURATION' | translate }}</label>
<div class="col-sm-5" ng-hide="editEnable.controller">
<span>{{resourcesLogsRetentionDurationMinutes}} {{ 'MINUTES' | translate }}</span>
</div>
<div ng-show="editEnable.controller">
<div class="col-sm-2">
<input class="form-control" ng-model="resourcesLogsRetentionDurationMinutes" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div class="col-sm-3 mc-form-fixer">
<span>{{ 'MINUTES' | translate }}</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'REGISTER_NODES_AUTOMATICALLY' | translate }}</label>
<div class="col-sm-5">
<input bs-switch ng-change="editEnable.controller = true" ng-model="controllerSettings.autoNodeRegistration" type="checkbox"
switch-animate="true" switch-handle-width="55px" switch-label-width="3px"
switch-off-color="default" switch-on-color="primary" ng-true-value="true"
ng-false-value="false" switch-on-text="{{ 'ENABLED' | translate }}" switch-off-text="{{ 'DISABLED' | translate }}">
</div>
</div>
<legend></legend>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'DASHBOARD_LIMIT' | translate }}</label>
<div class="col-sm-5" ng-hide="editEnable.controller">
<span>{{controllerSettings.dashboardLimit}}</span>
</div>
<div ng-show="editEnable.controller">
<div class="col-sm-2">
<input class="form-control" ng-model="controllerSettings.dashboardLimit" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TABLE_ROWS_LIMIT' | translate }}</label>
<div class="col-sm-5" ng-hide="editEnable.controller">
<span>{{controllerSettings.tableRowsLimit}}</span>
</div>
<div ng-show="editEnable.controller">
<div class="col-sm-2">
<input class="form-control" ng-model="controllerSettings.tableRowsLimit" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'GLOBAL_PAGE_REFRESH_TIME' | translate }}</label>
<div class="col-sm-5" ng-hide="editEnable.controller">
<span>{{globalPageRefreshTime}} {{ 'SECONDS' | translate }}</span>
</div>
<div ng-show="editEnable.controller">
<div class="col-sm-2">
<input class="form-control" ng-model="globalPageRefreshTime" pf-validation="cs.isNumber(input)" required />
<span class="help-block">{{ 'VALIDATION_ERROR_NUMBER' | translate }}</span>
</div>
<div class="col-sm-3 mc-form-fixer">
<span>{{ 'SECONDS' | translate }}</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'LANGUAGE' | translate }}</label>
<div class="col-sm-5">
<div ng-show="editEnable.controller">
<select class="form-control" pf-select ng-options="lg.displayName as lg.displayName for lg in languages" ng-model="controllerSettings.language">
<option value="" ng-hide="true"></option>
</select>
</div>
<span ng-hide="editEnable.controller">{{controllerSettings.language}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TIME_FORMAT' | translate }}</label>
<div class="col-sm-5">
<div ng-show="editEnable.controller">
<select class="form-control" pf-select ng-model="controllerSettings.timeFormat">
<option value="12 hours">{{ '12_HOURS' | translate }}</option>
<option value="24 hours">{{ '24_HOURS' | translate }}</option>
</select>
</div>
<span ng-hide="editEnable.controller">{{controllerSettings.timeFormat.toUpperCase().replace(" ", "_") | translate}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'GRANT_ACCESS_TO_CHILD_RESOURCES_IN_ROLES' | translate }}</label>
<div class="col-sm-5">
<input bs-switch ng-change="editEnable.controller = true" ng-model="controllerSettings.grantAccessToChildResources" type="checkbox"
switch-animate="true" switch-handle-width="55px" switch-label-width="3px"
switch-off-color="default" switch-on-color="primary" ng-true-value="true"
ng-false-value="false" switch-on-text="{{ 'ENABLED' | translate }}" switch-off-text="{{ 'DISABLED' | translate }}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'WIDGET_IMAGE_FILES_DISK_LOCATION' | translate }}</label>
<div class="col-sm-5" ng-hide="editEnable.controller">
<span>{{controllerSettings.widgetImageFilesLocation}}</span>
</div>
<div ng-show="editEnable.controller">
<div class="col-sm-5">
<input class="form-control" ng-model="controllerSettings.widgetImageFilesLocation" />
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'LOGIN_MESSAGE' | translate }}</label>
<div class="col-sm-5">
<textarea ng-show="editEnable.controller" class="form-control" ng-model="controllerSettings.loginMessage" placeholder="{{ 'LOGIN_MESSAGE' | translate }}" rows="4"></textarea>
<p ng-hide="editEnable.controller" ng-bind-html="controllerSettings.loginMessage"></span>
</div>
</div>
</form>
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.controller" ng-click="editEnable.controller = true">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.controller" ng-click="updateSettingsController();editEnable.controller = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-primary" ng-click="saveController()" ng-show="editEnable.controller" ng-disabled="saveProgress.controller || mcFormController.$invalid">
<div ng-show="saveProgress.controller" class="spinner spinner-xs"></div>
{{saveProgress.controller ? 'SAVING' : 'SAVE' | translate}}
</button>
</div>
</div>
</div>
</div>
<!-- System Jobs settings -->
<div class="col-md-12">
<div class="card-pf card-pf-accented">
<div class="card-pf-heading"><h2 class="card-pf-title"><i class="fa fa-star-o fa-lg"></i> {{ 'SYSTEM_JOBS' | translate }}</h2></div>
<div class="card-pf-body">
<form class="form-horizontal" name="mcForm">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'METRICS_AGGREGATION_JOB' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.systemJobs" class="form-control" ng-model="systemJobs.metricsAggregation" required />
<div ng-hide="editEnable.systemJobs">{{systemJobs.metricsAggregation}}</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RESOURCES_LOGS_AGGREGATION_JOB' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.systemJobs" class="form-control" ng-model="systemJobs.resourcesLogsAggregation" required />
<div ng-hide="editEnable.systemJobs">{{systemJobs.resourcesLogsAggregation}}</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'DAILY_ONCE_JOB' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.systemJobs" class="form-control" ng-model="systemJobs.dailyOnce" required />
<div ng-hide="editEnable.systemJobs">{{systemJobs.dailyOnce}}</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RULE_DEFINITION_ENGINE_JOB' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.systemJobs" class="form-control" ng-model="systemJobs.ruleDefinitionEngine" required />
<div ng-hide="editEnable.systemJobs">{{systemJobs.ruleDefinitionEngine}}</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RULE_DEFINITION_RE_ENABLE_JOB' | translate }}</label>
<div class="col-sm-5">
<input ng-show="editEnable.systemJobs" class="form-control" ng-model="systemJobs.ruleDefinitionReEnable" required />
<div ng-hide="editEnable.systemJobs">{{systemJobs.ruleDefinitionReEnable}}</div>
</div>
</div>
</form>
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.systemJobs" ng-click="systemJobsWarning()">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.systemJobs" ng-click="updateSettingsSystemJobs();editEnable.systemJobs = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-primary" ng-click="saveSystemJobsLocal()" ng-show="editEnable.systemJobs" ng-disabled="saveProgress.systemJobs || mcForm.$invalid">
<div ng-show="saveProgress.systemJobs" class="spinner spinner-xs"></div>
{{saveProgress.systemJobs ? 'SAVING' : 'SAVE' | translate}}
</button>
</div>
</div>
</div>
</div>
</div> <!-- Main Message -->
</div> <!-- Container -->

View File

@@ -0,0 +1,65 @@
<!--
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 mc-top-space-1x">
<!-- Loading icon disaplay -->
<div ng-hide="mcAbout.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="mcAbout.$resolved"> <!-- Main Message -->
<div class="col-lg-12">
<div class="card-pf card-pf-accented">
<div class="card-pf-body">
<legend><small><small>{{ 'MY_CONTROLLER' | translate }}</small></small></legend>
<dl class="dl-horizontal">
<dt>{{ 'VERSION' | translate }}</dt> <dd>{{mcAbout.applicationVersion}}</dd>
<dt>{{ 'DATABASE_SCHEMA_REVISION' | translate }}</dt> <dd>{{mcAbout.applicationDbVersion}}</dd>
<dt>{{ 'DATABASE_TYPE' | translate }}</dt> <dd>{{mcAbout.databaseType}}</dd>
<dt>{{ 'DATABASE_VERSION' | translate }}</dt> <dd>{{mcAbout.databaseVersion}}</dd>
<dt>{{ 'GIT_COMMIT_BRANCH' | translate }}</dt> <dd>{{mcAbout.gitCommit}}:{{mcAbout.gitBranch}}</dd>
<dt>{{ 'BUILT_ON' | translate }}</dt> <dd>{{mcAbout.gitBuiltOn}}</dd>
<dt>{{ 'BUILD_JDK' | translate }}</dt> <dd>{{mcAbout.gitBuildJdk}}</dd>
<dt>{{ 'BUILD_TOOL' | translate }}</dt> <dd>{{mcAbout.gitCreatedBy}}</dd>
</dl>
<legend><small><small>{{ 'JAVA_VIRTUAL_MACHINE_SPECIFICATION' | translate }}</small></small></legend>
<dl class="dl-horizontal">
<dt>{{ 'VM_VENDOR' | translate }}</dt> <dd>{{mcAbout.javaVmVendor}}</dd>
<dt>{{ 'VM_NAME' | translate }}</dt> <dd>{{mcAbout.javaVmName}}</dd>
<dt>{{ 'VM_VERSION' | translate }}</dt> <dd>{{mcAbout.javaRuntimeVersion}}</dd>
<dt>{{ 'JAVA_HOME' | translate }}</dt> <dd>{{mcAbout.javaHome}}</dd>
</dl>
<legend><small><small>{{ 'OPERATING_SYSTEM' | translate }}</small></small></legend>
<dl class="dl-horizontal">
<dt>{{ 'OPERATING_SYSTEM' | translate }}</dt> <dd>{{mcAbout.osName}}</dd>
<dt>{{ 'ARCHITECTURE' | translate }}</dt> <dd>{{mcAbout.osArch}}</dd>
<dt>{{ 'VERSION_KERNEL' | translate }}</dt> <dd>{{mcAbout.osVersion}}</dd>
<dt>{{ 'LOCATION' | translate }}</dt> <dd>{{mcAbout.applicationLocation}}</dd>
</dl>
</div>
</div>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,47 @@
<!--
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="initialLog.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="initialLog.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="btn-toolbar" style="margin-bottom: 10px;">
<!-- buttons -->
<button class="btn btn-default pull-right" ng-click="refreshLogs()" type="button">
<i class="fa fa-refresh"></i> {{ 'REFRESH' | translate }}</button>
</div>
<!--
<span class="mc-log text-{{getLogLevel(log)}}" ng-repeat="log in logData track by $index">
{{log}}
</span>
-->
<pre style="white-space: pre-wrap">
{{logData}}
</pre>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,137 @@
<!--
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 mc-top-space-1x">
<!-- Loading icon disaplay -->
<div ng-hide="jvmStatus.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="jvmStatus.$resolved"> <!-- Main Message -->
<div class="col-lg-12">
<div class="card-pf card-pf-accented">
<div>
<ul ng-init="tabSelection='java'" class="nav nav-tabs nav-tabs-pf">
<li ng-class="{'active' : tabSelection==='java'}"><a ng-click="tabSelection='java'" href=""><i class="icon-java-bold fa-2x"></i> <span class="mc-icon-md-3">{{ 'JAVA_VIRTUAL_MACHINE_SPECIFICATION' | translate }}</span></a></li>
<li ng-class="{'active' : tabSelection==='os'}"><a ng-click="tabSelection='os'" href=""><i class="icon-raspberrypi fa-2x"></i> <span class="mc-icon-md-3">{{ 'OPERATING_SYSTEM' | translate }}</span></a></li>
<li ng-class="{'active' : tabSelection==='se'}"><a ng-click="tabSelection='se'" href=""><i class="icon-python fa-2x"></i> <span class="mc-icon-md-3">{{ 'SCRIPT_ENGINES' | translate }}</span></a></li>
</ul>
</div>
<div ng-if="tabSelection==='java'" class="card-pf-body">
<dl class="dl-horizontal">
<dt>{{ 'JAVA_HOME' | translate }}</dt> <dd>{{osStatus.javaHome}}</dd>
<dt>{{ 'JAVA_VENDOR_URL' | translate }}</dt> <dd>{{osStatus.javaVendorUrl}}</dd>
<dt>{{ 'VM_NAME' | translate }}</dt> <dd>{{jvmStatus.jvmInfo.vmName}}</dd>
<dt>{{ 'VM_VENDOR' | translate }}</dt> <dd>{{jvmStatus.jvmInfo.vmVendor}}</dd>
<dt>{{ 'VM_VERSION' | translate }}</dt> <dd>{{jvmStatus.jvmInfo.vmVersion}}</dd>
<dt>{{ 'SPECIFICATION_VENDOR' | translate }}</dt> <dd>{{jvmStatus.jvmInfo.specVendor}}</dd>
<dt>{{ 'SPECIFICATION_VERSION' | translate }}</dt> <dd>{{jvmStatus.jvmInfo.specVersion}}</dd>
<dt>{{ 'MANAGEMENT_SPECIFICATION_VERSION' | translate }}</dt> <dd>{{jvmStatus.jvmInfo.managementSpecVersion}}</dd>
<dt>{{ 'UP_TIME' | translate }}</dt> <dd>{{jvmStatus.jvmInfo.uptime | millSecondsToTimeString}}</dd>
<dt>{{ 'HEAP_MEMORY' | translate }}</dt>
<dd>
{{ 'USED' | translate }}: {{jvmStatus.memory.heapMemoryUsage.used | byteToMBsizeConvertor}},
{{ 'COMMITTED' | translate }}: {{jvmStatus.memory.heapMemoryUsage.committed | byteToMBsizeConvertor}},
{{ 'INIT' | translate }}: {{jvmStatus.memory.heapMemoryUsage.init | byteToMBsizeConvertor}},
{{ 'MAX' | translate }}: {{jvmStatus.memory.heapMemoryUsage.max | byteToMBsizeConvertor}}
</dd>
<dt>{{ 'NON_HEAP_MEMORY' | translate }}</dt>
<dd>
{{ 'USED' | translate }}: {{jvmStatus.memory.nonHeapMemoryUsage.used | byteToMBsizeConvertor}},
{{ 'COMMITTED' | translate }}: {{jvmStatus.memory.nonHeapMemoryUsage.committed | byteToMBsizeConvertor}},
{{ 'INIT' | translate }}: {{jvmStatus.memory.nonHeapMemoryUsage.init | byteToMBsizeConvertor}},
{{ 'MAX' | translate }}: {{jvmStatus.memory.nonHeapMemoryUsage.max | byteToMBsizeConvertor}}
</dd>
<dt>{{ 'THREADS_COUNT' | translate }}</dt>
<dd>
{{ 'CURRENT' | translate }}: {{jvmStatus.thread.threadCount}},
{{ 'PEAK' | translate }}: {{jvmStatus.thread.peakThreadCount}},
{{ 'TOTAL_STARTED' | translate }}: {{jvmStatus.thread.totalStartedThreadCount}},
{{ 'DAEMON' | translate }}: {{jvmStatus.thread.daemonThreadCount}}
</dd>
<dt>{{ 'CLASS_LOADING_DETAILS' | translate }}</dt>
<dd>
{{ 'LOADED' | translate }}: {{jvmStatus.classLoadingDetail.loadedClassCount}},
{{ 'UNLOADED' | translate }}: {{jvmStatus.classLoadingDetail.unloadedClassCount}},
{{ 'TOTAL_LOADED' | translate }}: {{jvmStatus.classLoadingDetail.totalLoadedClassCount}}
</dd>
<span ng-repeat="garbageCollector in jvmStatus.garbageCollectors">
<dt>{{ 'GARBAGE_COLLECTOR' | translate }} - {{garbageCollector.name}}</dt>
<dd>
{{ 'COLLECTION_TIME' | translate }}: {{garbageCollector.collectionTime}},
{{ 'COLLECTION_COUNT' | translate }}: {{garbageCollector.collectionCount}},
{{ 'LAST_GARBAGECOLLECTOR_DURATION' | translate }}: {{garbageCollector.lastGcDuration}}
</dd>
</span>
</dl>
<div class="form-actions text-right">
<button ng-if="mchelper.user.permission === 'Super admin'" type="button" class="btn btn-default" class="button" ng-click="runGC()">
<i class="fa fa-recycle fa-lg"></i> {{ 'RUN_GARBAGE_COLLECTION' | translate }}
</button>
</div>
</div>
<div ng-if="tabSelection==='os'" class="card-pf-body">
<dl class="dl-horizontal">
<dt>{{ 'OPERATING_SYSTEM' | translate }}</dt> <dd>{{osStatus.name}}</dd>
<dt>{{ 'ARCHITECTURE' | translate }}</dt> <dd>{{osStatus.arch}}</dd>
<dt>{{ 'VERSION_KERNEL' | translate }}</dt> <dd>{{osStatus.version}}</dd>
<dt>{{ 'AVAILABLE_PROCESS' | translate }}</dt> <dd>{{osStatus.availableProcess}}</dd>
<dt>{{ 'SYSTEM_LOAD_AVERAGE' | translate }}</dt> <dd>{{osStatus.systemLoadAverage}}</dd>
<dt>{{ 'SYSTEM_CPU_LOAD' | translate }}</dt> <dd>{{osStatus.systemCpuLoad}}</dd>
<dt>{{ 'PROCESS_CPU' | translate }}</dt> <dd>{{ 'LOAD' | translate }}: {{osStatus.processCpuLoad}}, {{ 'TIME' | translate }}: {{osStatus.processCpuTime}}</dd>
<dt>{{ 'PHYSICAL_MEMORY' | translate }}</dt>
<dd>
{{ 'FREE' | translate }}: {{osStatus.freePhysicalMemorySize | byteToMBsizeConvertor}},
{{ 'TOTAL' | translate }}: {{osStatus.totalPhysicalMemorySize | byteToMBsizeConvertor}}
</dd>
<dt>{{ 'SWAP_SPACE' | translate }}</dt>
<dd>
{{ 'FREE' | translate }}: {{osStatus.freeSwapSpaceSize | byteToMBsizeConvertor}},
{{ 'TOTAL' | translate }}: {{osStatus.totalSwapSpaceSize | byteToMBsizeConvertor}}
</dd>
<dt>{{ 'COMMITTED_VIRTUAL_MEMORY_SIZE' | translate }}</dt> <dd>{{osStatus.committedVirtualMemorySize | byteToMBsizeConvertor}}</dd>
<dt>{{ 'USER_WORKING_DIRECTORY' | translate }}</dt> <dd>{{osStatus.userWorkingDir}}</dd>
</dl>
</div>
<div ng-if="tabSelection==='se'" class="card-pf-body">
<div ng-repeat="engine in scriptEngines track by $index">
<legend><small>{{$index+1}}) {{engine.engineName}}</small></legend>
<dl class="dl-horizontal">
<dt>{{ 'NAME' | translate }}</dt> <dd>{{engine.engineName}}</dd>
<dt>{{ 'VERSION' | translate }}</dt> <dd>{{engine.engineVersion}}</dd>
<dt>{{ 'LANGUAGE' | translate }}</dt> <dd>{{engine.languageName}}</dd>
<dt>{{ 'LANGUAGE_VERSION' | translate }}</dt> <dd>{{engine.languageVersion}}</dd>
<dt>{{ 'EXTENSIONS' | translate }}</dt> <dd>{{engine.extensions.join(', ')}}</dd>
<dt>{{ 'ALIAS' | translate }}</dt> <dd>{{engine.alias.join(', ')}}</dd>
</dl>
</div>
</div>
</div>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,64 @@
<!--
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>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true" ng-click="cancel()">
<span class="pficon pficon-close"></span>
</button>
<div class="modal-title"><b>{{header}}</b></div>
</div>
<div class="modal-body modal-body-text-only">
<form class="form-horizontal" name="mcForm">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TEMPLATE' | translate }}</label>
<div class="col-sm-10">
<label>{{request.template}}</label>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'SCRIPT' | translate }}</label>
<div class="col-sm-10">
<select class="form-control" pf-select data-live-search="true" ng-options="script for script in scripts" ng-model="request.script" >
<option value="" ng-hide="false">{{ 'NOTHING_SELECTED' | translate }}</option>
</select>
</div>
</div>
<div class="form-group" ng-if="request.script">
<label class="col-sm-2 control-label">{{ 'SCRIPT_BINDINGS' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'SCRIPT_BINDINGS' | translate }}" ng-model="request.bindings" pf-validation="cs.isJsonString(input)" required />
<span class="help-block">{{ 'SYNTAX_ERROR' | translate }}</span>
</div>
</div>
</form>
<div ng-if="templateResult">
<legend><small>{{ 'RESULT' | translate }}</small></legend>
<mc-dynamic ng-bind-html="templateResult"></mc-dynamic>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-default" ng-click="cancel()"><i class="fa fa-close"></i> {{ 'CANCEL' | translate }}</button>
<button class="btn btn-primary" ng-click="runNow()" ng-disabled="runningInProgress || mcForm.$invalid">
<div ng-if="runningInProgress" class="spinner spinner-xs"></div>
<i class="fa fa-play"></i> {{runningInProgress ? ('RUNNING' | translate):('RUN' | translate)}}</button>
</div>
</div>

View File

@@ -0,0 +1,77 @@
<!--
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="showData">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-if="showData"> <!-- 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-7">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NAME' | translate }}</label>
<div class="col-sm-10">
<input ng-if="!editMode" class="form-control" placeholder="{{ 'FILE_NAME' | translate }}" ng-model="item.name" required />
<span ng-if="editMode" >{{item.name}}</span>
</div>
</div>
<!-- extension -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'EXTENSION' | translate }}</label>
<div class="col-sm-5">
<select class="form-control" pf-select ng-model="item.extension" ng-disabled="editMode" required >
<option value="" ng-hide="true"></option>
<option value="html">HTML</option>
</select>
</div>
</div>
<!-- File -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'FILE' | translate }}</label>
<div class="col-sm-5">
<input type="file" class="form-control" id="firmware.file" on-read-file="displayFileContents(contents)" ng-accept="'.*'" ng-model="file">
</div>
</div>
<!-- File content list -->
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'CONTENT' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" rows="21" style="resize:none" ng-model="item.data" required ></textarea>
</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 -->

View File

@@ -0,0 +1,96 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || runNow()" class="text-default"><i class="pficon fa-lg pficon-running"></i> {{ 'RUN_NOW' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="templatesAddEdit">{{ 'ADD_TEMPLATE' | translate }}</a>
</div>
</div>
<!-- for now always hide sort by. this moment this feature not supported -->
<div class="pull-right mc-v-margin" ng-show="false">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'NAME' | translate }}</th>
<th>{{ 'EXTENSION' | translate }}</th>
<th>{{ 'FILE_SIZE' | translate }}</th>
<th>{{ 'LAST_MODIFIED' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.name) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.name) != -1"></td>
<td>{{item.name}}</td>
<td>{{item.extension}}</td>
<td>{{item.size | byteToFriendlyConvertor}}</td>
<td><span uib-tooltip="{{item.lastModified | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="left" am-time-ago="item.lastModified"></span></td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,185 @@
<!--
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 -->

View File

@@ -0,0 +1,106 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || clone()" class="text-default"><i class="fa fa-lg fa-files-o"></i> {{ 'CLONE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || enable()" class="text-default"><i class="fa fa-lg fa-circle"></i> {{ 'ENABLE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || disable()" class="text-danger"><i class="fa fa-lg fa-circle-thin"></i> {{ 'DISABLE' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="timersAddEdit"><i class="fa fa-plus"></i> {{ 'ADD' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'ENABLED' | translate }}</th>
<th>{{ 'NAME' | translate }}</th>
<th>{{ 'TYPE' | translate }}</th>
<th>{{ 'VALIDITY' | translate }}</th>
<th>{{ 'OPERATIONS' | translate }}</th>
<th>{{ 'LAST_FIRED' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td class="text-center">
<i ng-show="item.enabled" class="text-success fa fa-circle fa-lg" uib-tooltip="{{ 'ENABLED' | translate }}"></i>
<i ng-hide="item.enabled" class="text-danger fa fa-circle-o fa-lg" uib-tooltip="{{ 'DISABLED' | translate }}"></i>
</td>
<td>{{item.name}}</td>
<td>{{item.timerDataString}}</td>
<td>{{item.validityString}}</td>
<td>{{item.operations.join(', ')}}</td>
<td>
<span uib-tooltip="{{item.lastFire | date:mchelper.cfg.dateFormat:mchelper.cfg.timezone}}" tooltip-placement="left" am-time-ago="item.lastFire"></span>
</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,140 @@
<!--
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-if="!data.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-if="data.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div class="mc-top-space-header">
<legend style="margin-bottom:10px;">{{headerStringList}}</legend>
</div>
<div ng-if="isEmpty(data.items)" class="mc-top-space-1x">
<div class="blank-slate-pf">
<div class="blank-slate-pf-icon">
<i class="{{noItemsSystemIcon}}"></i>
</div>
<h1>{{noItemsSystemMsg}}</h1>
</div>
</div>
<div ng-if="!isEmpty(data.items)">
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space">
<label class="mc-align-center mc-top-space-5px checkbox-inline">
<input id="box" ng-change="refresh()" ng-false-value="false" ng-model="query.realtime" ng-true-value="true" type="checkbox" class="ng-pristine ng-untouched ng-valid ng-empty">
{{ 'REALTIME' | translate }}
</label>
</div>
<div class="btn-group mc-side-space">
<label class="mc-align-center mc-top-space-5px checkbox-inline">
<input id="box" ng-change="show_hide_names(checkboxModel.value)" ng-false-value="false" ng-model="checkboxModel.value" ng-true-value="true" type="checkbox" class="ng-pristine ng-untouched ng-valid ng-empty">
{{ 'DISPLAY_NAMES' | translate }}
</label>
</div>
<button class="btn btn-default mc-side-space" ng-click="refresh()">
<i class="fa fa-refresh fa-lg"></i>
{{ 'REFRESH' | translate }}
</button>
</div>
<div class="btn-toolbar pull-left" role="toolbar">
<form role="form" style="width: 250px;" class="search-pf has-button">
<div class="form-group has-clear">
<div class="search-pf-input-group">
<label for="search" class="sr-only">{{ 'SEARCH' | translate }}</label>
<input id="search" type="search" class="form-control" ng-model="search.query" placeholder="{{ 'SEARCH' | translate }}">
<button type="button" class="clear" ng-click="resetSearch()" aria-hidden="true"><span class="pficon pficon-close"></span></button>
</div>
</div>
<div class="form-group">
<button class="btn btn-default" ng-click="searchNode()" type="button"><span class="fa fa-search"></span></button>
</div>
</form>
</div>
</div>
<div class="container_topology" id="topology_kind_list">
<div class="legend">
<kubernetes-topology-icon kind="Gateway" ng-if="displayKinds.gateway">
<svg class="kube-topology">
<use xlink:href="#vertex-Gateway" x="21" y="22"></use>
</svg>
<label>{{ 'GATEWAYS' | translate }}</label>
</kubernetes-topology-icon>
<kubernetes-topology-icon kind="Node" ng-if="displayKinds.node">
<svg class="kube-topology">
<use xlink:href="#vertex-Node" x="21" y="22"></use>
</svg>
<label>{{ 'NODES' | translate }}</label>
</kubernetes-topology-icon>
<kubernetes-topology-icon kind="Sensor" ng-if="displayKinds.sensor">
<svg class="kube-topology">
<use xlink:href="#vertex-Sensor" x="21" y="22"></use>
</svg>
<label>{{ 'SENSORS' | translate }}</label>
</kubernetes-topology-icon>
<kubernetes-topology-icon kind="SensorVariable" ng-if="displayKinds.sensorVariable">
<svg class="kube-topology">
<use xlink:href="#vertex-SensorVariable" x="21" y="22"></use>
</svg>
<label>{{ 'SENSOR_VARIABLES' | translate }}</label>
</kubernetes-topology-icon>
</div>
</div>
<kubernetes-topology-graph style="height: {{topologyHeight}}px" items="data.items" relations="data.relations" kinds="kinds">
</kubernetes-topology-graph>
</div>
</div> <!-- Container-fluid -->
<!-- define icon to list -->
<svg class="kube-topology" hidden>
<defs>
<g class="Gateway" id="vertex-Gateway">
<circle r="15"></circle>
<text y="6" style="font-family:FontAwesome;fill:#663333">&#xf1e6;</text>
</g>
<g class="McNode" id="vertex-Node">
<circle r="15"></circle>
<text y="6" style="font-family:FontAwesome;fill:#1186C1">&#xf0e8;</text>
</g>
<g class="Sensor" id="vertex-Sensor">
<circle r="15"></circle>
<text y="6" style="font-family:FontAwesome;fill:#9467bd">&#xf06e;</text>
</g>
<g class="SensorVariable" id="vertex-SensorVariable">
<circle r="15"></circle>
<text y="6" style="font-family:FontAwesome;fill:#ff7f0e">&#xf005;</text>
</g>
</defs>
</svg>

View File

@@ -0,0 +1,66 @@
<!--
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-5">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'UID' | translate }}</label>
<div class="col-sm-5">
<input class="form-control" ng-model="item.uid" placeholder="{{ 'UID' | translate }}" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RESOURCE' | translate }}</label>
<div class="col-sm-4 mc-form-fixer-left">
<select class="form-control" pf-select ng-options="rT.displayName as rT.displayName for rT in resourceTypes"
ng-change="resourcesList = cs.getResources(item.resourceType); item.resourceId=''" ng-model="item.resourceType" required>
<option value="" ng-hide="true"></option>
</select>
</div>
<div class="col-sm-6 mc-form-fixer" ng-hide="item.resourceType === ''"><!-- List Resource -->
<select class="form-control" pf-select data-live-search="true" ng-model="item.resourceId" required>
<option value="" ng-hide="true"></option>
<option ng-repeat="res in resourcesList" ng-bind-html="res.displayName | mcResourceRepresentation" value="{{res.id}}" ng-selected="res.id == item.resourceId"></option>
</select>
</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 -->

View File

@@ -0,0 +1,92 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="uidTagsAddEdit">{{ 'ADD_AN_ENTRY' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'UID' | translate }}</th>
<th>{{ 'RESOURCE' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td>{{item.uid}}</td>
<td ng-bind-html="item.resourceName | mcResourceRepresentation"></td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,90 @@
<!--
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 mc-top-space-1x"> <!-- Container-fluid -->
<!-- Loading icon disaplay -->
<div ng-hide="item.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="item.$resolved"> <!-- Main Message -->
<!-- Email settings -->
<div class="col-md-12">
<div class="card-pf card-pf-accented">
<div class="card-pf-heading"><h2 class="card-pf-title"><i class="pficon pficon-user fa-lg"></i> {{ 'PROFILE' | translate }}</h2></div>
<div class="card-pf-body">
<form class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'USERNAME' | translate }}</label>
<div class="col-sm-7">
<span>{{item.user.username}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'FULL_NAME' | translate }}</label>
<div class="col-sm-7">
<input ng-show="editEnable.profile" class="form-control" ng-model="item.user.fullName"/>
<span ng-hide="editEnable.profile">{{item.user.fullName}}</span>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'EMAIL' | translate }}</label>
<div class="col-sm-7">
<input ng-show="editEnable.profile" class="form-control" ng-model="item.user.email"/>
<span ng-hide="editEnable.profile">{{item.user.email}}</span>
</div>
</div>
<div ng-show="editEnable.profile">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'CURRENT_PASSWORD' | translate }}</label>
<div class="col-sm-7">
<input type="password" class="form-control" placeholder="{{ 'CURRENT_PASSWORD' | translate }}" ng-model="item.currentPassword"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NEW_PASSWORD' | translate }}</label>
<div class="col-sm-7">
<input type="password" class="form-control" placeholder="{{ 'NEW_PASSWORD' | translate }}" ng-model="item.user.password"/>
</div>
</div>
</div>
</form>
<div class="form-actions text-right">
<button type="button" class="btn btn-default" class="button" ng-hide="editEnable.profile" ng-click="editEnable.profile = true">{{ 'EDIT' | translate }}</button>
<button type="button" class="btn btn-default" class="button" ng-show="editEnable.profile" ng-click="resetProfile();editEnable.profile = false">{{ 'CANCEL' | translate }}</button>
<button type="button" class="btn btn-primary" ng-click="save()" ng-show="editEnable.profile" ng-disabled="saveProgress">
<div ng-show="saveProgress" class="spinner spinner-xs"></div>
{{ 'SAVE' | translate }}
</button>
</div>
</div>
</div>
</div>
</div> <!-- Main Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,141 @@
<!--
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="rolePermissions.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="rolePermissions.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-add-update.html'"></div>
<div>
<form class="form-horizontal" name="mcForm">
<div class="col-md-8">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'NAME' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'NAME' | translate }}" ng-model="item.name" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'DESCRIPTION' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" ng-model="item.description" placeholder="{{ 'DESCRIPTION' | translate }}" rows="3"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PERMISSION' | translate }}</label>
<div class="col-sm-5">
<div ng-show="item.permission === 'Super admin'">
<label>{{item.permission}}</label>
</div>
<div ng-if="item.permission !== 'Super admin'">
<select class="form-control" pf-select ng-options="permission.displayName as permission.displayName for permission in rolePermissions" ng-change="refreshVariableTypes(sensor.type)" ng-model="item.permission" required >
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
</div>
<div ng-show="item.permission === 'MQTT user'">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TOPICS_PUBLISH' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" ng-model="item.topicsPublish" placeholder="topics publish comma separated" rows="3"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'TOPICS_SUBSCRIBE' | translate }}</label>
<div class="col-sm-10">
<textarea class="form-control" ng-model="item.topicsSubscribe" placeholder="topics subscribe comma separated" rows="3"></textarea>
</div>
</div>
</div>
<div ng-show="item.permission !== undefined">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'RESOURCES' | translate }}</label>
<div class="col-sm-10">
<div class="card-pf card-pf-accented">
<div class="card-pf-body">
<ul class="nav nav-tabs" ng-init="showResource = 'users'" >
<li ng-class="{'active' : showResource === 'users'}"><a href="" ng-click="showResource = 'users'">{{ 'USERS' | translate }}</a></li>
<li ng-show="item.permission === 'User'" ng-class="{'active' : showResource === 'gateways'}"><a href="" ng-click="showResource = 'gateways'">{{ 'GATEWAYS' | translate }}</a></li>
<li ng-show="item.permission === 'User'" ng-class="{'active' : showResource === 'nodes'}"><a href="" ng-click="showResource = 'nodes'">{{ 'NODES' | translate }}</a></li>
<li ng-show="item.permission === 'User'" ng-class="{'active' : showResource === 'sensors'}"><a href="" ng-click="showResource = 'sensors'">{{ 'SENSORS' | translate }}</a></li>
</ul>
<div ng-show="showResource === 'users'">
<select ng-options="ls.id as ls.displayName for ls in users" multiple
ng-model="item.users" bs-duallistbox
move-on-select="true"
filter="false"
select-min-height="250"
></select>
</div>
<div ng-if="item.permission === 'User'" ng-show="showResource === 'gateways'">
<select ng-options="ls.id as ls.displayName for ls in gateways" multiple
ng-model="item.gateways" bs-duallistbox
move-on-select="true"
filter="false"
select-min-height="250"
></select>
</div>
<div ng-if="item.permission === 'User'" ng-show="showResource === 'nodes'">
<select ng-options="ls.id as ls.displayName for ls in nodes" multiple
ng-model="item.nodes" bs-duallistbox
move-on-select="true"
filter="false"
select-min-height="250"
></select>
</div>
<div ng-if="item.permission === 'User'" ng-show="showResource === 'sensors'">
<select ng-options="ls.id as ls.displayName for ls in sensors" multiple
ng-model="item.sensors" bs-duallistbox
move-on-select="true"
filter="false"
select-min-height="250"
></select>
</div>
</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 Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,93 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="settingsRolesAddEdit">{{ 'ADD_ROLE' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="exampleSimpleSort" config="sortConfig"></div>
</div>
<div pf-filter id="nodesFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'NAME' | translate }}</th>
<th>{{ 'PERMISSION' | translate }}</th>
<th>{{ 'DESCRIPTION' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td>{{item.name}}</td>
<td>{{item.permission}}</td>
<td>{{item.description}}</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,95 @@
<!--
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="roles.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="roles.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-add-update.html'"></div>
<div>
<form class="form-horizontal" name="mcForm">
<div class="col-md-8">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ENABLED' | translate }}</label>
<div class="col-sm-10">
<input type="checkbox" ng-model="item.user.enabled">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'USERNAME' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'USERNAME' | translate }}" ng-model="item.user.username" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'FULL_NAME' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'FULL_NAME' | translate }}" ng-model="item.user.fullName" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'EMAIL' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'EMAIL' | translate }}" ng-model="item.user.email" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'PASSWORD' | translate }}</label>
<div class="col-sm-10">
<input type="password" class="form-control" placeholder="{{ 'PASSWORD' | translate }}" ng-model="item.user.password" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'ROLES' | translate }}</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 roles" multiple
ng-model="item.roles" bs-duallistbox
move-on-select="true"
filter="false"
select-min-height="250"
></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 Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,100 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || enable()" class="text-default"><i class="fa fa-lg fa-circle"></i> {{ 'ENABLE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || disable()" class="text-danger"><i class="fa fa-lg fa-circle-thin"></i> {{ 'DISABLE' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="settingsUsersAddEdit">{{ 'ADD_USER' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="exampleSimpleSort" config="sortConfig"></div>
</div>
<div pf-filter id="nodesFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-if="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th class="col-lg-1">{{ 'ENABLED' | translate }}</th>
<th>{{ 'USERNAME' | translate }}</th>
<th>{{ 'FULL_NAME' | translate }}</th>
<th>{{ 'EMAIL' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td class="text-center">
<i ng-show="item.enabled" class="text-success fa fa-circle fa-lg" uib-tooltip="Enabled"></i>
<i ng-hide="item.enabled" class="text-danger fa fa-circle-o fa-lg" uib-tooltip="Disabled"></i>
</td>
<td>{{item.username}}</td>
<td>{{item.fullName}}</td>
<td>{{item.email}}</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,58 @@
<!--
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="sensorVariableTypes.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="sensorVariableTypes.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-add-update.html'"></div>
<div>
<form class="form-horizontal">
<div class="col-md-4">
<div class="form-group">
<label class="col-md-3 control-label">{{ 'TYPE' | translate }}</label>
<div class="col-md-9">
<label>{{item.displayName}}</label>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{{ 'VARIABLE_TYPES' | translate }}</label>
<div class="col-md-9">
<select class="form-control" multiple data-live-search="true" pf-select ng-options="svt.displayName as svt.displayName for svt in sensorVariableTypes | orderBy:'displayName'" ng-model="item.value">
<option value="" ng-hide="true"></option>
</select>
</div>
</div>
<!-- Include save form buttons -->
<div ng-include src="'partials/common-html/save-form.html'"></div>
</div>
</form>
</div>
</div> <!-- Main Message -->
</div> <!-- container -->

View File

@@ -0,0 +1,71 @@
<!--
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-if="!orgList.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-if="orgList.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<!-- Single button -->
<div class="btn-group" role="group">
<a ng-class="{'disabled': !itemName}" class="btn btn-primary" type="button" ng-click="editItem()"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></a>
</div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="orgList.length > 0"></div>
</div>
<!-- Display When no data on table -->
<div ng-if="orgList.length > 0 && filteredList.length == 0">
<legend></legend>
<div class="blank-slate-pf" >
<div class="blank-slate-pf-icon">
<i class="fa fa-exclamation-triangle"></i>
</div>
<h1>{{ 'NO_ITEMS_IN_FILTER' | translate }}</h1>
</div>
</div>
<div ng-if="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="col-md-1">{{ 'SENSOR_TYPE' | translate }}</th>
<th class="col-md-11">{{ 'VARIABLES' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | orderBy:'displayName' | itemsPerPage: query.pageLimit" pagination-id="variable-mapper" ng-click="selectItem(item)" ng-class="{'mc-selected': itemName === item.displayName}" >
<td class="col-md-1">{{item.displayName}}</td>
<td class="col-md-11">{{item.value.join(', ')}}</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" pagination-id="variable-mapper"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->

View File

@@ -0,0 +1,70 @@
<!--
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="showData">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-if="showData"> <!-- 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-7">
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'KEY' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'KEY' | translate }}" ng-model="item.key" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'VALUE' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'VALUE' | translate }}" ng-model="item.value" required />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'VALUE2' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'VALUE2' | translate }}" ng-model="item.value2" />
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">{{ 'VALUE3' | translate }}</label>
<div class="col-sm-10">
<input class="form-control" placeholder="{{ 'VALUE3' | translate }}" ng-model="item.value3" />
</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 -->

View File

@@ -0,0 +1,94 @@
<!--
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="queryResponse.$resolved">
<div ng-include src="'partials/common-html/loading.html'"></div>
</div>
<div ng-show="queryResponse.$resolved"> <!-- Main Message -->
<!-- Page Header -->
<div ng-include src="'partials/common-html/header-list.html'"></div>
<div class="col-md-12">
<div class="btn-toolbar pull-right" role="toolbar">
<div class="btn-group mc-side-space" ng-show="filteredList.length > 0">
<label class="mc-align-center mc-top-space-5px">Showing {{(query.pageLimit * (query.page - 1))+1}} to {{getMin(getMin(query.pageLimit * query.page, queryResponse.query.totalItems), queryResponse.query.filteredCount)}} of {{queryResponse.query.totalItems}} items</label>
</div>
<div class="btn-group" role="group" aria-label="" ng-show="filteredList.length > 0">
<!-- Single button -->
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" ng-disabled="itemIds.length == 0">
{{ 'ACTIONS' | translate }} <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-class="{'disabled': itemIds.length == 0}"><a href='' ng-click="itemIds.length == 0 || delete()" class="text-danger"><i class="fa fa-lg fa-trash"></i> {{ 'DELETE' | translate }}</a></li>
<li ng-class="{'disabled': itemIds.length != 1}"><a href='' ng-click="itemIds.length != 1 || edit()" class="text-default"><i class="fa fa-lg fa-edit"></i> {{ 'EDIT' | translate }}</a></li>
</ul>
</div>
</div>
<div class="btn-group" role="group">
<a class="btn btn-primary" type="button" ui-sref="variablesRepositoryAddEdit">{{ 'ADD_VARIABLE' | translate }}</a>
</div>
</div>
<div class="pull-right mc-v-margin" ng-show="filteredList.length > 0">
<div pf-sort id="itemsSort" config="sortConfig"></div>
</div>
<div pf-filter id="itemsFilter" config="filterConfig" ng-show="queryResponse.query.totalItems > 0"></div>
</div>
<!-- Display No Items on system -->
<div ng-include src="'partials/common-html/no-items-system.html'"></div>
<!-- Display When no data on table -->
<div ng-include src="'partials/common-html/no-items-filter.html'"></div>
<div ng-show="filteredList.length > 0">
<!-- Table -->
<table class="table table-hover table-bordered table-striped mc-table">
<thead>
<th class="mc-align-center"><input type="checkbox" ng-checked="itemIds.length == filteredList.length" ng-click="selectAllItems()"></th>
<th>{{ 'KEY' | translate }}</th>
<th>{{ 'VALUE' | translate }}</th>
<th>{{ 'VALUE2' | translate }}</th>
<th>{{ 'VALUE3' | translate }}</th>
</thead>
<tbody>
<tr dir-paginate="item in filteredList | itemsPerPage: query.pageLimit" total-items="queryResponse.query.totalItems" current-page="currentPage"
ng-class="{'mc-selected': itemIds.indexOf(item.id) != -1}" ng-click="selectItem(item)">
<td class="mc-align-center"><input type="checkbox" ng-checked="itemIds.indexOf(item.id) != -1"></td>
<td>{{item.key}}</td>
<td>{{item.value}}</td>
<td>{{item.value2}}</td>
<td>{{item.value3}}</td>
</tr>
</tbody>
</table>
<dir-pagination-controls class="pull-right" boundary-links="true" on-page-change="pageChanged(newPageNumber)"></dir-pagination-controls>
</div>
</div> <!-- Main Message -->
</div> <!-- Container-fluid -->