Skip to content

Commit b4e9a0c

Browse files
authored
Merge pull request #504 from mycontroller-org/development
release 1.5.0
2 parents 828633c + 2aba103 commit b4e9a0c

File tree

135 files changed

+5903
-750
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+5903
-750
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: java
22
jdk:
3-
- oraclejdk8
3+
- openjdk8
44
branches:
55
only:
66
- master

dist/pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>org.mycontroller.standalone</groupId>
2323
<artifactId>mycontroller-standalone-parent</artifactId>
24-
<version>1.4.0.Final</version>
24+
<version>1.5.0</version>
2525
</parent>
2626

2727
<artifactId>mycontroller-dist</artifactId>
@@ -32,7 +32,7 @@
3232
<properties>
3333
<mc.dist.finalName>${project.artifactId}-standalone-${project.version}</mc.dist.finalName>
3434
<mc.dist.jar.finalName>${mc.dist.finalName}-single</mc.dist.jar.finalName>
35-
<mc.gui.version>29</mc.gui.version>
35+
<mc.gui.version>30</mc.gui.version>
3636
</properties>
3737

3838
<dependencies>

dist/src/main/package/www/app.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2018 Jeeva Kandasamy ([email protected])
2+
* Copyright 2015-2019 Jeeva Kandasamy ([email protected])
33
* and other contributors as indicated by the @author tags.
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -567,6 +567,20 @@ myControllerModule.config(function($stateProvider, $urlRouterProvider) {
567567
data: {
568568
requireLogin: true
569569
}
570+
}).state('settingsExportList', {
571+
url:"/settings/export/list",
572+
templateUrl: "partials/export/export-list.html?mcv=${mc.gui.version}",
573+
controller: "ExportControllerList",
574+
data: {
575+
requireLogin: true
576+
}
577+
}).state('settingsExportAuto', {
578+
url:"/settings/export/settings",
579+
templateUrl: "partials/export/automatic-export-settings.html?mcv=${mc.gui.version}",
580+
controller: "ExportControllerAutoSettings",
581+
data: {
582+
requireLogin: true
583+
}
570584
})
571585

572586
/* Login */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
1+
/*
2+
* Copyright 2015-2019 Jeeva Kandasamy ([email protected])
3+
* and other contributors as indicated by the @author tags.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
myControllerModule.controller('ExportControllerList', function(alertService, $scope, $filter, displayRestError, ExportImportFactory, $filter, mchelper, CommonServices, $uibModal) {
18+
//GUI page settings
19+
$scope.headerStringList = $filter('translate')('EXPORTS_DETAIL');
20+
$scope.noItemsSystemMsg = $filter('translate')('NO_EXPORTS_SETUP');
21+
$scope.noItemsSystemIcon = "fa fa-upload";
22+
23+
//load empty, configuration, etc.,
24+
$scope.mchelper = mchelper;
25+
$scope.filteredList=[];
26+
27+
//data query details
28+
$scope.currentPage = 1;
29+
$scope.query = CommonServices.getQuery();
30+
$scope.queryResponse = {};
31+
32+
//Get min number
33+
$scope.getMin = function(item1, item2){
34+
return CommonServices.getMin(item1, item2);
35+
};
36+
37+
//get all items
38+
$scope.getAllItems = function(){
39+
ExportImportFactory.getAll($scope.query, function(response) {
40+
$scope.queryResponse = response;
41+
$scope.filteredList = $scope.queryResponse.data;
42+
$scope.filterConfig.resultsCount = $scope.queryResponse.query.filteredCount;
43+
},function(error){
44+
$scope.queryResponse.$resolved = true;
45+
displayRestError.display(error);
46+
});
47+
}
48+
49+
50+
//Hold all the selected item ids
51+
$scope.itemIds = [];
52+
53+
$scope.selectAllItems = function(){
54+
CommonServices.selectAllItems($scope, 'name');
55+
};
56+
57+
$scope.selectItem = function(item){
58+
CommonServices.selectItem($scope, item, 'name');
59+
};
60+
61+
//On page change
62+
$scope.pageChanged = function(newPage){
63+
CommonServices.updatePageChange($scope, newPage);
64+
};
65+
66+
//Filter change method
67+
var filterChange = function (filters) {
68+
//Reset filter fields and update items
69+
CommonServices.updateFiltersChange($scope, filters);
70+
};
71+
72+
$scope.filterConfig = {
73+
fields: [
74+
{
75+
id: 'name',
76+
title: $filter('translate')('NAME'),
77+
placeholder: $filter('translate')('FILTER_BY_NAME'),
78+
filterType: 'text'
79+
}
80+
],
81+
resultsCount: $scope.filteredList.length,
82+
appliedFilters: [],
83+
onFilterChange: filterChange
84+
};
85+
86+
//Sort columns [*** NOT IN USE ***]
87+
var sortChange = function (sortId, isAscending) {
88+
//Reset sort type and update items
89+
CommonServices.updateSortChange($scope, sortId, isAscending);
90+
};
91+
92+
$scope.sortConfig = {
93+
fields: [
94+
{
95+
id: 'name',
96+
title: $filter('translate')('NAME'),
97+
sortType: 'text'
98+
}
99+
],
100+
onSortChange: sortChange
101+
};
102+
103+
//Pre load
104+
$scope.disableRunExport = false;
105+
106+
//Delete item(s)
107+
$scope.delete = function (size) {
108+
var modalInstance = $uibModal.open({
109+
templateUrl: 'partials/common-html/delete-modal.html',
110+
controller: 'ControllerDeleteModal',
111+
size: size,
112+
resolve: {}
113+
});
114+
115+
modalInstance.result.then(function () {
116+
ExportImportFactory.deleteIds($scope.itemIds, function(response) {
117+
alertService.success($filter('translate')('ITEMS_DELETED_SUCCESSFULLY'));
118+
//Update display table
119+
$scope.getAllItems();
120+
$scope.itemIds = [];
121+
},function(error){
122+
displayRestError.display(error);
123+
});
124+
}),
125+
function () {
126+
//console.log('Modal dismissed at: ' + new Date());
127+
}
128+
};
129+
130+
//export now
131+
$scope.exportNow = function(){
132+
$scope.disableRunExport = true;
133+
ExportImportFactory.exportNow({"rowLimit": 1000}, function(){
134+
$scope.getAllItems();
135+
alertService.success($filter('translate')('EXPORT_TRIGGERED_SUCCESSFULLY'));
136+
$scope.disableRunExport = false;
137+
},function(error){
138+
displayRestError.display(error);
139+
$scope.disableRunExport = false;
140+
});
141+
};
142+
143+
//Import
144+
$scope.importItemFn = function (size) {
145+
var addModalInstance = $uibModal.open({
146+
templateUrl: 'partials/export/import-confirmation-modal.html',
147+
controller: 'ExportControllerImport',
148+
size: size,
149+
resolve: {fileName: function () {return {'name': $scope.itemIds[0]}}}
150+
});
151+
152+
addModalInstance.result.then(function () {
153+
ExportImportFactory.importNow({"fileName": $scope.itemIds[0]}, function(response) {
154+
alertService.success($filter('translate')('IMPORT_INITIATED_SUCCESSFULLY')+' '+response.message);
155+
},function(error){
156+
displayRestError.display(error);
157+
});
158+
}),
159+
function () {
160+
//console.log('Modal dismissed at: ' + new Date());
161+
}
162+
};
163+
164+
});
165+
166+
//restore Modal
167+
myControllerModule.controller('ExportControllerImport', function ($scope, $uibModalInstance, $filter, fileName) {
168+
$scope.header = $filter('translate')('IMPORT_CONFIRMATION_TITLE', fileName);
169+
$scope.rebootMsg = $filter('translate')('IMPORT_CONFIRMATION_MESSAGE', fileName);
170+
$scope.importNow = function() {$uibModalInstance.close(); };
171+
$scope.cancel = function () { $uibModalInstance.dismiss('cancel'); }
172+
});
173+
174+
//Automatice export settings
175+
myControllerModule.controller('ExportControllerAutoSettings', function ($scope, ExportImportFactory, mchelper, alertService, displayRestError, $filter, CommonServices) {
176+
$scope.mchelper = mchelper;
177+
$scope.item = {};
178+
$scope.item.enabled = false;
179+
$scope.cs = CommonServices;
180+
181+
$scope.resetSettings = function(){
182+
ExportImportFactory.getSettings(function(response) {
183+
$scope.item = response;
184+
//Update dropdown
185+
if($scope.item.interval % 86400000 == 0){
186+
$scope.intervalLocal = $scope.item.interval / 86400000;
187+
$scope.intervalTimeConstant = "86400000";
188+
$scope.intervalTimeConstantString = $filter('translate')('DAYS');
189+
}else if($scope.item.interval % 3600000 == 0){
190+
$scope.intervalLocal = $scope.item.interval / 3600000;
191+
$scope.intervalTimeConstant = "3600000";
192+
$scope.intervalTimeConstantString = $filter('translate')('Hours');
193+
}else if($scope.item.interval % 60000 == 0){
194+
$scope.intervalLocal = $scope.item.interval / 60000;
195+
$scope.intervalTimeConstant = "60000";
196+
$scope.intervalTimeConstantString = $filter('translate')('Minutes');
197+
}
198+
},function(error){
199+
displayRestError.display(error);
200+
});
201+
}
202+
203+
//GUI page settings
204+
$scope.saveProgress = false;
205+
206+
//Load details
207+
$scope.resetSettings();
208+
209+
$scope.save = function(){
210+
if($scope.item.enabled){
211+
//Update time
212+
$scope.item.interval = $scope.intervalLocal * $scope.intervalTimeConstant;
213+
}
214+
$scope.saveProgress = true;
215+
ExportImportFactory.updateSettings($scope.item,function(response) {
216+
$scope.saveProgress = false;
217+
$scope.editEnable.exportSettings = false;
218+
$scope.resetSettings();
219+
},function(error){
220+
displayRestError.display(error);
221+
$scope.saveProgress = false;
222+
});
223+
}
224+
});

dist/src/main/package/www/index.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
<script src="libs/adf-widget-news/dist/adf-widget-news.min.js?mcv=${mc.gui.version}"></script>
153153
<script src="controllers/adf-widgets/adf-myc-asg/adf-myc-a-sensor-graph.js?mcv=${mc.gui.version}"></script>
154154
<script src="controllers/adf-widgets/adf-myc-cb/adf-myc-custom-buttons.js?mcv=${mc.gui.version}"></script>
155-
<script src="controllers/adf-widgets/adf-myc-os/adf-myc-os-commands.js?mcv=${mc.gui.version}"></script>
155+
<script src="controllers/adf-widgets/adf-myc-os/adf-myc-os-commands.js?mcv=${mc.gui.version}"></script>
156156
<script src="controllers/adf-widgets/adf-myc-cw/adf-myc-custom-widget.js?mcv=${mc.gui.version}"></script>
157157
<script src="controllers/adf-widgets/adf-myc-dsi/adf-myc-display-static-image.js?mcv=${mc.gui.version}"></script>
158158
<script src="controllers/adf-widgets/adf-myc-groups/adf-myc-groups.js?mcv=${mc.gui.version}"></script>
@@ -173,6 +173,7 @@
173173
<script src="app.js?mcv=${mc.gui.version}"></script>
174174
<script src="controllers/additional-headers.js?mcv=${mc.gui.version}"></script>
175175
<script src="controllers/backup.js?mcv=${mc.gui.version}"></script>
176+
<script src="controllers/export.js?mcv=${mc.gui.version}"></script>
176177
<script src="controllers/dashboard.js?mcv=${mc.gui.version}"></script>
177178
<script src="controllers/external-servers.js?mcv=${mc.gui.version}"></script>
178179
<script src="controllers/firmwares.js?mcv=${mc.gui.version}"></script>
@@ -367,6 +368,7 @@
367368
<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>
368369
<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>
369370
<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>
371+
<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>
370372
</ul>
371373
</li>
372374
</ul>

dist/src/main/package/www/languages/mc_locale_gui-ca_es.json

+17-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"ACTION_BOARD": "Tauler d'accions",
1515
"ACTIVE": "Actiu",
1616
"ADD": "Add",
17+
"ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load",
1718
"ADD_AN_ENTRY": "Afegir entrada",
1819
"ADD_EXTERNAL_SERVER": "Add external server",
1920
"ADD_FIRMWARE": "Agefir firmware",
@@ -37,7 +38,6 @@
3738
"ADD_UID_TAG_ENTRY": "Afegir entrada de cordó UID",
3839
"ADD_USER": "Afegir usuari",
3940
"ADD_VARIABLE": "Afegir la variable",
40-
"ADDITIONAL_ANGULARJS_MODULES_TO_LOAD": "Additional AngularJS modules to load",
4141
"AFTER": "Després",
4242
"ALIAS": "Àlies",
4343
"ALIVE_TEST_FREQUENCY": "Comprobació temps de vida (segons)",
@@ -52,6 +52,7 @@
5252
"AUTH_ID_SID": "Autorització ID",
5353
"AUTH_TOKEN": "Token Auth.",
5454
"AUTOMATIC_BACKUP_SETTINGS": "Paramètres de copies automàtiques",
55+
"AUTOMATIC_EXPORT_SETTINGS": "Automatic export settings",
5556
"AUTORIZED_USER": "Usuari autoritzat",
5657
"AUTO_GENERATE": "Autogeneració",
5758
"AVAILABLE_PROCESS": "Processos disponibles",
@@ -181,6 +182,15 @@
181182
"EUI": "EUI",
182183
"EVALUATIONS": "Evaluacions",
183184
"EXECUTE_DISCOVER_INTERVAL": "Execute discover interval",
185+
"EXPORT": "Export",
186+
"EXPORTS_DETAIL": "Exports detail",
187+
"EXPORT_EVERY": "Export every",
188+
"EXPORT_FILE_PREFIX": "Export file prefix",
189+
"EXPORT_LOCATION": "Export location",
190+
"EXPORT_ON": "Exported on",
191+
"EXPORT_ROW_LIMIT": "Row limit / per file",
192+
"EXPORT_SETTINGS": "Export settings",
193+
"EXPORT_TRIGGERED_SUCCESSFULLY": "Export triggered successfully.",
184194
"EXTENSION": "Extensió",
185195
"EXTENSIONS": "Extensions",
186196
"EXTERNAL_SERVERS": "External servers",
@@ -287,6 +297,10 @@
287297
"IGNORE_CASE": "Cas d'ignorar",
288298
"IGNORE_DUPLICATE": "Ignorar duplicats",
289299
"IMPERIAL": "Imperial",
300+
"IMPORT": "Import",
301+
"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>",
302+
"IMPORT_CONFIRMATION_TITLE": "Trigger import data progress and move system state to '{{name}}'",
303+
"IMPORT_INITIATED_SUCCESSFULLY": "Import initiated successfully.",
290304
"INCLUDE_THRESHOLD_HIGH": "Inclouen llindar alt",
291305
"INCLUDE_THRESHOLD_LOW": "Inclouen llindar baix",
292306
"INDIVIDUAL_SETTINGS": "Parametres individuals",
@@ -412,6 +426,7 @@
412426
"NO_ACK": "Cap ack",
413427
"NO_BACKUPS_SETUP": "Backups no configurats",
414428
"NO_DATA_AVAILABLE": "Dades no disponibles",
429+
"NO_EXPORTS_SETUP": "No export files available.",
415430
"NO_EXTERNAL_SERVERS_SETUP": "No external servers setup.",
416431
"NO_FIRMWARES_SETUP": "Firmware no configurats",
417432
"NO_FIRMWARE_TYPES_SETUP": "Tipus de firmware no configurats",
@@ -552,6 +567,7 @@
552567
"RUN": "Run",
553568
"RUNNING": "Running...",
554569
"RUN_BACKUP": "Executar la còpia de seguretat",
570+
"RUN_EXPORT": "Run export",
555571
"RUN_GARBAGE_COLLECTION": "Run garbage collection",
556572
"RUN_NOW": "Ara executi",
557573
"SAVE": "Desa",

0 commit comments

Comments
 (0)