mirror of
https://0xacab.org/sutty/sutty
synced 2025-02-24 08:01:49 +00:00
Merge branch 'issue-13611' into production.panel.sutty.nl
This commit is contained in:
commit
fb806933d9
8 changed files with 31 additions and 12 deletions
|
@ -22,6 +22,12 @@ class SitesController < ApplicationController
|
|||
render('sites/status', layout: false) if stale? site
|
||||
end
|
||||
|
||||
def button
|
||||
authorize site
|
||||
|
||||
render('sites/build', layout: false)
|
||||
end
|
||||
|
||||
# No tenemos propiedades de un sitio aún, así que vamos al listado de
|
||||
# artículos
|
||||
def show
|
||||
|
|
|
@ -9,9 +9,16 @@ try {
|
|||
host: window.env.PANEL_URL
|
||||
});
|
||||
|
||||
const ignoredErrors = ["htmx:afterRequest", "htmx:sendAbort"];
|
||||
|
||||
console.originalError = console.error;
|
||||
console.error = (...e) => {
|
||||
const msg = e.join(" ");
|
||||
|
||||
if (!ignoredErrors.some(x => msg.includes(x))) {
|
||||
window.airbrake.notify(e.join(" "));
|
||||
}
|
||||
|
||||
return console.originalError(...e);
|
||||
};
|
||||
} catch(e) {
|
||||
|
|
|
@ -61,6 +61,10 @@ class SitePolicy
|
|||
show? && usuarie?
|
||||
end
|
||||
|
||||
def button?
|
||||
show?
|
||||
end
|
||||
|
||||
def enqueue?
|
||||
build?
|
||||
end
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
.mb-3
|
||||
= render 'sites/header', site: @site
|
||||
= render 'sites/status', site: @site
|
||||
= render 'sites/build', site: @site, class: 'btn-block'
|
||||
= render 'sites/moderation_queue', site: @site, class: 'btn-block'
|
||||
|
||||
%h3= t('posts.new')
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
- if policy(site).build?
|
||||
%div{ 'hx-get': site_button_path(site, class: local_assigns[:class]), 'hx-trigger': 'every 10s', 'hx-swap': 'outerHTML' }
|
||||
= form_tag site_enqueue_path(site),
|
||||
method: :post,
|
||||
class: 'form-inline inline' do
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
- message = t('.available')
|
||||
- link = true
|
||||
|
||||
-# TODO: Calcular cada cuanto sería óptimo recargar
|
||||
-# TODO: Calcular cada cuánto sería óptimo recargar
|
||||
%div{ 'hx-get': site_status_path(site), 'hx-trigger': 'every 10s', 'hx-swap': 'outerHTML' }
|
||||
= render 'bootstrap/alert' do
|
||||
= link_to_if link, message.html_safe, site_build_stats_path(site), class: 'alert-link'
|
||||
|
||||
= render 'sites/build', site: site, class: 'btn-block'
|
||||
|
|
1
app/views/sites/build.haml
Normal file
1
app/views/sites/build.haml
Normal file
|
@ -0,0 +1 @@
|
|||
= render 'sites/build', site: @site, class: params.permit(:class)[:class]
|
|
@ -53,6 +53,7 @@ Rails.application.routes.draw do
|
|||
post 'pull', to: 'sites#merge'
|
||||
|
||||
get 'status', to: 'sites#status'
|
||||
get 'button', to: 'sites#button'
|
||||
|
||||
# Gestionar usuaries
|
||||
get 'usuaries/invite', to: 'usuaries#invite'
|
||||
|
|
Loading…
Reference in a new issue