Browse Source

tweak device display table when no devices are configured

Mark deVilliers 2 years ago
parent
commit
2618a07d57
2 changed files with 34 additions and 27 deletions
  1. 30 26
      ui/node.js
  2. 4 1
      ui/src/Node.elm

+ 30 - 26
ui/node.js

@@ -14467,30 +14467,23 @@ var _user$project$Node$drawDevices = function (d) {
14467 14467
 var _user$project$Node$devicesTable = function (model) {
14468 14468
 	var _p4 = model.devices;
14469 14469
 	if (_p4.ctor === 'Nothing') {
14470
-		return _elm_lang$html$Html$text('No devices running');
14470
+		return _elm_lang$html$Html$text('No devices configured.');
14471 14471
 	} else {
14472
-		return _rundis$elm_bootstrap$Bootstrap_Table$simpleTable(
14473
-			{
14474
-				ctor: '_Tuple2',
14475
-				_0: _rundis$elm_bootstrap$Bootstrap_Table$simpleThead(
14476
-					{
14477
-						ctor: '::',
14478
-						_0: A2(
14479
-							_rundis$elm_bootstrap$Bootstrap_Table$th,
14480
-							{ctor: '[]'},
14481
-							{
14482
-								ctor: '::',
14483
-								_0: _elm_lang$html$Html$text('Device'),
14484
-								_1: {ctor: '[]'}
14485
-							}),
14486
-						_1: {
14472
+		if (_p4._0.ctor === '[]') {
14473
+			return _elm_lang$html$Html$text('No devices configured.');
14474
+		} else {
14475
+			return _rundis$elm_bootstrap$Bootstrap_Table$simpleTable(
14476
+				{
14477
+					ctor: '_Tuple2',
14478
+					_0: _rundis$elm_bootstrap$Bootstrap_Table$simpleThead(
14479
+						{
14487 14480
 							ctor: '::',
14488 14481
 							_0: A2(
14489 14482
 								_rundis$elm_bootstrap$Bootstrap_Table$th,
14490 14483
 								{ctor: '[]'},
14491 14484
 								{
14492 14485
 									ctor: '::',
14493
-									_0: _elm_lang$html$Html$text('Type'),
14486
+									_0: _elm_lang$html$Html$text('Device'),
14494 14487
 									_1: {ctor: '[]'}
14495 14488
 								}),
14496 14489
 							_1: {
@@ -14500,18 +14493,29 @@ var _user$project$Node$devicesTable = function (model) {
14500 14493
 									{ctor: '[]'},
14501 14494
 									{
14502 14495
 										ctor: '::',
14503
-										_0: _elm_lang$html$Html$text('Description'),
14496
+										_0: _elm_lang$html$Html$text('Type'),
14504 14497
 										_1: {ctor: '[]'}
14505 14498
 									}),
14506
-								_1: {ctor: '[]'}
14499
+								_1: {
14500
+									ctor: '::',
14501
+									_0: A2(
14502
+										_rundis$elm_bootstrap$Bootstrap_Table$th,
14503
+										{ctor: '[]'},
14504
+										{
14505
+											ctor: '::',
14506
+											_0: _elm_lang$html$Html$text('Description'),
14507
+											_1: {ctor: '[]'}
14508
+										}),
14509
+									_1: {ctor: '[]'}
14510
+								}
14507 14511
 							}
14508
-						}
14509
-					}),
14510
-				_1: A2(
14511
-					_rundis$elm_bootstrap$Bootstrap_Table$tbody,
14512
-					{ctor: '[]'},
14513
-					_user$project$Node$drawDevices(_p4._0))
14514
-			});
14512
+						}),
14513
+					_1: A2(
14514
+						_rundis$elm_bootstrap$Bootstrap_Table$tbody,
14515
+						{ctor: '[]'},
14516
+						_user$project$Node$drawDevices(_p4._0))
14517
+				});
14518
+		}
14515 14519
 	}
14516 14520
 };
14517 14521
 var _user$project$Node$subscriptions = function (model) {

+ 4 - 1
ui/src/Node.elm

@@ -330,7 +330,10 @@ devicesTable : Model -> Html Msg
330 330
 devicesTable model =
331 331
     case model.devices of
332 332
         Nothing ->
333
-            text "No devices running"
333
+            text "No devices configured."
334
+
335
+        Just [] ->
336
+            text "No devices configured."
334 337
 
335 338
         Just d ->
336 339
             Table.simpleTable