show ip adress of device
parent
af8e338676
commit
f1d06c72fa
|
@ -20,6 +20,7 @@
|
|||
"deviceModelText": "Gerätemodell",
|
||||
"deviceFirmwareVersionText": "Firmware Version",
|
||||
"deviceLastUpdatedText": "Letzte Aktualisierung",
|
||||
"deviceIPAddressText": "IP-Adresse",
|
||||
"modalSettingsChangeDeviceDisplayName": {
|
||||
"pageTitle": "Gerätename ändern",
|
||||
"textTitle": "Gerätename",
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
"deviceModelText": "Device model",
|
||||
"deviceFirmwareVersionText": "Firmware Version",
|
||||
"deviceLastUpdatedText": "Last updated",
|
||||
"deviceIPAddressText": "IP address",
|
||||
"modalSettingsChangeDeviceDisplayName": {
|
||||
"pageTitle": "Customize device name",
|
||||
"textTitle": "Device name",
|
||||
|
|
|
@ -102,7 +102,7 @@ export function MyIconButton({
|
|||
name={iconName}
|
||||
size={iconSize}
|
||||
color={color}
|
||||
style={disabled && AppStyles.disabled}
|
||||
style={[disabled && AppStyles.disabled, { padding: 4 }]}
|
||||
/>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
|
|
|
@ -11,11 +11,35 @@ export default function SettingsView({ navigation }) {
|
|||
const appContext = useContext(AppContext);
|
||||
const { t } = useTranslation();
|
||||
const [switchState, setSwitchState] = useState(false);
|
||||
const [textDeviceIdHidden, setTextDeviceIdHidden] = useState(true);
|
||||
|
||||
const device = appContext.devices.find(
|
||||
(d) => d.id === AppSelectedUserDevice.current.id
|
||||
);
|
||||
|
||||
const SettingsText = ({ containerStyle, title, description, hidden }) => {
|
||||
return (
|
||||
<View style={containerStyle}>
|
||||
<Text
|
||||
style={
|
||||
([AppStyles.typography16], { color: appContext.appTheme.text })
|
||||
}
|
||||
>
|
||||
{title}
|
||||
</Text>
|
||||
<Text
|
||||
selectable
|
||||
style={
|
||||
([AppStyles.typography14],
|
||||
{ color: appContext.appTheme.textSecondary })
|
||||
}
|
||||
>
|
||||
{hidden ? "************" : description}
|
||||
</Text>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
navigation.setOptions({
|
||||
headerRight: null,
|
||||
|
@ -32,24 +56,12 @@ export default function SettingsView({ navigation }) {
|
|||
justifyContent: "space-between",
|
||||
}}
|
||||
>
|
||||
<View style={{ width: "80%" }}>
|
||||
<Text
|
||||
style={[
|
||||
AppStyles.typography16,
|
||||
{ color: appContext.appTheme.text },
|
||||
]}
|
||||
>
|
||||
{t("screens.device.settings.wifiStandByTitle")}
|
||||
</Text>
|
||||
<Text
|
||||
style={[
|
||||
AppStyles.typography14,
|
||||
{ color: appContext.appTheme.textSecondary },
|
||||
]}
|
||||
>
|
||||
{t("screens.device.settings.wifiStandByDescription")}
|
||||
</Text>
|
||||
</View>
|
||||
<SettingsText
|
||||
containerStyle={{ width: "80%" }}
|
||||
title={t("screens.device.settings.wifiStandByTitle")}
|
||||
description={t("screens.device.settings.wifiStandByDescription")}
|
||||
/>
|
||||
|
||||
<MySwitch
|
||||
value={switchState}
|
||||
onValueChange={(e) => setSwitchState(e)}
|
||||
|
@ -65,23 +77,10 @@ export default function SettingsView({ navigation }) {
|
|||
justifyContent: "space-between",
|
||||
}}
|
||||
>
|
||||
<View>
|
||||
<Text
|
||||
style={
|
||||
([AppStyles.typography16], { color: appContext.appTheme.text })
|
||||
}
|
||||
>
|
||||
{t("screens.device.settings.deviceNameText")}
|
||||
</Text>
|
||||
<Text
|
||||
style={
|
||||
([AppStyles.typography14],
|
||||
{ color: appContext.appTheme.textSecondary })
|
||||
}
|
||||
>
|
||||
{device.displayName}
|
||||
</Text>
|
||||
</View>
|
||||
<SettingsText
|
||||
title={t("screens.device.settings.deviceNameText")}
|
||||
description={device.displayName}
|
||||
/>
|
||||
|
||||
<MyIconButton
|
||||
onPress={() =>
|
||||
|
@ -97,57 +96,46 @@ export default function SettingsView({ navigation }) {
|
|||
|
||||
<Divider />
|
||||
|
||||
<Text
|
||||
style={
|
||||
([AppStyles.typography16], { color: appContext.appTheme.text })
|
||||
}
|
||||
>
|
||||
{t("screens.device.settings.deviceModelText")}
|
||||
</Text>
|
||||
<Text
|
||||
style={
|
||||
([AppStyles.typography14],
|
||||
{ color: appContext.appTheme.textSecondary })
|
||||
}
|
||||
>
|
||||
{device.deviceModel}
|
||||
</Text>
|
||||
<SettingsText
|
||||
title={t("screens.device.settings.deviceModelText")}
|
||||
description={device.deviceModel}
|
||||
/>
|
||||
|
||||
<Divider />
|
||||
|
||||
<Text
|
||||
style={
|
||||
([AppStyles.typography16], { color: appContext.appTheme.text })
|
||||
}
|
||||
>
|
||||
{t("screens.device.settings.deviceFirmwareVersionText")}
|
||||
</Text>
|
||||
<Text
|
||||
style={
|
||||
([AppStyles.typography14],
|
||||
{ color: appContext.appTheme.textSecondary })
|
||||
}
|
||||
>
|
||||
{device.firmware.version}
|
||||
</Text>
|
||||
<SettingsText
|
||||
title={t("screens.device.settings.deviceFirmwareVersionText")}
|
||||
description={device.firmware.version}
|
||||
/>
|
||||
|
||||
<Divider />
|
||||
|
||||
<Text
|
||||
style={
|
||||
([AppStyles.typography16], { color: appContext.appTheme.text })
|
||||
}
|
||||
<SettingsText
|
||||
title={t("screens.device.settings.deviceLastUpdatedText")}
|
||||
description={device.firmware.lastUpdated}
|
||||
/>
|
||||
|
||||
<Divider />
|
||||
|
||||
<View
|
||||
style={{
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
}}
|
||||
>
|
||||
{t("screens.device.settings.deviceLastUpdatedText")}
|
||||
</Text>
|
||||
<Text
|
||||
style={
|
||||
([AppStyles.typography14],
|
||||
{ color: appContext.appTheme.textSecondary })
|
||||
}
|
||||
>
|
||||
{device.firmware.lastUpdated}
|
||||
</Text>
|
||||
<SettingsText
|
||||
title={t("screens.device.settings.deviceIPAddressText")}
|
||||
description={device.deviceIp}
|
||||
hidden={textDeviceIdHidden}
|
||||
/>
|
||||
|
||||
<MyIconButton
|
||||
onPress={() => setTextDeviceIdHidden(!textDeviceIdHidden)}
|
||||
iconName={textDeviceIdHidden ? "eye-off" : "eye"}
|
||||
iconSize={18}
|
||||
/>
|
||||
</View>
|
||||
</Card>
|
||||
</ScrollView>
|
||||
);
|
||||
|
|
|
@ -506,6 +506,7 @@ const devDevices = [
|
|||
id: "1f21a12a-0bec-4336-99bb-df3f9fc9f537", // deviceId
|
||||
displayName: "Turtle",
|
||||
deviceModel: "Aurora",
|
||||
deviceIp: "127.0.0.1",
|
||||
firmware: {
|
||||
version: "1.0.1",
|
||||
lastUpdated: "11.07.2023 um 20:33 Uhr",
|
||||
|
@ -516,6 +517,7 @@ const devDevices = [
|
|||
id: "5b331a12a-0bec-4336-99bb-df3f9fc9f537", // deviceId
|
||||
displayName: "Elona",
|
||||
deviceModel: "Aurora",
|
||||
deviceIp: "192.168.0.1",
|
||||
firmware: {
|
||||
version: "1.0.1",
|
||||
lastUpdated: "11.07.2023 um 20:33 Uhr",
|
||||
|
|
Loading…
Reference in New Issue