Просмотр исходного кода

[js, css, php] popup styles fixed. backups download link added.

naumov-socolov 14 лет назад
Родитель
Сommit
34a9ee322f
4 измененных файлов с 37 добавлено и 4 удалено
  1. 21 3
      web/css/popup.css
  2. 4 0
      web/js/html.js
  3. 1 1
      web/js/templates.js
  4. 11 0
      web/vesta/api/MAIN.class.php

+ 21 - 3
web/css/popup.css

@@ -37,13 +37,13 @@
 	.d-popup span.close:active{
 		background-position:0 -33px;
 	}
-	
 .d-popup-title{
 	font-size:11px;
 	text-transform:uppercase;
 	text-align:center;
-	color:#fffdd4;
-	margin:0 0 9px;
+	color:#fffaba;
+	margin:5px 0 16px;
+    letter-spacing: 2px;
 }
 .d-popup-items{
 	font-size:12px;
@@ -64,4 +64,22 @@
 }
 .d-popup .prop-value{
 	color:#fff;
+    margin-bottom: 5px;
 } 
+.d-popup-content{
+    color: #fff;
+    font-size: 13px;
+    line-height: 24px;
+}
+.d-popup-content li{
+    margin-bottom: 5px;
+    color: #fff;
+    font-size: 12px;
+}
+.d-popup-content li strong{
+    color: #BDB9AE; 
+    text-transfom: uppercese;
+    font-weight: normal;
+    font-size: 10px;
+    margin-right: 7px;
+}

+ 4 - 0
web/js/html.js

@@ -498,6 +498,10 @@ App.HTML.Build.backup_list = function(backups)
         tpl.set(':OWNER', App.Env.initialParams.auth_user.uid.uid);
 		tpl.set(':CREATED_AT_WDAY', App.Constants.KEY.WDAYS[created_date.getDay()]);
         tpl.set(':SIZE', App.Helpers.getMbHuman(bckp.SIZE) + ' ' + App.Helpers.getMbHuman(bckp.SIZE, true));
+//		tpl.set(':DOWNLOAD_LINK', '/backup/' + App.Env.initialParams.auth_user.uid.uid + '.' + key + '.tar');
+		tpl.set(':DOWNLOAD_LINK', '/dispatch.php?jedi_method=MAIN.downloadBackup&key=' + key);
+
+        
 		acc[acc.length++] = tpl.finalize()
 	});
 	

+ 1 - 1
web/js/templates.js

@@ -1076,7 +1076,7 @@ App.Templates.html = {
 								<span class="backup-size">\
 									<span class="backup-size-inner">~!:SIZE~!</span>\
 								</span>\
-								<a class="backup-url" href="return alert(\'Not available at the time\');">download</a>\
+								<a class="backup-url" href="~!:DOWNLOAD_LINK~!">download</a>\
 							</div>\
 							<div class="props-ext">\
 								<!-- div class="backup-actions">\

+ 11 - 0
web/vesta/api/MAIN.class.php

@@ -144,6 +144,17 @@ MAIL;
 		return $this->reply($rs['status'], @$rs['data']);
 	}
 
+    public function downloadBackupExecute(Request $request)
+    {
+		$user = VestaSession::getInstance()->getUser();
+
+        header('Content-type: application/x-tar');
+        header('Content-Disposition: attachment; filename="'.$user['uid'].'.'.$_REQUEST['key'].'.tar"');
+        header('X-Accel-Redirect: /backup/'.$user['uid'].'.'.$_REQUEST['key'].'.tar');
+
+        exit;
+	}
+
     /**
      * Get Initial params.
      * Global constants / variables / configs