Skip to content

Commit 0710f32

Browse files
committed
fix #254
1 parent bdf125e commit 0710f32

File tree

14 files changed

+42
-17
lines changed

14 files changed

+42
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
------------------------------
2323

2424
[**官网**](https://dpanel.cc/)   |
25-
  [**演示**](https://demo.dpanel.cc)   |
25+
  [**演示**](https://demo.deepanel.com)   |
2626
  [**文档**](https://dpanel.cc/#/zh-cn/install/docker)   |
2727
  [**Pro版**](https://dpanel.cc/#/zh-cn/manual/pro)   |
2828
  [**交流群**](https://qm.qq.com/q/2v4x9x8q4k)   |

app/application/logic/compose.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,24 @@ func (self Compose) ComposeProjectOptionsFn(dbRow *entity.Compose) []cli.Project
310310
workingDir := dbRow.Setting.GetWorkingDir()
311311

312312
// 如果面板的 /dpanel 挂载到了宿主机,则重新设置 workDir
313-
// windows 下无法使用 link 目录对齐到宿主机目录
314313
linkComposePath := ""
315314
dpanelContainerInfo, _ := logic.Setting{}.GetDPanelInfo()
315+
316+
for i, mount := range dpanelContainerInfo.Mounts {
317+
if mount.Type != types.VolumeTypeBind {
318+
continue
319+
}
320+
// windows 路径需要先对齐到 linux 目录上
321+
if strings.Contains(mount.Source, define.WinSeparator) {
322+
target := "/"
323+
segments := strings.Split(filepath.Clean(mount.Source), define.WinSeparator)
324+
for _, segment := range segments {
325+
target = filepath.Join(target, strings.ToLower(strings.Trim(strings.TrimSpace(segment), ":")))
326+
}
327+
dpanelContainerInfo.Mounts[i].Source = filepath.Join("/", "mnt", "host", target)
328+
}
329+
}
330+
316331
for _, mount := range dpanelContainerInfo.Mounts {
317332
if mount.Type == types.VolumeTypeBind && mount.Destination == "/dpanel" && !strings.HasSuffix(filepath.VolumeName(mount.Source), ":") {
318333
linkComposePath = filepath.Join(mount.Source, filepath.Base(workingDir))

asset/static/i18n/en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@
15181518
"user.registerTitle": "Configure admin username and password",
15191519
"user.registerUserTitle": "User registration or reset",
15201520
"user.tipShowBuildName": "Panel container name not default dpanel, recreate with APP_NAME env",
1521-
"user.tipShowDemo": "Demo site, docker functions disabled. Account: admin 123456",
1521+
"user.tipShowDemo": "This site is for demo only and does not include admin features. Built with DPanel Standard Edition.Username: admin Password: 123456",
15221522
"user.title": "Account password login",
15231523
"user.userAgreement": "User Agreement",
15241524
"user.userAgreementUrl": "https://dpanel.cc/license",

asset/static/i18n/ja-JP.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@
15181518
"user.registerTitle": "管理者ユーザー名とパスワードを設定",
15191519
"user.registerUserTitle": "ユーザー登録またはリセット",
15201520
"user.tipShowBuildName": "パネルコンテナ名がデフォルトのdpanelではありません。再作成しAPP_NAME環境変数で新しいコンテナ名を指定",
1521-
"user.tipShowDemo": "デモサイトです。docker機能は無効化されています。アカウント: admin 123456",
1521+
"user.tipShowDemo": "本サイトはデモ用であり、管理機能は含まれません。DPanel Standard Edition で構築されています。ユーザー名: admin パスワード: 123456",
15221522
"user.title": "アカウントパスワードログイン",
15231523
"user.userAgreement": "利用規約",
15241524
"user.userAgreementUrl": "https://dpanel.cc/license",

asset/static/i18n/zh-CN.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1518,7 +1518,7 @@
15181518
"user.registerTitle": "配置管理员用户名及密码",
15191519
"user.registerUserTitle": "用户注册或重置",
15201520
"user.tipShowBuildName": "您创建的面板容器名称非默认的 dpanel,请重建并通过环境变量 -e APP_NAME= 指定新的容器名称。",
1521-
"user.tipShowDemo": "当前为演示站,禁用 docker 相关功能。帐号密码为 admin 123456",
1521+
"user.tipShowDemo": "当前站点仅供演示,不提管理功能;由 DPanel 标准版搭建。帐号: admin 密码: 123456",
15221522
"user.title": "账号密码登录",
15231523
"user.userAgreement": "《用户协议》",
15241524
"user.userAgreementUrl": "https://dpanel.cc/license",

asset/static/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
</head>
1919
<body>
2020
<div id="root"></div>
21-
<script src="/dpanel/static/asset/umi.30e31d51.js"></script>
21+
<script src="/dpanel/static/asset/umi.54a840c9.js"></script>
2222
</body>
2323
</html>
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/service/compose/create.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@ func WithYamlContent(content ...string) cli.ProjectOptionsFn {
4040
0666,
4141
)
4242
if err != nil {
43-
slog.Debug("compose create withYamlContent", "err", err)
43+
slog.Debug("compose create withYamlContent", "content", strings.Join(content, ","), "err", err)
44+
return err
4445
}
4546
options.ConfigPaths = append(options.ConfigPaths, tempComposeFile)
4647
}
4748

4849
if !function.IsEmptyMap(options.Environment) {
4950
err := os.WriteFile(tempEnvFile, []byte(strings.Join(options.Environment.Values(), "\n")), 0666)
5051
if err != nil {
51-
slog.Debug("compose create withYamlContent", "err", err)
52+
slog.Debug("compose create withYamlContent", "content", strings.Join(content, ","), "err", err)
53+
return err
5254
}
5355
}
5456

common/service/docker/docker.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ func NewClientWithDockerEnv(dockerEnv *types.DockerEnv, opts ...Option) (*Client
4747

4848
func NewDefaultClient() *Client {
4949
defaultDockerHost := dockerclient.DefaultDockerHost
50-
if e := os.Getenv(dockerclient.EnvOverrideHost); e != "" {
51-
defaultDockerHost = e
52-
}
5350
v, _ := NewClient(WithAddress(defaultDockerHost), WithDockerEnv(&types.DockerEnv{
5451
Name: define.DockerDefaultClientName,
5552
Title: define.DockerDefaultClientName,

common/service/ws/collection.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ func (self *Collection) Leave(c *Client) {
9292
//docker.Sdk.Ctx = ctx
9393
//docker.Sdk.CtxCancelFunc = cancelFunc
9494
//go logic.EventLogic{}.MonitorLoop()
95-
explorer, _ := plugin.NewPlugin(plugin.PluginExplorer, nil)
96-
_ = explorer.Destroy()
95+
if explorer, err := plugin.NewPlugin(plugin.PluginExplorer, nil); err == nil {
96+
_ = explorer.Destroy()
97+
}
9798
}
9899
}
99100

0 commit comments

Comments
 (0)