Skip to content
Snippets Groups Projects
Unverified Commit bb997530 authored by Arnaud Levy's avatar Arnaud Levy Committed by GitHub
Browse files

Merge pull request #1306 from noesya/server-monitor

parents b2c980a0 1f31c8de
No related branches found
No related tags found
No related merge requests found
......@@ -10,6 +10,7 @@ class Server::DashboardController < Server::ApplicationController
path: server_websites_path
}
]
@websites = Communication::Website.updatable_theme.ordered
breadcrumb
end
end
......@@ -5,6 +5,7 @@ class Server::WebsitesController < Server::ApplicationController
has_scope :for_production
has_scope :for_update
has_scope :for_search_term
has_scope :for_updatable_theme
def index
@websites = apply_scopes(Communication::Website.all).ordered
......
......@@ -90,6 +90,12 @@ class Communication::Website < ApplicationRecord
", term: "%#{sanitize_sql_like(term)}%")
}
scope :for_update, -> (autoupdate) { where(autoupdate_theme: autoupdate) }
scope :for_updatable_theme, -> (status) { updatable_theme if status == 'true' }
scope :updatable_theme, -> {
where.not(repository: [nil, '']).
where.not(access_token: [nil, '']).
where.not(url: [nil, ''])
}
def to_s
"#{name}"
......
......@@ -12,6 +12,10 @@ module Filters
add :for_update,
[{ to_s: 'Automatique', id: 'true' }, { to_s: 'Manuelle', id: 'false' }],
'Filtrer par mode de mise à jour'
add :for_updatable_theme,
[{ to_s: 'Mise à jour automatique possible', id: 'true' }],
'Filtrer par capacité de mise à jour automatique'
end
end
end
......@@ -9,3 +9,7 @@
</div>
<% end %>
</div>
<%= osuny_panel 'Monitoring' do %>
<%= render 'server/websites/list', websites: @websites %>
<% end %>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment