Explorar el Código

unetd: cli: fix editing service config attributes

They must be set on the config object instead of the main service object

Signed-off-by: Felix Fietkau <[email protected]>
Felix Fietkau hace 9 meses
padre
commit
228eb7f62a
Se han modificado 1 ficheros con 10 adiciones y 0 borrados
  1. 10 0
      package/network/services/unetd/files/unet.uc

+ 10 - 0
package/network/services/unetd/files/unet.uc

@@ -937,6 +937,12 @@ function is_vxlan_service(ctx, argv, named, spec)
 	return type == "vxlan";
 }
 
+function get_config_object(ctx, spec, obj, argv)
+{
+	obj.config ??= {};
+	return obj.config;
+}
+
 const service_editor = {
 	change_cb: function(ctx, argv) {
 		ctx.data.netdata.changed = true;
@@ -964,6 +970,7 @@ const service_editor = {
 			help: "VXLAN ID",
 			attribute: "id",
 			available: is_vxlan_service,
+			get_object: get_config_object,
 			args: {
 				type: "int",
 				min: 0,
@@ -974,6 +981,7 @@ const service_editor = {
 			help: "VXLAN port",
 			attribute: "port",
 			available: is_vxlan_service,
+			get_object: get_config_object,
 			args: {
 				type: "int",
 				min: 1,
@@ -984,6 +992,7 @@ const service_editor = {
 			help: "VXLAN tunnel MTU",
 			attribute: "mtu",
 			available: is_vxlan_service,
+			get_object: get_config_object,
 			args: {
 				type: "int",
 				min: 1280,
@@ -994,6 +1003,7 @@ const service_editor = {
 			help: "Member allowed to receive broad-/multicast and unknown unicast",
 			attribute: "forward_ports",
 			available: is_vxlan_service,
+			get_object: get_config_object,
 			multiple: true,
 			args: {
 				type: "enum",