Skip to content

Commit

Permalink
Add handlebar samples
Browse files Browse the repository at this point in the history
  • Loading branch information
lildude authored Sep 27, 2024
1 parent e977096 commit f3e1e0a
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
34 changes: 34 additions & 0 deletions samples/Handlebars/html.hb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{!-- Generate a simple HTML report --}}
<html>
<head>
<title>System Summary</title>
<style type="text/css">
body {
font-family: "Courier New", Courier, monospace;
}
</style>
</head>
<body>
<h1>System Summary</h1>
<p>Generated at {{ctime}}</p>

{{#servers}}
<h2>{{name}}</h2>
{{#inspectors}}{{#alarms}}
{{name}}: {{fired}}<br/>
{{/alarms}}{{/inspectors}}
{{#inspectors}}
<h3>{{name}}</h3>
<p>Type: {{type}}</p>

<p><pre>{{{text}}}</pre></p>
{{/inspectors}}
<hr />
{{/servers}}

<p>
Generated by <a href="http://sshsysmon.zdyn.net/">SshSysMon</a>
</p>

</body>
</html>
16 changes: 16 additions & 0 deletions samples/Handlebars/node.js.hb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
var exec = require('child_process').exec;

exec('{{escapeBackslashes command}}{{#if task}} {{escapeBackslashes task}}{{/if}}{{#if args}} {{{escapeBackslashes args}}}{{/if}}', {
cwd: '{{escapeBackslashes gruntfileDirectory}}'
}, function (err, stdout, stderr) {

var exitCode = 0;
if (err) {
console.log(stderr || err);
exitCode = -1;
}{{#unless preventExit}}

process.exit(exitCode);{{/unless}}
}).stdout.on('data', function (chunk){
process.stdout.write(chunk);
});

0 comments on commit f3e1e0a

Please sign in to comment.