mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-05-02 10:16:28 +02:00
Propose fix some typos (#14857)
Signed-off-by: John E <jeis4wpi@outlook.com>
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
<li> Supports VP8 / VP9 / AV1 software codecs, and H264 / H265 hardware codecs. </li>
|
<li> Supports VP8 / VP9 / AV1 software codecs, and H264 / H265 hardware codecs. </li>
|
||||||
<li> Own your data, easily set up self-hosting solution on your infrastructure. </li>
|
<li> Own your data, easily set up self-hosting solution on your infrastructure. </li>
|
||||||
<li> P2P connection with end-to-end encryption based on NaCl. </li>
|
<li> P2P connection with end-to-end encryption based on NaCl. </li>
|
||||||
<li> No administrative privileges or installation needed for Windows, elevate priviledge locally or from remote on demand. </li>
|
<li> No administrative privileges or installation needed for Windows, elevate privilege locally or from remote on demand. </li>
|
||||||
<li> We like to keep things simple and will strive to make simpler where possible. </li>
|
<li> We like to keep things simple and will strive to make simpler where possible. </li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>
|
<p>
|
||||||
@@ -56,4 +56,4 @@
|
|||||||
<control>pointing</control>
|
<control>pointing</control>
|
||||||
</supports>
|
</supports>
|
||||||
<content_rating type="oars-1.1"/>
|
<content_rating type="oars-1.1"/>
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ fn create_media_codec(name: &str, direction: MediaCodecDirection) -> Option<Medi
|
|||||||
log::error!("Failed to start decoder: {:?}", e);
|
log::error!("Failed to start decoder: {:?}", e);
|
||||||
return None;
|
return None;
|
||||||
};
|
};
|
||||||
log::debug!("Init decoder successed!: {:?}", name);
|
log::debug!("Init decoder succeeded!: {:?}", name);
|
||||||
return Some(MediaCodecDecoder {
|
return Some(MediaCodecDecoder {
|
||||||
decoder: codec,
|
decoder: codec,
|
||||||
name: name.to_owned(),
|
name: name.to_owned(),
|
||||||
|
|||||||
82
res/audits.py
Normal file → Executable file
82
res/audits.py
Normal file → Executable file
@@ -43,7 +43,7 @@ def get_connection_type_name(conn_type):
|
|||||||
"""Convert connection type number to readable name"""
|
"""Convert connection type number to readable name"""
|
||||||
type_map = {
|
type_map = {
|
||||||
0: "Remote Desktop",
|
0: "Remote Desktop",
|
||||||
1: "File Transfer",
|
1: "File Transfer",
|
||||||
2: "Port Transfer",
|
2: "Port Transfer",
|
||||||
3: "View Camera",
|
3: "View Camera",
|
||||||
4: "Terminal"
|
4: "Terminal"
|
||||||
@@ -55,7 +55,7 @@ def get_console_type_name(console_type):
|
|||||||
"""Convert console audit type number to readable name"""
|
"""Convert console audit type number to readable name"""
|
||||||
type_map = {
|
type_map = {
|
||||||
0: "Group Management",
|
0: "Group Management",
|
||||||
1: "User Management",
|
1: "User Management",
|
||||||
2: "Device Management",
|
2: "Device Management",
|
||||||
3: "Address Book Management"
|
3: "Address Book Management"
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,7 @@ def get_console_operation_name(operation_code):
|
|||||||
operation_map = {
|
operation_map = {
|
||||||
0: "User Login",
|
0: "User Login",
|
||||||
1: "Add Group",
|
1: "Add Group",
|
||||||
2: "Add User",
|
2: "Add User",
|
||||||
3: "Add Device",
|
3: "Add Device",
|
||||||
4: "Delete Groups",
|
4: "Delete Groups",
|
||||||
5: "Disconnect Device",
|
5: "Disconnect Device",
|
||||||
@@ -95,7 +95,7 @@ def get_console_operation_name(operation_code):
|
|||||||
def get_alarm_type_name(alarm_type):
|
def get_alarm_type_name(alarm_type):
|
||||||
"""Convert alarm type number to readable name"""
|
"""Convert alarm type number to readable name"""
|
||||||
type_map = {
|
type_map = {
|
||||||
0: "Access attempt outside the IP whiltelist",
|
0: "Access attempt outside the IP whitelist",
|
||||||
1: "Over 30 consecutive access attempts",
|
1: "Over 30 consecutive access attempts",
|
||||||
2: "Multiple access attempts within one minute",
|
2: "Multiple access attempts within one minute",
|
||||||
3: "Over 30 consecutive login attempts",
|
3: "Over 30 consecutive login attempts",
|
||||||
@@ -109,24 +109,24 @@ def enhance_audit_data(data, audit_type):
|
|||||||
"""Enhance audit data with readable formats"""
|
"""Enhance audit data with readable formats"""
|
||||||
if not data:
|
if not data:
|
||||||
return data
|
return data
|
||||||
|
|
||||||
enhanced_data = []
|
enhanced_data = []
|
||||||
for item in data:
|
for item in data:
|
||||||
enhanced_item = item.copy()
|
enhanced_item = item.copy()
|
||||||
|
|
||||||
# Convert timestamps - replace original values
|
# Convert timestamps - replace original values
|
||||||
if 'created_at' in enhanced_item:
|
if 'created_at' in enhanced_item:
|
||||||
enhanced_item['created_at'] = format_timestamp(enhanced_item['created_at'])
|
enhanced_item['created_at'] = format_timestamp(enhanced_item['created_at'])
|
||||||
if 'end_time' in enhanced_item:
|
if 'end_time' in enhanced_item:
|
||||||
enhanced_item['end_time'] = format_timestamp(enhanced_item['end_time'])
|
enhanced_item['end_time'] = format_timestamp(enhanced_item['end_time'])
|
||||||
|
|
||||||
# Add type-specific enhancements - replace original values
|
# Add type-specific enhancements - replace original values
|
||||||
if audit_type == 'conn':
|
if audit_type == 'conn':
|
||||||
if 'conn_type' in enhanced_item:
|
if 'conn_type' in enhanced_item:
|
||||||
enhanced_item['conn_type'] = get_connection_type_name(enhanced_item['conn_type'])
|
enhanced_item['conn_type'] = get_connection_type_name(enhanced_item['conn_type'])
|
||||||
else:
|
else:
|
||||||
enhanced_item['conn_type'] = "Not Logged In"
|
enhanced_item['conn_type'] = "Not Logged In"
|
||||||
|
|
||||||
elif audit_type == 'console':
|
elif audit_type == 'console':
|
||||||
if 'typ' in enhanced_item:
|
if 'typ' in enhanced_item:
|
||||||
# Replace typ field with type and convert to readable name
|
# Replace typ field with type and convert to readable name
|
||||||
@@ -136,14 +136,14 @@ def enhance_audit_data(data, audit_type):
|
|||||||
# Replace iop field with operation and convert to readable name
|
# Replace iop field with operation and convert to readable name
|
||||||
enhanced_item['operation'] = get_console_operation_name(enhanced_item['iop'])
|
enhanced_item['operation'] = get_console_operation_name(enhanced_item['iop'])
|
||||||
del enhanced_item['iop']
|
del enhanced_item['iop']
|
||||||
|
|
||||||
elif audit_type == 'alarm' and 'typ' in enhanced_item:
|
elif audit_type == 'alarm' and 'typ' in enhanced_item:
|
||||||
# Replace typ field with type and convert to readable name
|
# Replace typ field with type and convert to readable name
|
||||||
enhanced_item['type'] = get_alarm_type_name(enhanced_item['typ'])
|
enhanced_item['type'] = get_alarm_type_name(enhanced_item['typ'])
|
||||||
del enhanced_item['typ']
|
del enhanced_item['typ']
|
||||||
|
|
||||||
enhanced_data.append(enhanced_item)
|
enhanced_data.append(enhanced_item)
|
||||||
|
|
||||||
return enhanced_data
|
return enhanced_data
|
||||||
|
|
||||||
|
|
||||||
@@ -152,7 +152,7 @@ def check_response(response):
|
|||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
print(f"Error: HTTP {response.status_code} - {response.text}")
|
print(f"Error: HTTP {response.status_code} - {response.text}")
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response_json = response.json()
|
response_json = response.json()
|
||||||
if "error" in response_json:
|
if "error" in response_json:
|
||||||
@@ -163,28 +163,28 @@ def check_response(response):
|
|||||||
return response.text or "Success"
|
return response.text or "Success"
|
||||||
|
|
||||||
|
|
||||||
def view_audits_common(url, token, endpoint, filters=None, page_size=None, current=None,
|
def view_audits_common(url, token, endpoint, filters=None, page_size=None, current=None,
|
||||||
created_at=None, days_ago=None, non_wildcard_fields=None):
|
created_at=None, days_ago=None, non_wildcard_fields=None):
|
||||||
"""Common function for viewing audits"""
|
"""Common function for viewing audits"""
|
||||||
headers = {"Authorization": f"Bearer {token}"}
|
headers = {"Authorization": f"Bearer {token}"}
|
||||||
|
|
||||||
# Set default page size and current page
|
# Set default page size and current page
|
||||||
if page_size is None:
|
if page_size is None:
|
||||||
page_size = 10
|
page_size = 10
|
||||||
if current is None:
|
if current is None:
|
||||||
current = 1
|
current = 1
|
||||||
|
|
||||||
params = {
|
params = {
|
||||||
"pageSize": page_size,
|
"pageSize": page_size,
|
||||||
"current": current
|
"current": current
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add filter parameters if provided
|
# Add filter parameters if provided
|
||||||
if filters:
|
if filters:
|
||||||
for key, value in filters.items():
|
for key, value in filters.items():
|
||||||
if value is not None:
|
if value is not None:
|
||||||
params[key] = value
|
params[key] = value
|
||||||
|
|
||||||
# Handle time filters
|
# Handle time filters
|
||||||
if days_ago is not None:
|
if days_ago is not None:
|
||||||
# Calculate datetime from days ago
|
# Calculate datetime from days ago
|
||||||
@@ -205,10 +205,10 @@ def view_audits_common(url, token, endpoint, filters=None, page_size=None, curre
|
|||||||
# Apply wildcard patterns for string fields (excluding specific fields)
|
# Apply wildcard patterns for string fields (excluding specific fields)
|
||||||
if non_wildcard_fields is None:
|
if non_wildcard_fields is None:
|
||||||
non_wildcard_fields = set()
|
non_wildcard_fields = set()
|
||||||
|
|
||||||
# Always exclude these fields from wildcard treatment
|
# Always exclude these fields from wildcard treatment
|
||||||
non_wildcard_fields.update(["created_at", "pageSize", "current"])
|
non_wildcard_fields.update(["created_at", "pageSize", "current"])
|
||||||
|
|
||||||
string_params = {}
|
string_params = {}
|
||||||
for k, v in params.items():
|
for k, v in params.items():
|
||||||
if isinstance(v, str) and k not in non_wildcard_fields:
|
if isinstance(v, str) and k not in non_wildcard_fields:
|
||||||
@@ -221,10 +221,10 @@ def view_audits_common(url, token, endpoint, filters=None, page_size=None, curre
|
|||||||
|
|
||||||
response = requests.get(f"{url}/api/audits/{endpoint}", headers=headers, params=string_params)
|
response = requests.get(f"{url}/api/audits/{endpoint}", headers=headers, params=string_params)
|
||||||
response_json = check_response(response)
|
response_json = check_response(response)
|
||||||
|
|
||||||
# Enhance the data with readable formats
|
# Enhance the data with readable formats
|
||||||
data = enhance_audit_data(response_json.get("data", []), endpoint)
|
data = enhance_audit_data(response_json.get("data", []), endpoint)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"data": data,
|
"data": data,
|
||||||
"total": response_json.get("total", 0),
|
"total": response_json.get("total", 0),
|
||||||
@@ -233,7 +233,7 @@ def view_audits_common(url, token, endpoint, filters=None, page_size=None, curre
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def view_conn_audits(url, token, remote=None, conn_type=None,
|
def view_conn_audits(url, token, remote=None, conn_type=None,
|
||||||
page_size=None, current=None, created_at=None, days_ago=None):
|
page_size=None, current=None, created_at=None, days_ago=None):
|
||||||
"""View connection audits"""
|
"""View connection audits"""
|
||||||
filters = {
|
filters = {
|
||||||
@@ -241,7 +241,7 @@ def view_conn_audits(url, token, remote=None, conn_type=None,
|
|||||||
"conn_type": conn_type
|
"conn_type": conn_type
|
||||||
}
|
}
|
||||||
non_wildcard_fields = {"conn_type"}
|
non_wildcard_fields = {"conn_type"}
|
||||||
|
|
||||||
return view_audits_common(
|
return view_audits_common(
|
||||||
url, token, "conn", filters, page_size, current, created_at, days_ago, non_wildcard_fields
|
url, token, "conn", filters, page_size, current, created_at, days_ago, non_wildcard_fields
|
||||||
)
|
)
|
||||||
@@ -254,7 +254,7 @@ def view_file_audits(url, token, remote=None,
|
|||||||
"remote": remote
|
"remote": remote
|
||||||
}
|
}
|
||||||
non_wildcard_fields = set()
|
non_wildcard_fields = set()
|
||||||
|
|
||||||
return view_audits_common(
|
return view_audits_common(
|
||||||
url, token, "file", filters, page_size, current, created_at, days_ago, non_wildcard_fields
|
url, token, "file", filters, page_size, current, created_at, days_ago, non_wildcard_fields
|
||||||
)
|
)
|
||||||
@@ -267,7 +267,7 @@ def view_alarm_audits(url, token, device=None,
|
|||||||
"device": device
|
"device": device
|
||||||
}
|
}
|
||||||
non_wildcard_fields = set()
|
non_wildcard_fields = set()
|
||||||
|
|
||||||
return view_audits_common(
|
return view_audits_common(
|
||||||
url, token, "alarm", filters, page_size, current, created_at, days_ago, non_wildcard_fields
|
url, token, "alarm", filters, page_size, current, created_at, days_ago, non_wildcard_fields
|
||||||
)
|
)
|
||||||
@@ -280,7 +280,7 @@ def view_console_audits(url, token, operator=None,
|
|||||||
"operator": operator
|
"operator": operator
|
||||||
}
|
}
|
||||||
non_wildcard_fields = set()
|
non_wildcard_fields = set()
|
||||||
|
|
||||||
return view_audits_common(
|
return view_audits_common(
|
||||||
url, token, "console", filters, page_size, current, created_at, days_ago, non_wildcard_fields
|
url, token, "console", filters, page_size, current, created_at, days_ago, non_wildcard_fields
|
||||||
)
|
)
|
||||||
@@ -295,15 +295,15 @@ def main():
|
|||||||
)
|
)
|
||||||
parser.add_argument("--url", required=True, help="URL of the API")
|
parser.add_argument("--url", required=True, help="URL of the API")
|
||||||
parser.add_argument("--token", required=True, help="Bearer token for authentication")
|
parser.add_argument("--token", required=True, help="Bearer token for authentication")
|
||||||
|
|
||||||
# Pagination parameters
|
# Pagination parameters
|
||||||
parser.add_argument("--page-size", type=int, default=10, help="Number of records per page (default: 10)")
|
parser.add_argument("--page-size", type=int, default=10, help="Number of records per page (default: 10)")
|
||||||
parser.add_argument("--current", type=int, default=1, help="Current page number (default: 1)")
|
parser.add_argument("--current", type=int, default=1, help="Current page number (default: 1)")
|
||||||
|
|
||||||
# Time filtering parameters
|
# Time filtering parameters
|
||||||
parser.add_argument("--created-at", help="Filter by creation time in local time (format: 2025-09-16 14:15:57 or 2025-09-16 14:15:57.000)")
|
parser.add_argument("--created-at", help="Filter by creation time in local time (format: 2025-09-16 14:15:57 or 2025-09-16 14:15:57.000)")
|
||||||
parser.add_argument("--days-ago", type=int, help="Filter by days ago (e.g., 7 for last 7 days)")
|
parser.add_argument("--days-ago", type=int, help="Filter by days ago (e.g., 7 for last 7 days)")
|
||||||
|
|
||||||
# Audit filters (simplified)
|
# Audit filters (simplified)
|
||||||
parser.add_argument("--remote", help="Remote peer ID filter (for conn/file audits)")
|
parser.add_argument("--remote", help="Remote peer ID filter (for conn/file audits)")
|
||||||
parser.add_argument("--device", help="Device ID filter (for alarm audits)")
|
parser.add_argument("--device", help="Device ID filter (for alarm audits)")
|
||||||
@@ -319,9 +319,9 @@ def main():
|
|||||||
if args.command == "view-conn":
|
if args.command == "view-conn":
|
||||||
# View connection audits
|
# View connection audits
|
||||||
result = view_conn_audits(
|
result = view_conn_audits(
|
||||||
args.url,
|
args.url,
|
||||||
args.token,
|
args.token,
|
||||||
args.remote,
|
args.remote,
|
||||||
args.conn_type,
|
args.conn_type,
|
||||||
args.page_size,
|
args.page_size,
|
||||||
args.current,
|
args.current,
|
||||||
@@ -329,12 +329,12 @@ def main():
|
|||||||
args.days_ago
|
args.days_ago
|
||||||
)
|
)
|
||||||
print(json.dumps(result, indent=2))
|
print(json.dumps(result, indent=2))
|
||||||
|
|
||||||
elif args.command == "view-file":
|
elif args.command == "view-file":
|
||||||
# View file audits
|
# View file audits
|
||||||
result = view_file_audits(
|
result = view_file_audits(
|
||||||
args.url,
|
args.url,
|
||||||
args.token,
|
args.token,
|
||||||
args.remote,
|
args.remote,
|
||||||
args.page_size,
|
args.page_size,
|
||||||
args.current,
|
args.current,
|
||||||
@@ -342,12 +342,12 @@ def main():
|
|||||||
args.days_ago
|
args.days_ago
|
||||||
)
|
)
|
||||||
print(json.dumps(result, indent=2))
|
print(json.dumps(result, indent=2))
|
||||||
|
|
||||||
elif args.command == "view-alarm":
|
elif args.command == "view-alarm":
|
||||||
# View alarm audits
|
# View alarm audits
|
||||||
result = view_alarm_audits(
|
result = view_alarm_audits(
|
||||||
args.url,
|
args.url,
|
||||||
args.token,
|
args.token,
|
||||||
args.device,
|
args.device,
|
||||||
args.page_size,
|
args.page_size,
|
||||||
args.current,
|
args.current,
|
||||||
@@ -355,12 +355,12 @@ def main():
|
|||||||
args.days_ago
|
args.days_ago
|
||||||
)
|
)
|
||||||
print(json.dumps(result, indent=2))
|
print(json.dumps(result, indent=2))
|
||||||
|
|
||||||
elif args.command == "view-console":
|
elif args.command == "view-console":
|
||||||
# View console audits
|
# View console audits
|
||||||
result = view_console_audits(
|
result = view_console_audits(
|
||||||
args.url,
|
args.url,
|
||||||
args.token,
|
args.token,
|
||||||
args.operator,
|
args.operator,
|
||||||
args.page_size,
|
args.page_size,
|
||||||
args.current,
|
args.current,
|
||||||
|
|||||||
@@ -616,10 +616,10 @@ UINT __stdcall TryStopDeleteService(__in MSIHANDLE hInstall)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IsServiceRunningW(svcName)) {
|
if (IsServiceRunningW(svcName)) {
|
||||||
WcaLog(LOGMSG_STANDARD, "Service \"%ls\" is not stoped after 1000 ms.", svcName);
|
WcaLog(LOGMSG_STANDARD, "Service \"%ls\" is not stopped after 1000 ms.", svcName);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
WcaLog(LOGMSG_STANDARD, "Service \"%ls\" is stoped.", svcName);
|
WcaLog(LOGMSG_STANDARD, "Service \"%ls\" is stopped.", svcName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MyDeleteServiceW(svcName)) {
|
if (MyDeleteServiceW(svcName)) {
|
||||||
@@ -645,7 +645,7 @@ UINT __stdcall TryStopDeleteService(__in MSIHANDLE hInstall)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// It's really strange that we need sleep here.
|
// It's really strange that we need sleep here.
|
||||||
// But the upgrading may be stucked at "copying new files" because the file is in using.
|
// But the upgrading may be stuck at "copying new files" because the file is in using.
|
||||||
// Steps to reproduce: Install -> stop service in tray --> start service -> upgrade
|
// Steps to reproduce: Install -> stop service in tray --> start service -> upgrade
|
||||||
// Sleep(300);
|
// Sleep(300);
|
||||||
|
|
||||||
@@ -758,7 +758,7 @@ UINT __stdcall AddRegSoftwareSASGeneration(__in MSIHANDLE hInstall)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Why RegSetValueExW always return 998?
|
// Why RegSetValueExW always return 998?
|
||||||
//
|
//
|
||||||
result = RegCreateKeyExW(HKEY_LOCAL_MACHINE, subKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL);
|
result = RegCreateKeyExW(HKEY_LOCAL_MACHINE, subKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL);
|
||||||
if (result != ERROR_SUCCESS) {
|
if (result != ERROR_SUCCESS) {
|
||||||
WcaLog(LOGMSG_STANDARD, "Failed to create or open registry key: %d", result);
|
WcaLog(LOGMSG_STANDARD, "Failed to create or open registry key: %d", result);
|
||||||
@@ -874,7 +874,7 @@ void TryCreateStartServiceByShell(LPWSTR svcName, LPWSTR svcBinary, LPWSTR szSvc
|
|||||||
i = 0;
|
i = 0;
|
||||||
j = 0;
|
j = 0;
|
||||||
// svcBinary is a string with double quotes, we need to escape it for shell arguments.
|
// svcBinary is a string with double quotes, we need to escape it for shell arguments.
|
||||||
// It is orignal used for `CreateServiceW`.
|
// It is original used for `CreateServiceW`.
|
||||||
// eg. "C:\Program Files\MyApp\MyApp.exe" --service -> \"C:\Program Files\MyApp\MyApp.exe\" --service
|
// eg. "C:\Program Files\MyApp\MyApp.exe" --service -> \"C:\Program Files\MyApp\MyApp.exe\" --service
|
||||||
while (true) {
|
while (true) {
|
||||||
if (svcBinary[j] == L'"') {
|
if (svcBinary[j] == L'"') {
|
||||||
|
|||||||
@@ -2884,7 +2884,7 @@ pub fn main_set_common(_key: String, _value: String) {
|
|||||||
} else if _key == "update-me" {
|
} else if _key == "update-me" {
|
||||||
if let Some(new_version_file) = get_download_file_from_url(&_value) {
|
if let Some(new_version_file) = get_download_file_from_url(&_value) {
|
||||||
log::debug!(
|
log::debug!(
|
||||||
"New version file is downloaed, update begin, {:?}",
|
"New version file is downloaded, update begin, {:?}",
|
||||||
new_version_file.to_str()
|
new_version_file.to_str()
|
||||||
);
|
);
|
||||||
if let Some(f) = new_version_file.to_str() {
|
if let Some(f) = new_version_file.to_str() {
|
||||||
|
|||||||
Reference in New Issue
Block a user