Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    
    <title id="title">Splout SQL Panel - Dnode</title>
    
    <script src="js/jquery.js"></script>
    <script src="js/jquery-jtemplates.js"></script>
    <script src="js/panel.js"></script>
    <!-- Bootstrap -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <script src="js/bootstrap.min.js"></script>
    <style>
      body {
        padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
      }
    </style>
    
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    
    <!-- <link rel=stylesheet href="style.css" type="text/css" media=screen> -->
     
    <script>
			var dnodeEnc = $.urlParam("dnode");
			var dnode = decodeURIComponent(dnodeEnc);
			    	
			$("#title").html("Splout SQL Panel - DNode "+ dnode);
    
    	$.getJSON('/api/dnode/' + dnodeEnc + '/status',
  			function(data) {
    			$("#pageTitle").html("DNode " + dnode);
    					
					$('#dnode').setTemplateElement("dnodesTemplate");
					$('#dnode').processTemplate(data);
					
					$('#files').setTemplateElement("filesTemplate");
					$('#files').processTemplate(data.files);				

  			}
  		);
    </script>
  </head>
  <body>
  
	  <!-- DNode Properties TEMPLATE -->
		<textarea id="dnodesTemplate" style="display:none">		
			<table class="table table-striped table-condensed table-bordered">
				<tbody>
					{#foreach $T as property}
					{#if $T.property$key == 'files'}{#continue}{#/if}								
					
					<tr>
						<td>{$T.property$key}</td>
						<td>
							{#if $T.property$key == 'upSince'}
								{new Date($T.property)}
							{#else}
								{$T.property}
							{#/if}
						</td>
					</tr>
					{#/for}
				</tbody>
			</table>
		</textarea>
  
	  <!-- DNode files TEMPLATE -->
		<textarea id="filesTemplate" style="display:none">		
			<table class="table table-striped table-condensed table-bordered">
				<tbody>
					{#foreach $T as file}													
					<tr>
						<td>
							{cut($T.file, 130)}
						</td>
					</tr>
					{#/for}
				</tbody>
			</table>
		</textarea>
  
    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </a>
          <div class="brand">Splout SQL Panel</div>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li><a href="/">Status & Stats</a></li>
              <li><a href="console.html">Query Console</a></li>
            </ul>
          	<p class="navbar-text pull-right"><a href="javascript:history.go(0)" rel="tooltip" title="Refresh page"><i class="icon-refresh"></i></a></p>            
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>
  
  	<div class="container">
  	  <div class="page-header"><h2 id="pageTitle"></h2></div>
  	  			
			<!--  DNode properties -->
			<div>
			  <h3>DNode Properties</h3>
				<div id="dnode">					
				</div>
			</div>
				
			<!-- DNode files -->
			<div>
				<h3>DNode files</h3>
				<div id="files">					
				</div>
			</div>
				
			
			<div id="footer"><hr />Splout SQL 0.1</div>
			
		</div>
  </body>
</html>
New to GrepCode? Check out our FAQ X