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,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 -->