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