-
Notifications
You must be signed in to change notification settings - Fork 65
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
13 changed files
with
418 additions
and
198 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
uSync8.BackOffice/App_Plugins/uSync8/components/uSyncProgressView.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,27 @@ | ||
<div> | ||
<div class="flex flex-wrap justify-center items-center"> | ||
<div ng-repeat="handler in vm.status.Handlers" | ||
class="text-center usync-handler-icon" | ||
ng-class="{'usync-pending' : handler.Status == 0, 'usync-progress' : handler.Status == 1, 'usync-complete' : handler.Status == 2}" | ||
ng-click="vm.setFilter(handler.ItemType)"> | ||
<i class="icon {{handler.Icon}}"></i> | ||
<div class="usync-handler-name">{{handler.Name}}</div> | ||
<div ng-if="!vm.hideLabels"> | ||
<div class="handler-badge badge type-complete" ng-if="handler.Changes > 0" title="{{handler.Changes}} changes">{{handler.Changes}}</div> | ||
<div class="handler-badge type-complete" ng-if="handler.Changes == 0 && handler.Status == 2"><i class="icon icon-check"></i></div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="flex justify-center"> | ||
<div class="text-center"> | ||
<h4 class="usync-action-message">{{vm.status.Message}}</h4> | ||
<small>{{vm.update.Message}}</small> | ||
<div class="progress usync-not-animated" style="height: 3px;"> | ||
<div class="bar" role="progressbar" style="width: {{vm.calcPercentage(vm.update)}}%;" aria-valuenow="{{vm.calcPercentage(vm.update)}}" aria-valuemin="0" aria-valuemax="100"></div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="progress" style="height: 1px;"> | ||
<div class="bar" role="progressbar" style="width: {{vm.calcPercentage(vm.status)}}%;" aria-valuenow="{{vm.calcPercentage(vm.status)}}" aria-valuemin="0" aria-valuemax="100"></div> | ||
</div> | ||
</div> |
77 changes: 77 additions & 0 deletions
77
uSync8.BackOffice/App_Plugins/uSync8/components/uSyncReportView.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,77 @@ | ||
<div> | ||
<umb-box> | ||
<div class="umb-box-header flex justify-between items-center"> | ||
<div> | ||
<div class="umb-box-header-title">{{vm.action}}</div> | ||
<div class="umb-box-header-description">{{vm.countChanges(vm.results)}} changes across {{vm.results.length}} items</div> | ||
</div> | ||
<umb-toggle checked="vm.showAll" | ||
on-click="vm.showAll = !vm.showAll" | ||
show-labels="true" | ||
label-on="Show all" | ||
label-off="Changes only" | ||
label-position="left" | ||
ng-if="vm.runMode = 'report'"></umb-toggle> | ||
</div> | ||
<umb-box-content> | ||
<div class="umb-table" ng-show="vm.countChanges(vm.results) > 0 || vm.showAll"> | ||
<div class="umb-table-head"> | ||
<div class="umb-table-row"> | ||
<div class="umb-table-cell"> | ||
</div> | ||
<div class="umb-table-cell"> | ||
Type | ||
</div> | ||
<div class="umb-table-cell umb-table__name"> | ||
Name | ||
</div> | ||
<div class="umb-table-cell"> | ||
Change | ||
</div> | ||
<div class="umb-table-cell"> | ||
Message | ||
</div> | ||
<div class="umb-table-cell"></div> | ||
</div> | ||
</div> | ||
<div class="umb-table-body"> | ||
<div ng-repeat="result in vm.results"> | ||
<div class="umb-table-row" | ||
ng-if="vm.showChange(result.Change)"> | ||
<div class="umb-table-cell"> | ||
<i ng-if="result.Change == 'NoChange'" class="icon icon-check color-green"></i> | ||
<i ng-if="result.Change == 'Update'" class="icon icon-sync color-orange"></i> | ||
<i ng-if="result.Change == 'Delete'" class="icon icon-wrong color-red"></i> | ||
</div> | ||
<div class="umb-table-cell"> | ||
{{vm.getTypeName(result.ItemType)}} | ||
</div> | ||
<div class="umb-table-cell umb-table__name"> | ||
{{result.Name}} | ||
</div> | ||
<div class="umb-table-cell"> | ||
{{result.Change}} | ||
</div> | ||
<div class="umb-table-cell"> | ||
{{result.Message}} | ||
</div> | ||
<div class="umb-table-cell"> | ||
<umb-button type="button" | ||
button-style="link" | ||
label-key="usync_details" | ||
action="vm.openDetail(result)" | ||
ng-if="result.Details != null"></umb-button> | ||
<div ng-if="result.Details != null" class="usync-detail-count"> | ||
({{result.Details.length}} items) | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="flex justify-center items-center" ng-if="vm.countChanges(vm.results) == 0 && !vm.showAll"> | ||
<h4>No Changes</h4> | ||
</div> | ||
</umb-box-content> | ||
</umb-box> | ||
</div> |
63 changes: 63 additions & 0 deletions
63
uSync8.BackOffice/App_Plugins/uSync8/components/uSyncReportViewComponent.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,63 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
var uSyncReportViewComponent = { | ||
templateUrl: Umbraco.Sys.ServerVariables.application.applicationPath + 'App_Plugins/uSync8/Components/uSyncReportView.html', | ||
bindings: { | ||
action: '<', | ||
results: '<' | ||
}, | ||
controllerAs: 'vm', | ||
controller: uSyncReportViewController | ||
}; | ||
|
||
function uSyncReportViewController($scope, editorService) { | ||
|
||
var vm = this; | ||
|
||
vm.showChange = showChange; | ||
vm.getTypeName = getTypeName; | ||
vm.countChanges = countChanges; | ||
vm.openDetail = openDetail; | ||
vm.showAll = false; | ||
|
||
///////// | ||
|
||
function showChange(change) { | ||
return vm.showAll || (change !== 'NoChange' && change !== 'Removed'); | ||
} | ||
|
||
function getTypeName(typeName) { | ||
var umbType = typeName.substring(0, typeName.indexOf(',')); | ||
return umbType.substring(umbType.lastIndexOf('.') + 1); | ||
} | ||
|
||
function countChanges(changes) { | ||
var count = 0; | ||
angular.forEach(changes, function (val, key) { | ||
if (val.Change !== 'NoChange') { | ||
count++; | ||
} | ||
}); | ||
|
||
return count; | ||
} | ||
|
||
function openDetail(item) { | ||
|
||
var options = { | ||
item: item, | ||
title: 'uSync Change', | ||
view: "/App_Plugins/uSync8/changeDialog.html", | ||
close: function () { | ||
editorService.close(); | ||
} | ||
}; | ||
editorService.open(options); | ||
} | ||
|
||
} | ||
|
||
angular.module('umbraco') | ||
.component('usyncReportView', uSyncReportViewComponent); | ||
})(); |
30 changes: 30 additions & 0 deletions
30
uSync8.BackOffice/App_Plugins/uSync8/components/usyncProgressViewComponent.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,30 @@ | ||
(function () { | ||
'use strict'; | ||
|
||
var uSyncProgressViewComponent = { | ||
templateUrl: Umbraco.Sys.ServerVariables.application.applicationPath + 'App_Plugins/uSync8/Components/uSyncProgressView.html', | ||
bindings: { | ||
status: '<', | ||
update: '<', | ||
hideLabels: '<' | ||
}, | ||
controllerAs: 'vm', | ||
controller: uSyncProgressViewController | ||
}; | ||
|
||
function uSyncProgressViewController() { | ||
var vm = this; | ||
|
||
vm.calcPercentage = calcPercentage; | ||
|
||
function calcPercentage(status) { | ||
if (status !== undefined) { | ||
return (100 * status.Count) / status.Total; | ||
} | ||
return 1; | ||
} | ||
} | ||
|
||
angular.module('umbraco') | ||
.component('usyncProgressView', uSyncProgressViewComponent); | ||
})(); |
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
27 changes: 27 additions & 0 deletions
27
uSync8.Site/App_Plugins/uSync8/components/uSyncProgressView.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,27 @@ | ||
<div> | ||
<div class="flex flex-wrap justify-center items-center"> | ||
<div ng-repeat="handler in vm.status.Handlers" | ||
class="text-center usync-handler-icon" | ||
ng-class="{'usync-pending' : handler.Status == 0, 'usync-progress' : handler.Status == 1, 'usync-complete' : handler.Status == 2}" | ||
ng-click="vm.setFilter(handler.ItemType)"> | ||
<i class="icon {{handler.Icon}}"></i> | ||
<div class="usync-handler-name">{{handler.Name}}</div> | ||
<div ng-if="!vm.hideLabels"> | ||
<div class="handler-badge badge type-complete" ng-if="handler.Changes > 0" title="{{handler.Changes}} changes">{{handler.Changes}}</div> | ||
<div class="handler-badge type-complete" ng-if="handler.Changes == 0 && handler.Status == 2"><i class="icon icon-check"></i></div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="flex justify-center"> | ||
<div class="text-center"> | ||
<h4 class="usync-action-message">{{vm.status.Message}}</h4> | ||
<small>{{vm.update.Message}}</small> | ||
<div class="progress usync-not-animated" style="height: 3px;"> | ||
<div class="bar" role="progressbar" style="width: {{vm.calcPercentage(vm.update)}}%;" aria-valuenow="{{vm.calcPercentage(vm.update)}}" aria-valuemin="0" aria-valuemax="100"></div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="progress" style="height: 1px;"> | ||
<div class="bar" role="progressbar" style="width: {{vm.calcPercentage(vm.status)}}%;" aria-valuenow="{{vm.calcPercentage(vm.status)}}" aria-valuemin="0" aria-valuemax="100"></div> | ||
</div> | ||
</div> |
Oops, something went wrong.