Remove unused files

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
Kenji Okimoto 2018-10-09 17:37:56 +09:00
parent 1759da56bb
commit ec06161b3c
No known key found for this signature in database
GPG Key ID: F9E3E329A5C5E4A1
2 changed files with 0 additions and 85 deletions

View File

@ -1,60 +0,0 @@
const POLLING_INTERVAL = 3 * 1000;
const POLLING_URL = "/polling/alerts";
window.addEventListener("load", ()=> {
new Vue({
el: "#vue-notification",
data: {
"alerts": []
},
computed: {
alertsCount: {
get: function(){ return this.alerts.length; }
},
hasAlerts: {
get: function(){ return this.alertsCount > 0; }
}
},
created: function(){
let timer;
let self = this;
let currentInterval = POLLING_INTERVAL;
let fetch = function(){
self.fetchAlertsData().then(function(alerts){
if(self.alerts.toString() == alerts.toString()) {
currentInterval *= 1.1;
} else {
currentInterval = POLLING_INTERVAL;
}
self.alerts = alerts;
timer = setTimeout(fetch, currentInterval);
})["catch"](function(xhr){
if(xhr.status === 401) {
// signed out
}
if(xhr.status === 0) {
// server unreachable (maybe down)
}
});
};
window.addEventListener("focus", function(_event){
currentInterval = POLLING_INTERVAL;
timer = setTimeout(fetch, currentInterval);
}, false);
window.addEventListener("blur", function(_event){
clearTimeout(timer);
}, false);
fetch();
},
methods: {
fetchAlertsData: function() {
return new Promise(function(resolve, reject) {
$.getJSON(POLLING_URL, resolve).fail(reject);
});
}
}
});
});

View File

@ -1,25 +0,0 @@
<% primary_button ||= "Save changes" %>
<!-- Modal -->
<div class="modal fade" id="modal-destroy" tabindex="-1" role="dialog" aria-labelledby="modal-destroyLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel"><%= head %></h4>
</div>
<div class="modal-body">
<%= body %>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<%= primary_button %>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->