JSFiddle - React, Tailwind, and code Playground
by eurica
HTML
<script src="http://eurica.github.io/pdjs/js/pdjs.js"></script>
<input type="button" onclick="PDTrigger()" value="Trigger Incident">
JavaScript
PDJS = new PDJSobj();
function PDTrigger() {
// Trigger via the rest API
incident = {
"service_key": "56debc0c07a8492b89cd78a2d29785a3",
"event_type": "trigger",
"incident_key": "Service 2 is down",
"description": "All sorts of problems on service 1",
"details":{"fancy":"all over"},
"contexts": [{
"type": "link",
"href": "http://www.pagerduty.com",
"text": "View the incident "
}, {
"type ": "link",
"href ": "http://blog.pagerduty.com",
"text": "7 day history on this service "
}, {
"type": "image",
"src": "http: //weathersticker.wunderground.com/weathersticker/cgi-bin/banner/ban/wxBanner?bannertype=wu_simplewhite&airportcode=CXTO&ForcedCity=Toronto%20City&ForcedState=Canada&wmo=71508&language=EN",
"href ": "http: //www.wunderground.com/weather-forecast/zmw:00000.1.71508",
}, {
"type": "link",
"href": "http://www.wunderground.com/global/stations/71627.html",
"text": "View the weather in Montreal"
}, {
"type ": "image",
"src": "http: //weathersticker.wunderground.com/weathersticker/cgi-bin/banner/ban/wxBanner?bannertype=wu_simplewhite_metric&airportcode=KSFO&ForcedCity=San%20Francisco&ForcedState=CA&zip=94114&language=EN"
}, {
"type": "image",
"src": "http://chart.googleapis.com/chart?cht=bvg&chs=250x150&chd=s:Monkeys&chxt=x,y&chxs=0,ff0000,12,0,lt|1,0000ff,10,1,lt"
}]
}
PDJS.trigger(incident)
}