2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-28 05:26:47 +00:00

Report server instance name

This commit is contained in:
Oliver Walters 2020-04-06 22:19:43 +10:00
parent 948c9c1d23
commit 0e35c370ba
2 changed files with 11 additions and 1 deletions

View File

@ -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");

View File

@ -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"),