-
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
570 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
uSync.Migrations.Client/wwwroot/App_Plugins/uSyncMigrations/dialogs/download.controller.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
function downloadController($scope, | ||
notificationsService, | ||
uSyncMigrationService) { | ||
|
||
var vm = this; | ||
vm.working = false; | ||
vm.download = download; | ||
|
||
vm.status = {}; | ||
vm.update = {}; | ||
|
||
vm.$onInit = function () { | ||
vm.hub = $scope.model.hub; | ||
|
||
vm.hub.on('update', function (update) { | ||
console.log('update', update); | ||
vm.update = update; | ||
}); | ||
|
||
vm.hub.on('add', function (add) { | ||
console.log('add', add); | ||
vm.status = add; | ||
}); | ||
} | ||
|
||
function getClientId() { | ||
if ($.connection !== undefined) { | ||
return $.connection.connectionId; | ||
} | ||
return ""; | ||
} | ||
|
||
vm.close = function () { | ||
$scope.model.close(); | ||
} | ||
|
||
function download() { | ||
|
||
vm.working = true; | ||
|
||
uSyncMigrationService.download(getClientId()) | ||
.then(function () { | ||
vm.working = false; | ||
console.log('done'); | ||
vm.close(); | ||
}, function (error) { | ||
notificationsService.error('failed', 'failed to download, check console'); | ||
console.log(error); | ||
}); | ||
} | ||
} | ||
|
||
angular.module('umbraco') | ||
.controller('uSyncDownloadMigrationController', downloadController) | ||
})(); |
70 changes: 70 additions & 0 deletions
70
uSync.Migrations.Client/wwwroot/App_Plugins/uSyncMigrations/dialogs/download.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<div ng-controller="uSyncDownloadMigrationController as vm"> | ||
<umb-editor-panel> | ||
<umb-editor-header name="'download'" | ||
description="'download the setup of this site'" | ||
name-locked="true" | ||
description-locked="true" | ||
hide-alias="true" | ||
hide-icon="true"></umb-editor-header> | ||
|
||
<umb-editor-container class="form-horizontal"> | ||
|
||
<umb-box> | ||
<umb-box-header title="Download"></umb-box-header> | ||
<umb-box-content> | ||
<localize key="usyncmigrate_download-intro"></localize> | ||
</umb-box-content> | ||
|
||
<umb-box-content ng-if="!vm.working"> | ||
<div class="flex justify-center"> | ||
|
||
<umb-button type="button" | ||
button-style="success" | ||
size="l" | ||
label-key="usyncmigrate_download" | ||
action="vm.download()"></umb-button> | ||
|
||
</div> | ||
</umb-box-content> | ||
</umb-box> | ||
|
||
<umb-box ng-if="vm.working"> | ||
<umb-box-content class="flex justify-center flex-column items-stretch"> | ||
|
||
<div> | ||
<div class="text-center"> | ||
<div> | ||
<strong>{{vm.status.message}}</strong> | ||
</div> | ||
<em>({{vm.status.count}} / {{vm.status.total}})</em> | ||
</div> | ||
</div> | ||
<div class="text-center"> | ||
<div style="margin-top: 20px; height: 50px;"> | ||
{{vm.update.message}} | ||
</div> | ||
<umb-progress-bar percentage="{{vm.update.percentage}}" | ||
size="m" | ||
color="primary"></umb-progress-bar> | ||
<div> | ||
<em>{{vm.update.count}}/{{vm.update.total}}</em> | ||
</div> | ||
</div> | ||
</umb-box-content> | ||
|
||
</umb-box> | ||
|
||
</umb-editor-container> | ||
|
||
<umb-editor-footer> | ||
<umb-editor-footer-content-right> | ||
|
||
<umb-button type="button" | ||
button-style="link" | ||
label-key="general_close" | ||
action="vm.close()"></umb-button> | ||
|
||
</umb-editor-footer-content-right> | ||
</umb-editor-footer> | ||
</umb-editor-panel> | ||
</div> |
Oops, something went wrong.