mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 10:01:40 +00:00
Configuration + NTNet Relay (#48476)
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
icon_state = "bus"
|
||||
density = TRUE
|
||||
circuit = /obj/item/circuitboard/machine/ntnet_relay
|
||||
ui_x = 500
|
||||
ui_x = 400
|
||||
ui_y = 300
|
||||
|
||||
var/datum/ntnet/NTNet = null // This is mostly for backwards reference and to allow varedit modifications from ingame.
|
||||
@@ -91,10 +91,12 @@
|
||||
dos_failure = 0
|
||||
update_icon()
|
||||
SSnetworks.station_network.add_log("Quantum relay manually restarted from overload recovery mode to normal operation mode.")
|
||||
return TRUE
|
||||
if("toggle")
|
||||
enabled = !enabled
|
||||
SSnetworks.station_network.add_log("Quantum relay manually [enabled ? "enabled" : "disabled"].")
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/ntnet_relay/Initialize()
|
||||
uid = gl_uid++
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
unsendable = 1
|
||||
undeletable = 1
|
||||
size = 4
|
||||
ui_x = 420
|
||||
ui_y = 630
|
||||
available_on_ntnet = 0
|
||||
requires_ntnet = 0
|
||||
tgui_id = "ntos_configuration"
|
||||
|
||||
66
tgui-next/packages/tgui/interfaces/NtnetRelay.js
Normal file
66
tgui-next/packages/tgui/interfaces/NtnetRelay.js
Normal file
@@ -0,0 +1,66 @@
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, ProgressBar, Section, AnimatedNumber } from '../components';
|
||||
|
||||
export const NtnetRelay = props => {
|
||||
const { act, data } = useBackend(props);
|
||||
|
||||
const {
|
||||
enabled,
|
||||
dos_capacity,
|
||||
dos_overload,
|
||||
dos_crashed,
|
||||
} = data;
|
||||
|
||||
return (
|
||||
<Section
|
||||
title="Network Buffer"
|
||||
buttons={(
|
||||
<Button
|
||||
icon="power-off"
|
||||
selected={enabled}
|
||||
content={enabled ? 'ENABLED' : 'DISABLED'}
|
||||
onClick={() => act('toggle')}
|
||||
/>
|
||||
)}>
|
||||
{!dos_crashed ? (
|
||||
<ProgressBar
|
||||
value={dos_overload}
|
||||
minValue={0}
|
||||
maxValue={dos_capacity}>
|
||||
<AnimatedNumber value={dos_overload} /> GQ
|
||||
{' / '}
|
||||
{dos_capacity} GQ
|
||||
</ProgressBar>
|
||||
) : (
|
||||
<Box fontFamily="monospace">
|
||||
<Box fontSize="20px">
|
||||
NETWORK BUFFER OVERFLOW
|
||||
</Box>
|
||||
<Box fontSize="16px">
|
||||
OVERLOAD RECOVERY MODE
|
||||
</Box>
|
||||
<Box>
|
||||
This system is suffering temporary outage due to overflow
|
||||
of traffic buffers. Until buffered traffic is processed,
|
||||
all further requests will be dropped. Frequent occurences
|
||||
of this error may indicate insufficient hardware capacity
|
||||
of your network. Please contact your network planning
|
||||
department for instructions on how to resolve this issue.
|
||||
</Box>
|
||||
<Box fontSize="20px" color="bad">
|
||||
ADMINISTRATOR OVERRIDE
|
||||
</Box>
|
||||
<Box fontSize="16px" color="bad">
|
||||
CAUTION - DATA LOSS MAY OCCUR
|
||||
</Box>
|
||||
<Button
|
||||
icon="signal"
|
||||
content="PURGE BUFFER"
|
||||
mt={1}
|
||||
color="bad"
|
||||
onClick={() => act('restart')} />
|
||||
</Box>
|
||||
)}
|
||||
</Section>
|
||||
);
|
||||
};
|
||||
90
tgui-next/packages/tgui/interfaces/NtosConfiguration.js
Normal file
90
tgui-next/packages/tgui/interfaces/NtosConfiguration.js
Normal file
@@ -0,0 +1,90 @@
|
||||
import { Fragment } from 'inferno';
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, Flex, Icon, LabeledList, NoticeBox, ProgressBar, Section, ColorBox } from '../components';
|
||||
|
||||
export const NtosConfiguration = props => {
|
||||
const { act, data } = useBackend(props);
|
||||
|
||||
const {
|
||||
power_usage,
|
||||
battery_exists,
|
||||
battery = {},
|
||||
disk_size,
|
||||
disk_used,
|
||||
hardware = [],
|
||||
} = data;
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<Section
|
||||
title="Power Supply"
|
||||
buttons={(
|
||||
<Box
|
||||
inline
|
||||
bold
|
||||
mr={1}>
|
||||
Power Draw: {power_usage}W
|
||||
</Box>
|
||||
)}>
|
||||
<LabeledList>
|
||||
<LabeledList.Item
|
||||
label="Battery Status"
|
||||
color={!battery_exists && 'average'}>
|
||||
{battery_exists ? (
|
||||
<ProgressBar
|
||||
value={battery.charge}
|
||||
minValue={0}
|
||||
maxValue={battery.max}
|
||||
ranges={{
|
||||
good: [battery.max / 2, Infinity],
|
||||
average: [battery.max / 4, battery.max / 2],
|
||||
bad: [-Infinity, battery.max / 4],
|
||||
}}>
|
||||
{battery.charge} / {battery.max}
|
||||
</ProgressBar>
|
||||
) : 'Not Availible'}
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
</Section>
|
||||
<Section title="File System">
|
||||
<ProgressBar
|
||||
value={disk_used}
|
||||
minValue={0}
|
||||
maxValue={disk_size}
|
||||
color="good">
|
||||
{disk_used} GQ / {disk_size} GQ
|
||||
</ProgressBar>
|
||||
</Section>
|
||||
<Section title="Hardware Components">
|
||||
{hardware.map(component => (
|
||||
<Section
|
||||
key={component.name}
|
||||
title={component.name}
|
||||
level={2}
|
||||
buttons={(
|
||||
<Fragment>
|
||||
{!component.critical && (
|
||||
<Button.Checkbox
|
||||
content="Enabled"
|
||||
checked={component.enabled}
|
||||
mr={1}
|
||||
onClick={() => act('PC_toggle_component', {
|
||||
name: component.name,
|
||||
})}
|
||||
/>
|
||||
)}
|
||||
<Box
|
||||
inline
|
||||
bold
|
||||
mr={1}>
|
||||
Power Usage: {component.powerusage}W
|
||||
</Box>
|
||||
</Fragment>
|
||||
)}>
|
||||
{component.desc}
|
||||
</Section>
|
||||
))}
|
||||
</Section>
|
||||
</Fragment>
|
||||
);
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
@@ -52,7 +52,9 @@ import { NaniteCloudControl } from './interfaces/NaniteCloudControl';
|
||||
import { NaniteProgramHub } from './interfaces/NaniteProgramHub';
|
||||
import { NaniteProgrammer } from './interfaces/NaniteProgrammer';
|
||||
import { NaniteRemote } from './interfaces/NaniteRemote';
|
||||
import { NtnetRelay } from './interfaces/NtnetRelay';
|
||||
import { NtosArcade } from './interfaces/NtosArcade';
|
||||
import { NtosConfiguration } from './interfaces/NtosConfiguration';
|
||||
import { NtosMain } from './interfaces/NtosMain';
|
||||
import { NtosNetDownloader } from './interfaces/NtosNetDownloader';
|
||||
import { NtosSupermatterMonitor } from './interfaces/NtosSupermatterMonitor';
|
||||
@@ -309,6 +311,22 @@ const ROUTES = {
|
||||
component: () => NaniteRemote,
|
||||
scrollable: true,
|
||||
},
|
||||
ntnet_relay: {
|
||||
component: () => NtnetRelay,
|
||||
scrollable: false,
|
||||
},
|
||||
ntos_arcade: {
|
||||
component: () => NtosArcade,
|
||||
wrapper: () => NtosWrapper,
|
||||
scrollable: false,
|
||||
theme: 'ntos',
|
||||
},
|
||||
ntos_configuration: {
|
||||
component: () => NtosConfiguration,
|
||||
wrapper: () => NtosWrapper,
|
||||
scrollable: true,
|
||||
theme: 'ntos',
|
||||
},
|
||||
ntos_main: {
|
||||
component: () => NtosMain,
|
||||
wrapper: () => NtosWrapper,
|
||||
@@ -321,18 +339,18 @@ const ROUTES = {
|
||||
scrollable: true,
|
||||
theme: 'ntos',
|
||||
},
|
||||
ntos_arcade: {
|
||||
component: () => NtosArcade,
|
||||
wrapper: () => NtosWrapper,
|
||||
scrollable: false,
|
||||
theme: 'ntos',
|
||||
},
|
||||
ntos_power_monitor: {
|
||||
component: () => PowerMonitor,
|
||||
wrapper: () => NtosWrapper,
|
||||
scrollable: true,
|
||||
theme: 'ntos',
|
||||
},
|
||||
ntos_station_alert: {
|
||||
component: () => StationAlertConsole,
|
||||
wrapper: () => NtosWrapper,
|
||||
scrollable: true,
|
||||
theme: 'ntos',
|
||||
},
|
||||
ntos_supermatter_monitor: {
|
||||
component: () => NtosSupermatterMonitor,
|
||||
wrapper: () => NtosWrapper,
|
||||
|
||||
Reference in New Issue
Block a user