Answer by sammydc is correct.. adding few more info based on my experience (I am using dashing for the first time today) while creating a new widget (name = xzryryrk):
Run this command to create a new widget:
dashing generate widget xzryryrk
Output:
widgets/xzryryrk/xzryryrk.html
widgets/xzryryrk/xzryryrk.scss
widgets/xzryryrk/xzryryrk.coffee
Edit 'xzryryrk.coffee' to add code mentioned by sammydc in above post but keep in mind the space and tabs. Dashing is based on language which is space and tab sensitive.
Edit 'xzryryrk.scss' : By default new widget does not have any css configuration, You need to add following css (Edit name as per your reqirement):
$background-color: #47bbb3;
$title-color: rgba(255, 255, 255, 0.7);
$moreinfo-color: rgba(255, 255, 255, 0.7);
// ----------------------------------------------------------------------------
// Widget-text styles
// ----------------------------------------------------------------------------
.widget-xzryryrk {
background-color: $background-color;
.title {
color: $title-color;
}
.more-info {
color: $moreinfo-color;
}
.updated-at {
color: rgba(255, 255, 255, 0.7);
}
&.large h3 {
font-size: 65px;
}
}
Edit 'xzryryrk.html' : by default it is also blank. Add following:
<h1 class="title" data-bind="title"></h1>
<h3 data-bind="text"></h3>
<p class="more-info" data-bind="moreinfo"></p>
<p class="updated-at" data-bind="updatedAtMessage"></p>
And finally , Edit your erb file in (probably /dashing/dashboards/sample.erb)
`<li data-row="1" data-col="1" data-sizex="2" data-sizey="1">
<div data-id="xzryryrk" data-view="Xzryryrk" data-title="Hello" data-text="This is your shiny new dashboard." data-moreinfo="Protip: You can drag the widgets around!"></div>
</li>`
Now you can use CURL like this :
`curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "title":"XXX" ,"status": "FAIL" ,"text":"FAIL"}' http://X.X.X.X:8082/widgets/xzryryrk`