Repository: louislam/uptime-kuma
File: src/pages/EditMonitor.vue (Vue)

Code before:
                }
            }

            // Set default port for DNS if not already defined
            if (! this.monitor.port || this.monitor.port === "53" || this.monitor.port === "1812") {
                if (this.monitor.type === "dns") {
                    this.monitor.port = "53";
                } else if (this.monitor.type === "radius") {
                    this.monitor.port = "1812";
                } else if (this.monitor.type === "snmp") {
                    this.monitor.port = "161";
                } else {
                    this.monitor.port = undefined;
                }
            }

            if (this.monitor.type === "snmp") {
                // snmp is not expected to be executed via the internet => we can choose a lower default timeout
                this.monitor.timeout = 5;
            } else {
                this.monitor.timeout = 48;
            }

            // Set default SNMP version
            if (!this.monitor.snmpVersion) {
                this.monitor.snmpVersion = "1";
            }

            // Set default jsonPath
            if (!this.monitor.jsonPath) {
                this.monitor.jsonPath = "$";
            }

            // Set default condition for for jsonPathOperator
            if (!this.monitor.jsonPathOperator) {
                this.monitor.jsonPathOperator = "==";
            }

            // Get the game list from server
            if (this.monitor.type === "gamedig") {
                this.$root.getSocket().emit("getGameList", (res) => {
                    if (res.ok) {
                        this.gameList = res.gameList;
                    } else {
                        this.$root.toastError(res.msg);
                    }
                });
            }

            // Set default database connection string if empty or it is a template from another database monitor type
            for (let monitorType in this.connectionStringTemplates) {

Review comment (suggestion):
in the database this defaults to `2c` but here to `1`.
Lets keep only one default:
```suggestion
                this.monitor.snmpVersion = "2c";
```

Code after:
                }
            }

            // Set default port for DNS if not already defined
            if (! this.monitor.port || this.monitor.port === "53" || this.monitor.port === "1812") {
                if (this.monitor.type === "dns") {
                    this.monitor.port = "53";
                } else if (this.monitor.type === "radius") {
                    this.monitor.port = "1812";
                } else if (this.monitor.type === "snmp") {
                    this.monitor.port = "161";
                } else {
                    this.monitor.port = undefined;
                }
            }

            if (this.monitor.type === "snmp") {
                // snmp is not expected to be executed via the internet => we can choose a lower default timeout
                this.monitor.timeout = 5;
            } else {
                this.monitor.timeout = 48;
            }

            // Set default SNMP version
            if (!this.monitor.snmpVersion) {
                this.monitor.snmpVersion = "2c";
            }

            // Set default jsonPath
            if (!this.monitor.jsonPath) {
                this.monitor.jsonPath = "$";
            }

            // Set default condition for for jsonPathOperator
            if (!this.monitor.jsonPathOperator) {
                this.monitor.jsonPathOperator = "==";
            }

            // Get the game list from server
            if (this.monitor.type === "gamedig") {
                this.$root.getSocket().emit("getGameList", (res) => {
                    if (res.ok) {
                        this.gameList = res.gameList;
                    } else {
                        this.$root.toastError(res.msg);
                    }
                });
            }

            // Set default database connection string if empty or it is a template from another database monitor type
            for (let monitorType in this.connectionStringTemplates) {