import { Fragment } from 'inferno';
import { useBackend } from '../backend';
import { act as _act } from '../byond';
import { Button, LabeledList, NoticeBox, Section, Tabs, Input } from '../components';
export const TelePDALog = props => {
const { act, data } = useBackend(props);
const {
network,
notice = "",
authenticated = false,
canhack = false,
selected = null,
servers = [],
message_logs = [],
recon_logs = [],
} = data;
const fake_message = data.fake_message || {
'sender': 'System Administrator',
'job': 'Admin',
'recepient': null,
'message': 'This is a test, please ignore',
};
const prioritycolorMap = {
'Normal': 'warning',
'High': 'bad',
'Extreme': 'bad',
};
const valid = (selected && selected.status && authenticated);
if (data.hacking) {
return ( // should have used en -> jp unicode -> other encoding method->utf8
{"INTRN@L ACfES VIOL�TIa█ DEtE₡TED! Ree3ARcinG A█ \
BAaKUP RdST�RE PbINT [0xcff32ca] - PLfASE aAIT"}
{data.borg ? (
Brute-forcing for server key.
It will take 20 seconds for every character that the password has.
In the meantime, this console can reveal your
true intentions if you let someone access it.
Make sure no humans enter the room during that time.
) : (
QnJ1dGUtZm9yY2luZyBmb3Igc2VydmVyIGtleS48YnI+IEl0IHdpbG
wgdGFrZSAyMCBzZWNvbmRzIGZvciBldmVyeSBjaGFyYWN0ZXIgdGhh
dCB0aGUgcGFzc3dvcmQgaGFzLiBJbiB0aGUgbWVhbnRpbWUsIHRoaX
MgY29uc29sZSBjYW4gcmV2ZWFsIHlvdXIgdHJ1ZSBpbnRlbnRpb25z
IGlmIHlvdSBsZXQgc29tZW9uZSBhY2Nlc3MgaXQuIE1ha2Ugc3VyZS
BubyBodW1hbnMgZW50ZXIgdGhlIHJvb20gZHVyaW5nIHRoYXQgdGltZS4=
)}
);
}
return (
{!!notice && (
{notice}
)}
)}>
{servers ? (
`${servers.length} currently probed and buffered`
) : (
'Buffer is empty!'
)}
act('change_auth')}
/>
{canhack && (
act('hack')}
/>
)}
)}>
{authenticated ? "KEY OK" : "KEY FAIL"}
act('auth')}
/>
act('mainmenu')}
/>
)}>
{selected ? (
`${selected.name} (${selected.id})`
) : (
"None (None)"
)}
{selected ? (
selected.status ? (
'Running'
) : (
'Server down! Logging and messaging functionality unavailable!'
)
):(
'No server selected'
)}
{(servers && servers.length) ? (
{servers.map(server => {
return (
act('viewmachine', {
'value': server.id,
})} />
)}>
{`${server.name} (${server.id})`}
);
})}
) : (
'404 Servers not found. Have you tried scanning the network?'
)}
act('refresh')}
/>
act('clear_log', {
'value': 'pda_logs',
})}
/>
{(message_logs && message_logs.length) ? (
message_logs.map(message => {
return (
act('del_log', {
'ref': message.ref,
})}
/>
)}>
{message.sender}
{message.recipient}
_act(message.ref, 'photo')}
/>
)
)}>
{message.message}
);
})
) : (
'Error: Logs empty'
)}
act('refresh')}
/>
act('clear_log', {
'value': 'rc_msgs',
})}
/>
{(recon_logs && recon_logs.length) ? (
recon_logs.map(message => {
return (
act('del_log', {
'ref': message.ref,
})}
/>
)}>
{message.sender}
{message.recipient}
{message.message}
{message.stamp !== 'Unstamped' ? (
{message.stamp}
) : (
message.stamp
)}
{message.auth}
{message.priority === 'Extreme' ? (
!!{message.priority}!!
) : (
message.priority
)}
);
})
) : (
'Error: No logs found'
)}
act('fake', {
'reset': true,
})}
/>
act('fake', {
'send': true,
})}
/>
act('fake', {
'sender': value,
})}
/>
act('fake', {
'job': value,
})}
/>
act('fake', {
'recepient': true,
})}
/>
act('fake', {
'message': value,
})}
/>
);
};