-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
**功能更新** - [x] 记录终端的打印日志,捕获错误 @SAKURA-CAT @Feudalman - [x] 日志文件结构调整(不再兼容0.0.1版本日志结构) @SAKURA-CAT **前端更新** - [x] 错误页面 @Feudalman @SAKURA-CAT - [x] 修改图表分组名称与样式 @Feudalman - [x] 修改默认项目名称 @Feudalman - [x] 图表样式(折线图)更新,标题加粗 @SAKURA-CAT **其他更新** - [x] 优化终端打印信息 @SAKURA-CAT @Feudalman - [x] 图表颜色选用 @xiaolin199912 - [x] 实验排序改为倒序 #20 @Feudalman - [x] 用host参数代替share参数 #17 @SAKURA-CAT --------- Co-authored-by: KAAANG <cunykang@gmail.com> Co-authored-by: ZeYi Lin <58305964+xiaolin199912@users.noreply.github.com> Co-authored-by: KAAANG <79990647+SAKURA-CAT@users.noreply.github.com>
- Loading branch information
1 parent
79b504f
commit 239ac27
Showing
76 changed files
with
1,676 additions
and
484 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,6 @@ dist/ | |
package.json | ||
|
||
*.md | ||
|
||
|
||
swanlab/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
name: Bug提交 | ||
about: 向开发者们反映出现的bug | ||
title: '[BUG] ' | ||
labels: BUG | ||
assignees: '' | ||
--- | ||
|
||
## Bug 描述 | ||
|
||
> 描述 bug 的主要内容 | ||
## 如何复现 | ||
|
||
> 在此处向开发者描述 bug 的复现过程,在必要时请附上截图 | ||
1. 前往 '....' | ||
|
||
2. 点击 '....' | ||
|
||
3. 出现如下问题 '....' | ||
|
||
## 预期行为 | ||
|
||
> 向开发者描述如果没有此 bug,应该是什么样的 | ||
## 录屏 | ||
|
||
> 如果需要,可以附上截图 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,3 +64,5 @@ README.md | |
doc/** | ||
|
||
**.md | ||
|
||
swanlab/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,6 @@ click | |
ujson | ||
portalocker | ||
|
||
# Information collection | ||
psutil | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
r""" | ||
@DATE: 2023-12-15 15:53:21 | ||
@File: swanlab/cli/utils.py | ||
@IDE: vscode | ||
@Description: | ||
命令行工具 | ||
""" | ||
import re | ||
import psutil | ||
import socket | ||
import click | ||
|
||
|
||
def is_vaild_ip(ctx, param, ip: str) -> tuple: | ||
"""检测是否是合法的ip地址 | ||
Parameters | ||
---------- | ||
ctx : click.Context | ||
上下文 | ||
param : click.Parameter | ||
参数 | ||
ip : str | ||
带检测的字符串 | ||
""" | ||
ip = str(ip) | ||
pattern = re.compile(r"^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$") | ||
if not pattern.match(ip): | ||
raise click.BadParameter("Invalid IP address format: " + ip) | ||
# 没有问题,获取当前机器的所有ip地址 | ||
interfaces = psutil.net_if_addrs() | ||
ipv4 = [] | ||
for _, addresses in interfaces.items(): | ||
for address in addresses: | ||
# 如果是ipv4地址 | ||
if address.family == socket.AddressFamily.AF_INET: | ||
ipv4.append(address.address) | ||
if ip not in ipv4 and ip != "0.0.0.0": | ||
raise click.BadParameter("IP address '" + ip + "' should be one of " + str(ipv4) + ".") | ||
return ip, ipv4 | ||
|
||
|
||
def is_available_port(host, port): | ||
"""检测端口是否可用 | ||
Parameters | ||
---------- | ||
host : str | ||
ip地址 | ||
port : int | ||
端口号 | ||
""" | ||
try: | ||
with socket.create_server((host, port), reuse_port=True): | ||
pass | ||
except: | ||
raise OSError("Port '" + str(port) + "' is not available on " + host + ".") |
Oops, something went wrong.