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