tailwind updates, inkbunny listing stuff
This commit is contained in:
@@ -9,3 +9,4 @@ function install_extension() {
|
||||
install_extension Shopify.ruby-extensions-pack
|
||||
install_extension dbaeumer.vscode-eslint
|
||||
install_extension aliariff.vscode-erb-beautify
|
||||
install_extension bradlc.vscode-tailwindcss
|
||||
6
Gemfile
6
Gemfile
@@ -61,7 +61,6 @@ end
|
||||
group :development, :staging do
|
||||
# Use console on exceptions pages [https://github.com/rails/web-console]
|
||||
gem 'htmlbeautifier'
|
||||
gem 'rails_live_reload'
|
||||
gem 'rufo', require: false
|
||||
gem 'web-console'
|
||||
|
||||
@@ -124,7 +123,6 @@ group :production do
|
||||
gem 'sd_notify'
|
||||
end
|
||||
|
||||
gem 'tailwindcss-rails', '~> 2.0'
|
||||
|
||||
gem 'rack-cors'
|
||||
gem 'react_on_rails'
|
||||
@@ -132,3 +130,7 @@ gem 'sanitize'
|
||||
gem 'shakapacker'
|
||||
|
||||
gem "syntax_tree", "~> 6.2"
|
||||
gem "cssbundling-rails", "~> 1.4"
|
||||
gem 'tailwindcss-rails', '~> 3.0'
|
||||
|
||||
|
||||
|
||||
71
Gemfile.lock
71
Gemfile.lock
@@ -91,7 +91,7 @@ GEM
|
||||
debug_inspector (>= 0.0.1)
|
||||
bootsnap (1.16.0)
|
||||
msgpack (~> 1.2)
|
||||
builder (3.2.4)
|
||||
builder (3.3.0)
|
||||
capybara (3.38.0)
|
||||
addressable
|
||||
matrix
|
||||
@@ -112,6 +112,8 @@ GEM
|
||||
concurrent-ruby (= 1.3.4)
|
||||
connection_pool (2.4.0)
|
||||
crass (1.0.6)
|
||||
cssbundling-rails (1.4.1)
|
||||
railties (>= 6.0.0)
|
||||
curb (1.0.5)
|
||||
daemons (1.4.1)
|
||||
date (3.3.3)
|
||||
@@ -128,14 +130,14 @@ GEM
|
||||
numo-narray
|
||||
domain_name (0.5.20190701)
|
||||
unf (>= 0.0.5, < 1.0.0)
|
||||
erubi (1.12.0)
|
||||
erubi (1.13.0)
|
||||
et-orbi (1.2.11)
|
||||
tzinfo
|
||||
execjs (2.8.1)
|
||||
faiss (0.2.5)
|
||||
numo-narray
|
||||
rice (>= 4.0.2)
|
||||
ffi (1.15.5)
|
||||
ffi (1.17.0)
|
||||
fugit (1.11.1)
|
||||
et-orbi (~> 1, >= 1.2.11)
|
||||
raabro (~> 1.4)
|
||||
@@ -152,7 +154,7 @@ GEM
|
||||
htmlbeautifier (1.4.2)
|
||||
http-cookie (1.0.5)
|
||||
domain_name (~> 0.5)
|
||||
i18n (1.12.0)
|
||||
i18n (1.14.6)
|
||||
concurrent-ruby (~> 1.0)
|
||||
io-console (0.6.0)
|
||||
irb (1.6.2)
|
||||
@@ -174,12 +176,9 @@ GEM
|
||||
kaminari-core (1.2.2)
|
||||
libmf (0.3.0)
|
||||
ffi
|
||||
listen (3.8.0)
|
||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||
rb-inotify (~> 0.9, >= 0.9.10)
|
||||
loofah (2.19.1)
|
||||
loofah (2.23.1)
|
||||
crass (~> 1.0.2)
|
||||
nokogiri (>= 1.5.9)
|
||||
nokogiri (>= 1.12.0)
|
||||
mail (2.8.0.1)
|
||||
mini_mime (>= 0.1.1)
|
||||
net-imap
|
||||
@@ -188,10 +187,10 @@ GEM
|
||||
marcel (1.0.2)
|
||||
matrix (0.4.2)
|
||||
memory_profiler (1.0.1)
|
||||
method_source (1.0.0)
|
||||
method_source (1.1.0)
|
||||
mini_mime (1.1.2)
|
||||
mini_portile2 (2.8.1)
|
||||
minitest (5.17.0)
|
||||
mini_portile2 (2.8.8)
|
||||
minitest (5.25.4)
|
||||
msgpack (1.6.0)
|
||||
neighbor (0.2.2)
|
||||
activerecord (>= 5.2)
|
||||
@@ -204,9 +203,9 @@ GEM
|
||||
timeout
|
||||
net-smtp (0.3.3)
|
||||
net-protocol
|
||||
nio4r (2.5.8)
|
||||
nokogiri (1.14.1)
|
||||
mini_portile2 (~> 2.8.0)
|
||||
nio4r (2.7.4)
|
||||
nokogiri (1.17.2)
|
||||
mini_portile2 (~> 2.8.2)
|
||||
racc (~> 1.4)
|
||||
numo-narray (0.9.2.1)
|
||||
pg (1.4.5)
|
||||
@@ -227,15 +226,15 @@ GEM
|
||||
puma (5.6.5)
|
||||
nio4r (~> 2.0)
|
||||
raabro (1.4.0)
|
||||
racc (1.6.2)
|
||||
rack (2.2.6.2)
|
||||
racc (1.8.1)
|
||||
rack (2.2.10)
|
||||
rack-cors (2.0.1)
|
||||
rack (>= 2.0.0)
|
||||
rack-mini-profiler (3.0.0)
|
||||
rack (>= 1.2.0)
|
||||
rack-proxy (0.7.6)
|
||||
rack
|
||||
rack-test (2.0.2)
|
||||
rack-test (2.1.0)
|
||||
rack (>= 1.3)
|
||||
rails (7.0.4.2)
|
||||
actioncable (= 7.0.4.2)
|
||||
@@ -251,16 +250,13 @@ GEM
|
||||
activesupport (= 7.0.4.2)
|
||||
bundler (>= 1.15.0)
|
||||
railties (= 7.0.4.2)
|
||||
rails-dom-testing (2.0.3)
|
||||
activesupport (>= 4.2.0)
|
||||
rails-dom-testing (2.2.0)
|
||||
activesupport (>= 5.0.0)
|
||||
minitest
|
||||
nokogiri (>= 1.6)
|
||||
rails-html-sanitizer (1.5.0)
|
||||
loofah (~> 2.19, >= 2.19.1)
|
||||
rails_live_reload (0.3.4)
|
||||
listen
|
||||
nio4r
|
||||
railties
|
||||
websocket-driver
|
||||
rails-html-sanitizer (1.6.2)
|
||||
loofah (~> 2.21)
|
||||
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
||||
rails_semantic_logger (4.12.0)
|
||||
rack
|
||||
railties (>= 5.1)
|
||||
@@ -273,10 +269,7 @@ GEM
|
||||
thor (~> 1.0)
|
||||
zeitwerk (~> 2.5)
|
||||
rainbow (3.1.1)
|
||||
rake (13.0.6)
|
||||
rb-fsevent (0.11.2)
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
rake (13.2.1)
|
||||
react_on_rails (13.3.3)
|
||||
addressable
|
||||
connection_pool
|
||||
@@ -344,9 +337,11 @@ GEM
|
||||
syntax_tree (6.2.0)
|
||||
prettier_print (>= 1.2.0)
|
||||
table_print (1.5.7)
|
||||
tailwindcss-rails (2.0.26)
|
||||
railties (>= 6.0.0)
|
||||
thor (1.2.1)
|
||||
tailwindcss-rails (3.0.0)
|
||||
railties (>= 7.0.0)
|
||||
tailwindcss-ruby
|
||||
tailwindcss-ruby (3.4.17)
|
||||
thor (1.3.2)
|
||||
timeout (0.3.1)
|
||||
turbo-rails (1.3.3)
|
||||
actionpack (>= 6.0.0)
|
||||
@@ -367,12 +362,12 @@ GEM
|
||||
rubyzip (>= 1.3.0)
|
||||
selenium-webdriver (~> 4.0)
|
||||
websocket (1.2.9)
|
||||
websocket-driver (0.7.5)
|
||||
websocket-driver (0.7.6)
|
||||
websocket-extensions (>= 0.1.0)
|
||||
websocket-extensions (0.1.5)
|
||||
xpath (3.2.0)
|
||||
nokogiri (~> 1.8)
|
||||
zeitwerk (2.6.6)
|
||||
zeitwerk (2.7.1)
|
||||
zstd-ruby (1.5.5.0)
|
||||
|
||||
PLATFORMS
|
||||
@@ -386,6 +381,7 @@ DEPENDENCIES
|
||||
composite_primary_keys (~> 14.0)
|
||||
concurrent-ruby-edge
|
||||
concurrent-ruby-ext
|
||||
cssbundling-rails (~> 1.4)
|
||||
curb
|
||||
daemons
|
||||
debug
|
||||
@@ -412,7 +408,6 @@ DEPENDENCIES
|
||||
rack-cors
|
||||
rack-mini-profiler
|
||||
rails (~> 7.0.4, >= 7.0.4.2)
|
||||
rails_live_reload
|
||||
rails_semantic_logger
|
||||
rb-bsdiff!
|
||||
react_on_rails
|
||||
@@ -432,7 +427,7 @@ DEPENDENCIES
|
||||
stimulus-rails
|
||||
syntax_tree (~> 6.2)
|
||||
table_print
|
||||
tailwindcss-rails (~> 2.0)
|
||||
tailwindcss-rails (~> 3.0)
|
||||
turbo-rails
|
||||
tzinfo-data
|
||||
web-console
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Procfile for development using HMR
|
||||
# You can run these commands in separate shells
|
||||
rails: RAILS_ENV=development bundle exec rails s -p 3000
|
||||
tailwind: RAILS_ENV=development bundle exec rake tailwindcss:watch
|
||||
rails: RAILS_ENV=development bin/rails s -p 3000
|
||||
wp-client: HMR=true RAILS_ENV=development bin/webpacker-dev-server
|
||||
wp-server: HMR=true RAILS_ENV=development SERVER_BUNDLE_ONLY=yes bin/webpacker --watch
|
||||
css: yarn build:css --watch
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//= link_tree ../images
|
||||
//= link_directory ../stylesheets .css
|
||||
//= link_tree ../../javascript .js
|
||||
//= link_tree ../../../vendor/javascript .js
|
||||
//= link_tree ../builds
|
||||
|
||||
@@ -1,23 +1,3 @@
|
||||
@tailwind base;
|
||||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
html {
|
||||
@apply h-full;
|
||||
}
|
||||
body {
|
||||
@apply h-full;
|
||||
}
|
||||
main {
|
||||
@apply h-full;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@layer components {
|
||||
.btn-primary {
|
||||
@apply py-2 px-4 bg-blue-200;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
9
app/controllers/domain/inkbunny/posts_controller.rb
Normal file
9
app/controllers/domain/inkbunny/posts_controller.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class Domain::Inkbunny::PostsController < ApplicationController
|
||||
def index
|
||||
@posts = Domain::Inkbunny::Post.page(params[:page])
|
||||
end
|
||||
|
||||
def show
|
||||
@post = Domain::Inkbunny::Post.find(params[:id])
|
||||
end
|
||||
end
|
||||
5
app/controllers/domain/inkbunny/users_controller.rb
Normal file
5
app/controllers/domain/inkbunny/users_controller.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class Domain::Inkbunny::UsersController < ApplicationController
|
||||
def show
|
||||
@user = Domain::Inkbunny::User.find_by(name: params[:name])
|
||||
end
|
||||
end
|
||||
@@ -82,7 +82,9 @@ module Domain::Inkbunny::Job
|
||||
)
|
||||
end
|
||||
api_submissions_json = JSON.parse(@api_submissions_response.body)
|
||||
api_submissions_json["submissions"].each do |submission_json|
|
||||
submissions = api_submissions_json["submissions"]
|
||||
logger.info("api_submissions page has #{submissions.size} posts")
|
||||
submissions.each do |submission_json|
|
||||
Domain::Inkbunny::Post.transaction do
|
||||
deep_update_post_from_submission_json(submission_json)
|
||||
end
|
||||
@@ -146,7 +148,7 @@ module Domain::Inkbunny::Job
|
||||
}
|
||||
}
|
||||
)
|
||||
logger.info "[post #{post.ib_post_id.to_s.bold}]: " +
|
||||
logger.info "[ib_post_id #{post.ib_post_id.to_s.bold}] " +
|
||||
"new file #{file.ib_file_id.to_s.bold} - #{file.file_name.black.bold}"
|
||||
|
||||
defer_job(
|
||||
|
||||
@@ -48,7 +48,7 @@ class Scraper::ClientFactory
|
||||
end
|
||||
|
||||
def self.get_inkbunny_http_client
|
||||
if Rails.env.test? || Rails.env.development?
|
||||
if Rails.env.test?
|
||||
@http_client_mock || raise("no http client mock set")
|
||||
else
|
||||
client = _http_client_impl(:inkbunny, Scraper::InkbunnyHttpClientConfig)
|
||||
|
||||
@@ -19,7 +19,7 @@ class Scraper::InkbunnyHttpClientConfig < Scraper::HttpClientConfig
|
||||
raise("no sid") unless @sid
|
||||
new_query_ar = URI.decode_www_form(uri.query || "") << ["sid", @sid]
|
||||
uri = uri.dup
|
||||
uri.query = URI.encode_www_form(new_query_ar)
|
||||
uri.query = URI.encode_www_form(new_query_ar).gsub("%2C", ",")
|
||||
uri
|
||||
end
|
||||
|
||||
|
||||
@@ -12,4 +12,8 @@ class Domain::Inkbunny::User < ReduxApplicationRecord
|
||||
self.state ||= :ok
|
||||
self.state_detail ||= {}
|
||||
end
|
||||
|
||||
def to_param
|
||||
name
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class ReduxApplicationRecord < ActiveRecord::Base
|
||||
self.abstract_class = true
|
||||
connects_to database: { writing: :redux, reading: :redux }
|
||||
logger.level = Logger::ERROR
|
||||
end
|
||||
|
||||
32
app/views/domain/inkbunny/posts/index.html.erb
Normal file
32
app/views/domain/inkbunny/posts/index.html.erb
Normal file
@@ -0,0 +1,32 @@
|
||||
<div class='mx-auto'>
|
||||
<% if @user %>
|
||||
<h1 class='text-2xl'><%= link_to(@user.name, @user, class: "underline") %>'s posts</h1>
|
||||
<% else %>
|
||||
<h1 class='text-2xl'>Inkbunny Posts (<%= @posts.total_count %>), page <%= page_str(params) %></h1>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class='flex-row mx-2 flex justify-between'>
|
||||
<%= link_to "Previous page", path_to_prev_page(@posts) %>
|
||||
<%= link_to "Next page", path_to_next_page(@posts) %>
|
||||
</div>
|
||||
<div class='flex-row mx-2'>
|
||||
<% @posts.each do |post| %>
|
||||
<div class='border-stone-00 border-2 rounded-md mb-4 p-4'>
|
||||
<div class='text-stone-800 mb-2 flex justify-between'>
|
||||
<div>
|
||||
<%= link_to post.title, post, class: 'hover:underline' %>
|
||||
<span class="text-stone-500 text-sm ml-2">by <%= link_to post.creator.name, post.creator, class: 'hover:underline' %></span>
|
||||
</div>
|
||||
<div class='text-stone-400 text-sm'>(ID: <%= post.ib_post_id %>, <%= pluralize(post.files.count, 'file') %>)</div>
|
||||
</div>
|
||||
<div class='flex flex-row gap-2'>
|
||||
<% post.files.each do |file| %>
|
||||
<% img_src_path = contents_blob_path(HexUtil.bin2hex(file.blob_entry_sha256), format: "jpg", thumb: 'small') %>
|
||||
<div class="rounded-md overflow-hidden">
|
||||
<img class='p-2 first:pl-0 last:pr-0 h-32' alt='<%= post.title %>' src='<%= img_src_path %>' />
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
29
app/views/domain/inkbunny/posts/show.html.erb
Normal file
29
app/views/domain/inkbunny/posts/show.html.erb
Normal file
@@ -0,0 +1,29 @@
|
||||
<div class='max-w-5xl mx-auto w-full px-6 sm:px-8'>
|
||||
<%= link_to "← Back to Posts", domain_inkbunny_posts_path, class: "text-blue-600 hover:underline mb-4 inline-block" %>
|
||||
<div class="text-center">
|
||||
<h1 class='text-2xl'><%= @post.title %></h1>
|
||||
<div class='text-stone-500 text-sm mt-2'>
|
||||
by <%= link_to @post.creator.name, @post.creator, class: 'hover:underline' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='mx-auto mt-4'>
|
||||
<div class='text-stone-600 mb-4'>
|
||||
<div>Post ID: <%= link_to "https://inkbunny.net/s/#{@post.ib_post_id}", target: "_blank", class: "text-blue-600 hover:underline inline-flex items-center" do %>
|
||||
<%= @post.ib_post_id %>
|
||||
<%= render partial: "shared/icons/external_link", locals: { class_name: "w-4 h-4 ml-1" } %>
|
||||
<% end %></div>
|
||||
<div>Type: <%= @post.submission_type.titleize %></div>
|
||||
<div>Rating: <%= @post.rating.titleize %></div>
|
||||
<div>Posted: <%= @post.posted_at.strftime("%B %d, %Y at %I:%M %p") %> (<%= time_ago_in_words(@post.posted_at) %> ago)</div>
|
||||
<div>Scanned: <%= @post.created_at.strftime("%B %d, %Y at %I:%M %p") %> (<%= time_ago_in_words(@post.created_at) %> ago)</div>
|
||||
</div>
|
||||
<div class='flex flex-row gap-6 flex-wrap justify-center p-4'>
|
||||
<% @post.files.each do |file| %>
|
||||
<% img_src_path = contents_blob_path(HexUtil.bin2hex(file.blob_entry_sha256), format: "jpg") %>
|
||||
<div class="rounded-lg overflow-hidden shadow-lg">
|
||||
<img class='max-w-[400px] w-full h-auto' alt='<%= @post.title %>' src='<%= img_src_path %>' />
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
26
app/views/domain/inkbunny/users/show.html.erb
Normal file
26
app/views/domain/inkbunny/users/show.html.erb
Normal file
@@ -0,0 +1,26 @@
|
||||
<div class='mx-auto'>
|
||||
<h1 class='text-2xl'><%= @user.name %>'s Profile</h1>
|
||||
</div>
|
||||
<div class='mx-auto'>
|
||||
<h2 class='text-xl mt-4 mb-2'>Posts (<%= @user.posts.count %>)</h2>
|
||||
<div class='flex-row mx-2'>
|
||||
<% @user.posts.each do |post| %>
|
||||
<div class='border-stone-00 border-2 rounded-md mb-4 p-4'>
|
||||
<div class='text-stone-800 mb-2 flex justify-between'>
|
||||
<div>
|
||||
<%= link_to post.title, post, class: 'hover:underline' %>
|
||||
</div>
|
||||
<div class='text-stone-400 text-sm'>(ID: <%= post.ib_post_id %>, <%= pluralize(post.files.count, 'file') %>)</div>
|
||||
</div>
|
||||
<div class='flex flex-row gap-2'>
|
||||
<% post.files.each do |file| %>
|
||||
<% img_src_path = contents_blob_path(HexUtil.bin2hex(file.blob_entry_sha256), format: "jpg", thumb: 'small') %>
|
||||
<div class="rounded-md overflow-hidden">
|
||||
<img class='p-2 first:pl-0 last:pr-0 h-32' alt='<%= post.title %>' src='<%= img_src_path %>' />
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
3
app/views/shared/icons/_external_link.html.erb
Normal file
3
app/views/shared/icons/_external_link.html.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" class="<%= local_assigns[:class_name] %>">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 300 B |
35
bin/dev
35
bin/dev
@@ -1,30 +1,11 @@
|
||||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: true
|
||||
#!/usr/bin/env sh
|
||||
|
||||
def installed?(process)
|
||||
IO.popen "#{process} -v"
|
||||
rescue Errno::ENOENT
|
||||
false
|
||||
end
|
||||
if gem list --no-installed --exact --silent foreman; then
|
||||
echo "Installing foreman..."
|
||||
gem install foreman
|
||||
fi
|
||||
|
||||
def run(process)
|
||||
system "#{process} start -f Procfile.dev"
|
||||
rescue Errno::ENOENT
|
||||
warn <<~MSG
|
||||
ERROR:
|
||||
Please ensure `Procfile.dev` exists in your project!
|
||||
MSG
|
||||
exit!
|
||||
end
|
||||
# Default to port 3000 if not specified
|
||||
export PORT="${PORT:-3000}"
|
||||
|
||||
if installed? "overmind"
|
||||
run "overmind"
|
||||
elsif installed? "foreman"
|
||||
run "foreman"
|
||||
else
|
||||
warn <<~MSG
|
||||
NOTICE:
|
||||
For this script to run, you need either 'overmind' or 'foreman' installed on your machine. Please try this script after installing one of them.
|
||||
MSG
|
||||
exit!
|
||||
end
|
||||
exec foreman start -f Procfile.dev --env /dev/null "$@"
|
||||
|
||||
@@ -68,5 +68,5 @@ Rails.application.configure do
|
||||
# config.action_view.annotate_rendered_view_with_filenames = true
|
||||
|
||||
# Uncomment if you wish to allow Action Cable access from any origin.
|
||||
# config.action_cable.disable_request_forgery_protection = true
|
||||
config.action_cable.disable_request_forgery_protection = true
|
||||
end
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
Rails.application.routes.draw do
|
||||
root to: "pages#root"
|
||||
mount ActionCable.server => "/cable"
|
||||
|
||||
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
|
||||
namespace :api do
|
||||
@@ -45,10 +46,17 @@ Rails.application.routes.draw do
|
||||
resources :users, param: :url_name, only: [] do
|
||||
resources :posts, controller: "/domain/fa/posts"
|
||||
end
|
||||
resources :posts, param: :fa_id, only: [:inde] do
|
||||
resources :posts, param: :fa_id, only: [:index] do
|
||||
post :scan_post, on: :member
|
||||
end
|
||||
end
|
||||
|
||||
namespace :inkbunny, path: "ib" do
|
||||
resources :posts,
|
||||
only: %i[show index],
|
||||
controller: "/domain/inkbunny/posts"
|
||||
resources :users, param: :name, only: [:show]
|
||||
end
|
||||
end
|
||||
|
||||
resources :blobs, only: [:show], slug: :sha256
|
||||
|
||||
10
package.json
10
package.json
@@ -8,6 +8,11 @@
|
||||
"@babel/preset-react": "^7.18.6",
|
||||
"@babel/preset-typescript": "^7.21.4",
|
||||
"@babel/runtime": "7",
|
||||
"@tailwindcss/aspect-ratio": "^0.4.2",
|
||||
"@tailwindcss/container-queries": "^0.1.1",
|
||||
"@tailwindcss/forms": "^0.5.9",
|
||||
"@tailwindcss/typography": "^0.5.15",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"babel-loader": "8",
|
||||
"babel-plugin-macros": "^3.1.0",
|
||||
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
||||
@@ -17,6 +22,7 @@
|
||||
"fork-ts-checker-webpack-plugin": "^8.0.0",
|
||||
"lodash": "^4.17.21",
|
||||
"mini-css-extract-plugin": "^2.7.5",
|
||||
"postcss": "^8.4.49",
|
||||
"prop-types": "^15.8.1",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
@@ -24,6 +30,7 @@
|
||||
"react_ujs": "^2.6.2",
|
||||
"shakapacker": "6.6.0",
|
||||
"style-loader": "^3.3.2",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"terser-webpack-plugin": "5",
|
||||
"yarn": "^1.22.22"
|
||||
},
|
||||
@@ -50,5 +57,8 @@
|
||||
"webpack-cli": "4",
|
||||
"webpack-dev-server": "^4.13.2",
|
||||
"webpack-merge": "5"
|
||||
},
|
||||
"scripts": {
|
||||
"build:css": "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/tailwind.css"
|
||||
}
|
||||
}
|
||||
|
||||
42
rake/ib.rake
42
rake/ib.rake
@@ -1,8 +1,42 @@
|
||||
namespace :ib do
|
||||
desc "run a single e621 posts index job"
|
||||
task :latest_posts_job => :environment do
|
||||
Domain::Inkbunny::Job::LatestPostsJob.
|
||||
set(priority: -10).
|
||||
perform_later({})
|
||||
task latest_posts_job: :environment do
|
||||
Domain::Inkbunny::Job::LatestPostsJob.set(priority: -10).perform_later({})
|
||||
end
|
||||
|
||||
desc "set auth credentials"
|
||||
task set_auth: :environment do
|
||||
username = nil
|
||||
password = nil
|
||||
|
||||
while username.blank?
|
||||
print "enter username: "
|
||||
username = $stdin.gets.chomp
|
||||
end
|
||||
|
||||
while password.blank?
|
||||
print "enter password: "
|
||||
password = $stdin.gets.chomp
|
||||
end
|
||||
|
||||
Domain::Inkbunny::GlobalState.find_or_create_by(
|
||||
key: "direct-username"
|
||||
).update!(value: username)
|
||||
Domain::Inkbunny::GlobalState.find_or_create_by(
|
||||
key: "direct-password"
|
||||
).update!(value: password)
|
||||
|
||||
puts "auth credentials set to #{username} / #{password}"
|
||||
end
|
||||
|
||||
desc "enqueue FileJob for missing files"
|
||||
task enqueue_file_jobs: :environment do
|
||||
Domain::Inkbunny::File
|
||||
.where(state: :ok)
|
||||
.where(blob_entry_sha256: nil)
|
||||
.where("url_str <> ?", "")
|
||||
.find_each do |file|
|
||||
Domain::Inkbunny::Job::FileJob.new.perform(file: file)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user