Added clearCache function
This commit is contained in:
parent
191ad1e4ee
commit
4fbf705ae5
4 changed files with 75 additions and 15 deletions
|
|
@ -1,7 +1,9 @@
|
|||
|
||||
var tpl = '<div><h2>Foo</h2><p>Welcome to the foo.</p></div>';
|
||||
tpl += '<input type=\"button\" class=\"btn btn-default\" ng-click=\"doReboot()\" value=\"Reboot\"></input>';
|
||||
tpl += '<input type=\"button\" class=\"btn btn-default\" ng-click=\"doClearServerUrl()\" value=\"Clear Server\"></input>';
|
||||
tpl += '<input type=\"button\" class=\"btn btn-default\" ng-click=\"doReload()\" value=\"Reload\"></input>';
|
||||
tpl += '<input type=\"button\" class=\"btn btn-default\" ng-click=\"doClearServerUrl()\" value=\"Clear Server Url\"></input>';
|
||||
tpl += '<input type=\"button\" class=\"btn btn-default\" ng-click=\"doClearCache()\" value=\"Clear Cache\"></input>';
|
||||
tpl += '<p>{{message}}</p>';
|
||||
|
||||
pageRouteInit.push(function ($routeProvider, $locationProvider) {
|
||||
$routeProvider.when('/example-ui/foo', {
|
||||
|
|
@ -11,17 +13,30 @@ pageRouteInit.push(function ($routeProvider, $locationProvider) {
|
|||
});
|
||||
|
||||
function PageFoo($scope) {
|
||||
$scope.doReboot = function ( path ) {
|
||||
$scope.message = '';
|
||||
$scope.doReload = function () {
|
||||
window.location.reload(true);
|
||||
};
|
||||
|
||||
$scope.doClearServerUrl = function ( path ) {
|
||||
$scope.doClearServerUrl = function () {
|
||||
FFSpaLoader.clearServerUrl(function(err) {
|
||||
if (err) {
|
||||
window.alert(err);
|
||||
$scope.message = 'Error: '+err;
|
||||
} else {
|
||||
window.location.reload(true);
|
||||
$scope.message = 'Cleared server url';
|
||||
}
|
||||
$scope.$apply();
|
||||
});
|
||||
};
|
||||
|
||||
$scope.doClearCache = function () {
|
||||
FFSpaLoader.clearCache(function(err) {
|
||||
if (err) {
|
||||
$scope.message = 'Error: '+err;
|
||||
} else {
|
||||
$scope.message = 'Cleared cache';
|
||||
}
|
||||
$scope.$apply();
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue