Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Template.incidentsWrapper.onCreated(function() {
- this.subscribe('currentSnapshot');
- });
- Template.incidents.onCreated(function() {
- var instance = this;
- // Set incident data here
- incident = Snapshots.findOne();
- instance.data.incident = incident;
- });
- Template.incidents.onRendered(function() {
- var instance = this;
- console.log(this.data.incident);
- this.$('.incidents-page').fadeIn();
- this.$('.badges-wrapper').height($('.badges').height());
- this.$('.badges').affix({
- offset: {
- top: 10,
- bottom: 0
- }
- });
- // console.log(this.data.incident.active_incidents);
- $('#incidentsTable').DataTable({
- responsive: true,
- select: true,
- data: instance.data.incident.active_incidents,
- columns: [
- { data: 'incident_id', title: 'Incident ID' },
- { data: 'incident_type', title: 'Type' },
- { data: 'incident_source', title: 'Source' },
- { data: 'associated_alarms', title: 'Associated Alarm IDs' },
- { data: 'incident_regions', title: 'Regions' },
- { data: 'bounce_count', title: 'Bounce/Flap Count' },
- { data: 'incident_raise_time', title: 'Timestamp', name: 'date' }
- ],
- "columnDefs": [
- {
- "targets": [6],
- "render": function( data, type, row ) {
- return moment(data, 'X').format('YYYY-MM-DD hh:mm:ss');
- }
- }
- ],
- dom: '<"incidents-table"<"col-sm-6"B><"col-sm-6"f>rt<"col-sm-6"i><"col-sm-6"p>>',
- buttons: {
- buttons: [
- { extend: 'copyHtml5', className: 'btn-primary btn-xs' },
- { extend: 'csvHtml5', className: 'btn-primary btn-xs', filename: 'active_incidents' }
- ]
- },
- "language": {
- "search": "Filter <i class=\"fa fa-filter\" aria-hidden=\"true\"></i>",
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement