Skip to content

Commit

Permalink
Fix build and add styles to template
Browse files Browse the repository at this point in the history
  • Loading branch information
romanrizzi committed Jul 2, 2024
1 parent c380ee9 commit 2a9d1f3
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h3>{{i18n "antivirus.stats.title"}}</h3>
</div>

<table>
<table class="antivirus-stats__table">
<thead>
<tr>
<th>{{i18n "antivirus.version"}}</th>
Expand All @@ -22,7 +22,11 @@
</tbody>
</table>

<table>
<div class="antivirus-stats__sub-header">
<h4>{{i18n "antivirus.stats.data"}}</h4>
</div>

<table class="antivirus-stats__table">
<thead>
<tr>
<th>{{i18n "antivirus.stats.total_scans"}}</th>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ export default {
path: "/plugins",

map() {
this.route(
"discourse-antivirus-stats",
{ path: "stats" }
);
this.route("discourse-antivirus-stats", { path: "stats" });
},
};
9 changes: 9 additions & 0 deletions assets/stylesheets/antivirus-stats.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.antivirus-stats {
&__sub-header {
margin-top: 15px;
}

&__header {
margin-bottom: 5px;
}
}
1 change: 1 addition & 0 deletions config/locales/client.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ en:

stats:
title: Stats
data: Scan results
total_scans: Scanned Files
recently_scanned: Recently Scanned
quarantined: Quarantined
Expand Down
1 change: 1 addition & 0 deletions plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
enabled_site_setting :discourse_antivirus_enabled

register_asset "stylesheets/reviewable-upload.scss"
register_asset "stylesheets/antivirus-stats.scss"

module ::DiscourseAntivirus
PLUGIN_NAME = "discourse-antivirus"
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/discourse_antivirus/background_scan_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def create_scanned_upload(database_version: db_version, next_scan_at: nil)
end

def get_stats(stat)
build_scanner.stats.dig(:background_scan_stats, stat)
build_scanner.stats.dig(:stats, stat)
end

def create_scanned_upload(updated_at: 6.hours.ago, quarantined: false, scans: 0)
Expand Down

0 comments on commit 2a9d1f3

Please sign in to comment.