forked from extern/dockge
Compare commits
15 Commits
websocket
...
reset-pass
Author | SHA1 | Date | |
---|---|---|---|
8cd9f46335 | |||
a0fca4df4d | |||
694923cd42 | |||
bfaa8fd795 | |||
d5721dd8ca | |||
5c35b09e93 | |||
9a5d403219 | |||
9ca65ec94d | |||
5b02b63c95 | |||
88d33aace8 | |||
b5f6919bab | |||
0546f6a24e | |||
7385d216a3 | |||
631bc60cb2 | |||
d23e2d8aa1 |
16
.github/workflows/prevent-file-change.yml
vendored
Normal file
16
.github/workflows/prevent-file-change.yml
vendored
Normal 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
|
@ -7,13 +7,15 @@ Here are some references:
|
|||||||
### ✅ Usually accepted:
|
### ✅ Usually accepted:
|
||||||
- Bug fix
|
- Bug fix
|
||||||
- Security 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:
|
### ⚠️ Discussion required:
|
||||||
- Large pull requests
|
- Large pull requests
|
||||||
- New features
|
- New features
|
||||||
|
|
||||||
### ❌ Won't be merged:
|
### ❌ 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
|
- Do not pass the auto-test
|
||||||
- Any breaking changes
|
- Any breaking changes
|
||||||
- Duplicated pull requests
|
- Duplicated pull requests
|
||||||
|
45
README.md
45
README.md
@ -48,14 +48,14 @@ Requirements:
|
|||||||
- Default Port: 5001
|
- 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
|
mkdir -p /opt/stacks /opt/dockge
|
||||||
cd /opt/dockge
|
cd /opt/dockge
|
||||||
|
|
||||||
# Download the compose.yaml
|
# Download the compose.yaml
|
||||||
curl https://raw.githubusercontent.com/louislam/dockge/master/compose.yaml --output 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
|
docker compose up -d
|
||||||
|
|
||||||
# If you are using docker-compose V1 or Podman
|
# If you are using docker-compose V1 or Podman
|
||||||
@ -66,40 +66,27 @@ Dockge is now running on http://localhost:5001
|
|||||||
|
|
||||||
### Advanced
|
### 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
|
## How to Update
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd /opt/dockge
|
cd /opt/dockge
|
||||||
docker compose pull
|
docker compose pull && docker compose up -d
|
||||||
docker compose up -d
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
@ -150,9 +150,6 @@ export class DockgeServer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create all the necessary directories
|
|
||||||
this.initDataDir();
|
|
||||||
|
|
||||||
// Create express
|
// Create express
|
||||||
this.app = express();
|
this.app = express();
|
||||||
|
|
||||||
@ -195,7 +192,6 @@ export class DockgeServer {
|
|||||||
// Create Socket.io
|
// Create Socket.io
|
||||||
this.io = new socketIO.Server(this.httpServer, {
|
this.io = new socketIO.Server(this.httpServer, {
|
||||||
cors,
|
cors,
|
||||||
transports: [ "websocket" ],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.io.on("connection", async (socket: Socket) => {
|
this.io.on("connection", async (socket: Socket) => {
|
||||||
@ -256,6 +252,9 @@ export class DockgeServer {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
async serve() {
|
async serve() {
|
||||||
|
// Create all the necessary directories
|
||||||
|
this.initDataDir();
|
||||||
|
|
||||||
// Connect to database
|
// Connect to database
|
||||||
try {
|
try {
|
||||||
await Database.init(this);
|
await Database.init(this);
|
||||||
|
@ -5,8 +5,6 @@ import { LimitQueue } from "./utils/limit-queue";
|
|||||||
import { DockgeSocket } from "./util-server";
|
import { DockgeSocket } from "./util-server";
|
||||||
import {
|
import {
|
||||||
allowedCommandList, allowedRawKeys,
|
allowedCommandList, allowedRawKeys,
|
||||||
getComposeTerminalName,
|
|
||||||
getCryptoRandomInt,
|
|
||||||
PROGRESS_TERMINAL_ROWS,
|
PROGRESS_TERMINAL_ROWS,
|
||||||
TERMINAL_COLS,
|
TERMINAL_COLS,
|
||||||
TERMINAL_ROWS
|
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> {
|
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);
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
let terminal = new Terminal(server, terminalName, file, args, cwd);
|
||||||
terminal.rows = PROGRESS_TERMINAL_ROWS;
|
terminal.rows = PROGRESS_TERMINAL_ROWS;
|
||||||
|
|
||||||
if (socket) {
|
if (socket) {
|
||||||
terminal.join(socket);
|
terminal.join(socket);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
|
||||||
terminal.onExit((exitCode : number) => {
|
terminal.onExit((exitCode : number) => {
|
||||||
resolve(exitCode);
|
resolve(exitCode);
|
||||||
});
|
});
|
||||||
|
@ -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 PNPM_HOME="/pnpm"
|
||||||
ENV PATH="$PNPM_HOME:$PATH"
|
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 \
|
RUN apt update && apt install --yes --no-install-recommends \
|
||||||
curl \
|
curl \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
@ -24,16 +22,3 @@ RUN apt update && apt install --yes --no-install-recommends \
|
|||||||
&& rm -rf /var/lib/apt/lists/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& npm install pnpm -g \
|
&& npm install pnpm -g \
|
||||||
&& pnpm install -g tsx
|
&& 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
84
extra/reset-password.ts
Normal 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();
|
||||||
|
}
|
@ -30,6 +30,10 @@ export default {
|
|||||||
displayName: {
|
displayName: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
|
},
|
||||||
|
objectType: {
|
||||||
|
type: String,
|
||||||
|
default: "service",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@ -41,8 +45,7 @@ export default {
|
|||||||
array() {
|
array() {
|
||||||
// Create the array if not exists, it should be safe.
|
// Create the array if not exists, it should be safe.
|
||||||
if (!this.service[this.name]) {
|
if (!this.service[this.name]) {
|
||||||
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
return [];
|
||||||
this.service[this.name] = [];
|
|
||||||
}
|
}
|
||||||
return this.service[this.name];
|
return this.service[this.name];
|
||||||
},
|
},
|
||||||
@ -56,8 +59,24 @@ export default {
|
|||||||
return this.service[this.name] !== undefined;
|
return this.service[this.name] !== undefined;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Not a good name, but it is used to get the object.
|
||||||
|
*/
|
||||||
service() {
|
service() {
|
||||||
|
if (this.objectType === "service") {
|
||||||
|
// Used in Container.vue
|
||||||
return this.$parent.$parent.service;
|
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() {
|
valid() {
|
||||||
@ -81,6 +100,19 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addField() {
|
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("");
|
this.array.push("");
|
||||||
},
|
},
|
||||||
remove(index) {
|
remove(index) {
|
||||||
|
@ -49,8 +49,7 @@ export default {
|
|||||||
array() {
|
array() {
|
||||||
// Create the array if not exists, it should be safe.
|
// Create the array if not exists, it should be safe.
|
||||||
if (!this.service[this.name]) {
|
if (!this.service[this.name]) {
|
||||||
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
return [];
|
||||||
this.service[this.name] = [];
|
|
||||||
}
|
}
|
||||||
return this.service[this.name];
|
return this.service[this.name];
|
||||||
},
|
},
|
||||||
@ -89,6 +88,10 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addField() {
|
addField() {
|
||||||
|
// Create the array if not exists.
|
||||||
|
if (!this.service[this.name]) {
|
||||||
|
this.service[this.name] = [];
|
||||||
|
}
|
||||||
this.array.push("");
|
this.array.push("");
|
||||||
},
|
},
|
||||||
remove(index) {
|
remove(index) {
|
||||||
|
@ -2,13 +2,18 @@
|
|||||||
|
|
||||||
A simple guide on how to translate `Dockge` in your native language.
|
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
|
## How to add a new language in the dropdown
|
||||||
|
|
||||||
(11-21-2023) Updated
|
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)
|
||||||
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.
|
|
||||||
3. Add your language at the end of `languageList` in `frontend/src/i18n.ts`, format: `"zh-TW": "繁體中文 (台灣)"`,
|
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.
|
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.
|
|
||||||
|
@ -96,5 +96,7 @@
|
|||||||
"reverseProxyMsg2": "Check how to config it for WebSocket",
|
"reverseProxyMsg2": "Check how to config it for WebSocket",
|
||||||
"Cannot connect to the socket server.": "Cannot connect to the socket server.",
|
"Cannot connect to the socket server.": "Cannot connect to the socket server.",
|
||||||
"reconnecting...": "Reconnecting...",
|
"reconnecting...": "Reconnecting...",
|
||||||
"connecting...": "Connecting to the socket server..."
|
"connecting...": "Connecting to the socket server...",
|
||||||
|
"url": "URL | URLs",
|
||||||
|
"extra": "Extra"
|
||||||
}
|
}
|
||||||
|
@ -90,5 +90,13 @@
|
|||||||
"Allowed commands:": "اجازت شدہ احکامات:",
|
"Allowed commands:": "اجازت شدہ احکامات:",
|
||||||
"Internal Networks": "اندرونی نیٹ ورکس",
|
"Internal Networks": "اندرونی نیٹ ورکس",
|
||||||
"External Networks": "بیرونی نیٹ ورکس",
|
"External Networks": "بیرونی نیٹ ورکس",
|
||||||
"No External Networks": "کوئی بیرونی نیٹ ورک نہیں"
|
"No External Networks": "کوئی بیرونی نیٹ ورک نہیں",
|
||||||
|
"reverseProxyMsg1": "ایک ریورس پراکسی کا استعمال کرتے ہوئے؟",
|
||||||
|
"Cannot connect to the socket server.": "ساکٹ سرور سے منسلک نہیں ہو سکتا۔",
|
||||||
|
"reconnecting...": "دوبارہ منسلک ہو رہا ہے...",
|
||||||
|
"connecting...": "ساکٹ سرور سے منسلک ہو رہا ہے...",
|
||||||
|
"url": "یو آر ایل | یو آر ایل",
|
||||||
|
"extra": "اضافی",
|
||||||
|
"downStack": "اسٹاپ اینڈ ڈاؤن",
|
||||||
|
"reverseProxyMsg2": "اسے WebSocket کے لیے ترتیب دینے کا طریقہ چیک کریں"
|
||||||
}
|
}
|
||||||
|
@ -90,5 +90,10 @@
|
|||||||
"Allowed commands:": "允许使用的指令:",
|
"Allowed commands:": "允许使用的指令:",
|
||||||
"Internal Networks": "内部网络",
|
"Internal Networks": "内部网络",
|
||||||
"External Networks": "外部网络",
|
"External Networks": "外部网络",
|
||||||
"No External Networks": "无外部网络"
|
"No External Networks": "无外部网络",
|
||||||
|
"reconnecting...": "重连中...",
|
||||||
|
"reverseProxyMsg2": "检查如何配置WebSocket",
|
||||||
|
"reverseProxyMsg1": "正在使用反向代理?",
|
||||||
|
"connecting...": "正在连接到socket服务器...",
|
||||||
|
"Cannot connect to the socket server.": "无法连接到socket服务器。"
|
||||||
}
|
}
|
||||||
|
@ -109,7 +109,7 @@ export default defineComponent({
|
|||||||
}, 1500);
|
}, 1500);
|
||||||
|
|
||||||
socket = io(url, {
|
socket = io(url, {
|
||||||
transports: [ "websocket" ]
|
transports: [ "websocket", "polling" ]
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("connect", () => {
|
socket.on("connect", () => {
|
||||||
|
@ -56,6 +56,13 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</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 -->
|
<!-- Progress Terminal -->
|
||||||
<transition name="slide-fade" appear>
|
<transition name="slide-fade" appear>
|
||||||
<Terminal
|
<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>
|
<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 -->
|
<!-- Combined Terminal Output -->
|
||||||
<div v-show="!isEditMode">
|
<div v-show="!isEditMode">
|
||||||
<h4 class="mb-3">Terminal</h4>
|
<h4 class="mb-3">Terminal</h4>
|
||||||
@ -252,6 +273,34 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
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() {
|
isAdd() {
|
||||||
return this.$route.path === "/compose" && !this.submitted;
|
return this.$route.path === "/compose" && !this.submitted;
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "dockge",
|
"name": "dockge",
|
||||||
"version": "1.1.1",
|
"version": "1.2.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 18.0.0 && <= 18.17.1"
|
||||||
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"fmt": "eslint \"**/*.{ts,vue}\" --fix",
|
"fmt": "eslint \"**/*.{ts,vue}\" --fix",
|
||||||
"lint": "eslint \"**/*.{ts,vue}\"",
|
"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",
|
"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",
|
"start-docker": "docker run --rm -p 5001:5001 --name dockge louislam/dockge:latest",
|
||||||
"mark-as-nightly": "tsx ./extra/mark-as-nightly.ts",
|
"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": {
|
"dependencies": {
|
||||||
"@homebridge/node-pty-prebuilt-multiarch": "~0.11.11",
|
"@homebridge/node-pty-prebuilt-multiarch": "~0.11.11",
|
||||||
|
Reference in New Issue
Block a user