-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use actioncable to track indexing progress
- Loading branch information
Showing
23 changed files
with
1,334 additions
and
120 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,6 @@ | ||
# frozen_string_literal: true | ||
|
||
module ApplicationCable | ||
class Channel < ActionCable::Channel::Base | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# frozen_string_literal: true | ||
|
||
module ApplicationCable | ||
class Connection < ActionCable::Connection::Base | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
# Channel for receiving indexing progress | ||
class ProgressChannel < ApplicationCable::Channel | ||
def subscribed | ||
stream_from 'progress_channel' | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<div data-behavior='progress-panel' data-exhibit-id="<%= exhibit.id %>"> | ||
<div class="card index-status border-info mb-3"> | ||
<h3 class="card-header bg-info text-white h4"><%= t("#{translation_field}.heading") %></h3> | ||
<div class="card-body"> | ||
<p data-behavior='monitor-start'> | ||
<span class="text-muted" data-behavior='date'></span> <%= t("#{translation_field}.begin_html") %> | ||
</p> | ||
|
||
<% if I18n.exists?("#{translation_field}.current_html") %> | ||
<p data-behavior='monitor-current'> | ||
<span class="text-muted" data-behavior='date'></span> <%= t("#{translation_field}.current_html") %> | ||
</p> | ||
<% end %> | ||
<% if I18n.exists?("#{translation_field}.completed_html") %> | ||
<p data-behavior='monitor-completed'> | ||
<span class="text-muted" data-behavior='date'></span> <%= t("#{translation_field}.completed_html") %> | ||
</p> | ||
<% end %> | ||
|
||
<p class="bg-warning" data-behavior='monitor-error' style='display:none;'> | ||
<%= t("#{translation_field}.error") %> | ||
</p> | ||
|
||
<div class="progress"> | ||
<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="" aria-valuemin="0" aria-valuemax=""></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module Spotlight | ||
# Renders progress bar html which is updated by progress_monitor.js | ||
class ProgressBarComponent < ViewComponent::Base | ||
attr_reader :exhibit, :translation_field | ||
|
||
def initialize(exhibit:, translation_field:) | ||
@exhibit = exhibit | ||
@translation_field = translation_field | ||
super | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Action Cable provides the framework to deal with WebSockets in Rails. | ||
// You can generate new channels where WebSocket features live using the `bin/rails generate channel` command. | ||
|
||
import { createConsumer } from "@rails/actioncable" | ||
|
||
export default createConsumer() |
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 @@ | ||
// Import all the channels to be used by Action Cable |
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 was deleted.
Oops, something went wrong.
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
19 changes: 0 additions & 19 deletions
19
app/views/spotlight/catalog/_reindex_progress_panel.html.erb
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
development: | ||
adapter: async | ||
|
||
production: | ||
adapter: redis | ||
url: redis://localhost:6379/1 | ||
channel_prefix: myapp_production |
Oops, something went wrong.