458 lines
19 KiB
PHP
Executable File
458 lines
19 KiB
PHP
Executable File
<?php
|
|
include_once 'path.php';
|
|
if(!isset($_SESSION['validUser']) || $_SESSION['validUser'] !== true)
|
|
exit(header("Location:../index.php"));
|
|
|
|
$jobs = Scheduler::ReadJobs();
|
|
$cancellingBackupJob=false;
|
|
|
|
$startPidfilePath = Scheduler::$localbackup_dir.Scheduler::$manual_dir."/".START_PID;
|
|
$userCancelPath = Scheduler::$localbackup_dir.Scheduler::$manual_dir."/".CANCEL_PATH;
|
|
$currentLocalBackupJob = '';
|
|
|
|
if(file_exists($startPidfilePath)){
|
|
$currentLocalBackupJob = 0;
|
|
|
|
if(file_exists($userCancelPath))
|
|
$cancellingBackupJob=true;
|
|
}
|
|
|
|
$_SESSION['currentLocalBackupJob']=$currentLocalBackupJob;
|
|
|
|
if(!isset($_SESSION['showHidden'])){
|
|
checkShowHidden();
|
|
}
|
|
|
|
$reIndexRunning = FALSE;
|
|
if(file_exists("{$reIndexDirPath}/{$pidPath}")) {
|
|
$reIndexRunning = TRUE;
|
|
}
|
|
?>
|
|
|
|
<script type="text/javascript">
|
|
<?php if($currentLocalBackupJob == 0) { ?>
|
|
manualLocalBackupRunning = true;
|
|
<?php } ?>
|
|
</script>
|
|
<div id="rgt" class="serverDts " style="height: 591px; right: -800px;">
|
|
<span class="closeIcon"> <img class="right closeWin" src="include/images/popup_close_btn.png"></span>
|
|
<h4>Search</h4>
|
|
<div class="search_box">
|
|
<!-- <form onsubmit="return false;" name="search_box_inpt"> -->
|
|
<input type="text" placeholder="Search file/folder" title="Search" value="" class="search_box_inpt search_input">
|
|
<div style="display: none;" class="head_srch_item"> <span>Contacts</span> </div>
|
|
<input type="submit" class="search_box_btn" id="localSearch" value="Search">
|
|
<span style="display:block;" class="disabled_search_btn">Search</span>
|
|
<section class="locationWrapper">
|
|
<div class="locationMain"><span>Location</span>: <span id="location_selected">/</span></div>
|
|
</section>
|
|
<!-- <input type="submit" class="search_box_btn" id="search_home" value="Search"> -->
|
|
<!-- </form> -->
|
|
</div>
|
|
<div class="clear"></div>
|
|
<div id="searchError" class="common_msg">
|
|
<p>Please enter the keyword</p>
|
|
<a class="close_info" href="javascript:void(0)">
|
|
<img width="16" height="16" src="include/images/close.png" alt="close" title="Close">
|
|
</a>
|
|
</div>
|
|
<div class="common_msg welcome_message" id="exlude_resultmsg" style="display: none;">
|
|
<p></p>
|
|
<a class="close_info" href="javascript:void(0)"><img width="16" height="16" src="include/images/close.png" alt="close" title="Close"></a>
|
|
</div>
|
|
|
|
<div class="currentLoad">
|
|
<div style="display: none;" id="lazyLoadingImg" class="pageLoaderbtm"></div>
|
|
<!-- <div class="center popLoader"><img src="include/images/loader_small.gif"></div>-->
|
|
<section class="menu">
|
|
<div class="left_menu">
|
|
</div>
|
|
<div id="rightMenu" class="right_menu">
|
|
<div class="addbckupset" id="addToBackupSet"><a alt="" href="javascript:void(0)" class="bckp_img">Add to backup set</a></div>
|
|
</div>
|
|
</section>
|
|
<div class="exclude">
|
|
<div class="excludeContainer searchSection">
|
|
<div class="tab_loader"><p>loader...</p></div>
|
|
<div style="border:none" class="selected_bdr" id="localDirSearchListWrapper">
|
|
<table id="localDirSearchHeader" cellspacing="0" cellpadding="0" border="0" width="100%" class="folderBackupContent">
|
|
<tbody>
|
|
<tr class="excludeheader header_part ">
|
|
<td class="file_check search-chk-box">
|
|
<!-- <input type="checkbox" class="checkcontrol" id="mainchek">
|
|
<label class="" >All</label> -->
|
|
</td>
|
|
<td class="search-file-name">File / Folder name</td>
|
|
<td class="search-file-size">Size</td>
|
|
<td class="search-file-date">Date modified</td>
|
|
<td class="search-menu-icon"> </td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="ajax_loader"></div>
|
|
<div class="nfiles">No Results</div>
|
|
<div id="localDirSearchList" style="overflow: auto;" class="excludefiles">
|
|
<table cellspacing="0" cellpadding="0" border="0" width="100%" class="folderBackupContent selectedFiles_tab backupset_table bc_table">
|
|
<tbody>
|
|
<!-- Search Result will be here -->
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<!-- selected_bdr -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="container body_wrap localbackup_page">
|
|
<div class="ajax_loader"><p>loader...</p></div>
|
|
<section class="breadcrum_menu menu_wrap">
|
|
<div id="fullPathBreadCrumb" class="breadcrumb"><a href="javascript:void(0);" alt="/" class="getDirList home">Home</a></div>
|
|
<div class="menu_refresh_icon" title="Refresh your backup list">Refresh</div>
|
|
</section>
|
|
<section class="menu localbkp-menu"> <!-- Local backup related css class updates -->
|
|
<!-- Local backup related HTML code updates -->
|
|
<div class="left_menu">
|
|
<div class="locakbackup-wrap">
|
|
<div class="localbkp_lft">
|
|
<label>Local backup location:</label>
|
|
<select class="localbkp_txtbox" id="selectBackupLocation" name="selectBackupLocation" onchange="checkSelectedLocalPath(this.value,1,true)">
|
|
<?php getLocalDriveListHTML(); ?>
|
|
</select>
|
|
</div>
|
|
<div class="localbkp_rgt">
|
|
<div class="localbkp_rgt_box">
|
|
<div class="top-bath">
|
|
<p>Backup Path:<span title="<?php //print $hostName; ?>" id="localbkp_path"><?php //print $hostName; ?></span></p>
|
|
</div>
|
|
<div class="btm-refresh">
|
|
<div class="space_container">
|
|
<div class="space_used">Total space used:</div>
|
|
<span class="space_used_value">0 B</span>
|
|
<span class="refresh-btn"></span>
|
|
<span style="display: block;" id="refreshLoader"><img src="include/images/loader_small.gif" align="absmiddle" border="0"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- Local backup related HTML code updates -->
|
|
<div class="right_menu">
|
|
<div class="search_menu"><img src="include/images/search_icon.png">Search</div>
|
|
</div>
|
|
</section>
|
|
<div class="exclude restorset_top">
|
|
<div class="excludeContainer backupFilePath">
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
|
<tr class="excludeheader header_part ">
|
|
<td class="file_check">
|
|
<input type="checkbox" id="maincheck" class="checkcontrol">
|
|
<label class="mainCheck">All</label>
|
|
</td>
|
|
<td class="fname cont_heading">File/Folder name</td>
|
|
<td class="file_size">Size</td>
|
|
<td class="file_date">Date modified</td>
|
|
</tr>
|
|
</table>
|
|
<div class="nfiles"><?php print NO_FILES;?></div>
|
|
<div id="loadFullPath">
|
|
<div class="excludefiles" style="overflow: hidden;">
|
|
<table id="excludeFilesPath" width="100%" border="0" cellspacing="0" cellpadding="0" class="folderBackupContent backupset_table bc_table">
|
|
|
|
<tbody></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="backupset_list" class="exclude clear_margin restore_set">
|
|
<div class="excludeContainer">
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="main_chk_table1">
|
|
<tr class="excludeheader backupsetTitle ">
|
|
<?php /*Machine Based list*/backupJobList($jobs,'localBackup'); ?>
|
|
</tr>
|
|
</table>
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="main_chk_table">
|
|
<tr class="excludeheader header_part" style="display:none;">
|
|
<td class="file_check">
|
|
<input type="checkbox" id="maincheckBackup" class="checkcontrol">
|
|
<label class="mainCheck">All</label>
|
|
</td>
|
|
<td class="fname" width="37%">File/Folder name</td>
|
|
<td width="14%"> </td>
|
|
<td width="25%" id="removebBackupsetFiles" class="backupset_chk_delete" align="right"> <span> Remove </span></td>
|
|
</tr>
|
|
</table>
|
|
<div class="nfiles" id="noBackupsetFiles" style="display:block;"><?php print NO_BACKUPSET_FILES;?></div>
|
|
<div class="ajax_loader"><p>loader...</p></div>
|
|
<form id="startBackupForm" name="startBackupForm" method="POST">
|
|
<input type="hidden" name="jobTypeManualTask" value="LocalBackup" />
|
|
<input type="hidden" name="oldJobName" id="oldJobName" value="<?php print $currentLocalBackupJob!=''?$currentLocalBackupJob:'0'; ?>" />
|
|
<div class="excludefiles scheduler_part" style="display:none;">
|
|
<table id="backupsetFiles" width="100%" cellspacing="0" cellpadding="0" border="0" class="folderBackupContent">
|
|
<!-- backup set Files needs to be added -->
|
|
|
|
</table>
|
|
</div>
|
|
<div class="restorenow_btm">
|
|
<div class="restorenow_lft">
|
|
<div class="folder_capacity">
|
|
<span class="sizeLoadingIcon"></span>
|
|
<div class="capacity_wrapper">Size of the files / folders selected for backup: <span id="backupSetSizeHTML">0.00 B</span></div>
|
|
<input type="hidden" id="backupSetSize" value="0" />
|
|
</div>
|
|
</div>
|
|
<div class="restorenow_rgt">
|
|
<input type="hidden" id="startManualTaskButton" name="startManualTaskButton" />
|
|
<input type="hidden" id="cancelManualTaskButton" name="cancelManualTaskButton" />
|
|
<?php
|
|
if($cancellingBackupJob==true){
|
|
$cancellingJob = 'style="display:block;"';
|
|
$startJobButton = 'style="display:none;"';
|
|
$cancelJobButton = 'style="display:none;"';
|
|
$cancellingLoader = 'style="display:block;"';
|
|
} else if($currentLocalBackupJob===0){
|
|
$cancellingJob = 'style="display:none;"';
|
|
$startJobButton = 'style="display:none;"';
|
|
$cancelJobButton = 'style="display:block;"';
|
|
$cancellingLoader = 'style="display:none;"';
|
|
} else {
|
|
$cancellingJob = 'style="display:none;"';
|
|
$startJobButton = 'style="display:block;"';
|
|
$cancelJobButton = 'style="display:none;"';
|
|
$cancellingLoader = 'style="display:none;"';
|
|
}
|
|
|
|
|
|
if($machine=='twotier' || $machine==SYNOLOGY_LOCAL){
|
|
?>
|
|
<input type="submit" class="scheduleBtn" id="startBackup" name="startBackup" value="Backup Now" onClick="return startManualBackup()" <?php print $startJobButton; ?> />
|
|
<div class="stop_bkp">
|
|
<div class="cancel_loading_icon" style="display: none;" <?php print $cancellingLoader; ?>>Loading...</div>
|
|
<span class="scheduleBtn" id="cancellingBackup" <?php print $cancellingJob; ?>>Stopping Backup</span>
|
|
</div>
|
|
<input type="submit" class="scheduleBtn" id="cancelBackup" name="cancelBackup" value="Stop Backup" onClick="return cancelManualBackup()" <?php print $cancelJobButton; ?> />
|
|
<!--<div class="loading_icon" <?php print $cancelJobButton; ?>>Loading...</div> -->
|
|
<!-- <input type="submit" class="scheduleBtn" id="ScheduleBackup" name="cancelBackup" value="Schedule Backup" onClick="return scheduleBackup()" /> -->
|
|
<?php } else { ?>
|
|
<!-- <div class="loading_icon" <?php print $cancelJobButton; ?>>Loading...</div> -->
|
|
<input type="submit" class="scheduleBtn" id="startBackup" name="startBackup" value="Backup Now" onClick="return startManualBackup()" <?php print $startJobButton; ?> />
|
|
<div class="stop_bkp">
|
|
<div class="cancel_loading_icon" style="display:none;">Loading...</div>
|
|
<span class="scheduleBtn" id="cancellingBackup" style="display:none;">Stopping Backup</span>
|
|
</div>
|
|
<input type="submit" class="scheduleBtn" id="cancelBackup" name="cancelBackup" value="Stop Backup" onClick="return cancelManualBackup()" <?php print $cancelJobButton; ?> />
|
|
<?php } ?>
|
|
<input type="hidden" id="localBackupLocation" name="localBackupLocation" value="" />
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<!-- End excludeContainer -->
|
|
</div>
|
|
<!-- End exclude -->
|
|
<!--q napschedule_container starts Schedule job popup-->
|
|
|
|
<div id="scheduler_div" class="popup_container qnapschedule_container popLeft" >
|
|
<form name="frm_update_schedule" id="frm_update_schedule" method="post" >
|
|
<section class="popup_header">
|
|
<h4>Schedule backup parameters</h4>
|
|
<span class="popup_close_btn hide_popup" title="Close"></span>
|
|
</section>
|
|
<section class="popup_body">
|
|
<div id="popupError" class="common_msg">
|
|
<p><?php print INVALID_EMAIL; ?></p>
|
|
<a class="close_info" href="javascript:void(0)">
|
|
<img width="16" height="16" src="include/images/close.png" alt="close" title="Close">
|
|
</a>
|
|
</div>
|
|
<?php
|
|
//Backup Scheduler
|
|
$curPage = 'backup';
|
|
include('scheduleDiv.php');
|
|
?>
|
|
|
|
</section>
|
|
<section class="popup_footer">
|
|
<input type="button" id="update_scheduler" name="update_scheduler" class="addButton" value="Update Scheduler">
|
|
<input type="button" class="scheduleBtn popup_cancelBtn" value="Cancel" >
|
|
</section>
|
|
</form>
|
|
</div>
|
|
|
|
<!--popup starts New Backup set-->
|
|
<div class="popup_container popContent newBkpSet popLeft">
|
|
<section class="popup_header">
|
|
<h4>Create new Backup set</h4>
|
|
<span class="popup_close_btn hide_popup"></span>
|
|
</section>
|
|
<section class="popup_body">
|
|
<div id="popupError1" class="common_msg">
|
|
<p>Please select folder/file to backup</p>
|
|
<a class="close_info" href="javascript:void(0)">
|
|
<img width="16" height="16" src="include/images/close.png" alt="close" title="Close">
|
|
</a>
|
|
</div>
|
|
<div class="setname">Backup Set Name <input type="text" class="backupsetInput" name="newJobName" id="newJobName" > </div>
|
|
<div class="exclude popup_set_exclude">
|
|
<div class="excludeContainer newBackupSetClass">
|
|
<!-- files table -->
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" height="40">
|
|
<tr class="popup_tabs" id="backupTab">
|
|
<td width="30%" class="selected_before active" >Files/Folders for backup </td>
|
|
<td width="30%" class="selected_after" >Selected files/folders list</td>
|
|
<td width="20%" class="selected_empty"> </td>
|
|
<td width="20%" class="selected_empty"></td>
|
|
</tr>
|
|
</table>
|
|
<div id="selectFiles" class="exclude popup_set_exclude" style="margin-top:0px">
|
|
<div class="excludeContainer backup_page">
|
|
<div class="selected_bdr">
|
|
<div class="breadcrumb" id="bkpBreadCrumb"><a href="javascript:void(0);" alt="/">/</a></div>
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="folderBackupContent selectedFiles_tab">
|
|
<tr class="excludeheader header_part ">
|
|
<td class="file_check"> <input type="checkbox" id="maincheck" class="checkcontrol"> <label class="mainCheck">All</label> </td>
|
|
<td class="fname cont_heading">File/Folder name</td>
|
|
<td class="file_size">Size</td>
|
|
<td class="file_date">Date modified</td>
|
|
</tr>
|
|
</table>
|
|
<div class="ajax_loader"><p>loader...</p></div>
|
|
<div class="nfiles"><?php print NO_FILES;?></div>
|
|
<div id="newBackupSet">
|
|
<div style="overflow: hidden;" class="excludefiles">
|
|
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="folderBackupContent backupset_table" id="excludeFilesPath">
|
|
<tbody></tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="selectedFiles" class="exclude popup_set_exclude" style="margin-top:0px; display:none;">
|
|
<div class="excludeContainer">
|
|
<!-- Selected Folders/Files - Start -->
|
|
<div class="selected_bdr" >
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="main_chk_table folderBackupContent" style="display:none;">
|
|
<tr class="excludeheader header_part">
|
|
<td class="file_check">
|
|
<input type="checkbox" id="maincheckSelected" class="checkcontrol">
|
|
<label class="mainCheck">All</label>
|
|
</td>
|
|
<td class="fname" width="37%">File/Folder name</td>
|
|
<td width="24%"> </td>
|
|
<td width="15%" id="removeSelectedFiles" class="backupset_chk_delete" align="right"> <span style="display: none;"> Remove </span></td>
|
|
</tr>
|
|
</table>
|
|
<div class="nfiles"><?php print NO_BACKUPSET_FILES;?></div>
|
|
<div class="excludefiles selected_items">
|
|
<form id="newBackupSetForm" method="POST"><input type="hidden" name="jobType" value="Backup" />
|
|
<table id="selectedBackupsetFiles" width="100%" cellspacing="0" cellpadding="0" border="0" class="folderBackupContent">
|
|
<!-- Folders/Files needs to be added-->
|
|
</table>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<!-- Selected Folders/Files -->
|
|
</div>
|
|
</div>
|
|
<!-- End file table -->
|
|
</div>
|
|
</div>
|
|
<div class="clear"></div>
|
|
</section>
|
|
<section class="popup_footer">
|
|
<div class="btncontainer">
|
|
<input type="submit" class="addButton" id="schedule_backup" value="Schedule Backup" >
|
|
<input type="submit" class="scheduleBtn popup_cancelBtn" value="Cancel" >
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<!--popup starts Add Folders/Files to your exclude list -->
|
|
<div class="popup_container popContent Backuplocation_popup popLeft backup_page">
|
|
<section class="popup_header">
|
|
<h4>Select your backup location</h4>
|
|
<span class="popup_close_btn hide_popup"></span>
|
|
</section>
|
|
<section class="popup_body">
|
|
<!-- files table -->
|
|
<div class="exclude popup_set_exclude">
|
|
<div class="excludeContainer">
|
|
<div id="backupLocationBreadCrumb" class="breadcrumb"><a href="javascript:void(0);" alt="/" class="getBackupDirList">/</a></div>
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="folderBackupContent">
|
|
<tbody>
|
|
<tr class="excludeheader header_part ">
|
|
<td class="cont_heading" width="100%">File/Folder name</td>
|
|
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<div class="ajax_loader"><p>loader...</p></div>
|
|
<div class="nfiles"><?php print NO_FILES;?></div>
|
|
<!-- Load Folders/Files from Disk - Start -->
|
|
<div id="loadBackupLocation">
|
|
</div>
|
|
<!-- Load Folders/Files from Disk - End -->
|
|
</div>
|
|
</div>
|
|
<!-- End file table -->
|
|
<div class="clear"></div>
|
|
</section>
|
|
<section class="popup_footer">
|
|
<div class="btncontainer">
|
|
<input type="submit" id="addBackupLocation" class="scheduleBtn" value=" Ok ">
|
|
<input type="submit" class="scheduleBtn popup_cancelBtn" value="Cancel">
|
|
</div>
|
|
</section>
|
|
</div>
|
|
</div>
|
|
|
|
<ul class="dropdown row_dropdown bkp_dropdown jeegoocontext" id="dropdown">
|
|
<li><a class="file_menu_backupset exclude_list">Add to Exclude List</a></li>
|
|
<li><a class="file_menu_refresh refresh_list">Refresh</a></li>
|
|
</ul>
|
|
<script type="text/javascript">
|
|
var localDirMore = true;
|
|
var checkScrolledHeight=0;
|
|
<?php if($reIndexRunning) { ?>
|
|
reIndexStarted = true;
|
|
<?php } else {?>
|
|
reIndexStarted = false;
|
|
<?php } ?>
|
|
/* For Search - End*/
|
|
actionRequired=0;
|
|
jQuery(document).ready(function(){
|
|
loadLocalFiles('/','loadFullPath','fullPathBreadCrumb','backupFilePath');
|
|
checkSelectedLocalPath(jQuery('#selectBackupLocation').val(),false,false);
|
|
onScrollForLocal(); // For Search
|
|
|
|
//Added for right menu issue
|
|
var dropdownHTML = jQuery('#dropdown').detach();
|
|
dropdownHTML.appendTo("body");
|
|
<?php
|
|
if($currentLocalBackupJob===0){
|
|
?>
|
|
loadExistingJob('0','localBackup');
|
|
watchBackupStatus('localBackup');
|
|
<?php
|
|
} else {
|
|
?>
|
|
if(manualLocalBackupRunning==true){
|
|
manualLocalBackupRunning=false;
|
|
defaultLocalBackupSetArray = [];
|
|
defaultLocalBackupSetTypeArray = [];
|
|
}
|
|
|
|
loadExistingJob('','localBackup');
|
|
IDrive.Scheduler.selectSchedule('Backup_LocalBackupSet','Backup');
|
|
actionRequired=1;
|
|
<?php
|
|
}
|
|
?>
|
|
});
|
|
</script>
|