mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-10 08:17:06 +02:00
Refactoring
This commit is contained in:
parent
59b7b05c81
commit
1f1cb60c5c
@ -33,9 +33,7 @@
|
|||||||
methods: {
|
methods: {
|
||||||
fetchAlertsData: function() {
|
fetchAlertsData: function() {
|
||||||
return new Promise(function(resolve, reject) {
|
return new Promise(function(resolve, reject) {
|
||||||
$.getJSON(POLLING_URL, function(data){
|
$.getJSON(POLLING_URL, resolve).fail(reject);
|
||||||
resolve(data);
|
|
||||||
}).fail(reject);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,23 +23,23 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def installing_gem?
|
def installing_gem?
|
||||||
installing_gems.length > 0
|
installing_gems.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def installing_gems
|
def installing_gems
|
||||||
Plugin::WORKING.find_all do |data|
|
Plugin::WORKING.find_all do |data|
|
||||||
data[:type] == :install && data[:state] == :running
|
data[:type] == :install && data[:state] == :running
|
||||||
end.map{|data| data[:plugin]} || []
|
end.map{|data| data[:plugin]}
|
||||||
end
|
end
|
||||||
|
|
||||||
def uninstalling_gem?
|
def uninstalling_gem?
|
||||||
uninstalling_gems.length > 0
|
uninstalling_gems.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
def uninstalling_gems
|
def uninstalling_gems
|
||||||
Plugin::WORKING.find_all do |data|
|
Plugin::WORKING.find_all do |data|
|
||||||
data[:type] == :uninstall && data[:state] == :running
|
data[:type] == :uninstall && data[:state] == :running
|
||||||
end.map{|data| data[:plugin]} || []
|
end.map{|data| data[:plugin]}
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
Loading…
Reference in New Issue
Block a user