From 7a6b426ab2f6309a3be276166b395198e96c445e Mon Sep 17 00:00:00 2001 From: Pliable Pixels Date: Thu, 31 Oct 2019 13:23:51 -0400 Subject: #857 api caching layer --- www/js/MenuController.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'www/js/MenuController.js') diff --git a/www/js/MenuController.js b/www/js/MenuController.js index 318e4d15..92aca6da 100644 --- a/www/js/MenuController.js +++ b/www/js/MenuController.js @@ -400,6 +400,35 @@ angular.module('zmApp.controllers').controller('MenuController', ['$scope', '$io }; + $scope.flushAPICache = function() { + + NVR.flushAPICache() + .then ( function () { + showCachePopup($translate.instant('kFlushAllCachesMessageOk')); + }) + .catch (function (err) { + showCachePopup($translate.instant('kFlushAllCachesMessageOk')+JSON.stringify(err)); + }); + + function showCachePopup(str) { + $rootScope.zmPopup = $ionicPopup.alert({ + template: str, + + title: $translate.instant('kNote'), + + buttons: [ + { + text: $translate.instant('kButtonOk'), + } + ] + }); + + + } + + }; + + $scope.switchLang = function () { $scope.lang = NVR.getLanguages(); $scope.myopt = { -- cgit v1.2.3