mirror of
				https://github.com/inventree/inventree-app.git
				synced 2025-10-30 21:05:42 +00:00 
			
		
		
		
	Report server instance name
This commit is contained in:
		| @@ -72,8 +72,11 @@ class InvenTreeAPI { | ||||
|   // Authentication token (initially empty, must be requested) | ||||
|   String _token = ""; | ||||
|  | ||||
|   // Server instance information | ||||
|   String instance = ''; | ||||
|  | ||||
|   // Server version information | ||||
|   String _version; | ||||
|   String _version = ''; | ||||
|  | ||||
|   // Getter for server version information | ||||
|   String get version => _version; | ||||
| @@ -174,6 +177,9 @@ class InvenTreeAPI { | ||||
|  | ||||
|     _version = data["version"]; | ||||
|  | ||||
|     // Record the instance name of the server | ||||
|     instance = data['instance'] ?? ''; | ||||
|  | ||||
|     // Request token from the server if we do not already have one | ||||
|     if (_token.isNotEmpty) { | ||||
|       print("Already have token - $_token"); | ||||
|   | ||||
| @@ -61,6 +61,10 @@ class _InvenTreeSettingsState extends State<InvenTreeSettingsWidget> { | ||||
|                 title: Text("Server Version"), | ||||
|                 subtitle: Text(InvenTreeAPI().version.isNotEmpty ? InvenTreeAPI().version : "Not connected"), | ||||
|               ), | ||||
|               ListTile( | ||||
|                 title: Text("Server Instance"), | ||||
|                 subtitle: Text(InvenTreeAPI().instance.isNotEmpty ? InvenTreeAPI().instance : "Not connected"), | ||||
|               ), | ||||
|               Divider(), | ||||
|               ListTile( | ||||
|                 title: Text("App Name"), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user