Skip to content

Commit

Permalink
Fixed layouts not loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Dec 15, 2024
1 parent c72c50b commit 4a5f6a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions lib/pages/dashboard_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ class _DashboardPageState extends State<DashboardPage> with WindowListener {
ntConnection: widget.ntConnection,
preferences: widget.preferences,
onTabChanged: (tab) {
_showShuffleboardWarningMessage();
int? parsedTabIndex = int.tryParse(tab);

bool isIndex = parsedTabIndex != null;
Expand Down Expand Up @@ -651,12 +650,22 @@ class _DashboardPageState extends State<DashboardPage> with WindowListener {
TabGridModel existingTab =
_tabData.firstWhere((tab) => tab.name == tabName).tabGrid;
existingTab.mergeFromJson(
jsonData: tabJson,
jsonData: tabJson['grid_layout'],
onJsonLoadingWarning: _showJsonLoadingWarning,
);
}
}

_showNotification(
title: 'Successfully Downloaded Layout',
message: 'Remote layout has been successfully downloaded and merged!',
color: const Color(0xff01CB67),
icon: const Icon(Icons.error, color: Color(0xff01CB67)),
width: 350,
);

setState(() {});

return true;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/services/elastic_layout_downloader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ElasticLayoutDownloader {
String robotIP =
preferences.getString(PrefKeys.ipAddress) ?? Defaults.ipAddress;
Uri robotUri = Uri.parse(
'http://$robotIP:5800/elastic_layout.json',
'http://$robotIP:5800/elastic-layout.json',
);
Response response;
try {
Expand All @@ -34,7 +34,7 @@ class ElasticLayoutDownloader {
if (response.statusCode < 200 || response.statusCode >= 300) {
String errorMessage = switch (response.statusCode) {
404 =>
'File "elastic_layout.json" was not found, ensure that you have deployed a file named "elastic_layout.json" in the deploy directory',
'File "elastic-layout.json" was not found, ensure that you have deployed a file named "elastic_layout.json" in the deploy directory',
_ => 'Request returned status code ${response.statusCode}',
};

Expand Down

0 comments on commit 4a5f6a5

Please sign in to comment.