From 0dd117711df29eea98750aadcc0e66e3f0074d1a Mon Sep 17 00:00:00 2001 From: mofeng-git Date: Fri, 29 Nov 2024 05:29:28 +0000 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=E6=A0=B7=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/kvmd/meta.yaml | 7 ++++++- web/ipmi/index.html | 2 +- web/ipmi/index.pug | 2 +- web/kvm/index.html | 18 +++++++++--------- web/kvm/index.pug | 2 +- web/kvm/window-about.pug | 12 +++++++----- web/share/i18n/i18n_en.json | 2 +- web/share/i18n/i18n_zh.json | 8 ++++---- web/share/js/i18n/i18n.js | 17 ++++++++--------- 9 files changed, 38 insertions(+), 32 deletions(-) diff --git a/configs/kvmd/meta.yaml b/configs/kvmd/meta.yaml index a9de085e..ed1f7f02 100644 --- a/configs/kvmd/meta.yaml +++ b/configs/kvmd/meta.yaml @@ -6,4 +6,9 @@ server: host: localhost.localdomain -kvm: {} +kvm: { + base_on: PiKVM, + app_name: One-KVM, + majaro_version: 241204, + author: SilentWind +} diff --git a/web/ipmi/index.html b/web/ipmi/index.html index 6a7d868e..17b6b2f4 100644 --- a/web/ipmi/index.html +++ b/web/ipmi/index.html @@ -25,7 +25,7 @@ - PiKVM IPMI Info + One-KVM IPMI Info diff --git a/web/ipmi/index.pug b/web/ipmi/index.pug index df4ebac9..0fb840ae 100644 --- a/web/ipmi/index.pug +++ b/web/ipmi/index.pug @@ -1,7 +1,7 @@ extends ../start.pug append vars - - title = "PiKVM IPMI Info" + - title = "One-KVM IPMI Info" - main_js = "ipmi/main" - index_link = true diff --git a/web/kvm/index.html b/web/kvm/index.html index bb4e7766..f5799301 100644 --- a/web/kvm/index.html +++ b/web/kvm/index.html @@ -25,7 +25,7 @@ - PiKVM Session + One-KVM Session @@ -2040,7 +2040,7 @@
- +
// You can get this JSON using handle /api/info?fields=meta
@@ -2050,20 +2050,20 @@
- - + +
No data
- - + +
No data
- - + +
// These kind people donated money to the PiKVM project
// and supported the work on it. We are very grateful
@@ -2708,7 +2708,7 @@

-

PiKVM Project  |  Documentation  |  Support

+

PiKVM Project  |  Documentation  |  One-KVM Project  |  One-KVM Documentation

diff --git a/web/kvm/index.pug b/web/kvm/index.pug index 379295f4..28307828 100644 --- a/web/kvm/index.pug +++ b/web/kvm/index.pug @@ -1,7 +1,7 @@ extends ../base.pug append vars - - title = "PiKVM Session" + - title = "One-KVM Session" - main_js = "kvm/main" - body_class = "body-no-select" - css_list = css_list.concat(["navbar", "window", "modal", "led", "slider", "switch", "radio", "progress", "keypad", "tabs"]) diff --git a/web/kvm/window-about.pug b/web/kvm/window-about.pug index ddb36779..ffc22718 100644 --- a/web/kvm/window-about.pug +++ b/web/kvm/window-about.pug @@ -1,4 +1,4 @@ -mixin about_tab(name, title, checked=false, i18nid) +mixin about_tab(name, title, i18nid, checked=false) - let button_id = `about-tab-${name}-button` input(checked=checked type="radio" name="about-tab-button", id=button_id) label(for=button_id i18n=i18nid) #{title} @@ -27,7 +27,7 @@ div(id="about-window" class="window") | Copyright © 2018-2024 #[a(target="_blank" href="mailto:mdevaev@gmail.com") Maxim Devaev] br div(class="tabs-box") - +about_tab("meta", "Meta", true) + +about_tab("meta", "Meta", "meta", true) div span(class="code-comment") | // You can get this JSON using handle #[a(target="_blank" href="/api/info?fields=meta") /api/info?fields=meta]#[br] @@ -683,8 +683,10 @@ div(id="about-window" class="window") li Zsombor Vari br p(class="text credits") - a(target="_blank" href="https://pikvm.org") PiKVM Project + a(target="_blank" href="https://pikvm.org" i18n="index_text_10") PiKVM Project |   |   - a(target="_blank" href="https://docs.pikvm.org") Documentation + a(target="_blank" href="https://docs.pikvm.org" i18n="index_text_11") Documentation |   |   - a(target="_blank" href="https://pikvm.org/support") Support + a(target="_blank" href="https://github.com/mofeng-git/One-KVM" i18n="index_text_12") One-KVM Project + |   |   + a(target="_blank" href="https://one-kvm.mofeng.run" i18n="index_text_13") One-KVM Documentation diff --git a/web/share/i18n/i18n_en.json b/web/share/i18n/i18n_en.json index cbde31cc..0086d367 100644 --- a/web/share/i18n/i18n_en.json +++ b/web/share/i18n/i18n_en.json @@ -29,7 +29,7 @@ "ipmi_text3":"NEVER use the same passwords for KVMD and IPMI users. And even better not to use IPMI. Instead, you can directly use KVMD API via curl. Here some examples:", "kvm_text1":"About", - "kvm_text2":"// These kind people donated money to the PiKVM project
// and supported the work on it. We are very grateful
// for their help, and memorializing their names
// is the least we can do in gratitude.
// If you also want to support this project,
// you can donate on Patreon or Paypal.", + "kvm_text2":"// These kind people donated money to the PiKVM project and supported the work on it.
// If you also want to support this project, you can donate on Patreon or Paypal.

// These kind people donated money to the One-KVM project and supported the work on it.
// If you also want to support this project, you can donate on afdian .", "kvm_text3":"System", "kvm_text4":"Runtime settings & tools", "kvm_text5":"Term", diff --git a/web/share/i18n/i18n_zh.json b/web/share/i18n/i18n_zh.json index c08f0797..1a18e675 100644 --- a/web/share/i18n/i18n_zh.json +++ b/web/share/i18n/i18n_zh.json @@ -11,8 +11,8 @@ "index": " One-KVM 导航 ", "copyright": "版权所有 © 2018-2024 Maxim Devaev | 由 SilentWind 二次开发", - "index_text_1": "请注意,在使用 KVM 会话或其他可捕获键盘的应用程序时,您无法使用某些快捷键,如 Ctrl+Alt+Del(这会被操作系统捕获)或 Ctrl+W(这会被浏览器捕获)。", - "index_text_2": "要突破这一限制,您可以在应用程序模式下使用 Google Chrome 浏览器。", + "index_text_1": "请注意,在使用 KVM 会话或其他可捕获键盘的应用程序时,您可能无法使用某些快捷键,如 Ctrl+Alt+Del(这会被操作系统捕获)或 Ctrl+W(这会被浏览器捕获)。", + "index_text_2": "要突破这一限制,您可以使用 Google Chrome 浏览器。", "serve_name": "主机名:", "index_text_10":"PiKVM 项目", "index_text_11":"PiKVM 文档", @@ -29,7 +29,7 @@ "ipmi_text3":"不建议为 KVMD 和 IPMI 用户使用相同的密码,或者直接关闭 IPMI。如有需要可以通过 curl 直接使用 KVMD API。下面是一些示例:", "kvm_text1":"关于", - "kvm_text2":"//这些人向 PiKVM 项目捐款并支持其工作,非常感谢他们的帮助。
//如果您也想支持 PiKVM ,可以在 Patreon PayPal 上捐款

//这些人向 One-KVM 项目捐款并支持其工作,非常感谢他们的帮助。
//如果您也想支持 One-KVM ,可以在 为爱发电 上捐款。", + "kvm_text2":"//这些人向 PiKVM 项目捐款并支持其工作,非常感谢他们的帮助。
//如果您也想支持 PiKVM ,可以在 Patreon PayPal 上捐款

//这些人向 One-KVM 项目捐款并支持其工作,非常感谢他们的帮助。
//如果您也想支持 One-KVM ,可以在 爱发电 上捐款。", "kvm_text3":"系统", "kvm_text4":"运行设置 & 工具", "kvm_text5":"终端", @@ -149,7 +149,7 @@ "msd-message-image-broken":"当前镜像已损坏!", "msd-message-too-big-for-cdrom":"当前 CD-ROM 格式镜像大小超出限制!", "msd-message-out-of-storage":"当前镜像大小超出存储空间", - "msd-message-rw-enabled":"读写模式以启用", + "msd-message-rw-enabled":"读写模式已启用", "msd-message-downloads":"正在从 One-KVM 下载镜像", "msd-message-another-user-uploads":"另一个用户正在上传镜像", "page-full-tab-stream-switch":"自动全屏视频窗口" diff --git a/web/share/js/i18n/i18n.js b/web/share/js/i18n/i18n.js index 9fffe152..a008940d 100644 --- a/web/share/js/i18n/i18n.js +++ b/web/share/js/i18n/i18n.js @@ -1,15 +1,10 @@ -/* cookie存储用户选取的值 */ function setCookie (name, value) { - /* 设置名称为name,值为value的Cookie */ var expdate = new Date(); - /* 计算时间,30天后过期 */ expdate.setTime(expdate.getTime() + 30 * 24 * 60 * 60 * 1000); document.cookie = name + "=" + value + "; expires=" + expdate.toGMTString() + "; path=/" + ";SameSite=Lax"; - /* 即document.cookie= name+"="+value+";path=/"; 时间可以不要,但路径(path)必须要填写,因为JS的默认路径是当前页,如果不填,此cookie只在当前页面生效! */ } -/* 获取cookie */ function getCookie(name) { if (document.cookie.length > 0) @@ -26,15 +21,19 @@ function getCookie(name) return "" } -/** - * 设置语言类型: 默认为中文 - */ var i18nLanguage = "zh"; $(document).ready(function() { - /* 首先获取用户选择过的语言 */ if (getCookie('userLanguage')) { i18nLanguage = getCookie('userLanguage'); + if (i18nLanguage == "zh") { + no = 0; + }else if (i18nLanguage == "en") { + no = 1; + } + $("#selectLanguage").each(function(){ + $(this).find("option").eq(no).prop("selected",true) + }); } $("[i18n]").i18n({