Initial setup of mycontroller
This commit is contained in:
301
www/partials/external-servers/external-server-add-edit.html
Normal file
301
www/partials/external-servers/external-server-add-edit.html
Normal 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 -->
|
||||
100
www/partials/external-servers/external-servers-list.html
Normal file
100
www/partials/external-servers/external-servers-list.html
Normal 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 -->
|
||||
Reference in New Issue
Block a user