ui fixes hopefully

This commit is contained in:
sarcoph
2022-03-19 23:40:57 -08:00
parent db96ed19c0
commit 12d78e0fdf
8 changed files with 164 additions and 217 deletions
+17 -13
View File
@@ -56,19 +56,23 @@ export const Apc = (props, context) => {
if (data.failTime > 0) {
return (
<NoticeBox>
<b><h3>SYSTEM FAILURE</h3></b>
<i>
I/O regulators malfunction detected!
Waiting for system reboot...
</i>
<br />
Automatic reboot in {data.failTime} seconds...
<Button
icon="sync"
content="Reboot Now"
onClick={() => act('reboot')} />
</NoticeBox>
<Window resizable>
<Window.Content>
<NoticeBox>
<b><h3>SYSTEM FAILURE</h3></b>
<i>
I/O regulators malfunction detected!
Waiting for system reboot...
</i>
<br />
Automatic reboot in {data.failTime} seconds...
<Button
icon="sync"
content="Reboot Now"
onClick={() => act('reboot')} />
</NoticeBox>
</Window.Content>
</Window>
);
}
@@ -24,6 +24,7 @@ export const ChemMaster = (props, context) => {
if (screen === "analyze") {
return <AnalysisResults />;
}
return (
<Window resizable>
<Window.Content scrollable>
@@ -1,93 +1,98 @@
import { useBackend } from '../../backend';
import { Button, ColorBox, LabeledList, Section } from '../../components';
import { Window } from '../../layouts';
export const AnalysisResults = (props, context) => {
const { data, act } = useBackend(context);
const { analyzeVars, fermianalyze } = data;
return (
<Section
title="Analysis Results"
buttons={(
<Button
icon="arrow-left"
content="Back"
onClick={() => act('goScreen', {
screen: 'home',
})} />
)}>
{!fermianalyze && (
<LabeledList>
<LabeledList.Item label="Name">
{analyzeVars.name}
</LabeledList.Item>
<LabeledList.Item label="State">
{analyzeVars.state}
</LabeledList.Item>
<LabeledList.Item label="Color">
<ColorBox color={analyzeVars.color} mr={1} />
{analyzeVars.color}
</LabeledList.Item>
<LabeledList.Item label="Description">
{analyzeVars.description}
</LabeledList.Item>
<LabeledList.Item label="Metabolization Rate">
{analyzeVars.metaRate} u/minute
</LabeledList.Item>
<LabeledList.Item label="Overdose Threshold">
{analyzeVars.overD}
</LabeledList.Item>
<LabeledList.Item label="Addiction Threshold">
{analyzeVars.addicD}
</LabeledList.Item>
</LabeledList>
)}
{!!fermianalyze && (
<LabeledList>
<LabeledList.Item label="Name">
{analyzeVars.name}
</LabeledList.Item>
<LabeledList.Item label="State">
{analyzeVars.state}
</LabeledList.Item>
<LabeledList.Item label="Color">
<ColorBox color={analyzeVars.color} mr={1} />
{analyzeVars.color}
</LabeledList.Item>
<LabeledList.Item label="Description">
{analyzeVars.description}
</LabeledList.Item>
<LabeledList.Item label="Metabolization Rate">
{analyzeVars.metaRate} u/minute
</LabeledList.Item>
<LabeledList.Item label="Overdose Threshold">
{analyzeVars.overD}
</LabeledList.Item>
<LabeledList.Item label="Addiction Threshold">
{analyzeVars.addicD}
</LabeledList.Item>
<LabeledList.Item label="Purity">
{analyzeVars.purityF}
</LabeledList.Item>
<LabeledList.Item label="Inverse Ratio">
{analyzeVars.inverseRatioF}
</LabeledList.Item>
<LabeledList.Item label="Purity E">
{analyzeVars.purityE}
</LabeledList.Item>
<LabeledList.Item label="Lower Optimal Temperature">
{analyzeVars.minTemp}
</LabeledList.Item>
<LabeledList.Item label="Upper Optimal Temperature">
{analyzeVars.maxTemp}
</LabeledList.Item>
<LabeledList.Item label="Explosive Temperature">
{analyzeVars.eTemp}
</LabeledList.Item>
<LabeledList.Item label="pH Peak">
{analyzeVars.pHpeak}
</LabeledList.Item>
</LabeledList>
)}
</Section>
<Window>
<Window.Content>
<Section
title="Analysis Results"
buttons={(
<Button
icon="arrow-left"
content="Back"
onClick={() => act('goScreen', {
screen: 'home',
})} />
)}>
{!fermianalyze && (
<LabeledList>
<LabeledList.Item label="Name">
{analyzeVars.name}
</LabeledList.Item>
<LabeledList.Item label="State">
{analyzeVars.state}
</LabeledList.Item>
<LabeledList.Item label="Color">
<ColorBox color={analyzeVars.color} mr={1} />
{analyzeVars.color}
</LabeledList.Item>
<LabeledList.Item label="Description">
{analyzeVars.description}
</LabeledList.Item>
<LabeledList.Item label="Metabolization Rate">
{analyzeVars.metaRate} u/minute
</LabeledList.Item>
<LabeledList.Item label="Overdose Threshold">
{analyzeVars.overD}
</LabeledList.Item>
<LabeledList.Item label="Addiction Threshold">
{analyzeVars.addicD}
</LabeledList.Item>
</LabeledList>
)}
{!!fermianalyze && (
<LabeledList>
<LabeledList.Item label="Name">
{analyzeVars.name}
</LabeledList.Item>
<LabeledList.Item label="State">
{analyzeVars.state}
</LabeledList.Item>
<LabeledList.Item label="Color">
<ColorBox color={analyzeVars.color} mr={1} />
{analyzeVars.color}
</LabeledList.Item>
<LabeledList.Item label="Description">
{analyzeVars.description}
</LabeledList.Item>
<LabeledList.Item label="Metabolization Rate">
{analyzeVars.metaRate} u/minute
</LabeledList.Item>
<LabeledList.Item label="Overdose Threshold">
{analyzeVars.overD}
</LabeledList.Item>
<LabeledList.Item label="Addiction Threshold">
{analyzeVars.addicD}
</LabeledList.Item>
<LabeledList.Item label="Purity">
{analyzeVars.purityF}
</LabeledList.Item>
<LabeledList.Item label="Inverse Ratio">
{analyzeVars.inverseRatioF}
</LabeledList.Item>
<LabeledList.Item label="Purity E">
{analyzeVars.purityE}
</LabeledList.Item>
<LabeledList.Item label="Lower Optimal Temperature">
{analyzeVars.minTemp}
</LabeledList.Item>
<LabeledList.Item label="Upper Optimal Temperature">
{analyzeVars.maxTemp}
</LabeledList.Item>
<LabeledList.Item label="Explosive Temperature">
{analyzeVars.eTemp}
</LabeledList.Item>
<LabeledList.Item label="pH Peak">
{analyzeVars.pHpeak}
</LabeledList.Item>
</LabeledList>
)}
</Section>
</Window.Content>
</Window>
);
};
@@ -31,14 +31,18 @@ export const NaniteProgrammer = (props, context) => {
if (!has_program) {
return (
<Section
title="Blank Disk"
buttons={(
<Button
icon="eject"
content="Eject"
onClick={() => act('eject')} />
)} />
<Window>
<Window.Content>
<Section
title="Blank Disk"
buttons={(
<Button
icon="eject"
content="Eject"
onClick={() => act('eject')} />
)} />
</Window.Content>
</Window>
);
}
@@ -9,11 +9,16 @@ import { NtosWindow, Window } from '../layouts';
const logScale = value => Math.log2(16 + Math.max(0, value)) - 4;
export const NtosSupermatterMonitor = (props, context) => {
const { state } = props;
const { act, data } = useBackend(context);
const {
active,
} = data;
const gases = flow([
gases => gases.filter(gas => gas.amount >= 0.01),
sortBy(gas => -gas.amount),
])(data.gases || []);
const gasMaxAmount = Math.max(1, ...gases.map(gas => gas.amount));
if (!active) {
return (
<NtosWindow resizable>
@@ -23,18 +28,14 @@ export const NtosSupermatterMonitor = (props, context) => {
</NtosWindow>
);
}
const gases = flow([
gases => gases.filter(gas => gas.amount >= 0.01),
sortBy(gas => -gas.amount),
])(data.gases || []);
const gasMaxAmount = Math.max(1, ...gases.map(gas => gas.amount));
return (
<NtosWindow resizable>
<NtosWindow.Content scrollable>
<Flex spacing={1}>
<Flex.Item width="270px">
<Section title="Metrics">
<NtosSmMetrics {...data} />
<NtosSmMetrics />
</Section>
</Flex.Item>
<Flex.Item grow={1}>
@@ -71,7 +72,8 @@ export const NtosSupermatterMonitor = (props, context) => {
);
};
const NtosSmMetrics = data => {
const NtosSmMetrics = (props, context) => {
const { data } = useBackend(context);
const {
SM_integrity,
SM_power,
@@ -234,77 +234,4 @@ export const ShuttleManipulatorTemplates = (props, context) => {
</Flex>
</Section>
);
};
// const TemplatesTab = (props, context) => {
// const { act, data } = useBackend(context);
// const {
// templates = {},
// templates_tabs = [],
// selected = {},
// } = data;
// const [templateTab, setTemplateTab] = useLocalState(context, 'templateTab', 'arrival');
// return (
// <Section>
// <Tabs>
// {templates_tabs.map(tempTab => (
// <Tabs.Tab
// key={tempTab}
// selected={templateTab === tempTab}
// onClick={() => setTemplateTab(tempTab)}>
// {tempTab}
// </Tabs.Tab>
// ))}
// </Tabs>
// {JSON.stringify(templates)}
// {/* {() => {
// const tab = templates[templateTab];
// return (
// <Section
// title={templateTab}>
// {tab.templates.map(template => {
// const isSelected = (
// template.shuttle_id === selected.shuttle_id
// );
// return (
// <Section
// title={template.name}
// level={2}
// key={template.shuttle_id}
// buttons={(
// <Button
// content={isSelected ? 'Selected' : 'Select'}
// selected={isSelected}
// onClick={() => act('select_template', {
// shuttle_id: template.shuttle_id,
// })} />
// )}>
// {(!!template.description || !!template.admin_notes) && (
// <LabeledList>
// {!!template.description && (
// <LabeledList.Item label="Description">
// {template.description}
// </LabeledList.Item>
// )}
// {!!template.admin_notes && (
// <LabeledList.Item label="Admin Notes">
// {template.admin_notes}
// </LabeledList.Item>
// )}
// </LabeledList>
// )}
// </Section>
// );
// })}
// </Section>
// );
// } } */}
// </Section>
// );
// };
};
@@ -32,36 +32,40 @@ export const TelecommsPDALog = (props, context) => {
if (data.hacking) {
return ( // should have used en -> jp unicode -> other encoding method->utf8
<NoticeBox>
<b>
<h3>
{"INTRN@L ACfES VIOLTIa█ DEtE₡TED! Ree3ARcinG A█ \
<NtosWindow resizable>
<NtosWindow.Content scrollable>
<NoticeBox>
<b>
<h3>
{"INTRN@L ACfES VIOLTIa█ DEtE₡TED! Ree3ARcinG A█ \
BAaKUP RdSTRE PbINT [0xcff32ca] - PLfASE aAIT"}
</h3>
</b>
<i>
{data.borg ? (
<Fragment>
Brute-forcing for server key. <br />
It will take 20 seconds for every character that the password has.
<br />
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.
</Fragment>
) : (
<Fragment>
QnJ1dGUtZm9yY2luZyBmb3Igc2VydmVyIGtleS48YnI+IEl0IHdpbG<br />
wgdGFrZSAyMCBzZWNvbmRzIGZvciBldmVyeSBjaGFyYWN0ZXIgdGhh<br />
dCB0aGUgcGFzc3dvcmQgaGFzLiBJbiB0aGUgbWVhbnRpbWUsIHRoaX<br />
MgY29uc29sZSBjYW4gcmV2ZWFsIHlvdXIgdHJ1ZSBpbnRlbnRpb25z<br />
IGlmIHlvdSBsZXQgc29tZW9uZSBhY2Nlc3MgaXQuIE1ha2Ugc3VyZS<br />
BubyBodW1hbnMgZW50ZXIgdGhlIHJvb20gZHVyaW5nIHRoYXQgdGltZS4=<br />
<br />
</Fragment>
)}
</i>
</NoticeBox>
</h3>
</b>
<i>
{data.borg ? (
<Fragment>
Brute-forcing for server key. <br />
It will take 20 seconds for every character that the password has.
<br />
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.
</Fragment>
) : (
<Fragment>
QnJ1dGUtZm9yY2luZyBmb3Igc2VydmVyIGtleS48YnI+IEl0IHdpbG<br />
wgdGFrZSAyMCBzZWNvbmRzIGZvciBldmVyeSBjaGFyYWN0ZXIgdGhh<br />
dCB0aGUgcGFzc3dvcmQgaGFzLiBJbiB0aGUgbWVhbnRpbWUsIHRoaX<br />
MgY29uc29sZSBjYW4gcmV2ZWFsIHlvdXIgdHJ1ZSBpbnRlbnRpb25z<br />
IGlmIHlvdSBsZXQgc29tZW9uZSBhY2Nlc3MgaXQuIE1ha2Ugc3VyZS<br />
BubyBodW1hbnMgZW50ZXIgdGhlIHJvb20gZHVyaW5nIHRoYXQgdGltZS4=<br />
<br />
</Fragment>
)}
</i>
</NoticeBox>
</NtosWindow.Content>
</NtosWindow>
);
}
File diff suppressed because one or more lines are too long