Compare commits

..

19 Commits

Author SHA1 Message Date
8cd9f46335 WIP 2023-11-29 18:50:00 +08:00
a0fca4df4d Update Base.Dockerfile 2023-11-27 21:01:11 +08:00
694923cd42 Update README.md 2023-11-27 18:58:15 +08:00
bfaa8fd795 Update README.md 2023-11-26 23:25:52 +08:00
d5721dd8ca chore(ci): Add workflow to prevent changing lang files (#191)
* Create prevent-file-change.yml

* fix
2023-11-26 22:17:45 +08:00
5c35b09e93 Update CONTRIBUTING.md 2023-11-26 18:53:17 +08:00
9a5d403219 Update to 1.2.0 2023-11-26 18:02:36 +08:00
9ca65ec94d Merge pull request #184 from UptimeKumaBot/weblate-dockge-dockge
Translations update from Uptime Kuma Weblate
2023-11-26 17:54:57 +08:00
5b02b63c95 Translated using Weblate (Urdu)
Currently translated at 100.0% (100 of 100 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/ur/
2023-11-26 09:51:33 +00:00
88d33aace8 Translated using Weblate (Chinese (Simplified))
Currently translated at 97.0% (97 of 100 strings)

Translation: Dockge/dockge
Translate-URL: https://weblate.kuma.pet/projects/dockge/dockge/zh_Hans/
2023-11-26 09:51:33 +00:00
b5f6919bab Fix 100% cpu usage and terminal issue by downgrading Node.js to 18.17.1 (#186)
* Downgrade from Node.js 20 to Node.js 18.17.1

* Enable back socket.io polling

* Avoid multiple commands at the same for a stack
2023-11-26 17:51:26 +08:00
0546f6a24e chore(docs): Update Translation Guide (#185)
* update

* Update README.md
2023-11-26 13:30:57 +08:00
7385d216a3 Fix 2023-11-25 22:26:12 +08:00
631bc60cb2 Add support for extra info: URLs (#182)
* Always show Down button

* Add URL and improve ArrayInput handling

* Minor
2023-11-25 22:14:21 +08:00
d23e2d8aa1 Enforce Websocket (#181)
* Always show Down button

* Force WebSocket

* Force WebSocket
2023-11-25 21:21:23 +08:00
457f038108 Fix css 2023-11-25 13:50:15 +08:00
f862bbc7cd Added Traditional Chinese (#96)
* Fix a typo

* Added Traditional Chinese

* Removed zh-HK

* Update zh-TW.json
2023-11-25 13:08:14 +08:00
3d56846cd6 Add Ukrainian translation (#175)
* Create uk-UA.json

Ukrainian translation

* Update i18n.ts

Add Ukrainian translation

* Update i18n.ts

* Update i18n.ts
2023-11-25 12:06:24 +08:00
cff929c69d Remove compose version (#174) 2023-11-25 03:08:48 +08:00
21 changed files with 481 additions and 83 deletions

View File

@ -0,0 +1,16 @@
name: Prevent File Change
on:
pull_request:
jobs:
check-file-changes:
runs-on: ubuntu-latest
steps:
- name: Prevent file change
uses: xalvarez/prevent-file-change-action@v1
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
# Regex, /src/lang/*.json is not allowed to be changed, except for /src/lang/en.json
pattern: '^(?!frontend/src/lang/en\.json$)frontend/src/lang/.*\.json$'
trustedAuthors: UptimeKumaBot

View File

@ -7,13 +7,15 @@ Here are some references:
### ✅ Usually accepted:
- Bug fix
- Security fix
- Translation
- Adding new language files (see [these instructions](https://github.com/louislam/dockge/blob/master/frontend/src/lang/README.md))
- Adding new language keys: `$t("...")`
### ⚠️ Discussion required:
- Large pull requests
- New features
### ❌ Won't be merged:
- A dedicated PR for translating existing languages (see [these instructions](https://github.com/louislam/dockge/blob/master/frontend/src/lang/README.md))
- Do not pass the auto-test
- Any breaking changes
- Duplicated pull requests

View File

@ -48,14 +48,14 @@ Requirements:
- Default Port: 5001
```
# Create a directory that stores your stacks and stores dockge's compose.yaml
# Create directories that store your stacks and stores Dockge's stack
mkdir -p /opt/stacks /opt/dockge
cd /opt/dockge
# Download the compose.yaml
curl https://raw.githubusercontent.com/louislam/dockge/master/compose.yaml --output compose.yaml
# Start the Server
# Start the server
docker compose up -d
# If you are using docker-compose V1 or Podman
@ -66,40 +66,27 @@ Dockge is now running on http://localhost:5001
### Advanced
If you want to store your stacks in another directory, you can change the `DOCKGE_STACKS_DIR` environment variable and volumes.
If you want to store your stacks in another directory, you can generate your compose.yaml file by using the following URL with custom query strings.
```yaml
version: "3.8"
services:
dockge:
image: louislam/dockge:1
restart: unless-stopped
ports:
# Host Port : Container Port
- 5001:5001
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data:/app/data
# If you want to use private registries, you need to share the auth file with Dockge:
# - /root/.docker/:/root/.docker
# Your stacks directory in the host (The paths inside container must be the same as the host)
# ⚠️⚠️ If you did it wrong, your data could end up be written into a wrong path.
# ✔️✔️✔️✔️ CORRECT: - /my-stacks:/my-stacks (Both paths match)
# ❌❌❌❌ WRONG: - /docker:/my-stacks (Both paths do not match)
- /opt/stacks:/opt/stacks
environment:
# Tell Dockge where is your stacks directory
- DOCKGE_STACKS_DIR=/opt/stacks
```
# Download your compose.yaml
curl "https://dockge.kuma.pet/compose.yaml?port=5001&stacksPath=/opt/stacks" --output compose.yaml
```
- port=`5001`
- stacksPath=`/opt/stacks`
Interactive compose.yaml generator is available on:
https://dockge.kuma.pet
You can also view compose.yaml here:
https://github.com/louislam/dockge/blob/master/compose.yaml
## How to Update
```bash
cd /opt/dockge
docker compose pull
docker compose up -d
docker compose pull && docker compose up -d
```
## Screenshots

View File

@ -150,9 +150,6 @@ export class DockgeServer {
}
}
// Create all the necessary directories
this.initDataDir();
// Create express
this.app = express();
@ -255,6 +252,9 @@ export class DockgeServer {
*
*/
async serve() {
// Create all the necessary directories
this.initDataDir();
// Connect to database
try {
await Database.init(this);

View File

@ -5,8 +5,6 @@ import { LimitQueue } from "./utils/limit-queue";
import { DockgeSocket } from "./util-server";
import {
allowedCommandList, allowedRawKeys,
getComposeTerminalName,
getCryptoRandomInt,
PROGRESS_TERMINAL_ROWS,
TERMINAL_COLS,
TERMINAL_ROWS
@ -207,14 +205,20 @@ export class Terminal {
}
public static exec(server : DockgeServer, socket : DockgeSocket | undefined, terminalName : string, file : string, args : string | string[], cwd : string) : Promise<number> {
const terminal = new Terminal(server, terminalName, file, args, cwd);
terminal.rows = PROGRESS_TERMINAL_ROWS;
return new Promise((resolve, reject) => {
// check if terminal exists
if (Terminal.terminalMap.has(terminalName)) {
reject("Another operation is already running, please try again later.");
return;
}
if (socket) {
terminal.join(socket);
}
let terminal = new Terminal(server, terminalName, file, args, cwd);
terminal.rows = PROGRESS_TERMINAL_ROWS;
if (socket) {
terminal.join(socket);
}
return new Promise((resolve) => {
terminal.onExit((exitCode : number) => {
resolve(exitCode);
});

View File

@ -1,9 +1,7 @@
FROM node:20-bookworm-slim
# Due to the bug of #145, Node.js's version cannot be changed, unless upstream is fixed.
FROM node:18.17.1-bookworm-slim
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
# COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/
RUN apt update && apt install --yes --no-install-recommends \
curl \
ca-certificates \
@ -24,16 +22,3 @@ RUN apt update && apt install --yes --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& npm install pnpm -g \
&& pnpm install -g tsx
# ensures that /var/run/docker.sock exists
# changes the ownership of /var/run/docker.sock
RUN touch /var/run/docker.sock && chown node:node /var/run/docker.sock
# Full Base Image
# MariaDB, Chromium and fonts
#FROM base-slim AS base
#ENV DOCKGE_ENABLE_EMBEDDED_MARIADB=1
#RUN apt update && \
# apt --yes --no-install-recommends install mariadb-server && \
# rm -rf /var/lib/apt/lists/* && \
# apt --yes autoremove

84
extra/reset-password.ts Normal file
View File

@ -0,0 +1,84 @@
import { Database } from "../backend/database";
import { R } from "redbean-node";
import readline from "readline";
import { User } from "../backend/models/user";
import { DockgeServer } from "../backend/dockge-server";
import { log } from "../backend/log";
console.log("== Dockge Reset Password Tool ==");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
export const main = async () => {
const server = new DockgeServer();
// Check if
console.log("Connecting the database");
try {
await Database.init(server);
} catch (e) {
if (e instanceof Error) {
log.error("server", "Failed to connect to your database: " + e.message);
}
process.exit(1);
}
try {
// No need to actually reset the password for testing, just make sure no connection problem. It is ok for now.
if (!process.env.TEST_BACKEND) {
const user = await R.findOne("user");
if (! user) {
throw new Error("user not found, have you installed?");
}
console.log("Found user: " + user.username);
while (true) {
let password = await question("New Password: ");
let confirmPassword = await question("Confirm New Password: ");
if (password === confirmPassword) {
await User.resetPassword(user.id, password);
// Reset all sessions by reset jwt secret
await server.initJWTSecret();
break;
} else {
console.log("Passwords do not match, please try again.");
}
}
console.log("Password reset successfully.");
}
} catch (e) {
if (e instanceof Error) {
console.error("Error: " + e.message);
}
}
await Database.close();
rl.close();
console.log("Finished.");
};
/**
* Ask question of user
* @param question Question to ask
* @returns Users response
*/
function question(question : string) : Promise<string> {
return new Promise((resolve) => {
rl.question(question, (answer) => {
resolve(answer);
});
});
}
if (!process.env.TEST_BACKEND) {
main();
}

View File

@ -30,6 +30,10 @@ export default {
displayName: {
type: String,
required: true,
},
objectType: {
type: String,
default: "service",
}
},
data() {
@ -41,8 +45,7 @@ export default {
array() {
// Create the array if not exists, it should be safe.
if (!this.service[this.name]) {
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
this.service[this.name] = [];
return [];
}
return this.service[this.name];
},
@ -56,8 +59,24 @@ export default {
return this.service[this.name] !== undefined;
},
/**
* Not a good name, but it is used to get the object.
*/
service() {
return this.$parent.$parent.service;
if (this.objectType === "service") {
// Used in Container.vue
return this.$parent.$parent.service;
} else if (this.objectType === "x-dockge") {
if (!this.$parent.$parent.jsonConfig["x-dockge"]) {
return {};
}
// Used in Compose.vue
return this.$parent.$parent.jsonConfig["x-dockge"];
} else {
return {};
}
},
valid() {
@ -81,6 +100,19 @@ export default {
},
methods: {
addField() {
// Create the object if not exists.
if (this.objectType === "x-dockge") {
if (!this.$parent.$parent.jsonConfig["x-dockge"]) {
this.$parent.$parent.jsonConfig["x-dockge"] = {};
}
}
// Create the array if not exists.
if (!this.service[this.name]) {
this.service[this.name] = [];
}
this.array.push("");
},
remove(index) {

View File

@ -49,8 +49,7 @@ export default {
array() {
// Create the array if not exists, it should be safe.
if (!this.service[this.name]) {
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
this.service[this.name] = [];
return [];
}
return this.service[this.name];
},
@ -89,6 +88,10 @@ export default {
},
methods: {
addField() {
// Create the array if not exists.
if (!this.service[this.name]) {
this.service[this.name] = [];
}
this.array.push("");
},
remove(index) {

View File

@ -45,11 +45,12 @@ export default {
<style scoped>
.badge {
min-width: 62px;
overflow: hidden;
text-overflow: ellipsis;
}
.fixed-width {
width: 62px;
overflow: hidden;
text-overflow: ellipsis;
}
</style>

View File

@ -13,6 +13,7 @@ const languageList = {
"sl": "Slovenščina",
"tr": "Türkçe",
"zh-CN": "简体中文",
"zh-TW": "繁體中文(台灣)",
"ur": "Urdu",
"ko-KR": "한국어",
"ru": "Русский",
@ -20,7 +21,8 @@ const languageList = {
"ar": "العربية",
"th":"ไทย",
"it-IT":"Italiano",
"sv-SE":"Svenska"
"sv-SE":"Svenska",
"uk-UA":"Українська"
};
let messages = {

View File

@ -2,13 +2,18 @@
A simple guide on how to translate `Dockge` in your native language.
## How to Translate
(11-26-2023) Updated
1. Go to <https://weblate.kuma.pet>
2. Register an account on Weblate
3. Make sure your GitHub email is matched with Weblate's account, so that it could show you as a contributor on GitHub
4. Choose your language on Weblate and start translating.
## How to add a new language in the dropdown
(11-21-2023) Updated
1. Add your Language at `frontend/src/lang/` by creating a new file with your language Code, format: `zh-TW.json` .
2. Copy the content from `en.json` and make translations from that.
1. Add your Language at <https://weblate.kuma.pet/projects/dockge/dockge/>.
2. Find the language code (You can find it at the end of the URL)
3. Add your language at the end of `languageList` in `frontend/src/i18n.ts`, format: `"zh-TW": "繁體中文 (台灣)"`,
4. Commit to new branch and make a new Pull Request for me to approve.
*Note:* Currently we are only accepting one Pull Request per Language Translate.

View File

@ -91,5 +91,12 @@
"Allowed commands:": "Allowed commands:",
"Internal Networks": "Internal Networks",
"External Networks": "External Networks",
"No External Networks": "No External Networks"
"No External Networks": "No External Networks",
"reverseProxyMsg1": "Using a Reverse Proxy?",
"reverseProxyMsg2": "Check how to config it for WebSocket",
"Cannot connect to the socket server.": "Cannot connect to the socket server.",
"reconnecting...": "Reconnecting...",
"connecting...": "Connecting to the socket server...",
"url": "URL | URLs",
"extra": "Extra"
}

View File

@ -0,0 +1,94 @@
{
"languageName": "Українська",
"Create your admin account": "Створити акаунт адміністратора",
"authIncorrectCreds": "Невірний логін чи пароль",
"PasswordsDoNotMatch": "Паролі не співпадають.",
"Repeat Password": "Повторіть пароль",
"Create": "Створити",
"signedInDisp": "Авторизовано як {0}",
"signedInDispDisabled": "Авторизацію вимкнено.",
"home": "Головна",
"console": "Консоль",
"registry": "Registry",
"compose": "Compose",
"addFirstStackMsg": "Додайте свій перший стек!",
"stackName" : "Назва стеку",
"deployStack": "Розрознути",
"deleteStack": "Видалити",
"stopStack": "Зупинити",
"restartStack": "Перезапустити",
"updateStack": "Оновити",
"startStack": "Запустити",
"editStack": "Редагувати",
"discardStack": "Відмінити",
"saveStackDraft": "Зберегти",
"notAvailableShort" : "Н/Д",
"deleteStackMsg": "Ви впевнені що хочете видалити цей стек?",
"stackNotManagedByDockgeMsg": "Даний стек не управляється Dockge.",
"primaryHostname": "Назва хосту",
"general": "Загальне",
"container": "Контейнер | Контейнери",
"scanFolder": "Сканувати папку зі стеками",
"dockerImage": "Образ",
"restartPolicyUnlessStopped": "Доки не буде зупинено",
"restartPolicyAlways": "Завжди",
"restartPolicyOnFailure": "При падінні",
"restartPolicyNo": "Ніколи",
"environmentVariable": "Змінна середовища | змінні середовища",
"restartPolicy": "Перезапуск",
"containerName": "Назва контейнеру",
"port": "Порт | Порти",
"volume": "Сховище | Сховища",
"network": "Мережа | Мережі",
"dependsOn": "Залежність контейнера | Залежності контейнеру",
"addListItem": "Додати {0}",
"deleteContainer": "Видалити",
"addContainer": "Додати Контейнер",
"addNetwork": "Додати Мережу",
"disableauth.message1": "Ви впевнені що хочете <strong>вимкнути авторизацію</strong>?",
"disableauth.message2": "Це призначено для сценаріїв, <strong>де ви збираєтесь використати сторонню авторизацію</strong> перед Dockge, наприклад Cloudflare Access, Authelia чи інші.",
"passwordNotMatchMsg": "Паролі не співпадають.",
"autoGet": "Отримати",
"add": "Додати",
"Edit": "Змінити",
"applyToYAML": "Застосувати для YAML",
"createExternalNetwork": "Створити",
"addInternalNetwork": "Додати",
"Save": "Зберегти",
"Language": "Мова",
"Current User": "Користувач",
"Change Password": "Змінити пароль",
"Current Password": "Поточний пароль",
"New Password": "Новий пароль",
"Repeat New Password": "Повторіть новий пароль",
"Update Password": "Оновити пароль",
"Advanced": "Розширені опції",
"Please use this option carefully!": "Будь-ласка, використовуйте цю опцію з обережністю!",
"Enable Auth": "Увімкнути автентифікацію",
"Disable Auth": "Вимкнути автентифікацію",
"I understand, please disable": "Зрозуміло, все-одно вимкнути",
"Leave": "Покинути",
"Frontend Version": "Версія інтерфейсу",
"Check Update On GitHub": "Перевірити оновлення на GitHub",
"Show update if available": "Показати оновлення, якщо доступно",
"Also check beta release": "Перевіряти оновлення до бета-версії",
"Remember me": "Запамʼятати мене",
"Login": "Логін",
"Username": "Імʼя користувача",
"Password": "Пароль",
"Settings": "Налаштування",
"Logout": "Вийти",
"Lowercase only": "Тільки нижній регістр",
"Convert to Compose": "Конвертувати в Compose",
"Docker Run": "Запустити Docker",
"active": "активно",
"exited": "завершено",
"inactive": "неактивно",
"Appearance": "Зовнішній вигляд",
"Security": "Безпека",
"About": "Про продукт",
"Allowed commands:": "Дозволені команди:",
"Internal Networks": "Внутрішні мережі",
"External Networks": "Зовнішні мережі",
"No External Networks": "Немає зовнішніх мереж"
}

View File

@ -12,7 +12,7 @@
"registry": "رجسٹری",
"compose": "تحریر",
"addFirstStackMsg": "اپنا پہلا اسٹیک کمپوز کریں!",
"stackName" : "اسٹیک کا نام",
"stackName": "اسٹیک کا نام",
"deployStack": "تعینات",
"deleteStack": "حذف کریں",
"stopStack": "روکو",
@ -22,7 +22,7 @@
"editStack": "ترمیم",
"discardStack": "رد کر دیں۔",
"saveStackDraft": "محفوظ کریں۔",
"notAvailableShort" : "N / A",
"notAvailableShort": "N / A",
"deleteStackMsg": "کیا آپ واقعی اس اسٹیک کو حذف کرنا چاہتے ہیں؟",
"stackNotManagedByDockgeMsg": "یہ اسٹیک Dockge کے زیر انتظام نہیں ہے۔",
"primaryHostname": "بنیادی میزبان نام",
@ -90,5 +90,13 @@
"Allowed commands:": "اجازت شدہ احکامات:",
"Internal Networks": "اندرونی نیٹ ورکس",
"External Networks": "بیرونی نیٹ ورکس",
"No External Networks": "کوئی بیرونی نیٹ ورک نہیں"
"No External Networks": "کوئی بیرونی نیٹ ورک نہیں",
"reverseProxyMsg1": "ایک ریورس پراکسی کا استعمال کرتے ہوئے؟",
"Cannot connect to the socket server.": "ساکٹ سرور سے منسلک نہیں ہو سکتا۔",
"reconnecting...": "دوبارہ منسلک ہو رہا ہے...",
"connecting...": "ساکٹ سرور سے منسلک ہو رہا ہے...",
"url": "یو آر ایل | یو آر ایل",
"extra": "اضافی",
"downStack": "اسٹاپ اینڈ ڈاؤن",
"reverseProxyMsg2": "اسے WebSocket کے لیے ترتیب دینے کا طریقہ چیک کریں"
}

View File

@ -12,7 +12,7 @@
"registry": "镜像仓库",
"compose": "Compose",
"addFirstStackMsg": "组合你的第一个堆栈!",
"stackName" : "堆栈名称",
"stackName": "堆栈名称",
"deployStack": "部署",
"deleteStack": "删除",
"stopStack": "停止",
@ -22,7 +22,7 @@
"editStack": "编辑",
"discardStack": "放弃",
"saveStackDraft": "保存",
"notAvailableShort" : "不可用",
"notAvailableShort": "不可用",
"deleteStackMsg": "你确定要删除这个堆栈吗?",
"stackNotManagedByDockgeMsg": "这个堆栈不由Dockge管理",
"primaryHostname": "主机名",
@ -90,5 +90,10 @@
"Allowed commands:": "允许使用的指令:",
"Internal Networks": "内部网络",
"External Networks": "外部网络",
"No External Networks": "无外部网络"
"No External Networks": "无外部网络",
"reconnecting...": "重连中...",
"reverseProxyMsg2": "检查如何配置WebSocket",
"reverseProxyMsg1": "正在使用反向代理?",
"connecting...": "正在连接到socket服务器...",
"Cannot connect to the socket server.": "无法连接到socket服务器。"
}

View File

@ -0,0 +1,94 @@
{
"languageName": "繁體中文(台灣)",
"Create your admin account": "建立您的管理員帳號",
"authIncorrectCreds": "使用者名稱或密碼錯誤",
"PasswordsDoNotMatch": "兩次輸入的密碼不一致。",
"Repeat Password": "重複以確認密碼",
"Create": "建立",
"signedInDisp": "目前使用者:{0}",
"signedInDispDisabled": "已停用身份驗證",
"home": "首頁",
"console": "主控台",
"registry": "映像倉庫",
"compose": "Compose",
"addFirstStackMsg": "組合您的第一個堆疊!",
"stackName": "堆疊名稱",
"deployStack": "部署",
"deleteStack": "刪除",
"stopStack": "停止",
"restartStack": "重啟",
"updateStack": "更新",
"startStack": "啟動",
"editStack": "編輯",
"discardStack": "捨棄",
"saveStackDraft": "儲存",
"notAvailableShort": "不可用",
"deleteStackMsg": "您確定要刪除這個堆疊嗎?",
"stackNotManagedByDockgeMsg": "這個堆疊不由 Dockge 管理",
"primaryHostname": "主機名稱",
"general": "一般",
"container": "容器 | 容器群組",
"scanFolder": "掃描堆疊資料夾",
"dockerImage": "映像",
"restartPolicyUnlessStopped": "除非手動停止",
"restartPolicyAlways": "始終",
"restartPolicyOnFailure": "在失敗時",
"restartPolicyNo": "不重啟",
"environmentVariable": "環境變數 | 環境變數群組",
"restartPolicy": "重啟策略",
"containerName": "容器名稱",
"port": "連接埠 | 連接埠群組",
"volume": "資料卷 | 資料卷群組",
"network": "網路 | 網路群組",
"dependsOn": "容器依賴 | 容器依賴關係",
"addListItem": "新增 {0}",
"deleteContainer": "刪除容器",
"addContainer": "新增容器",
"addNetwork": "新增網路",
"disableauth.message1": "您確定要<strong>停用身份驗證</strong>嗎?",
"disableauth.message2": "該選項設計用於某些場景,<strong>例如在 Dockge 之上接入第三方認證</strong>,如 Cloudflare Access、Authelia 或其他認證機制。如果您不清楚這個選項的作用,請不要停用驗證!",
"passwordNotMatchMsg": "兩次輸入的密碼不一致。",
"autoGet": "自動取得",
"add": "新增",
"Edit": "編輯",
"applyToYAML": "應用到YAML",
"createExternalNetwork": "建立",
"addInternalNetwork": "新增",
"Save": "儲存",
"Language": "語言",
"Current User": "目前使用者",
"Change Password": "更換密碼",
"Current Password": "目前密碼",
"New Password": "新密碼",
"Repeat New Password": "重複以確認新密碼",
"Update Password": "更新密碼",
"Advanced": "進階",
"Please use this option carefully!": "請謹慎使用該選項!",
"Enable Auth": "啟用驗證",
"Disable Auth": "停用驗證",
"I understand, please disable": "我已了解風險,確認停用",
"Leave": "離開",
"Frontend Version": "前端版本",
"Check Update On GitHub": "在 GitHub 上檢查更新",
"Show update if available": "有更新時提醒我",
"Also check beta release": "同時檢查 Beta 渠道更新",
"Remember me": "記住我",
"Login": "登入",
"Username": "使用者名稱",
"Password": "密碼",
"Settings": "設定",
"Logout": "登出",
"Lowercase only": "僅小寫字母",
"Convert to Compose": "轉換為 Compose 格式",
"Docker Run": "Docker 啟動",
"active": "已啟動",
"exited": "已退出",
"inactive": "未啟動",
"Appearance": "外觀",
"Security": "安全",
"About": "關於",
"Allowed commands:": "允許使用的指令:",
"Internal Networks": "內部網路",
"External Networks": "外部網路",
"No External Networks": "無外部網路"
}

View File

@ -3,6 +3,9 @@
<div v-if="! $root.socketIO.connected && ! $root.socketIO.firstConnect" class="lost-connection">
<div class="container-fluid">
{{ $root.socketIO.connectionErrorMsg }}
<div v-if="$root.socketIO.showReverseProxyGuide">
{{ $t("reverseProxyMsg1") }} <a href="https://github.com/louislam/uptime-kuma/wiki/Reverse-Proxy" target="_blank">{{ $t("reverseProxyMsg2") }}</a>
</div>
</div>
</div>
@ -82,6 +85,10 @@
</header>
<main>
<div v-if="$root.socketIO.connecting" class="container mt-5">
<h4>{{ $t("connecting...") }}</h4>
</div>
<router-view v-if="$root.loggedIn" />
<Login v-if="! $root.loggedIn && $root.allowLoginDialog" />
</main>

View File

@ -19,6 +19,7 @@ export default defineComponent({
initedSocketIO: false,
connectionErrorMsg: `${this.$t("Cannot connect to the socket server.")} ${this.$t("Reconnecting...")}`,
showReverseProxyGuide: true,
connecting: false,
},
info: {
@ -103,6 +104,10 @@ export default defineComponent({
url = location.protocol + "//" + location.host;
}
let connectingMsgTimeout = setTimeout(() => {
this.socketIO.connecting = true;
}, 1500);
socket = io(url, {
transports: [ "websocket", "polling" ]
});
@ -110,6 +115,9 @@ export default defineComponent({
socket.on("connect", () => {
console.log("Connected to the socket server");
clearTimeout(connectingMsgTimeout);
this.socketIO.connecting = false;
this.socketIO.connectCount++;
this.socketIO.connected = true;
this.socketIO.showReverseProxyGuide = false;
@ -143,10 +151,11 @@ export default defineComponent({
socket.on("connect_error", (err) => {
console.error(`Failed to connect to the backend. Socket.io connect_error: ${err.message}`);
this.socketIO.connectionErrorMsg = `${this.$t("Cannot connect to the socket server.")} [${err}] ${this.$t("Reconnecting...")}`;
this.socketIO.connectionErrorMsg = `${this.$t("Cannot connect to the socket server.")} [${err}] ${this.$t("reconnecting...")}`;
this.socketIO.showReverseProxyGuide = true;
this.socketIO.connected = false;
this.socketIO.firstConnect = false;
this.socketIO.connecting = false;
});
// Custom Events

View File

@ -41,7 +41,7 @@
{{ $t("stopStack") }}
</button>
<BDropdown v-if="!isEditMode && active" right text="" variant="normal">
<BDropdown right text="" variant="normal">
<BDropdownItem @click="downStack">
<font-awesome-icon icon="stop" class="me-1" />
{{ $t("downStack") }}
@ -56,6 +56,13 @@
</button>
</div>
<!-- URLs -->
<div v-if="urls.length > 0" class="mb-3">
<a v-for="(url, index) in urls" :key="index" target="_blank" :href="url.url">
<span class="badge bg-secondary me-2">{{ url.display }}</span>
</a>
</div>
<!-- Progress Terminal -->
<transition name="slide-fade" appear>
<Terminal
@ -111,6 +118,20 @@
<button v-if="false && isEditMode && jsonConfig.services && Object.keys(jsonConfig.services).length > 0" class="btn btn-normal mb-3" @click="addContainer">{{ $t("addContainer") }}</button>
<!-- General -->
<div v-if="isEditMode">
<h4 class="mb-3">{{ $t("extra") }}</h4>
<div class="shadow-box big-padding mb-3">
<!-- URLs -->
<div class="mb-4">
<label class="form-label">
{{ $tc("url", 2) }}
</label>
<ArrayInput name="urls" :display-name="$t('url')" placeholder="https://" object-type="x-dockge" />
</div>
</div>
</div>
<!-- Combined Terminal Output -->
<div v-show="!isEditMode">
<h4 class="mb-3">Terminal</h4>
@ -252,6 +273,34 @@ export default {
};
},
computed: {
urls() {
if (!this.jsonConfig["x-dockge"] || !this.jsonConfig["x-dockge"].urls || !Array.isArray(this.jsonConfig["x-dockge"].urls)) {
return [];
}
let urls = [];
for (const url of this.jsonConfig["x-dockge"].urls) {
let display;
try {
let obj = new URL(url);
let pathname = obj.pathname;
if (pathname === "/") {
pathname = "";
}
display = obj.host + pathname + obj.search;
} catch (e) {
display = url;
}
urls.push({
display,
url,
});
}
return urls;
},
isAdd() {
return this.$route.path === "/compose" && !this.submitted;
},

View File

@ -1,7 +1,10 @@
{
"name": "dockge",
"version": "1.1.1",
"version": "1.2.0",
"type": "module",
"engines": {
"node": ">= 18.0.0 && <= 18.17.1"
},
"scripts": {
"fmt": "eslint \"**/*.{ts,vue}\" --fix",
"lint": "eslint \"**/*.{ts,vue}\"",
@ -16,7 +19,8 @@
"build:docker-nightly": "pnpm run build:frontend && docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/dockge:nightly --target nightly -f ./docker/Dockerfile . --push",
"start-docker": "docker run --rm -p 5001:5001 --name dockge louislam/dockge:latest",
"mark-as-nightly": "tsx ./extra/mark-as-nightly.ts",
"reformat-changelog": "tsx ./extra/reformat-changelog.ts"
"reformat-changelog": "tsx ./extra/reformat-changelog.ts",
"reset-password": "tsx ./extra/reset-password.ts"
},
"dependencies": {
"@homebridge/node-pty-prebuilt-multiarch": "~0.11.11",