mirror of
https://github.com/RetroShare/RSNewWebUI.git
synced 2026-09-14 11:05:47 +05:00
Merge master into ImproveWebui: resolve endpoint update conflicts
This commit is contained in:
commit
de4d237b8f
@ -23,7 +23,7 @@ const SharedDirectories = () => {
|
||||
const DownloadDirectory = () => {
|
||||
let dlDir = '';
|
||||
const setDir = () => {
|
||||
rs.rsJsonApiRequest('rsFiles/setDownloadDirectory', {
|
||||
rs.rsJsonApiRequest('/rsFiles/setDownloadDirectory', {
|
||||
path: dlDir,
|
||||
});
|
||||
};
|
||||
@ -48,7 +48,7 @@ const PartialsDirectory = () => {
|
||||
const setDir = () => {
|
||||
// const path = document.getElementById('partial-dir-input').value; // unused?
|
||||
|
||||
rs.rsJsonApiRequest('rsFiles/setPartialsDirectory', {
|
||||
rs.rsJsonApiRequest('/rsFiles/setPartialsDirectory', {
|
||||
path: partialsDir,
|
||||
});
|
||||
};
|
||||
@ -76,7 +76,6 @@ const TransferOptions = () => {
|
||||
let maxUploadSlots = undefined;
|
||||
let strategy = undefined;
|
||||
let diskLimit = undefined;
|
||||
let encryptionPolicy = undefined;
|
||||
let directDLPerm = undefined;
|
||||
const setMaxSimultaneousDownloads = () =>
|
||||
rs.rsJsonApiRequest('/rsFiles/setQueueSize', {
|
||||
@ -94,11 +93,6 @@ const TransferOptions = () => {
|
||||
rs.rsJsonApiRequest('/rsFiles/setFreeDiskSpaceLimit', {
|
||||
minimumFreeMB: parseInt(diskLimit),
|
||||
});
|
||||
const setDefaultEncryption = () => {
|
||||
rs.rsJsonApiRequest('/rsFiles/setDefaultEncryptionPolicy', {
|
||||
policy: parseInt(encryptionPolicy),
|
||||
});
|
||||
};
|
||||
const setDirectDLPerm = () => {
|
||||
rs.rsJsonApiRequest('/rsFiles/setFilePermDirectDL', {
|
||||
perm: parseInt(directDLPerm),
|
||||
@ -112,9 +106,6 @@ const TransferOptions = () => {
|
||||
(res) => (maxUploadSlots = res.body.retval)
|
||||
);
|
||||
rs.rsJsonApiRequest('/rsFiles/freeDiskSpaceLimit', {}, (data) => (diskLimit = data.retval));
|
||||
rs.rsJsonApiRequest('/rsFiles/defaultEncryptionPolicy').then(
|
||||
(res) => (encryptionPolicy = res.body.retval)
|
||||
);
|
||||
rs.rsJsonApiRequest('/rsFiles/filePermDirectDL').then(
|
||||
(res) => (directDLPerm = res.body.retval)
|
||||
);
|
||||
@ -153,31 +144,6 @@ const TransferOptions = () => {
|
||||
oninput: (e) => (diskLimit = e.target.value),
|
||||
onchange: setFreeLimit,
|
||||
}),
|
||||
m('p', 'End-to-end encryption:'),
|
||||
m(
|
||||
'select',
|
||||
{
|
||||
value: encryptionPolicy,
|
||||
oninput: (e) => (encryptionPolicy = e.target.value),
|
||||
onchange: setDefaultEncryption,
|
||||
},
|
||||
[
|
||||
m(
|
||||
'option',
|
||||
{
|
||||
value: util.RS_FILE_CTRL_ENCRYPTION_POLICY_STRICT,
|
||||
},
|
||||
'Enforced'
|
||||
),
|
||||
m(
|
||||
'option',
|
||||
{
|
||||
value: util.RS_FILE_CTRL_ENCRYPTION_POLICY_PERMISSIVE,
|
||||
},
|
||||
'Accepted'
|
||||
),
|
||||
]
|
||||
),
|
||||
m('p', 'Allow Direct Download:'),
|
||||
m(
|
||||
'select',
|
||||
@ -230,4 +196,4 @@ const Layout = () => {
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = Layout;
|
||||
module.exports = Layout;
|
||||
|
||||
@ -71,7 +71,7 @@ const Reputation = () => {
|
||||
}),
|
||||
m('p', 'Difference in votes (+/-) to rate an ID positively:'),
|
||||
m('input[type=number]', {
|
||||
oninput: (e) => (positiveThreshold = e.target.value),
|
||||
oninput: (e) => (positiveThreshold = parseInt(e.target.value)),
|
||||
value: positiveThreshold,
|
||||
onchange: () =>
|
||||
rs.rsJsonApiRequest(
|
||||
@ -84,7 +84,7 @@ const Reputation = () => {
|
||||
}),
|
||||
m('p', 'Difference in votes (+/-) to rate an ID negatively:'),
|
||||
m('input[type=number]', {
|
||||
oninput: (e) => (negativeThreshold = e.target.value),
|
||||
oninput: (e) => (negativeThreshold = parseInt(e.target.value)),
|
||||
value: negativeThreshold,
|
||||
onchange: () =>
|
||||
rs.rsJsonApiRequest(
|
||||
@ -97,7 +97,7 @@ const Reputation = () => {
|
||||
}),
|
||||
m('p', 'Delete banned identities after(in days, 0 means indefinitely):'),
|
||||
m('input[type=number]', {
|
||||
oninput: (e) => (deleteBannedAfter = e.target.value),
|
||||
oninput: (e) => (deleteBannedAfter = parseInt(e.target.value)),
|
||||
value: deleteBannedAfter,
|
||||
onchange: () =>
|
||||
rs.rsJsonApiRequest(
|
||||
|
||||
@ -36,7 +36,11 @@ function loadSharedDirectories() {
|
||||
// Update Shared Directories when there is a corresponding event
|
||||
rs.events[rs.RsEventsType.SHARED_DIRECTORIES] = {
|
||||
handler: (event) => {
|
||||
loadSharedDirectories();
|
||||
switch (event.mEventCode) {
|
||||
case futil.RsSharedDirectoriesEventCode.SHARED_DIRS_LIST_CHANGED:
|
||||
loadSharedDirectories();
|
||||
break;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@ -24,6 +24,22 @@ const DIR_FLAGS_ANONYMOUS_SEARCH = 0x0800;
|
||||
const DIR_FLAGS_ANONYMOUS_DOWNLOAD = 0x0080;
|
||||
const DIR_FLAGS_BROWSABLE = 0x0400;
|
||||
|
||||
const RsSharedDirectoriesEventCode = {
|
||||
UNKNOWN : 0x00,
|
||||
HASHING_PROCESS_STARTED : 0x01,
|
||||
HASHING_PROCESS_PAUSED : 0x02,
|
||||
HASHING_PROCESS_RESUMED : 0x04,
|
||||
HASHING_PROCESS_FINISHED : 0x05,
|
||||
HASHING_FILE : 0x06,
|
||||
SAVING_FILE_INDEX : 0x07,
|
||||
EXTRA_LIST_FILE_ADDED : 0x08,
|
||||
EXTRA_LIST_FILE_REMOVED : 0x09,
|
||||
SHARED_DIRS_LIST_CHANGED : 0x0a,
|
||||
FRIEND_DIR_LIST_UPDATED : 0x0b,
|
||||
OWN_DIR_LIST_UPDATED : 0x0c,
|
||||
OWN_DIR_LIST_PROCESSING : 0x0d,
|
||||
};
|
||||
|
||||
/* eslint-disable no-unused-vars */
|
||||
|
||||
// Access Permission calculated by performing OR operation on the above three flags.
|
||||
@ -333,6 +349,7 @@ module.exports = {
|
||||
DIR_FLAGS_ANONYMOUS_SEARCH,
|
||||
DIR_FLAGS_ANONYMOUS_DOWNLOAD,
|
||||
DIR_FLAGS_BROWSABLE,
|
||||
RsSharedDirectoriesEventCode,
|
||||
RsNodeGroupId,
|
||||
loadRsNodeGroupId,
|
||||
File,
|
||||
|
||||
@ -149,7 +149,7 @@ function rsJsonApiRequest(
|
||||
}
|
||||
} else {
|
||||
connectionState.status = false;
|
||||
if (result.status === 401) {
|
||||
if (result.status === 401 || result.status === 403) {
|
||||
setKeys(loginKey.username, loginKey.passwd, loginKey.url, false);
|
||||
m.route.set('/');
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user