Commits

Jarrod Funnell committed 4f84930

Added handy tooltips to webui. Made it display device name to avoid confusion

  • Participants
  • Parent commits b0a9cdd

Comments (0)

Files changed (4)

File conf/Example.yml

+name: ASL Thermometer
 id: 920120
 module: Device::ASLF250
 interface: /dev/ttyUSB0

File conf/dummy.yml

-id: asdf
+name: Dummy Module
+id: asdf01
 module: Device::Test
-active: 1
-interface: 'None'
+interface: 'None'
+active: 1

File webmin/templates/layouts/default.html.ep

 		<style>
 			body { padding-top:5px; }
 		</style>
-		<link href="/css/bootstrap-responsive.css" rel="stylesheet">
+		<link href="/css/bootstrap-responsive.min.css" rel="stylesheet">
 		<script src="/js/jquery.js"></script>
 	</head>
 	<body>
 	<div class="container-fluid">
 	<div class="row-fluid">
 	
-	<!--div class="span3">
-	<div class="well sidebar-nav">
-	%= include 'layouts/navbar'
-	</div>
-	</div-->
-	
 	<%= content %>
 	
 	</div>
 	</div>
+	
+	<script src="/js/bootstrap.min.js"></script>
+	<script type="text/javascript">
+		$(".has-tooltip").tooltip();
+	</script>
+
 	</body>
 </html>

File webmin/templates/status/overview.html.ep

 	% $ff = !$ff;
 	%== '<div class="row-fluid">' if ($ff)
 	<div class="span6 alert <%== "alert-success" if $device->{active} %>">
-		<h2 class="pagination-centered">Device <%= $device->{id} %><br>
-			<small>
-				Status: <%= $device->{active} ? "Enabled" : "Disabled" %>
-			</small>
-		</h2>
+		<div class="page-header pagination-centered">
+			<h2><%= $device->{name} %></h2>
+			<h2>
+				<small>
+					ID: <%= $device->{id} %>
+				</small>
+				<br>
+				<small>
+					Status: 
+				</small>
+				<a 
+					id="<%= $device->{id} %>-toggle-active" 
+					class="btn btn-inverse has-tooltip"
+					href="#"
+					data-original-title="<%= $device->{active} ? "Click to unload" : "Click to load" %>"
+				>
+					<%= $device->{active} ? "Loaded" : "Unloaded" %> 
+				</a>
+			</h2>
+		</div>
 
-		<dl class="dl-horizontal">
-			<dt>Module:</dt>
-			<dd><input type="text" value="<%== $device->{module} %>" data-provide="typeahead"></dd>
-			<dt>Interface:</dt>
-			<dd><input type="text" value="<%== $device->{interface} %>" data-provide="typeahead"></dd>
-		</dl>
+		<div class="form-horizontal">
+		<div class="control-group">
+			<label class="control-label" for="<%== $device->{id}."-modinput" %>">
+				Module
+			</label>
+			<div class="controls">
+				<input id="<%== $device->{id}."-modinput" %>" type="text" value="<%== $device->{module} %>">
+			</div>
+		</div>
+		<div class="control-group">
+			<label class="control-label" for="<%== $device->{id}."-interface-input" %>">
+				Interface
+			</label>
+			
+			<div class="controls">
+				<input id="<%== $device->{id}."-interface-input" %>" type="text" value="<%== $device->{interface} %>">
+			</div>
+		</div>
+		</div>
 	</div>
 	%== '</div>' if (!$ff);
 % }