From 2f2ef4d6bef84675d72f9c10e15bad092d0ebd5a Mon Sep 17 00:00:00 2001 From: RudiThoeni Date: Fri, 28 Jul 2023 15:06:27 +0200 Subject: [PATCH 1/6] updating webcaminfolist --- .../GeoBank/WebCamInfo/WebcamInfoList.cshtml | 385 +++++++++++++++++- .../wwwroot/NgScripts/pathconfig-dev.js | 4 +- 2 files changed, 381 insertions(+), 8 deletions(-) diff --git a/odh-databrowser-core/Views/GeoBank/WebCamInfo/WebcamInfoList.cshtml b/odh-databrowser-core/Views/GeoBank/WebCamInfo/WebcamInfoList.cshtml index 34bb529..c7fe004 100644 --- a/odh-databrowser-core/Views/GeoBank/WebCamInfo/WebcamInfoList.cshtml +++ b/odh-databrowser-core/Views/GeoBank/WebCamInfo/WebcamInfoList.cshtml @@ -74,9 +74,12 @@
SourceClear
@@ -256,8 +259,12 @@
@@ -319,8 +326,240 @@ - + +
+
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+
+ +
+
+ + + +
+ + + + + + +
+
+
+ +
+ +
+ +
+
+ + + +
+ + + + + + +
+
+
+ +
+
+ +
+ + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+ Upload progress: +
+
+ @**@ + + @*Do isch a lei der gleiche kaas*@ +
+ +
+ +
+ +
+ + + +
+
+
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+
+ + +
@@ -404,6 +643,140 @@
+ +
+
+
+
+
+

Upload Images

+ +
+ +

Queue length: {{ uploader.queue.length }}

+ + + + + + + + + + + + + + + + + + + +
NameSizeProgressStatusActions
+ {{ item.file.name }} + + + + +
+ + +
{{ item.file.size/1024/1024|number:2 }} MB +
+
+
+
+ + + + + +
+ +
+ +
+
+
+ Queue progress: +
+
+
+
+ + + +
+ + +
+
+
+ +
+
+

Image Gallery Title, Description, Copyright, License, Position, Active

+
+
+ +
+ + +
+
+
+
+ + + +
+ +
+
+ +
+
+ +
+ +
+ +
+ +
+ +
+
+ +
+
+
+
+ +
+
+
+
+
diff --git a/odh-databrowser-core/wwwroot/NgScripts/pathconfig-dev.js b/odh-databrowser-core/wwwroot/NgScripts/pathconfig-dev.js index cae1c5b..1f7a664 100644 --- a/odh-databrowser-core/wwwroot/NgScripts/pathconfig-dev.js +++ b/odh-databrowser-core/wwwroot/NgScripts/pathconfig-dev.js @@ -4,8 +4,8 @@ // Path Config Constants var pathconfig = angular.module('pathconfig', []) - //.constant('apipath', 'https://localhost:5001') - .constant('apipath', 'https://api.tourism.testingmachine.eu') + .constant('apipath', 'https://localhost:5001') + //.constant('apipath', 'https://api.tourism.testingmachine.eu') .constant('authserverpath', 'https://auth.opendatahub.testingmachine.eu/auth/realms/noi/protocol/openid-connect/auth?client_id=odh-frontend-core&response_type=token&redirect_uri='); From a831e9b7b88fc37f6fca34ddec9b086f708da841 Mon Sep 17 00:00:00 2001 From: RudiThoeni Date: Fri, 28 Jul 2023 15:17:21 +0200 Subject: [PATCH 2/6] view fixes --- .../GeoBank/WebCamInfo/WebcamInfoList.cshtml | 105 ++++++++++++------ 1 file changed, 73 insertions(+), 32 deletions(-) diff --git a/odh-databrowser-core/Views/GeoBank/WebCamInfo/WebcamInfoList.cshtml b/odh-databrowser-core/Views/GeoBank/WebCamInfo/WebcamInfoList.cshtml index c7fe004..fa965f0 100644 --- a/odh-databrowser-core/Views/GeoBank/WebCamInfo/WebcamInfoList.cshtml +++ b/odh-databrowser-core/Views/GeoBank/WebCamInfo/WebcamInfoList.cshtml @@ -529,6 +529,21 @@
+
+ +
+ +
+
+ +
+
+
+ +
+ +
+
@@ -558,7 +573,6 @@
-
@@ -606,42 +620,69 @@ -
-
-
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - +
+
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + +
+ + + +
+
-
- -
- - +
+
+ + +
+ + + + + {{ gps.Gpstype }} - {{ gps.Latitude }} - {{ gps.Longitude }} - {{ gps.Altitude }}m +
+
-
-
- +
From 76d367b3addb30f37605a5ef5ff322af32e70613 Mon Sep 17 00:00:00 2001 From: RudiThoeni Date: Fri, 28 Jul 2023 15:43:30 +0200 Subject: [PATCH 3/6] fixes gps --- .../wwwroot/NgScripts/WebcamInfoController.js | 268 ++++++++++++++++-- 1 file changed, 252 insertions(+), 16 deletions(-) diff --git a/odh-databrowser-core/wwwroot/NgScripts/WebcamInfoController.js b/odh-databrowser-core/wwwroot/NgScripts/WebcamInfoController.js index 7ccac5b..bf26243 100644 --- a/odh-databrowser-core/wwwroot/NgScripts/WebcamInfoController.js +++ b/odh-databrowser-core/wwwroot/NgScripts/WebcamInfoController.js @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: AGPL-3.0-or-later -var app = angular.module('webcam', ['ui.bootstrap', 'ngSanitize', 'appconfig', 'textAngular', 'appfactory', 'leaflet-directive', 'pathconfig']); +var app = angular.module('webcam', ['ui.bootstrap', 'angularFileUpload', 'ngSanitize', 'appconfig', 'textAngular', 'appfactory', 'leaflet-directive', 'pathconfig']); app.controller('webcamListController', [ '$scope', '$http', '$modal', 'appconfig', 'leafletData', 'leafletmapsimple', 'languageFactory', 'apipath', @@ -21,7 +21,7 @@ app.controller('webcamListController', [ $scope.newwebcam = true; $scope.webcam = { - Id: '', Shortname: '', Source: 'Content', GpsInfo: { Gpstype: 'position' }, _Meta: { Id: '', Type: 'webcam', Source: 'noi' } }; + Id: '', Shortname: '', Source: 'Content', _Meta: { Id: '', Type: 'webcam', Source: 'noi' } }; var modalInstance = $modal.open({ templateUrl: 'myWebcamModal.html', @@ -201,13 +201,7 @@ app.controller('webcamListController', [ $scope.webcam = result; $scope.isloading = false; - var passedgps = []; - - if ($scope.webcam.GpsInfo && $scope.webcam.GpsInfo.Latitude && $scope.webcam.GpsInfo.Longitude) { - - passedgps.push({ Gpstype: 'position', Latitude: $scope.webcam.GpsInfo.Latitude, Longitude: $scope.webcam.GpsInfo.Longitude }); - leafletmapsimple.preparemap(passedgps, null, ['position'], 'webcamListController'); - } + leafletmapsimple.preparemap($scope.poi.GpsInfo, $scope.poi.GpsTrack, ['Standpunkt', 'position', 'carparking', 'startingpoint', 'arrivalpoint', 'viewpoint', 'Talstation', 'Bergstation', 'startingandarrivalpoint'], 'webcamListController'); var slidemodalInstance = $modal.open({ templateUrl: 'myWebcamInfoModal.html', @@ -221,6 +215,12 @@ app.controller('webcamListController', [ $scope.webcams = []; }]); +var wysiwygeditorCtrl = function ($scope) { + $scope.htmlcontentbase = "
"; + $scope.htmlcontentintro = "
"; + $scope.disabled = false; +}; + //Modal Controller var WebcamModalInstanceCtrl = function ($scope, $modalInstance, $http) { @@ -338,9 +338,9 @@ var WebcamModalInstanceCtrl = function ($scope, $modalInstance, $http) { console.log(key, $scope.webcam.Mapping[provider][key]); }); - //$.each($scope.common.Mapping[provider], function (i) { + //$.each($scope.webcam.Mapping[provider], function (i) { - // if ($scope.common.Mapping[provider][i] === $scope.mappingproperty.Name) { + // if ($scope.webcam.Mapping[provider][i] === $scope.mappingproperty.Name) { // alert('Already present!'); // addToArray = false; @@ -354,7 +354,7 @@ var WebcamModalInstanceCtrl = function ($scope, $modalInstance, $http) { if (addToArray) { //var property = { Name: $scope.mappingproperty.Name, Value: $scope.mappingproperty.Value }; - //$scope.common.Mapping[provider].push(property); + //$scope.webcam.Mapping[provider].push(property); var dicttoadd = {}; @@ -389,9 +389,9 @@ var WebcamModalInstanceCtrl = function ($scope, $modalInstance, $http) { delete $scope.webcam.Mapping[provider][mapping]; - //$.each($scope.common.Mapping[provider], function (i) { - // if ($scope.common.Mapping[provider][i].Name === mapping) { - // $scope.common.Mapping[provider].splice(i, 1); + //$.each($scope.webcam.Mapping[provider], function (i) { + // if ($scope.webcam.Mapping[provider][i].Name === mapping) { + // $scope.webcam.Mapping[provider].splice(i, 1); // return false; // } //}); @@ -547,4 +547,240 @@ app.filter('moment', function () { return function (dateString, format) { return moment(dateString).format(format); }; -}); \ No newline at end of file +}); + +//Fileupload Test +app.controller('FileUploadController', ['$scope', 'FileUploader', function ($scope, FileUploader) { + var uploader = $scope.uploader = new FileUploader({ + url: $scope.basePath + '/v1/FileUpload/webcam' + }); + + + // FILTERS + uploader.filters.push({ + name: 'imageFilter', + fn: function (item /*{File|FileLikeObject}*/, options) { + var type = '|' + item.type.slice(item.type.lastIndexOf('/') + 1) + '|'; + return '|jpg|png|jpeg|bmp|gif|'.indexOf(type) !== -1; + } + }); + + // CALLBACKS + + uploader.onWhenAddingFileFailed = function (item /*{File|FileLikeObject}*/, filter, options) { + console.info('onWhenAddingFileFailed', item, filter, options); + }; + uploader.onAfterAddingFile = function (fileItem) { + console.info('onAfterAddingFile', fileItem); + }; + uploader.onAfterAddingAll = function (addedFileItems) { + console.info('onAfterAddingAll', addedFileItems); + }; + uploader.onBeforeUploadItem = function (item) { + console.info('onBeforeUploadItem', item); + }; + uploader.onProgressItem = function (fileItem, progress) { + console.info('onProgressItem', fileItem, progress); + }; + uploader.onProgressAll = function (progress) { + console.info('onProgressAll', progress); + }; + uploader.onSuccessItem = function (fileItem, response, status, headers) { + + if ($scope.webcam.ImageGallery == null) { + $scope.webcam.ImageGallery = []; + } + + console.log($scope.webcam.ImageGallery.length); + + var currentimagescount = $scope.webcam.ImageGallery.length; + + var r = new RegExp('"', 'g'); + var imageurl = response.replace(r, ''); + + alert('added Image: ' + imageurl); + + var UploadedImage = { ImageName: '', ImageUrl: imageurl, Width: 0, Height: 0, ImageSource: 'SMGManager', ImageTitle: { de: '', it: '', en: '', nl: '', cs: '', pl: '' }, ListPosition: currentimagescount++ } + + $scope.webcam.ImageGallery.push(UploadedImage); + + + console.info('onSuccessItem', fileItem, response, status, headers); + }; + uploader.onErrorItem = function (fileItem, response, status, headers) { + + alert('error'); + console.info('onErrorItem', fileItem, response, status, headers); + }; + uploader.onCancelItem = function (fileItem, response, status, headers) { + console.info('onCancelItem', fileItem, response, status, headers); + }; + uploader.onCompleteItem = function (fileItem, response, status, headers) { + console.info('onCompleteItem', fileItem, response, status, headers); + }; + uploader.onCompleteAll = function () { + console.info('onCompleteAll'); + }; + + console.info('uploader', uploader); +}]); + +//Fileupload Logo +app.controller('LogoFileUploadController', ['$scope', 'FileUploader', function ($scope, FileUploader) { + var uploader = $scope.uploader = new FileUploader({ + url: $scope.basePath + '/v1/FileUpload/webcam/Logo' + }); + + + // FILTERS + uploader.filters.push({ + name: 'imageFilter', + fn: function (item /*{File|FileLikeObject}*/, options) { + var type = '|' + item.type.slice(item.type.lastIndexOf('/') + 1) + '|'; + return '|jpg|png|jpeg|bmp|gif|'.indexOf(type) !== -1; + } + }); + + // CALLBACKS + + uploader.onWhenAddingFileFailed = function (item /*{File|FileLikeObject}*/, filter, options) { + console.info('onWhenAddingFileFailed', item, filter, options); + }; + uploader.onAfterAddingFile = function (fileItem) { + console.info('onAfterAddingFile', fileItem); + alert("file selected"); + }; + uploader.onAfterAddingAll = function (addedFileItems) { + console.info('onAfterAddingAll', addedFileItems); + }; + uploader.onBeforeUploadItem = function (item) { + console.info('onBeforeUploadItem', item); + }; + uploader.onProgressItem = function (fileItem, progress) { + console.info('onProgressItem', fileItem, progress); + }; + uploader.onProgressAll = function (progress) { + console.info('onProgressAll', progress); + }; + uploader.onSuccessItem = function (fileItem, response, status, headers) { + + var r = new RegExp('"', 'g'); + var imageurl = response.replace(r, ''); + + alert('added Logo Image: ' + imageurl); + + var lang = $scope.lang; + + $scope.webcam.ContactInfos[lang].LogoUrl = imageurl; + + //alert($scope.webcam.ContactInfos[lang].LogoUrl); + + console.info('onSuccessItem', fileItem, response, status, headers); + }; + uploader.onErrorItem = function (fileItem, response, status, headers) { + + alert('error'); + console.info('onErrorItem', fileItem, response, status, headers); + }; + uploader.onCancelItem = function (fileItem, response, status, headers) { + console.info('onCancelItem', fileItem, response, status, headers); + }; + uploader.onCompleteItem = function (fileItem, response, status, headers) { + console.info('onCompleteItem', fileItem, response, status, headers); + }; + uploader.onCompleteAll = function () { + console.info('onCompleteAll'); + }; + + console.info('uploader', uploader); +}]); + +//Fileupload Test +app.controller('FileUploadControllerSingle', ['$scope', 'FileUploader', function ($scope, FileUploader) { + + $scope.oldimageurl = ""; + + $scope.init = function (oldimageurl) { + $scope.oldimageurl = oldimageurl; + } + + var uploader = $scope.uploader = new FileUploader({ + url: $scope.basePath + '/v1/FileUpload/webcam' + }); + + // FILTERS + uploader.filters.push({ + name: 'imageFilter', + fn: function (item /*{File|FileLikeObject}*/, options) { + var type = '|' + item.type.slice(item.type.lastIndexOf('/') + 1) + '|'; + return '|jpg|png|jpeg|bmp|gif|'.indexOf(type) !== -1; + } + }); + + // CALLBACKS + + uploader.onWhenAddingFileFailed = function (item /*{File|FileLikeObject}*/, filter, options) { + console.info('onWhenAddingFileFailed', item, filter, options); + }; + uploader.onAfterAddingFile = function (fileItem) { + console.info('onAfterAddingFile', fileItem); + }; + uploader.onAfterAddingAll = function (addedFileItems) { + console.info('onAfterAddingAll', addedFileItems); + }; + uploader.onBeforeUploadItem = function (item) { + console.info('onBeforeUploadItem', item); + }; + uploader.onProgressItem = function (fileItem, progress) { + console.info('onProgressItem', fileItem, progress); + }; + uploader.onProgressAll = function (progress) { + console.info('onProgressAll', progress); + }; + uploader.onSuccessItem = function (fileItem, response, status, headers) { + + var currentimagescount = $scope.webcam.ImageGallery.length; + + var r = new RegExp('"', 'g'); + var imageurl = response.replace(r, ''); + //Filename + var imagename = imageurl.substring(imageurl.lastIndexOf('/') + 1); + + + alert('changed Image: ' + imageurl); + + var UploadedImage = { ImageName: '', ImageUrl: imageurl, Width: 0, Height: 0, ImageSource: 'SMGManager', ImageTitle: { de: '', it: '', en: '', nl: '', cs: '', pl: '' }, ListPosition: currentimagescount++ } + + //$scope.webcam.ImageGallery.push(UploadedImage); + + $.each($scope.webcam.ImageGallery, function (i) { + if ($scope.webcam.ImageGallery[i].ImageUrl === $scope.oldimageurl) { + + $scope.webcam.ImageGallery[i].ImageUrl = imageurl; + $scope.webcam.ImageGallery[i].ImageName = imagename; + + //console.log("image changed from " + $scope.oldimageurl + " to " + imageurl); + + return false; + } + }); + + console.info('onSuccessItem', fileItem, response, status, headers); + }; + uploader.onErrorItem = function (fileItem, response, status, headers) { + + alert('error'); + console.info('onErrorItem', fileItem, response, status, headers); + }; + uploader.onCancelItem = function (fileItem, response, status, headers) { + console.info('onCancelItem', fileItem, response, status, headers); + }; + uploader.onCompleteItem = function (fileItem, response, status, headers) { + console.info('onCompleteItem', fileItem, response, status, headers); + }; + uploader.onCompleteAll = function () { + console.info('onCompleteAll'); + }; + + //console.info('uploader', uploader); +}]); \ No newline at end of file From 769fdee9e38933c90952b83318477169f2c9f3f0 Mon Sep 17 00:00:00 2001 From: RudiThoeni Date: Fri, 28 Jul 2023 15:58:59 +0200 Subject: [PATCH 4/6] webcam view fixes --- .../Views/GeoBank/WebCamInfo/WebcamInfoList.cshtml | 2 +- odh-databrowser-core/wwwroot/NgScripts/WebcamInfoController.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/odh-databrowser-core/Views/GeoBank/WebCamInfo/WebcamInfoList.cshtml b/odh-databrowser-core/Views/GeoBank/WebCamInfo/WebcamInfoList.cshtml index fa965f0..6ea9ca8 100644 --- a/odh-databrowser-core/Views/GeoBank/WebCamInfo/WebcamInfoList.cshtml +++ b/odh-databrowser-core/Views/GeoBank/WebCamInfo/WebcamInfoList.cshtml @@ -772,7 +772,7 @@

Image Gallery Title, Description, Copyright, License, Position, Active

- +