-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #368 from fablabbcn/device-error-logging
Device error logging
- Loading branch information
Showing
9 changed files
with
162 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class IngestError < ActiveRecord::Base | ||
belongs_to :device | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta name="viewport" content="width=device-width" /> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<title>Device has errrors</title> | ||
<%= render "email_css" %> | ||
</head> | ||
|
||
<body itemscope itemtype="http://schema.org/EmailMessage"> | ||
|
||
<table class="body-wrap"> | ||
<tr> | ||
<td></td> | ||
<td class="container" width="600"> | ||
<div class="content"> | ||
<table class="main" width="100%" cellpadding="0" cellspacing="0"> | ||
<tr> | ||
<td class="alert alert-warning"> | ||
<h3 class="mail-title"> | ||
<img class="text-white" src="https://fablabbcn.github.io/assets/images/sck_logo_box.png" alt="SCK logo"> | ||
</h3> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="content-wrap"> | ||
<table width="100%" cellpadding="0" cellspacing="0"> | ||
<tr> | ||
<td class="content-block"> | ||
<h2 class="corporate-text-color"><%= @user.username %>,</h2> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="content-block"> | ||
<p class="corporate-text-color"> | ||
We have encountered errors on processing data from the | ||
<a href="https://smartcitizen.me/kits/<%= @device.id %>" class="">device '<%= @device %>'</a>. | ||
</p> | ||
<p> | ||
If these errors persist, you may want to <a href="https://docs.smartcitizen.me/Guides/firmware/Update%20the%20firmware/">update the device firmware</a>, or <a href="mailto:support@smartcitizen.me">get in touch with our support team</a>. | ||
</p> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="content-block"> | ||
<a href="https://smartcitizen.me/kits/<%= @device.id %>/edit" class="btn-primary">Manage your notifications</a> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td class="content-block"> | ||
<p class="corporate-text-color">The Smart Citizen Team</p> | ||
</td> | ||
</tr> | ||
</table> | ||
</td> | ||
</tr> | ||
</table> | ||
|
||
</div> | ||
</td> | ||
<td></td> | ||
</tr> | ||
</table> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class CreateDeviceIngestErrors < ActiveRecord::Migration[6.1] | ||
def change | ||
create_table :ingest_errors do |t| | ||
t.references :device, null: false, foreign_key: true | ||
t.text :topic | ||
t.text :message | ||
t.text :error_class | ||
t.text :error_message | ||
t.text :error_trace | ||
t.timestamps | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters