mirror of
https://github.com/RetroShare/RSNewWebUI.git
synced 2026-09-12 19:50:04 +05:00
config people done
This commit is contained in:
parent
9d19627006
commit
c91bd393a7
@ -3,7 +3,11 @@ const rs = require('rswebui');
|
||||
|
||||
const Reputation = () => {
|
||||
let addFriendIdAsContacts = undefined;
|
||||
let usePositiveDefault = undefined;
|
||||
let deleteBannedAfter = undefined;
|
||||
let negativeThreshold = undefined;
|
||||
let positiveThreshold = undefined;
|
||||
|
||||
return {
|
||||
oninit: (vnode) => {
|
||||
rs.rsJsonApiRequest(
|
||||
@ -11,17 +15,46 @@ const Reputation = () => {
|
||||
{},
|
||||
(data) => (addFriendIdAsContacts = data.retval)
|
||||
);
|
||||
rs.rsJsonApiRequest(
|
||||
'/rsreputations/autoPositiveOpinionForContacts',
|
||||
{},
|
||||
(data) => (usePositiveDefault = data.retval)
|
||||
);
|
||||
rs.rsJsonApiRequest(
|
||||
'/rsIdentity/deleteBannedNodesThreshold',
|
||||
{},
|
||||
(data) => (deleteBannedAfter = data.retval)
|
||||
);
|
||||
rs.rsJsonApiRequest(
|
||||
'/rsreputations/thresholdForRemotelyPositiveReputation',
|
||||
{},
|
||||
(data) => (positiveThreshold = data.retval)
|
||||
);
|
||||
rs.rsJsonApiRequest(
|
||||
'/rsreputations/thresholdForRemotelyNegativeReputation',
|
||||
{},
|
||||
(data) => (negativeThreshold = data.retval)
|
||||
);
|
||||
},
|
||||
view: (vnode) =>
|
||||
m('.widget', [
|
||||
m('h3', 'Reputation'),
|
||||
m('hr'),
|
||||
m('.grid-2col', [
|
||||
m('p', 'Use "positive" as the default opinion for contacts(instead of neutral):'),
|
||||
m('input[type=checkbox]', {
|
||||
checked: usePositiveDefault,
|
||||
oninput: (e) => {
|
||||
usePositiveDefault = e.target.checked;
|
||||
rs.rsJsonApiRequest(
|
||||
'/rsreputations/setAutoPositiveOpinionForContacts',
|
||||
{
|
||||
b: usePositiveDefault,
|
||||
},
|
||||
() => {}
|
||||
);
|
||||
},
|
||||
}),
|
||||
m('p', 'Automatically add identities owned by friend nodes to my contacts:'),
|
||||
m('input[type=checkbox]', {
|
||||
checked: addFriendIdAsContacts,
|
||||
@ -36,6 +69,32 @@ const Reputation = () => {
|
||||
);
|
||||
},
|
||||
}),
|
||||
m('p', 'Difference in votes (+/-) to rate an ID positively:'),
|
||||
m('input[type=number]', {
|
||||
oninput: (e) => (positiveThreshold = e.target.value),
|
||||
value: positiveThreshold,
|
||||
onchange: () =>
|
||||
rs.rsJsonApiRequest(
|
||||
'/rsreputations/setThresholdForRemotelyPositiveReputation',
|
||||
{
|
||||
thresh: positiveThreshold,
|
||||
},
|
||||
() => {}
|
||||
),
|
||||
}),
|
||||
m('p', 'Difference in votes (+/-) to rate an ID negatively:'),
|
||||
m('input[type=number]', {
|
||||
oninput: (e) => (negativeThreshold = e.target.value),
|
||||
value: negativeThreshold,
|
||||
onchange: () =>
|
||||
rs.rsJsonApiRequest(
|
||||
'/rsreputations/setThresholdForRemotelyNegativeReputation',
|
||||
{
|
||||
thresh: negativeThreshold,
|
||||
},
|
||||
() => {}
|
||||
),
|
||||
}),
|
||||
m('p', 'Delete banned identities after(in days, 0 means indefinitely):'),
|
||||
m('input[type=number]', {
|
||||
oninput: (e) => (deleteBannedAfter = e.target.value),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user