Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
RoboPLC
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
黄新宇
RoboPLC
Commits
bc3395ef
提交
bc3395ef
authored
4月 06, 2025
作者:
Serhij S
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clippy fmt
上级
5ddfcee8
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
4 行增加
和
1 行删除
+4
-1
config.rs
roboplc-cli/src/config.rs
+3
-0
metrics.rs
roboplc-cli/src/metrics.rs
+1
-1
没有找到文件。
roboplc-cli/src/config.rs
浏览文件 @
bc3395ef
...
@@ -87,6 +87,7 @@ pub fn get_global_remote(url: &str) -> Option<Remote> {
...
@@ -87,6 +87,7 @@ pub fn get_global_remote(url: &str) -> Option<Remote> {
}
}
#[derive(Deserialize)]
#[derive(Deserialize)]
#[allow(clippy
::
module_name_repetitions)]
pub
struct
ServerConfig
{
pub
struct
ServerConfig
{
pub
http
:
ServerHttpConfig
,
pub
http
:
ServerHttpConfig
,
pub
aaa
:
ServerAaaConfig
,
pub
aaa
:
ServerAaaConfig
,
...
@@ -101,11 +102,13 @@ impl ServerConfig {
...
@@ -101,11 +102,13 @@ impl ServerConfig {
}
}
#[derive(Deserialize)]
#[derive(Deserialize)]
#[allow(clippy
::
module_name_repetitions)]
pub
struct
ServerHttpConfig
{
pub
struct
ServerHttpConfig
{
pub
bind
:
String
,
pub
bind
:
String
,
}
}
#[derive(Deserialize)]
#[derive(Deserialize)]
#[allow(clippy
::
module_name_repetitions)]
pub
struct
ServerAaaConfig
{
pub
struct
ServerAaaConfig
{
pub
management_key
:
Option
<
String
>
,
pub
management_key
:
Option
<
String
>
,
}
}
roboplc-cli/src/metrics.rs
浏览文件 @
bc3395ef
...
@@ -9,7 +9,7 @@ use ureq::Agent;
...
@@ -9,7 +9,7 @@ use ureq::Agent;
#[allow(clippy
::
too_many_arguments,
clippy
::
fn_params_excessive_bools)]
#[allow(clippy
::
too_many_arguments,
clippy
::
fn_params_excessive_bools)]
pub
fn
display
(
url
:
&
str
,
port
:
u16
,
agent
:
Agent
)
->
Result
<
(),
Box
<
dyn
std
::
error
::
Error
>>
{
pub
fn
display
(
url
:
&
str
,
port
:
u16
,
agent
:
Agent
)
->
Result
<
(),
Box
<
dyn
std
::
error
::
Error
>>
{
let
mut
url
=
url
::
Url
::
parse
(
url
)
?
;
let
mut
url
=
url
::
Url
::
parse
(
url
)
?
;
url
.set_port
(
Some
(
port
))
.map_err
(|
_
|
"invalid port"
)
?
;
url
.set_port
(
Some
(
port
))
.map_err
(|
()
|
"invalid port"
)
?
;
let
r
=
agent
.get
(
url
.as_str
())
.call
()
?
;
let
r
=
agent
.get
(
url
.as_str
())
.call
()
?
;
if
r
.status
()
!=
200
{
if
r
.status
()
!=
200
{
return
Err
(
format!
(
"Error: {}"
,
r
.status
())
.into
());
return
Err
(
format!
(
"Error: {}"
,
r
.status
())
.into
());
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论