mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-11 15:21:01 +03:00
add: job logic
This commit is contained in:
@@ -100,6 +100,12 @@ class JobTable: Reactor.Component {
|
||||
refreshDir(is_remote);
|
||||
}
|
||||
|
||||
function clearAllJobs() {
|
||||
this.jobs = [];
|
||||
this.job_map = {};
|
||||
this.update();
|
||||
}
|
||||
|
||||
function send(path, is_remote) {
|
||||
var to;
|
||||
var show_hidden;
|
||||
@@ -124,6 +130,14 @@ class JobTable: Reactor.Component {
|
||||
self.timer(30ms, function() { self.update(); });
|
||||
}
|
||||
|
||||
function addJob(id, path, to, show_hidden, is_remote) {
|
||||
this.jobs.push({ type: "transfer",
|
||||
id: id, path: path, to: to,
|
||||
include_hidden: show_hidden,
|
||||
is_remote: is_remote });
|
||||
this.job_map[id] = this.jobs[this.jobs.length - 1];
|
||||
}
|
||||
|
||||
function addDelDir(path, is_remote) {
|
||||
var id = jobIdCounter;
|
||||
jobIdCounter += 1;
|
||||
@@ -649,6 +663,18 @@ handler.jobError = function(id, err, file_num = -1) {
|
||||
file_transfer.job_table.updateJobStatus(id, file_num, err);
|
||||
}
|
||||
|
||||
handler.clearAllJobs = function() {
|
||||
file_transfer.job_table.clearAllJobs();
|
||||
}
|
||||
|
||||
handler.addJob = function (id, path, to, file_num, show_hidden, is_remote) {
|
||||
file_transfer.job_table.addJob(id,path,to,file_num,show_hidden,is_remote);
|
||||
}
|
||||
|
||||
handler.updateTransferList = function () {
|
||||
file_transfer.job_table.update();
|
||||
}
|
||||
|
||||
function refreshDir(is_remote) {
|
||||
if (is_remote) file_transfer.remote_folder_view.refreshDir();
|
||||
else file_transfer.local_folder_view.refreshDir();
|
||||
|
||||
Reference in New Issue
Block a user