Skip to content

Commit

Permalink
Merge pull request #504 from mycontroller-org/development
Browse files Browse the repository at this point in the history
release 1.5.0
  • Loading branch information
jkandasa authored Dec 11, 2019
2 parents 828633c + 2aba103 commit b4e9a0c
Show file tree
Hide file tree
Showing 135 changed files with 5,903 additions and 750 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: java
jdk:
- oraclejdk8
- openjdk8
branches:
only:
- master
Expand Down
4 changes: 2 additions & 2 deletions dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>org.mycontroller.standalone</groupId>
<artifactId>mycontroller-standalone-parent</artifactId>
<version>1.4.0.Final</version>
<version>1.5.0</version>
</parent>

<artifactId>mycontroller-dist</artifactId>
Expand All @@ -32,7 +32,7 @@
<properties>
<mc.dist.finalName>${project.artifactId}-standalone-${project.version}</mc.dist.finalName>
<mc.dist.jar.finalName>${mc.dist.finalName}-single</mc.dist.jar.finalName>
<mc.gui.version>29</mc.gui.version>
<mc.gui.version>30</mc.gui.version>
</properties>

<dependencies>
Expand Down
16 changes: 15 additions & 1 deletion dist/src/main/package/www/app.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2015-2018 Jeeva Kandasamy ([email protected])
* Copyright 2015-2019 Jeeva Kandasamy ([email protected])
* and other contributors as indicated by the @author tags.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -567,6 +567,20 @@ myControllerModule.config(function($stateProvider, $urlRouterProvider) {
data: {
requireLogin: true
}
}).state('settingsExportList', {
url:"/settings/export/list",
templateUrl: "partials/export/export-list.html?mcv=${mc.gui.version}",
controller: "ExportControllerList",
data: {
requireLogin: true
}
}).state('settingsExportAuto', {
url:"/settings/export/settings",
templateUrl: "partials/export/automatic-export-settings.html?mcv=${mc.gui.version}",
controller: "ExportControllerAutoSettings",
data: {
requireLogin: true
}
})

/* Login */
Expand Down
224 changes: 224 additions & 0 deletions dist/src/main/package/www/controllers/export.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,224 @@
/*
* Copyright 2015-2019 Jeeva Kandasamy ([email protected])
* and other contributors as indicated by the @author tags.
*
* 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.
*/
myControllerModule.controller('ExportControllerList', function(alertService, $scope, $filter, displayRestError, ExportImportFactory, $filter, mchelper, CommonServices, $uibModal) {
//GUI page settings
$scope.headerStringList = $filter('translate')('EXPORTS_DETAIL');
$scope.noItemsSystemMsg = $filter('translate')('NO_EXPORTS_SETUP');
$scope.noItemsSystemIcon = "fa fa-upload";

//load empty, configuration, etc.,
$scope.mchelper = mchelper;
$scope.filteredList=[];

//data query details
$scope.currentPage = 1;
$scope.query = CommonServices.getQuery();
$scope.queryResponse = {};

//Get min number
$scope.getMin = function(item1, item2){
return CommonServices.getMin(item1, item2);
};

//get all items
$scope.getAllItems = function(){
ExportImportFactory.getAll($scope.query, function(response) {
$scope.queryResponse = response;
$scope.filteredList = $scope.queryResponse.data;
$scope.filterConfig.resultsCount = $scope.queryResponse.query.filteredCount;
},function(error){
$scope.queryResponse.$resolved = true;
displayRestError.display(error);
});
}


//Hold all the selected item ids
$scope.itemIds = [];

$scope.selectAllItems = function(){
CommonServices.selectAllItems($scope, 'name');
};

$scope.selectItem = function(item){
CommonServices.selectItem($scope, item, 'name');
};

//On page change
$scope.pageChanged = function(newPage){
CommonServices.updatePageChange($scope, newPage);
};

//Filter change method
var filterChange = function (filters) {
//Reset filter fields and update items
CommonServices.updateFiltersChange($scope, filters);
};

$scope.filterConfig = {
fields: [
{
id: 'name',
title: $filter('translate')('NAME'),
placeholder: $filter('translate')('FILTER_BY_NAME'),
filterType: 'text'
}
],
resultsCount: $scope.filteredList.length,
appliedFilters: [],
onFilterChange: filterChange
};

//Sort columns [*** NOT IN USE ***]
var sortChange = function (sortId, isAscending) {
//Reset sort type and update items
CommonServices.updateSortChange($scope, sortId, isAscending);
};

$scope.sortConfig = {
fields: [
{
id: 'name',
title: $filter('translate')('NAME'),
sortType: 'text'
}
],
onSortChange: sortChange
};

//Pre load
$scope.disableRunExport = false;

//Delete item(s)
$scope.delete = function (size) {
var modalInstance = $uibModal.open({
templateUrl: 'partials/common-html/delete-modal.html',
controller: 'ControllerDeleteModal',
size: size,
resolve: {}
});

modalInstance.result.then(function () {
ExportImportFactory.deleteIds($scope.itemIds, function(response) {
alertService.success($filter('translate')('ITEMS_DELETED_SUCCESSFULLY'));
//Update display table
$scope.getAllItems();
$scope.itemIds = [];
},function(error){
displayRestError.display(error);
});
}),
function () {
//console.log('Modal dismissed at: ' + new Date());
}
};

//export now
$scope.exportNow = function(){
$scope.disableRunExport = true;
ExportImportFactory.exportNow({"rowLimit": 1000}, function(){
$scope.getAllItems();
alertService.success($filter('translate')('EXPORT_TRIGGERED_SUCCESSFULLY'));
$scope.disableRunExport = false;
},function(error){
displayRestError.display(error);
$scope.disableRunExport = false;
});
};

//Import
$scope.importItemFn = function (size) {
var addModalInstance = $uibModal.open({
templateUrl: 'partials/export/import-confirmation-modal.html',
controller: 'ExportControllerImport',
size: size,
resolve: {fileName: function () {return {'name': $scope.itemIds[0]}}}
});

addModalInstance.result.then(function () {
ExportImportFactory.importNow({"fileName": $scope.itemIds[0]}, function(response) {
alertService.success($filter('translate')('IMPORT_INITIATED_SUCCESSFULLY')+' '+response.message);
},function(error){
displayRestError.display(error);
});
}),
function () {
//console.log('Modal dismissed at: ' + new Date());
}
};

});

//restore Modal
myControllerModule.controller('ExportControllerImport', function ($scope, $uibModalInstance, $filter, fileName) {
$scope.header = $filter('translate')('IMPORT_CONFIRMATION_TITLE', fileName);
$scope.rebootMsg = $filter('translate')('IMPORT_CONFIRMATION_MESSAGE', fileName);
$scope.importNow = function() {$uibModalInstance.close(); };
$scope.cancel = function () { $uibModalInstance.dismiss('cancel'); }
});

//Automatice export settings
myControllerModule.controller('ExportControllerAutoSettings', function ($scope, ExportImportFactory, mchelper, alertService, displayRestError, $filter, CommonServices) {
$scope.mchelper = mchelper;
$scope.item = {};
$scope.item.enabled = false;
$scope.cs = CommonServices;

$scope.resetSettings = function(){
ExportImportFactory.getSettings(function(response) {
$scope.item = response;
//Update dropdown
if($scope.item.interval % 86400000 == 0){
$scope.intervalLocal = $scope.item.interval / 86400000;
$scope.intervalTimeConstant = "86400000";
$scope.intervalTimeConstantString = $filter('translate')('DAYS');
}else if($scope.item.interval % 3600000 == 0){
$scope.intervalLocal = $scope.item.interval / 3600000;
$scope.intervalTimeConstant = "3600000";
$scope.intervalTimeConstantString = $filter('translate')('Hours');
}else if($scope.item.interval % 60000 == 0){
$scope.intervalLocal = $scope.item.interval / 60000;
$scope.intervalTimeConstant = "60000";
$scope.intervalTimeConstantString = $filter('translate')('Minutes');
}
},function(error){
displayRestError.display(error);
});
}

//GUI page settings
$scope.saveProgress = false;

//Load details
$scope.resetSettings();

$scope.save = function(){
if($scope.item.enabled){
//Update time
$scope.item.interval = $scope.intervalLocal * $scope.intervalTimeConstant;
}
$scope.saveProgress = true;
ExportImportFactory.updateSettings($scope.item,function(response) {
$scope.saveProgress = false;
$scope.editEnable.exportSettings = false;
$scope.resetSettings();
},function(error){
displayRestError.display(error);
$scope.saveProgress = false;
});
}
});
4 changes: 3 additions & 1 deletion dist/src/main/package/www/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
<script src="libs/adf-widget-news/dist/adf-widget-news.min.js?mcv=${mc.gui.version}"></script>
<script src="controllers/adf-widgets/adf-myc-asg/adf-myc-a-sensor-graph.js?mcv=${mc.gui.version}"></script>
<script src="controllers/adf-widgets/adf-myc-cb/adf-myc-custom-buttons.js?mcv=${mc.gui.version}"></script>
<script src="controllers/adf-widgets/adf-myc-os/adf-myc-os-commands.js?mcv=${mc.gui.version}"></script>
<script src="controllers/adf-widgets/adf-myc-os/adf-myc-os-commands.js?mcv=${mc.gui.version}"></script>
<script src="controllers/adf-widgets/adf-myc-cw/adf-myc-custom-widget.js?mcv=${mc.gui.version}"></script>
<script src="controllers/adf-widgets/adf-myc-dsi/adf-myc-display-static-image.js?mcv=${mc.gui.version}"></script>
<script src="controllers/adf-widgets/adf-myc-groups/adf-myc-groups.js?mcv=${mc.gui.version}"></script>
Expand All @@ -173,6 +173,7 @@
<script src="app.js?mcv=${mc.gui.version}"></script>
<script src="controllers/additional-headers.js?mcv=${mc.gui.version}"></script>
<script src="controllers/backup.js?mcv=${mc.gui.version}"></script>
<script src="controllers/export.js?mcv=${mc.gui.version}"></script>
<script src="controllers/dashboard.js?mcv=${mc.gui.version}"></script>
<script src="controllers/external-servers.js?mcv=${mc.gui.version}"></script>
<script src="controllers/firmwares.js?mcv=${mc.gui.version}"></script>
Expand Down Expand Up @@ -367,6 +368,7 @@
<li ng-show="mchelper.user.permission === 'Super admin'" ng-class="{ active: $state.current.name.indexOf('settingsUsers') == 0 }"><a ui-sref="settingsUsersList"><i class="fa fa-users fa-lg"></i> {{ 'USERS' | translate }}</a></li>
<li ng-show="mchelper.user.permission === 'Super admin'" ng-class="{ active: $state.current.name.indexOf('settingsRoles') == 0 }"><a ui-sref="settingsRolesList"><i class="pficon pficon-registry fa-lg mc-margin-right"></i>{{ 'ROLES' | translate }}</a></li>
<li ng-show="mchelper.user.permission === 'Super admin'" ng-class="{ active: $state.current.name.indexOf('settingsBackup') == 0 }"><a ui-sref="settingsBackupList"><i class="fa fa fa-database fa-lg"></i> {{ 'BACKUP' | translate }}</a></li>
<li ng-show="mchelper.user.permission === 'Super admin'" ng-class="{ active: $state.current.name.indexOf('settingsExport') == 0 }"><a ui-sref="settingsExportList"><i class="fa fa fa-upload fa-lg"></i> {{ 'EXPORT' | translate }}</a></li>
</ul>
</li>
</ul>
Expand Down
18 changes: 17 additions & 1 deletion dist/src/main/package/www/languages/mc_locale_gui-ca_es.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"ACTION_BOARD": "Tauler d'accions",
"ACTIVE": "Actiu",
"ADD": "Add",
"ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load",
"ADD_AN_ENTRY": "Afegir entrada",
"ADD_EXTERNAL_SERVER": "Add external server",
"ADD_FIRMWARE": "Agefir firmware",
Expand All @@ -37,7 +38,6 @@
"ADD_UID_TAG_ENTRY": "Afegir entrada de cordó UID",
"ADD_USER": "Afegir usuari",
"ADD_VARIABLE": "Afegir la variable",
"ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load",
"AFTER": "Després",
"ALIAS": "Àlies",
"ALIVE_TEST_FREQUENCY": "Comprobació temps de vida (segons)",
Expand All @@ -52,6 +52,7 @@
"AUTH_ID_SID": "Autorització ID",
"AUTH_TOKEN": "Token Auth.",
"AUTOMATIC_BACKUP_SETTINGS": "Paramètres de copies automàtiques",
"AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings",
"AUTORIZED_USER": "Usuari autoritzat",
"AUTO_GENERATE": "Autogeneració",
"AVAILABLE_PROCESS": "Processos disponibles",
Expand Down Expand Up @@ -181,6 +182,15 @@
"EUI": "EUI",
"EVALUATIONS": "Evaluacions",
"EXECUTE_DISCOVER_INTERVAL": "Execute discover interval",
"EXPORT": "Export",
"EXPORTS_DETAIL": "Exports detail",
"EXPORT_EVERY": "Export every",
"EXPORT_FILE_PREFIX": "Export file prefix",
"EXPORT_LOCATION": "Export location",
"EXPORT_ON": "Exported on",
"EXPORT_ROW_LIMIT": "Row limit / per file",
"EXPORT_SETTINGS": "Export settings",
"EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.",
"EXTENSION": "Extensió",
"EXTENSIONS": "Extensions",
"EXTERNAL_SERVERS": "External servers",
Expand Down Expand Up @@ -287,6 +297,10 @@
"IGNORE_CASE": "Cas d'ignorar",
"IGNORE_DUPLICATE": "Ignorar duplicats",
"IMPERIAL": "Imperial",
"IMPORT": "Import",
"IMPORT_CONFIRMATION_MESSAGE": "You are about to import a data file and modify the system state to '{{name}}'.<br>Import removes current data completely (will not touch your mycontroller.properties file) and system goes to '{{name}}' state!<br>Click 'Import' to proceed.<br><b>NOTE: After successful import you have to start the server manually from command line</b>",
"IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'",
"IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.",
"INCLUDE_THRESHOLD_HIGH": "Inclouen llindar alt",
"INCLUDE_THRESHOLD_LOW": "Inclouen llindar baix",
"INDIVIDUAL_SETTINGS": "Parametres individuals",
Expand Down Expand Up @@ -412,6 +426,7 @@
"NO_ACK": "Cap ack",
"NO_BACKUPS_SETUP": "Backups no configurats",
"NO_DATA_AVAILABLE": "Dades no disponibles",
"NO_EXPORTS_SETUP": "No export files available.",
"NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.",
"NO_FIRMWARES_SETUP": "Firmware no configurats",
"NO_FIRMWARE_TYPES_SETUP": "Tipus de firmware no configurats",
Expand Down Expand Up @@ -552,6 +567,7 @@
"RUN": "Run",
"RUNNING": "Running...",
"RUN_BACKUP": "Executar la còpia de seguretat",
"RUN_EXPORT": "Run export",
"RUN_GARBAGE_COLLECTION": "Run garbage collection",
"RUN_NOW": "Ara executi",
"SAVE": "Desa",
Expand Down
Loading

0 comments on commit b4e9a0c

Please sign in to comment.