mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-14 03:56:24 +00:00
Report server instance name
This commit is contained in:
parent
948c9c1d23
commit
0e35c370ba
2 changed files with 11 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue