mirror of
https://github.com/RetroShare/RSNewWebUI.git
synced 2026-09-14 11:05:47 +05:00
Add 'People' section in config tab
This section mirrors Retroshare's People panel inside the config tab. Allows for changing peers-specific settings.
This commit is contained in:
parent
b7f133df81
commit
0b80a66fb9
56
webui-src/app/config/config_people.js
Normal file
56
webui-src/app/config/config_people.js
Normal file
@ -0,0 +1,56 @@
|
||||
const m = require('mithril');
|
||||
const rs = require('rswebui');
|
||||
|
||||
const Reputation = () => {
|
||||
let addFriendIdAsContacts = undefined;
|
||||
let deleteBannedAfter = undefined;
|
||||
return {
|
||||
oninit: (vnode) => {
|
||||
rs.rsJsonApiRequest('/rsIdentity/autoAddFriendIdsAsContact', {},
|
||||
(data) => addFriendIdAsContacts = data.retval);
|
||||
rs.rsJsonApiRequest('/rsIdentity/deleteBannedNodesThreshold', {},
|
||||
(data) => deleteBannedAfter = data.retval);
|
||||
},
|
||||
view: (vnode) => m('.widget', [
|
||||
m('h3', 'Reputation'),
|
||||
m('hr'),
|
||||
m('.grid-2col', [
|
||||
m('p',
|
||||
'Automatically add identities owned by friend nodes to my contacts:'
|
||||
),
|
||||
m('input[type=checkbox]', {
|
||||
checked: addFriendIdAsContacts,
|
||||
oninput: (e) => {
|
||||
addFriendIdAsContacts = e.target.checked;
|
||||
rs.rsJsonApiRequest(
|
||||
'/rsIdentity/setAutoAddFriendIdsAsContact', {
|
||||
enabled: addFriendIdAsContacts
|
||||
}, () => {});
|
||||
},
|
||||
}),
|
||||
m('p',
|
||||
'Delete banned identities after(in days, 0 means indefinitely):'
|
||||
),
|
||||
m('input[type=number]', {
|
||||
oninput: (e) => deleteBannedAfter = e.target.value,
|
||||
value: deleteBannedAfter,
|
||||
onchange: () => rs.rsJsonApiRequest(
|
||||
'/rsIdentity/setDeleteBannedNodesThreshold', {
|
||||
days: deleteBannedAfter
|
||||
}, () => {}),
|
||||
}),
|
||||
]),
|
||||
]),
|
||||
}
|
||||
};
|
||||
|
||||
const Layout = () => {
|
||||
return {
|
||||
view: (vnode) => [
|
||||
m(Reputation),
|
||||
]
|
||||
};
|
||||
};
|
||||
|
||||
module.exports = Layout;
|
||||
|
||||
@ -26,6 +26,7 @@ let sections = {
|
||||
node: require('config_node'),
|
||||
services: require('config_services'),
|
||||
files: require('config_files'),
|
||||
people: require('config_people'),
|
||||
};
|
||||
|
||||
const Layout = {
|
||||
|
||||
@ -105,7 +105,7 @@ hr {
|
||||
|
||||
.grid-2col {
|
||||
display: grid;
|
||||
grid-template-columns: 50% 50%;
|
||||
grid-template-columns: auto auto;
|
||||
grid-row-gap: 16px;
|
||||
justify-content: start;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user