@@ -146,6 +146,10 @@ export default defineComponent({
type: Boolean,
default: false,
},
+ status: {
+ type: String,
+ default: "N/A",
+ }
},
emits: [
],
@@ -156,6 +160,14 @@ export default defineComponent({
},
computed: {
+ bgStyle() {
+ if (this.status === "running") {
+ return "bg-primary";
+ } else {
+ return "bg-secondary";
+ }
+ },
+
terminalRouteLink() {
return {
name: "containerTerminal",
diff --git a/frontend/src/components/Login.vue b/frontend/src/components/Login.vue
index ad90bad..9667d7a 100644
--- a/frontend/src/components/Login.vue
+++ b/frontend/src/components/Login.vue
@@ -71,7 +71,7 @@ export default {
submit() {
this.processing = true;
- this.login(this.username, this.password, this.token, (res) => {
+ this.$root.login(this.username, this.password, this.token, (res) => {
this.processing = false;
if (res.tokenRequired) {
@@ -82,40 +82,6 @@ export default {
});
},
- /**
- * Send request to log user in
- * @param {string} username Username to log in with
- * @param {string} password Password to log in with
- * @param {string} token User token
- * @param {loginCB} callback Callback to call with result
- * @returns {void}
- */
- login(username, password, token, callback) {
-
- this.$root.getSocket().emit("login", {
- username,
- password,
- token,
- }, (res) => {
- if (res.tokenRequired) {
- callback(res);
- }
-
- if (res.ok) {
- this.$root.storage().token = res.token;
- this.$root.socketIO.token = res.token;
- this.$root.loggedIn = true;
- this.$root.username = this.$root.getJWTPayload()?.username;
-
- this.$root.afterLogin();
-
- // Trigger Chrome Save Password
- history.pushState({}, "");
- }
-
- callback(res);
- });
- }
},
};
diff --git a/frontend/src/components/settings/Security.vue b/frontend/src/components/settings/Security.vue
index 2fe4d44..0ece48a 100644
--- a/frontend/src/components/settings/Security.vue
+++ b/frontend/src/components/settings/Security.vue
@@ -64,7 +64,8 @@
-
+
+
{{ $t("Two Factor Authentication") }}
@@ -182,7 +183,7 @@ export default {
this.saveSettings(() => {
this.password.currentPassword = "";
this.$root.username = null;
- this.$root.socket.token = "autoLogin";
+ this.$root.socketIO.token = "autoLogin";
}, this.password.currentPassword);
},
diff --git a/frontend/src/lang/en.json b/frontend/src/lang/en.json
index 3aa0ce2..91ff47d 100644
--- a/frontend/src/lang/en.json
+++ b/frontend/src/lang/en.json
@@ -43,5 +43,6 @@
"addContainer": "Add Container",
"addNetwork": "Add Network",
"disableauth.message1": "Are you sure want to disable authentication?",
- "disableauth.message2": "It is designed for scenarios where you intend to implement third-party authentication in front of Uptime Kuma such as Cloudflare Access, Authelia or other authentication mechanisms."
+ "disableauth.message2": "It is designed for scenarios where you intend to implement third-party authentication in front of Uptime Kuma such as Cloudflare Access, Authelia or other authentication mechanisms.",
+ "passwordNotMatchMsg": "The repeat password does not match."
}
diff --git a/frontend/src/mixins/socket.ts b/frontend/src/mixins/socket.ts
index 21d65bb..42e4698 100644
--- a/frontend/src/mixins/socket.ts
+++ b/frontend/src/mixins/socket.ts
@@ -220,6 +220,40 @@ export default defineComponent({
return undefined;
},
+ /**
+ * Send request to log user in
+ * @param {string} username Username to log in with
+ * @param {string} password Password to log in with
+ * @param {string} token User token
+ * @param {loginCB} callback Callback to call with result
+ * @returns {void}
+ */
+ login(username : string, password : string, token : string, callback) {
+ this.getSocket().emit("login", {
+ username,
+ password,
+ token,
+ }, (res) => {
+ if (res.tokenRequired) {
+ callback(res);
+ }
+
+ if (res.ok) {
+ this.storage().token = res.token;
+ this.socketIO.token = res.token;
+ this.loggedIn = true;
+ this.username = this.getJWTPayload()?.username;
+
+ this.afterLogin();
+
+ // Trigger Chrome Save Password
+ history.pushState({}, "");
+ }
+
+ callback(res);
+ });
+ },
+
/**
* Log in using a token
* @param {string} token Token to log in with
diff --git a/frontend/src/pages/Compose.vue b/frontend/src/pages/Compose.vue
index c7877d1..3d87034 100644
--- a/frontend/src/pages/Compose.vue
+++ b/frontend/src/pages/Compose.vue
@@ -97,6 +97,7 @@
:name="name"
:is-edit-mode="isEditMode"
:first="name === Object.keys(jsonConfig.services)[0]"
+ :status="serviceStatusList[name]"
/>
@@ -201,6 +202,8 @@ services:
let yamlErrorTimeout = null;
+let serviceStatusTimeout = null;
+
export default {
components: {
NetworkInput,
@@ -228,10 +231,12 @@ export default {
stack: {
},
+ serviceStatusList: {},
isEditMode: false,
submitted: false,
showDeleteDialog: false,
newContainerName: "",
+ stopServiceStatusTimeout: false,
};
},
computed: {
@@ -331,8 +336,33 @@ export default {
this.stack.name = this.$route.params.stackName;
this.loadStack();
}
+
+ this.requestServiceStatus();
+ },
+ unmounted() {
+ this.stopServiceStatusTimeout = true;
+ clearTimeout(serviceStatusTimeout);
},
methods: {
+
+ startServiceStatusTimeout() {
+ clearTimeout(serviceStatusTimeout);
+ serviceStatusTimeout = setTimeout(async () => {
+ this.requestServiceStatus();
+ }, 2000);
+ },
+
+ requestServiceStatus() {
+ this.$root.getSocket().emit("serviceStatusList", this.stack.name, (res) => {
+ if (res.ok) {
+ this.serviceStatusList = res.serviceStatusList;
+ }
+ if (!this.stopServiceStatusTimeout) {
+ this.startServiceStatusTimeout();
+ }
+ });
+ },
+
exitConfirm(next) {
if (this.isEditMode) {
if (confirm("You are currently editing a stack. Are you sure you want to leave?")) {
diff --git a/package.json b/package.json
index a12b2d4..f9d1936 100644
--- a/package.json
+++ b/package.json
@@ -33,7 +33,7 @@
"knex": "~2.5.1",
"limiter-es6-compat": "~2.1.2",
"mysql2": "^3.6.3",
- "redbean-node": "0.3.1",
+ "redbean-node": "0.3.2",
"socket.io": "~4.7.2",
"socket.io-client": "~4.7.2",
"timezones-list": "~3.0.2",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 849a631..6651088 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -57,8 +57,8 @@ dependencies:
specifier: ^3.6.3
version: 3.6.3
redbean-node:
- specifier: 0.3.1
- version: 0.3.1(mysql2@3.6.3)
+ specifier: 0.3.2
+ version: 0.3.2(mysql2@3.6.3)
socket.io:
specifier: ~4.7.2
version: 4.7.2
@@ -3491,8 +3491,8 @@ packages:
resolve: 1.22.8
dev: false
- /redbean-node@0.3.1(mysql2@3.6.3):
- resolution: {integrity: sha512-rz71vF7UtJQ14ttZ9I0QuaJ9TOwBCnZb+qHUBiU05f2fLaiQC79liisL3xgkHI8uE9et6HAkG8Z8VPkZbhgxKw==}
+ /redbean-node@0.3.2(mysql2@3.6.3):
+ resolution: {integrity: sha512-39VMxPWPpPicRlU4FSJJnJuUMoxw5/4envFthHtKnLe+3qWTBje3RMrJTFZcQGLruWQ/s2LgeYzdd+d0O+p+uQ==}
dependencies:
'@types/node': 20.3.3
await-lock: 2.2.2