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