1+ <script data-exec-on-popstate >
2+ $ (function () {
3+
4+ $ (" .backup-run" ).click (function () {
5+ var $btn = $ (this );
6+ $btn .button (' loading' );
7+
8+ NProgress .start ();
9+ $ .ajax ({
10+ url: $btn .attr (' href' ),
11+ data : {
12+ _token: LA .token
13+ },
14+ method: ' POST' ,
15+ success : function (data ){
16+
17+ if (data .status ) {
18+ $ (' .output-box' ).removeClass (' hide' );
19+ $ (' .output-box .output-body' ).html (data .message )
20+ }
21+
22+ $btn .button (' reset' );
23+ NProgress .done ();
24+ }
25+ });
26+
27+ return false ;
28+ });
29+
30+ $ (" .backup-delete" ).click (function () {
31+
32+ var $btn = $ (this );
33+
34+ $ .ajax ({
35+ url: $btn .attr (' href' ),
36+ data : {
37+ _token: LA .token
38+ },
39+ method: ' DELETE' ,
40+ success : function (data ){
41+
42+ $ .pjax .reload (' #pjax-container' );
43+
44+ if (typeof data === ' object' ) {
45+ if (data .status ) {
46+ toastr .success (data .message );
47+ } else {
48+ toastr .error (data .message );
49+ }
50+ }
51+
52+ $btn .button (' reset' );
53+ }
54+ });
55+
56+ return false ;
57+ });
58+
59+ });
60+ </script >
61+
62+ <style >
63+ .output-body {
64+ white-space : pre-wrap ;
65+ background : #000000 ;
66+ color : #00fa4a ;
67+ padding : 10px ;
68+ border-radius : 0 ;
69+ }
70+
71+ .todo-list > li .tools {
72+ display : none ;
73+ float : none ;
74+ color : #3c8dbc ;
75+ margin-left : 10px ;
76+ }
77+
78+ </style >
79+
80+ <div class =" box" >
81+ <div class =" box-header" >
82+ <h3 class =" box-title" >Existing backups</h3 >
83+
84+ <div class =" box-tools" >
85+ <a href =" {{ route (' backup-run' ) } }" class =" btn btn-dropbox backup-run" >Backup</a >
86+ </div >
87+ </div >
88+ <!-- /.box-header -->
89+ <div class =" box-body table-responsive no-padding" >
90+ <table class =" table table-hover" >
91+ <tbody >
92+ <tr >
93+ <th >#</th >
94+ <th >Name</th >
95+ <th >Disk</th >
96+ <th >Reachable</th >
97+ <th >Healthy</th >
98+ <th ># of backups</th >
99+ <th >Newest backup</th >
100+ <th >Used storage</th >
101+ </tr >
102+ @foreach ($backups as $index => $backup )
103+ <tr data-toggle =" collapse" data-target =" #trace-{{ $index + 1 } }" style =" cursor : pointer ;" >
104+ <td >{{ $index + 1 } } .</td >
105+ <td >{{ $backup [0 ] } } </td >
106+ <td >{{ $backup [1 ] } } </td >
107+ <td >{{ $backup [2 ] } } </td >
108+ <td >{{ $backup [3 ] } } </td >
109+ <td >{{ $backup [' amount' ] } } </td >
110+ <td >{{ $backup [' newest' ] } } </td >
111+ <td >{{ $backup [' usedStorage' ] } } </td >
112+ </tr >
113+ <tr class =" collapse" id =" trace-{{ $index + 1 } }" >
114+ <td colspan =" 8" >
115+ <ul class =" todo-list ui-sortable" >
116+ @foreach ($backup [' files' ] as $file )
117+ <li >
118+ <span class =" text" >{{ $file } } </span >
119+ <!-- Emphasis label -->
120+
121+ <div class =" tools" >
122+ <a href =" {{ route (' backup-download' , [' disk' => $backup [1 ], ' file' => $backup [0 ]. ' /' . $file ]) } }" ><i class =" fa fa-download" ></i ></a >
123+ <a href =" {{ route (' backup-delete' , [' disk' => $backup [1 ], ' file' => $backup [0 ]. ' /' . $file ]) } }" class =" backup-delete" ><i class =" fa fa-trash-o" ></i ></a >
124+ </div >
125+ </li >
126+ @endforeach
127+ </ul >
128+ </td >
129+ </tr >
130+ @endforeach
131+
132+ </tbody >
133+ </table >
134+ </div >
135+ <!-- /.box-body -->
136+ </div >
137+
138+ <div class =" box box-default output-box hide" >
139+ <div class =" box-header with-border" >
140+ <i class =" fa fa-terminal" ></i >
141+
142+ <h3 class =" box-title" >Output</h3 >
143+ </div >
144+ <!-- /.box-header -->
145+ <div class =" box-body" >
146+ <pre class =" output-body" ></pre >
147+ </div >
148+ <!-- /.box-body -->
149+ </div >
0 commit comments