tailwind updates, inkbunny listing stuff

This commit is contained in:
Dylan Knutson
2024-12-19 06:04:37 +00:00
parent a15e79a231
commit 29f671b41f
24 changed files with 876 additions and 105 deletions

View File

@@ -9,3 +9,4 @@ function install_extension() {
install_extension Shopify.ruby-extensions-pack install_extension Shopify.ruby-extensions-pack
install_extension dbaeumer.vscode-eslint install_extension dbaeumer.vscode-eslint
install_extension aliariff.vscode-erb-beautify install_extension aliariff.vscode-erb-beautify
install_extension bradlc.vscode-tailwindcss

View File

@@ -61,7 +61,6 @@ end
group :development, :staging do group :development, :staging do
# Use console on exceptions pages [https://github.com/rails/web-console] # Use console on exceptions pages [https://github.com/rails/web-console]
gem 'htmlbeautifier' gem 'htmlbeautifier'
gem 'rails_live_reload'
gem 'rufo', require: false gem 'rufo', require: false
gem 'web-console' gem 'web-console'
@@ -124,7 +123,6 @@ group :production do
gem 'sd_notify' gem 'sd_notify'
end end
gem 'tailwindcss-rails', '~> 2.0'
gem 'rack-cors' gem 'rack-cors'
gem 'react_on_rails' gem 'react_on_rails'
@@ -132,3 +130,7 @@ gem 'sanitize'
gem 'shakapacker' gem 'shakapacker'
gem "syntax_tree", "~> 6.2" gem "syntax_tree", "~> 6.2"
gem "cssbundling-rails", "~> 1.4"
gem 'tailwindcss-rails', '~> 3.0'

View File

@@ -91,7 +91,7 @@ GEM
debug_inspector (>= 0.0.1) debug_inspector (>= 0.0.1)
bootsnap (1.16.0) bootsnap (1.16.0)
msgpack (~> 1.2) msgpack (~> 1.2)
builder (3.2.4) builder (3.3.0)
capybara (3.38.0) capybara (3.38.0)
addressable addressable
matrix matrix
@@ -112,6 +112,8 @@ GEM
concurrent-ruby (= 1.3.4) concurrent-ruby (= 1.3.4)
connection_pool (2.4.0) connection_pool (2.4.0)
crass (1.0.6) crass (1.0.6)
cssbundling-rails (1.4.1)
railties (>= 6.0.0)
curb (1.0.5) curb (1.0.5)
daemons (1.4.1) daemons (1.4.1)
date (3.3.3) date (3.3.3)
@@ -128,14 +130,14 @@ GEM
numo-narray numo-narray
domain_name (0.5.20190701) domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0) unf (>= 0.0.5, < 1.0.0)
erubi (1.12.0) erubi (1.13.0)
et-orbi (1.2.11) et-orbi (1.2.11)
tzinfo tzinfo
execjs (2.8.1) execjs (2.8.1)
faiss (0.2.5) faiss (0.2.5)
numo-narray numo-narray
rice (>= 4.0.2) rice (>= 4.0.2)
ffi (1.15.5) ffi (1.17.0)
fugit (1.11.1) fugit (1.11.1)
et-orbi (~> 1, >= 1.2.11) et-orbi (~> 1, >= 1.2.11)
raabro (~> 1.4) raabro (~> 1.4)
@@ -152,7 +154,7 @@ GEM
htmlbeautifier (1.4.2) htmlbeautifier (1.4.2)
http-cookie (1.0.5) http-cookie (1.0.5)
domain_name (~> 0.5) domain_name (~> 0.5)
i18n (1.12.0) i18n (1.14.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
io-console (0.6.0) io-console (0.6.0)
irb (1.6.2) irb (1.6.2)
@@ -174,12 +176,9 @@ GEM
kaminari-core (1.2.2) kaminari-core (1.2.2)
libmf (0.3.0) libmf (0.3.0)
ffi ffi
listen (3.8.0) loofah (2.23.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.19.1)
crass (~> 1.0.2) crass (~> 1.0.2)
nokogiri (>= 1.5.9) nokogiri (>= 1.12.0)
mail (2.8.0.1) mail (2.8.0.1)
mini_mime (>= 0.1.1) mini_mime (>= 0.1.1)
net-imap net-imap
@@ -188,10 +187,10 @@ GEM
marcel (1.0.2) marcel (1.0.2)
matrix (0.4.2) matrix (0.4.2)
memory_profiler (1.0.1) memory_profiler (1.0.1)
method_source (1.0.0) method_source (1.1.0)
mini_mime (1.1.2) mini_mime (1.1.2)
mini_portile2 (2.8.1) mini_portile2 (2.8.8)
minitest (5.17.0) minitest (5.25.4)
msgpack (1.6.0) msgpack (1.6.0)
neighbor (0.2.2) neighbor (0.2.2)
activerecord (>= 5.2) activerecord (>= 5.2)
@@ -204,9 +203,9 @@ GEM
timeout timeout
net-smtp (0.3.3) net-smtp (0.3.3)
net-protocol net-protocol
nio4r (2.5.8) nio4r (2.7.4)
nokogiri (1.14.1) nokogiri (1.17.2)
mini_portile2 (~> 2.8.0) mini_portile2 (~> 2.8.2)
racc (~> 1.4) racc (~> 1.4)
numo-narray (0.9.2.1) numo-narray (0.9.2.1)
pg (1.4.5) pg (1.4.5)
@@ -227,15 +226,15 @@ GEM
puma (5.6.5) puma (5.6.5)
nio4r (~> 2.0) nio4r (~> 2.0)
raabro (1.4.0) raabro (1.4.0)
racc (1.6.2) racc (1.8.1)
rack (2.2.6.2) rack (2.2.10)
rack-cors (2.0.1) rack-cors (2.0.1)
rack (>= 2.0.0) rack (>= 2.0.0)
rack-mini-profiler (3.0.0) rack-mini-profiler (3.0.0)
rack (>= 1.2.0) rack (>= 1.2.0)
rack-proxy (0.7.6) rack-proxy (0.7.6)
rack rack
rack-test (2.0.2) rack-test (2.1.0)
rack (>= 1.3) rack (>= 1.3)
rails (7.0.4.2) rails (7.0.4.2)
actioncable (= 7.0.4.2) actioncable (= 7.0.4.2)
@@ -251,16 +250,13 @@ GEM
activesupport (= 7.0.4.2) activesupport (= 7.0.4.2)
bundler (>= 1.15.0) bundler (>= 1.15.0)
railties (= 7.0.4.2) railties (= 7.0.4.2)
rails-dom-testing (2.0.3) rails-dom-testing (2.2.0)
activesupport (>= 4.2.0) activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6) nokogiri (>= 1.6)
rails-html-sanitizer (1.5.0) rails-html-sanitizer (1.6.2)
loofah (~> 2.19, >= 2.19.1) loofah (~> 2.21)
rails_live_reload (0.3.4) 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)
listen
nio4r
railties
websocket-driver
rails_semantic_logger (4.12.0) rails_semantic_logger (4.12.0)
rack rack
railties (>= 5.1) railties (>= 5.1)
@@ -273,10 +269,7 @@ GEM
thor (~> 1.0) thor (~> 1.0)
zeitwerk (~> 2.5) zeitwerk (~> 2.5)
rainbow (3.1.1) rainbow (3.1.1)
rake (13.0.6) rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
react_on_rails (13.3.3) react_on_rails (13.3.3)
addressable addressable
connection_pool connection_pool
@@ -344,9 +337,11 @@ GEM
syntax_tree (6.2.0) syntax_tree (6.2.0)
prettier_print (>= 1.2.0) prettier_print (>= 1.2.0)
table_print (1.5.7) table_print (1.5.7)
tailwindcss-rails (2.0.26) tailwindcss-rails (3.0.0)
railties (>= 6.0.0) railties (>= 7.0.0)
thor (1.2.1) tailwindcss-ruby
tailwindcss-ruby (3.4.17)
thor (1.3.2)
timeout (0.3.1) timeout (0.3.1)
turbo-rails (1.3.3) turbo-rails (1.3.3)
actionpack (>= 6.0.0) actionpack (>= 6.0.0)
@@ -367,12 +362,12 @@ GEM
rubyzip (>= 1.3.0) rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0) selenium-webdriver (~> 4.0)
websocket (1.2.9) websocket (1.2.9)
websocket-driver (0.7.5) websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5) websocket-extensions (0.1.5)
xpath (3.2.0) xpath (3.2.0)
nokogiri (~> 1.8) nokogiri (~> 1.8)
zeitwerk (2.6.6) zeitwerk (2.7.1)
zstd-ruby (1.5.5.0) zstd-ruby (1.5.5.0)
PLATFORMS PLATFORMS
@@ -386,6 +381,7 @@ DEPENDENCIES
composite_primary_keys (~> 14.0) composite_primary_keys (~> 14.0)
concurrent-ruby-edge concurrent-ruby-edge
concurrent-ruby-ext concurrent-ruby-ext
cssbundling-rails (~> 1.4)
curb curb
daemons daemons
debug debug
@@ -412,7 +408,6 @@ DEPENDENCIES
rack-cors rack-cors
rack-mini-profiler rack-mini-profiler
rails (~> 7.0.4, >= 7.0.4.2) rails (~> 7.0.4, >= 7.0.4.2)
rails_live_reload
rails_semantic_logger rails_semantic_logger
rb-bsdiff! rb-bsdiff!
react_on_rails react_on_rails
@@ -432,7 +427,7 @@ DEPENDENCIES
stimulus-rails stimulus-rails
syntax_tree (~> 6.2) syntax_tree (~> 6.2)
table_print table_print
tailwindcss-rails (~> 2.0) tailwindcss-rails (~> 3.0)
turbo-rails turbo-rails
tzinfo-data tzinfo-data
web-console web-console

View File

@@ -1,6 +1,6 @@
# Procfile for development using HMR # Procfile for development using HMR
# You can run these commands in separate shells # You can run these commands in separate shells
rails: RAILS_ENV=development bundle exec rails s -p 3000 rails: RAILS_ENV=development bin/rails s -p 3000
tailwind: RAILS_ENV=development bundle exec rake tailwindcss:watch
wp-client: HMR=true RAILS_ENV=development bin/webpacker-dev-server 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 wp-server: HMR=true RAILS_ENV=development SERVER_BUNDLE_ONLY=yes bin/webpacker --watch
css: yarn build:css --watch

View File

@@ -1,5 +1,4 @@
//= link_tree ../images //= link_tree ../images
//= link_directory ../stylesheets .css
//= link_tree ../../javascript .js //= link_tree ../../javascript .js
//= link_tree ../../../vendor/javascript .js //= link_tree ../../../vendor/javascript .js
//= link_tree ../builds //= link_tree ../builds

View File

@@ -1,23 +1,3 @@
@tailwind base; @tailwind base;
@tailwind components; @tailwind components;
@tailwind utilities; @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;
}
}
*/

View 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

View File

@@ -0,0 +1,5 @@
class Domain::Inkbunny::UsersController < ApplicationController
def show
@user = Domain::Inkbunny::User.find_by(name: params[:name])
end
end

View File

@@ -82,7 +82,9 @@ module Domain::Inkbunny::Job
) )
end end
api_submissions_json = JSON.parse(@api_submissions_response.body) 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 Domain::Inkbunny::Post.transaction do
deep_update_post_from_submission_json(submission_json) deep_update_post_from_submission_json(submission_json)
end 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}" "new file #{file.ib_file_id.to_s.bold} - #{file.file_name.black.bold}"
defer_job( defer_job(

View File

@@ -48,7 +48,7 @@ class Scraper::ClientFactory
end end
def self.get_inkbunny_http_client 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") @http_client_mock || raise("no http client mock set")
else else
client = _http_client_impl(:inkbunny, Scraper::InkbunnyHttpClientConfig) client = _http_client_impl(:inkbunny, Scraper::InkbunnyHttpClientConfig)

View File

@@ -19,7 +19,7 @@ class Scraper::InkbunnyHttpClientConfig < Scraper::HttpClientConfig
raise("no sid") unless @sid raise("no sid") unless @sid
new_query_ar = URI.decode_www_form(uri.query || "") << ["sid", @sid] new_query_ar = URI.decode_www_form(uri.query || "") << ["sid", @sid]
uri = uri.dup uri = uri.dup
uri.query = URI.encode_www_form(new_query_ar) uri.query = URI.encode_www_form(new_query_ar).gsub("%2C", ",")
uri uri
end end

View File

@@ -12,4 +12,8 @@ class Domain::Inkbunny::User < ReduxApplicationRecord
self.state ||= :ok self.state ||= :ok
self.state_detail ||= {} self.state_detail ||= {}
end end
def to_param
name
end
end end

View File

@@ -1,4 +1,5 @@
class ReduxApplicationRecord < ActiveRecord::Base class ReduxApplicationRecord < ActiveRecord::Base
self.abstract_class = true self.abstract_class = true
connects_to database: { writing: :redux, reading: :redux } connects_to database: { writing: :redux, reading: :redux }
logger.level = Logger::ERROR
end end

View 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>

View 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>

View 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>

View 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
View File

@@ -1,30 +1,11 @@
#!/usr/bin/env ruby #!/usr/bin/env sh
# frozen_string_literal: true
def installed?(process) if gem list --no-installed --exact --silent foreman; then
IO.popen "#{process} -v" echo "Installing foreman..."
rescue Errno::ENOENT gem install foreman
false fi
end
def run(process) # Default to port 3000 if not specified
system "#{process} start -f Procfile.dev" export PORT="${PORT:-3000}"
rescue Errno::ENOENT
warn <<~MSG
ERROR:
Please ensure `Procfile.dev` exists in your project!
MSG
exit!
end
if installed? "overmind" exec foreman start -f Procfile.dev --env /dev/null "$@"
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

View File

@@ -68,5 +68,5 @@ Rails.application.configure do
# config.action_view.annotate_rendered_view_with_filenames = true # config.action_view.annotate_rendered_view_with_filenames = true
# Uncomment if you wish to allow Action Cable access from any origin. # 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 end

View File

@@ -1,5 +1,6 @@
Rails.application.routes.draw do Rails.application.routes.draw do
root to: "pages#root" root to: "pages#root"
mount ActionCable.server => "/cable"
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
namespace :api do namespace :api do
@@ -45,10 +46,17 @@ Rails.application.routes.draw do
resources :users, param: :url_name, only: [] do resources :users, param: :url_name, only: [] do
resources :posts, controller: "/domain/fa/posts" resources :posts, controller: "/domain/fa/posts"
end end
resources :posts, param: :fa_id, only: [:inde] do resources :posts, param: :fa_id, only: [:index] do
post :scan_post, on: :member post :scan_post, on: :member
end end
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 end
resources :blobs, only: [:show], slug: :sha256 resources :blobs, only: [:show], slug: :sha256

View File

@@ -8,6 +8,11 @@
"@babel/preset-react": "^7.18.6", "@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.4", "@babel/preset-typescript": "^7.21.4",
"@babel/runtime": "7", "@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-loader": "8",
"babel-plugin-macros": "^3.1.0", "babel-plugin-macros": "^3.1.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24", "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
@@ -17,6 +22,7 @@
"fork-ts-checker-webpack-plugin": "^8.0.0", "fork-ts-checker-webpack-plugin": "^8.0.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mini-css-extract-plugin": "^2.7.5", "mini-css-extract-plugin": "^2.7.5",
"postcss": "^8.4.49",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
@@ -24,6 +30,7 @@
"react_ujs": "^2.6.2", "react_ujs": "^2.6.2",
"shakapacker": "6.6.0", "shakapacker": "6.6.0",
"style-loader": "^3.3.2", "style-loader": "^3.3.2",
"tailwindcss": "^3.4.17",
"terser-webpack-plugin": "5", "terser-webpack-plugin": "5",
"yarn": "^1.22.22" "yarn": "^1.22.22"
}, },
@@ -50,5 +57,8 @@
"webpack-cli": "4", "webpack-cli": "4",
"webpack-dev-server": "^4.13.2", "webpack-dev-server": "^4.13.2",
"webpack-merge": "5" "webpack-merge": "5"
},
"scripts": {
"build:css": "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/tailwind.css"
} }
} }

View File

@@ -1,8 +1,42 @@
namespace :ib do namespace :ib do
desc "run a single e621 posts index job" desc "run a single e621 posts index job"
task :latest_posts_job => :environment do task latest_posts_job: :environment do
Domain::Inkbunny::Job::LatestPostsJob. Domain::Inkbunny::Job::LatestPostsJob.set(priority: -10).perform_later({})
set(priority: -10). end
perform_later({})
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
end end

660
yarn.lock

File diff suppressed because it is too large Load Diff