优化:主动控制·远程WOL唤醒功能 #328

This commit is contained in:
pppscn 2023-07-29 22:25:06 +08:00
parent 24d152cf87
commit 74c461f917
3 changed files with 137 additions and 135 deletions

View File

@ -1,133 +1,133 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="?attr/xui_config_color_background" android:background="?attr/xui_config_color_background"
android:orientation="vertical"> android:orientation="vertical">
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="1" android:layout_weight="1"
android:overScrollMode="never"> android:overScrollMode="never">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="5dp" android:layout_margin="5dp"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<androidx.appcompat.widget.AppCompatImageView <androidx.appcompat.widget.AppCompatImageView
android:layout_width="250dp" android:layout_width="250dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="10dp" android:layout_margin="10dp"
android:contentDescription="@string/api_wol" android:contentDescription="@string/api_wol"
app:srcCompat="@drawable/icon_api_wol" /> app:srcCompat="@drawable/icon_api_wol" />
<LinearLayout <LinearLayout
style="@style/senderBarStyle" style="@style/senderBarStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/mac" /> android:text="@string/mac" />
<com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText <com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
android:id="@+id/et_mac" android:id="@+id/et_mac"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/mac_hint" android:hint="@string/mac_hint"
android:singleLine="true" android:singleLine="true"
app:met_clearButton="true" app:met_clearButton="true"
app:met_errorMessage="@string/mac_error" app:met_errorMessage="@string/mac_error"
app:met_regexp="@string/mac_regex" app:met_regexp="@string/mac_regex"
app:met_validateOnFocusLost="true" /> app:met_validateOnFocusLost="true" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
style="@style/senderBarStyle" style="@style/senderBarStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/ip" /> android:text="@string/broadcast_address" />
<com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText <com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
android:id="@+id/et_ip" android:id="@+id/et_ip"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/ip_hint" android:hint="@string/ip_hint"
android:singleLine="true" android:singleLine="true"
app:met_clearButton="true" app:met_clearButton="true"
app:met_errorMessage="@string/ip_error" app:met_errorMessage="@string/ip_error"
app:met_regexp="@string/ip_regex" app:met_regexp="@string/ip_regex"
app:met_validateOnFocusLost="true" /> app:met_validateOnFocusLost="true" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
style="@style/senderBarStyle" style="@style/senderBarStyle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/port" /> android:text="@string/port" />
<com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText <com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
android:id="@+id/et_port" android:id="@+id/et_port"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:hint="@string/wol_port_hint" android:hint="@string/wol_port_hint"
android:singleLine="true" android:singleLine="true"
android:value="9" android:value="9"
app:met_clearButton="true" app:met_clearButton="true"
app:met_errorMessage="@string/wol_port_error" app:met_errorMessage="@string/wol_port_error"
app:met_regexp="@string/wol_port_regex" app:met_regexp="@string/wol_port_regex"
app:met_validateOnFocusLost="true" /> app:met_validateOnFocusLost="true" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
android:padding="10dp"> android:padding="10dp">
<com.xuexiang.xui.widget.textview.supertextview.SuperButton <com.xuexiang.xui.widget.textview.supertextview.SuperButton
android:id="@+id/btn_server_history" android:id="@+id/btn_server_history"
style="@style/SuperButton.Gray.Icon" style="@style/SuperButton.Gray.Icon"
android:drawableStart="@drawable/ic_restore" android:drawableStart="@drawable/ic_restore"
android:paddingStart="7dp" android:paddingStart="7dp"
android:text="@string/server_history" android:text="@string/server_history"
tools:ignore="RtlSymmetry" /> tools:ignore="RtlSymmetry" />
<com.xuexiang.xui.widget.textview.supertextview.SuperButton <com.xuexiang.xui.widget.textview.supertextview.SuperButton
android:id="@+id/btn_submit" android:id="@+id/btn_submit"
style="@style/SuperButton.Blue.Icon" style="@style/SuperButton.Blue.Icon"
android:layout_marginStart="20dp" android:layout_marginStart="20dp"
android:drawableStart="@drawable/ic_send_white" android:drawableStart="@drawable/ic_send_white"
android:paddingStart="20dp" android:paddingStart="20dp"
android:text="@string/send" android:text="@string/send"
tools:ignore="RtlSymmetry" /> tools:ignore="RtlSymmetry" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>

View File

@ -991,12 +991,13 @@
<string name="appsecret">AppSecret</string> <string name="appsecret">AppSecret</string>
<string name="sampleText">Text</string> <string name="sampleText">Text</string>
<string name="sampleMarkdown">Markdown</string> <string name="sampleMarkdown">Markdown</string>
<string name="ip_hint">IP address/broadcast address, eg. 192.168.1.255</string> <string name="ip_hint">Broadcast Address, eg. 192.168.1.255</string>
<string name="ip_error">Malformed IP address, eg. 192.168.168.168</string> <string name="ip_error">Malformed IP address, eg. 192.168.168.168</string>
<string name="ip_regex" tools:ignore="TypographyDashes">^((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])$</string> <string name="ip_regex" tools:ignore="TypographyDashes">^((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])$</string>
<string name="mac_hint">Network card mac, eg. AA:BB:CC:DD:EE:FF</string> <string name="mac_hint">Network card mac, eg. AA:BB:CC:DD:EE:FF</string>
<string name="mac_error">The network card mac format is incorrect, eg. AA:BB:CC:DD:EE:FF</string> <string name="mac_error">The network card mac format is incorrect, eg. AA:BB:CC:DD:EE:FF</string>
<string name="mac_regex" tools:ignore="TypographyDashes">^((([a-fA-F0-9]{2}:){5})|(([a-fA-F0-9]{2}-){5}))[a-fA-F0-9]{2}$</string> <string name="mac_regex" tools:ignore="TypographyDashes">^((([a-fA-F0-9]{2}:){5})|(([a-fA-F0-9]{2}-){5}))[a-fA-F0-9]{2}$</string>
<string name="broadcast_address">Broadcast Address</string>
<string name="ip">IP</string> <string name="ip">IP</string>
<string name="mac">MAC</string> <string name="mac">MAC</string>
<string name="no_wol_history">There is no history record, WOL will be added automatically after successful sending</string> <string name="no_wol_history">There is no history record, WOL will be added automatically after successful sending</string>

View File

@ -992,13 +992,14 @@
<string name="appsecret">AppSecret</string> <string name="appsecret">AppSecret</string>
<string name="sampleText">文本类型</string> <string name="sampleText">文本类型</string>
<string name="sampleMarkdown">Markdown类型</string> <string name="sampleMarkdown">Markdown类型</string>
<string name="ip_hint">可选,主机IP/广播地址例如192.168.1.255</string> <string name="ip_hint">可选,内网广播地址例如192.168.1.255</string>
<string name="ip_error">IP地址格式错误例如192.168.168.168</string> <string name="ip_error">IP地址格式错误例如192.168.168.168</string>
<string name="ip_regex" tools:ignore="TypographyDashes">^((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])$</string> <string name="ip_regex" tools:ignore="TypographyDashes">^((\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])\.){3}(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])$</string>
<string name="mac_hint">必填网卡mac例如AA:BB:CC:DD:EE:FF</string> <string name="mac_hint">必填网卡mac例如AA:BB:CC:DD:EE:FF</string>
<string name="mac_error">网卡mac格式错误例如AA:BB:CC:DD:EE:FF</string> <string name="mac_error">网卡mac格式错误例如AA:BB:CC:DD:EE:FF</string>
<string name="mac_regex" tools:ignore="TypographyDashes">^((([a-fA-F0-9]{2}:){5})|(([a-fA-F0-9]{2}-){5}))[a-fA-F0-9]{2}$</string> <string name="mac_regex" tools:ignore="TypographyDashes">^((([a-fA-F0-9]{2}:){5})|(([a-fA-F0-9]{2}-){5}))[a-fA-F0-9]{2}$</string>
<string name="ip">主机IP/广播地址</string> <string name="broadcast_address">内网广播地址</string>
<string name="ip">IP</string>
<string name="mac">网卡MAC</string> <string name="mac">网卡MAC</string>
<string name="no_wol_history">暂无历史记录WOL发送成功后自动加入</string> <string name="no_wol_history">暂无历史记录WOL发送成功后自动加入</string>
<string name="wol_port_hint">可选WOL一般透过端口7或端口9进行发送</string> <string name="wol_port_hint">可选WOL一般透过端口7或端口9进行发送</string>