manman-sync node_id -> location_id
This commit is contained in:
		
							parent
							
								
									c5ccdf15f8
								
							
						
					
					
						commit
						46f58256e9
					
				@ -13,5 +13,5 @@ end
 | 
			
		||||
if not msg then return end
 | 
			
		||||
 | 
			
		||||
renderer.render_string(msg, {
 | 
			
		||||
	location_id = uci:get('gluon-manman-sync', 'sync', 'node_id')
 | 
			
		||||
	location_id = uci:get('gluon-manman-sync', 'sync', 'location_id')
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
@ -20,10 +20,10 @@ return function(form, uci)
 | 
			
		||||
 | 
			
		||||
	local id = s:option(Value, 'manman_id', pkg_i18n.translate('ManMan location ID'))
 | 
			
		||||
	id:depends(manman, true)
 | 
			
		||||
	id.default = uci:get('gluon-manman-sync', 'sync', 'node_id')
 | 
			
		||||
	id.default = uci:get('gluon-manman-sync', 'sync', 'location_id')
 | 
			
		||||
	id.datatype = 'uinteger'
 | 
			
		||||
	function id:write(data)
 | 
			
		||||
		uci:set('gluon-manman-sync', 'sync', 'node_id', data)
 | 
			
		||||
		uci:set('gluon-manman-sync', 'sync', 'location_id', data)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	function s:write()
 | 
			
		||||
 | 
			
		||||
@ -50,7 +50,7 @@ static struct json_object * get_autoupdater(void) {
 | 
			
		||||
 | 
			
		||||
	struct json_object *ret = json_object_new_object();
 | 
			
		||||
 | 
			
		||||
	json_object_object_add(ret, "node_id", gluonutil_wrap_string(uci_lookup_option_string(ctx, s, "node_id")));
 | 
			
		||||
	json_object_object_add(ret, "location_id", gluonutil_wrap_string(uci_lookup_option_string(ctx, s, "location_id")));
 | 
			
		||||
 | 
			
		||||
	const char *enabled = uci_lookup_option_string(ctx, s, "enabled");
 | 
			
		||||
	json_object_object_add(ret, "enabled", json_object_new_boolean(enabled && !strcmp(enabled, "1")));
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user