人人商城

az.html 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {template 'common/header'}
  2. <ol class="breadcrumb we7-breadcrumb">
  3. <a href="./index.php?c=platform&amp;a=reply&amp;m=keyword"><i class="fa fa-chevron-circle-left"></i> </a>
  4. <li>
  5. <a href="./index.php?c=platform&amp;a=reply&amp;m=keyword">模块安装</a>
  6. </li>
  7. <li>
  8. <a href="./index.php?c=platform&amp;a=reply&amp;do=post&amp;m=keyword">模块下载</a>
  9. </li>
  10. </ol>
  11. <div class="alert alert-warning">
  12. 正在下载模块文件, 请不要关闭窗口.
  13. </div>
  14. <div class="alert alert-warning">
  15. 如果下载模块文件失败,可能造成的原因:写入失败,请仔细检查写入权限是否正确。
  16. </div>
  17. <div class="alert alert-info form-horizontal ng-cloak" ng-controller="processor">
  18. <dl class="dl-horizontal">
  19. <dt>模块文件下载中,请耐心等待...</dt>
  20. <dd>{{pragress}}</dd></br>
  21. <dt></dt>
  22. <dd>{{file}}</dd>
  23. </dl>
  24. <dl class="dl-horizontal" ng-show="fails.length > 0">
  25. <dt>下载失败的模块文件</dt>
  26. <dd>
  27. <p class="text-danger" ng-repeat="file in fails" style="margin:0;">{{file}}</p>
  28. </dd>
  29. </dl>
  30. </div>
  31. <script>
  32. require(['angular'], function(angular){
  33. angular.module('app', []).controller('processor', function($scope, $http){
  34. $scope.files = {php echo json_encode($packet['files']);};
  35. $scope.fails = [];
  36. var total = $scope.files.length;
  37. var i = 1;
  38. var proc = function() {
  39. var path = $scope.files.pop();
  40. if(!path) {
  41. if($scope.fails.length == 0 || confirm('有模块未下载成功, 是否进行下一步操作.')) {
  42. setTimeout(function(){
  43. // location.href = "{php echo create_url('system/module/not_installed',array());}";
  44. location.href = "{php echo create_url('module/manage-system/not_installed',array());}";
  45. }, 10000);
  46. }
  47. return;
  48. }
  49. $scope.file = path;
  50. $scope.pragress = i + '/' + total;
  51. var params = {path: path, type : '{php echo $packet['type']}'};
  52. $http.post(location.href, params).success(function(dat){
  53. i++;
  54. //if(dat != 'success') {
  55. // $scope.fails.push(path);
  56. //}
  57. proc();
  58. }).error(function(){
  59. i++;
  60. $scope.fails.push(path);
  61. proc();
  62. });
  63. }
  64. proc();
  65. });
  66. angular.bootstrap(document, ['app']);
  67. });
  68. </script>
  69. {template 'common/footer'}