diff --git a/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java b/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java index dd9f08c..524324f 100644 --- a/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java +++ b/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java @@ -451,13 +451,24 @@ public class RcrdIt extends ResourceConfig implements AutoCloseable { return new HashMap<>(); } - @POST + @POST @Path("getAutoRecs") @Produces(MediaType.APPLICATION_JSON) public List getAutoRecs() { return autoRecs; } + @POST + @Path("getCurrentlyRecording") + @Produces(MediaType.APPLICATION_JSON) + public List getCurrentlyRecording() { + List currentlyRecording = new ArrayList<>(); + tuners.getTuners().stream().map((tuner) -> tuner.getRecording()).filter((rec) -> (rec != null)).forEach((rec) -> { + currentlyRecording.add(rec); + }); + return currentlyRecording; + } + @POST @Path("getSchedule") @Produces(MediaType.APPLICATION_JSON) diff --git a/src/main/java/com/moparisthebest/rcrdit/tuner/Tuners.java b/src/main/java/com/moparisthebest/rcrdit/tuner/Tuners.java index 8bf6eb6..c8d8c0f 100644 --- a/src/main/java/com/moparisthebest/rcrdit/tuner/Tuners.java +++ b/src/main/java/com/moparisthebest/rcrdit/tuner/Tuners.java @@ -107,6 +107,12 @@ public class Tuners implements Tuner { return chosenTuner.recordNow(par, timer); } + public List getTuners() { + return tuners; + } + + + @Override public synchronized boolean stopRecording(final ProgramAutoRec program) { for (final Tuner tuner : tuners) diff --git a/src/main/webapp/css/rcrdit.css b/src/main/webapp/css/rcrdit.css index 79f3d09..d456bf3 100644 --- a/src/main/webapp/css/rcrdit.css +++ b/src/main/webapp/css/rcrdit.css @@ -256,6 +256,7 @@ ul#channelGroups li ul li ul li.channel { #rcrditHeader{ width: 70%; + min-width:1100 px; margin-left: auto; margin-right: auto; padding-left: 15px; @@ -335,13 +336,19 @@ ul#channelGroups li ul li ul li.channel { width:128px; padding: 21px; margin-left: 10px; - margin-right: 10px; + margin-right: 10px; + vertical-align:top; } .sectionSelection:hover{ cursor: pointer; } +.nowRecording{ + color: white; + overflow:hidden; +} + .logoImageDiv{ display: inline-block; float:left; @@ -358,4 +365,10 @@ ul#channelGroups li ul li ul li.channel { padding:20px; border-radius: 30px; height: 400px; +} + +.circle:before { + content: ' \25CF'; + font-size: 15px; + color:red; } \ No newline at end of file diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html index 9765d44..931cb30 100644 --- a/src/main/webapp/index.html +++ b/src/main/webapp/index.html @@ -41,7 +41,7 @@
Schedule
-
+
diff --git a/src/main/webapp/js/rcrdit.js b/src/main/webapp/js/rcrdit.js index 1947535..9e70d75 100644 --- a/src/main/webapp/js/rcrdit.js +++ b/src/main/webapp/js/rcrdit.js @@ -23,8 +23,29 @@ $( document ).ready(function() { $("#autoRecsGoHere").show(); $("#programInfo").dialog("close"); }); + getCurrentlyRecording(); + setInterval(getCurrentlyRecording,30000); }); + +function getCurrentlyRecording(){ + $.ajax({ + url: 'rest/getCurrentlyRecording', + type: 'post', + dataType: 'json', + success: function (data) { + var nowRecordingTable = $("")); + } + $("#nowRecordingDiv").html(nowRecordingTable); + }, + error: function ( jqXHR, textStatus, errorThrown ){ + alert(errorThrown); + } + }); +} + function getAutoRecs(){ $("#autoRecsGoHere").html(""); @@ -473,6 +494,7 @@ function scheduleRecording(recordingDetails){ data: JSON.stringify(recordingDetails), success: function (data) { $("#recordOptionsDiv").hide(); + setTimeout(getCurrentlyRecording,5000); toastr["success"]("Recording Scheduled!"); }, error: function ( jqXHR, textStatus, errorThrown ){
"+data[idx].program.title+"