From 6f9d6c2fb5c5ca8374b4c2436e4db629e20360bc Mon Sep 17 00:00:00 2001 From: Seth Call Date: Thu, 2 Jul 2015 10:43:16 -0500 Subject: [PATCH] * cleanup notifications --- web/app/assets/javascripts/backend_alerts.js | 2 +- web/app/assets/javascripts/globals.js | 30 +++++++++---------- .../PopupMediaControls.js.jsx.coffee | 2 +- .../PopupRecordingStartStop.js.jsx.coffee | 5 ++++ .../SessionNotification.js.jsx.coffee | 19 ++++++++++-- .../SessionRecordBtn.js.jsx.coffee | 16 ++-------- .../SessionTrackVU.js.jsx.coffee | 6 ++-- .../actions/RecordingActions.js.coffee | 3 +- .../stores/RecordingStore.js.jsx.coffee | 24 +++++++++++++++ .../stores/SessionNotificationStore.js.coffee | 24 ++++++++++++++- .../react-components/SessionScreen.css.scss | 18 +++++++++++ 11 files changed, 110 insertions(+), 39 deletions(-) diff --git a/web/app/assets/javascripts/backend_alerts.js b/web/app/assets/javascripts/backend_alerts.js index b3b090c5e..348560630 100644 --- a/web/app/assets/javascripts/backend_alerts.js +++ b/web/app/assets/javascripts/backend_alerts.js @@ -41,7 +41,7 @@ var alert = ALERT_TYPES[type]; if(alert && alert.title) { - context.NotificationActions.backendNotification({msg: alert.title, detail: alert.message}) + context.NotificationActions.backendNotification({msg: alert.title, detail: alert.message, backend_detail:text, help: alert.help}) } else { logger.debug("Unhandled Backend Event type %o, data %o", type, text) diff --git a/web/app/assets/javascripts/globals.js b/web/app/assets/javascripts/globals.js index c0e50c728..f7f8e4019 100644 --- a/web/app/assets/javascripts/globals.js +++ b/web/app/assets/javascripts/globals.js @@ -123,23 +123,23 @@ 0: {"title": "", "message": ""}, // NO_EVENT, 1: {"title": "", "message": ""}, // BACKEND_ERROR: generic error - eg P2P message error 2: {"title": "", "message": ""}, // BACKEND_MIXER_CHANGE, - event that controls have been regenerated - 3: {"title": "High Packet Jitter", "message": "Your network connection is currently experiencing packet jitter at a level that is too high to deliver good audio quality. For troubleshooting tips, click here."}, // PACKET_JTR, - 4: {"title": "High Packet Loss", "message": "Your network connection is currently experiencing packet loss at a rate that is too high to deliver good audio quality. For troubleshooting tips, click here." }, // PACKET_LOSS - 5: {"title": "High Packet Late", "message": "Your network connection is currently experiencing packet loss at a rate that is too high to deliver good audio quality. For troubleshooting tips, click here."}, // PACKET_LATE, - 6: {"title": "Large Jitter Queue", "message": "Your network connection is currently experiencing packet jitter at a level that is too high to deliver good audio quality. For troubleshooting tips, click here."}, // JTR_QUEUE_DEPTH, - 7: {"title": "High Network Jitter", "message": "Your network connection is currently experiencing network jitter at a level that is too high to deliver good audio quality. For troubleshooting tips, click here."}, // NETWORK_JTR, - 8: {"title": "High Session Latency", "message": "The latency of your audio device combined with your Internet connection has become high enough to impact your session quality. For troubleshooting tips, click here." }, // NETWORK_PING, - 9: {"title": "Bandwidth Throttled", "message": "The available bandwidth on your network has diminished, and this may impact your audio quality. For troubleshooting tips, click here."}, // BITRATE_THROTTLE_WARN, - 10:{"title": "Low Bandwidth", "message": "The available bandwidth on your network has become too low, and this may impact your audio quality. For troubleshooting tips, click here." }, // BANDWIDTH_LOW + 3: {"title": "High Packet Jitter", "message": "Your network connection is currently experiencing packet jitter at a level that is too high to deliver good audio quality. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems"}, // PACKET_JTR, + 4: {"title": "High Packet Loss", "message": "Your network connection is currently experiencing packet loss at a rate that is too high to deliver good audio quality. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems" }, // PACKET_LOSS + 5: {"title": "High Packet Late", "message": "Your network connection is currently experiencing packet loss at a rate that is too high to deliver good audio quality. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems"}, // PACKET_LATE, + 6: {"title": "Large Jitter Queue", "message": "Your network connection is currently experiencing packet jitter at a level that is too high to deliver good audio quality. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems"}, // JTR_QUEUE_DEPTH, + 7: {"title": "High Network Jitter", "message": "Your network connection is currently experiencing network jitter at a level that is too high to deliver good audio quality. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems"}, // NETWORK_JTR, + 8: {"title": "High Session Latency", "message": "The latency of your audio device combined with your Internet connection has become high enough to impact your session quality. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems" }, // NETWORK_PING, + 9: {"title": "Bandwidth Throttled", "message": "The available bandwidth on your network has diminished, and this may impact your audio quality. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems"}, // BITRATE_THROTTLE_WARN, + 10:{"title": "Low Bandwidth", "message": "The available bandwidth on your network has become too low, and this may impact your audio quality. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems" }, // BANDWIDTH_LOW // IO related events - 11:{"title": "Variable Input Rate", "message": "The input rate of your audio device is varying too much to deliver good audio quality. For troubleshooting tips, click here." }, // INPUT_IO_RATE - 12:{"title": "High Input Jitter", "message": "The input rate of your audio device is varying too much to deliver good audio quality. For troubleshooting tips, click here."}, // INPUT_IO_JTR, - 13:{"title": "Variable Output Rate", "message": "The output rate of your audio device is varying too much to deliver good audio quality. For troubleshooting tips, click here." }, // OUTPUT_IO_RATE - 14:{"title": "High Output Jitter", "message": "The output rate of your audio device is varying too much to deliver good audio quality. For troubleshooting tips, click here."}, // OUTPUT_IO_JTR, + 11:{"title": "Variable Input Rate", "message": "The input rate of your audio device is varying too much to deliver good audio quality. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems" }, // INPUT_IO_RATE + 12:{"title": "High Input Jitter", "message": "The input rate of your audio device is varying too much to deliver good audio quality. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems"}, // INPUT_IO_JTR, + 13:{"title": "Variable Output Rate", "message": "The output rate of your audio device is varying too much to deliver good audio quality. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems"}, // OUTPUT_IO_RATE + 14:{"title": "High Output Jitter", "message": "The output rate of your audio device is varying too much to deliver good audio quality. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems"}, // OUTPUT_IO_JTR, // CPU load related - 15: { "title": "CPU Utilization High", "message": "The CPU of your computer is unable to keep up with the current processing load, and this may impact your audio quality. For troubleshooting tips, click here." }, // CPU_LOAD + 15: { "title": "CPU Utilization High", "message": "The CPU of your computer is unable to keep up with the current processing load, and this may impact your audio quality. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems"}, // CPU_LOAD 16: {"title": "Decode Violations", "message": ""}, // DECODE_VIOLATIONS, 17: {"title": "", "message": ""}, // LAST_THRESHOLD 18: {"title": "Wifi Alert", "message": ""}, // WIFI_NETWORK_ALERT, //user or peer is using wifi @@ -162,10 +162,10 @@ 33: {"title": "Client No Longer Pinned", "message": "This client is no longer designated as the source of the broadcast."}, // SESSION_LIVEBROADCAST_UNPINNED, //node unpinned by user 34: {"title": "", "message": ""}, // BACKEND_STATUS_MSG, //status/informational message - 35: {"title": "LAN Unpredictable", "message": "Your local network is adding considerable variance to transmit times. For troubleshooting tips, click here."}, // LOCAL_NETWORK_VARIANCE_HIGH,//the ping time via a hairpin for the user network is unnaturally high or variable. + 35: {"title": "LAN Unpredictable", "message": "Your local network is adding considerable variance to transmit times. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems"}, // LOCAL_NETWORK_VARIANCE_HIGH,//the ping time via a hairpin for the user network is unnaturally high or variable. //indicates problem with user computer stack or network itself (wifi, antivirus etc) - 36: {"title": "LAN High Latency", "message": "Your local network is adding considerable latency. For troubleshooting tips, click here."}, // LOCAL_NETWORK_LATENCY_HIGH, + 36: {"title": "LAN High Latency", "message": "Your local network is adding considerable latency. For troubleshooting tips, click the '?'.", help: "https://jamkazam.desk.com/customer/portal/articles/1288778-troubleshoot-session-quality-problems"}, // LOCAL_NETWORK_LATENCY_HIGH, 37: {"title": "", "message": ""}, // RECORDING_CLOSE, //update and remove tracks from front-end 38: {"title": "No Audio Sent", "message": ""}, // PEER_REPORTS_NO_AUDIO_RECV, //update and remove tracks from front-end 39: {"title": "", "message": ""}, // SHOW_PREFERENCES, //show preferences dialog diff --git a/web/app/assets/javascripts/react-components/PopupMediaControls.js.jsx.coffee b/web/app/assets/javascripts/react-components/PopupMediaControls.js.jsx.coffee index b73105757..87d0bdc13 100644 --- a/web/app/assets/javascripts/react-components/PopupMediaControls.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/PopupMediaControls.js.jsx.coffee @@ -81,7 +81,7 @@ mixins.push(Reflux.listenTo(MediaPlaybackStore, 'onMediaStateChanged')) componentDidMount: () -> - $(window).unload(@windowUnloaded ) + $(window).unload(@windowUnloaded) @root = jQuery(this.getDOMNode()) diff --git a/web/app/assets/javascripts/react-components/PopupRecordingStartStop.js.jsx.coffee b/web/app/assets/javascripts/react-components/PopupRecordingStartStop.js.jsx.coffee index 5eaa6a050..7cb29df6e 100644 --- a/web/app/assets/javascripts/react-components/PopupRecordingStartStop.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/PopupRecordingStartStop.js.jsx.coffee @@ -96,7 +96,12 @@ if window.opener ` + windowUnloaded: () -> + window.opener.RecordingActions.recordingControlsClosed() + componentDidMount: () -> + $(window).unload(@windowUnloaded) + $root = jQuery(this.getDOMNode()) $recordingType = $root.find('input[type="radio"]') diff --git a/web/app/assets/javascripts/react-components/SessionNotification.js.jsx.coffee b/web/app/assets/javascripts/react-components/SessionNotification.js.jsx.coffee index f89ab3e39..b1decbf08 100644 --- a/web/app/assets/javascripts/react-components/SessionNotification.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/SessionNotification.js.jsx.coffee @@ -3,14 +3,27 @@ context = window @SessionNotification = React.createClass({ render: () -> - `
-
{this.props.msg}
+ + classes = classNames({ + 'session-notification' : true + 'has-details' : @props.detail? + }) + + help = `?` if @props.help? + + title = `
{this.props.title}{help}
` + extra = `
{this.props.extra}
` if @props.extra? + + `
+ {title} + {extra}
` componentDidMount: () -> $root = $(@getDOMNode()) + context.JK.popExternalLinks($root) - if @props.detail + if @props.detail? context.JK.hoverBubble($root, @props.detail, {offsetParent:$root.closest('.top-parent'), positions: ['left', 'bottom']}) }) \ No newline at end of file diff --git a/web/app/assets/javascripts/react-components/SessionRecordBtn.js.jsx.coffee b/web/app/assets/javascripts/react-components/SessionRecordBtn.js.jsx.coffee index e6bf9c2d5..90234b18c 100644 --- a/web/app/assets/javascripts/react-components/SessionRecordBtn.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/SessionRecordBtn.js.jsx.coffee @@ -1,4 +1,5 @@ context = window +RecordingActions = @RecordingActions @SessionRecordBtn = React.createClass({ @@ -13,20 +14,7 @@ context = window openRecording: () -> - if this.state.childWindow? - this.state.childWindow.close() - - childWindow = window.open("/popups/recording-controls", 'Recording', 'scrollbars=yes,toolbar=no,status=no,height=315,width=350') - childWindow.ParentRecordingStore = context.RecordingStore - childWindow.ParentIsRecording = this.state.isRecording - - ### - $(childWindow).on('load', ()=> - childWindow.focus() - ) - ### - - this.setState({childWindow: childWindow}) + RecordingActions.openRecordingControls() render: () -> ` diff --git a/web/app/assets/javascripts/react-components/SessionTrackVU.js.jsx.coffee b/web/app/assets/javascripts/react-components/SessionTrackVU.js.jsx.coffee index 8cd74e68c..933538a7c 100644 --- a/web/app/assets/javascripts/react-components/SessionTrackVU.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/SessionTrackVU.js.jsx.coffee @@ -64,9 +64,9 @@ ptrCount = 0 $root = $(this.getDOMNode()) if mixerChanged - logger.debug("re-registering VU", mixer) + logger.debug("re-registering VU") else - logger.debug("registered VU", mixer) + logger.debug("registered VU") context.JK.VuHelpers.registerVU(@props.side, mixer, @state.ptr, @props.orientation == 'horizontal', @props.lightCount, $root.find('td')) @@ -81,7 +81,7 @@ ptrCount = 0 componentWillUnmount: () -> if @state.registered? - logger.debug("unregistered VU", @state.registered.mixer) + logger.debug("unregistered VU") context.JK.VuHelpers.unregisterVU(@state.registered.mixer, @state.registered.ptr) }) \ No newline at end of file diff --git a/web/app/assets/javascripts/react-components/actions/RecordingActions.js.coffee b/web/app/assets/javascripts/react-components/actions/RecordingActions.js.coffee index 546176110..f6b111ac9 100644 --- a/web/app/assets/javascripts/react-components/actions/RecordingActions.js.coffee +++ b/web/app/assets/javascripts/react-components/actions/RecordingActions.js.coffee @@ -9,5 +9,6 @@ context = window stoppingRecording: {} stoppedRecording: {} abortedRecording: {} - + openRecordingControls: {} + recordingControlsClosed: {} }) \ No newline at end of file diff --git a/web/app/assets/javascripts/react-components/stores/RecordingStore.js.jsx.coffee b/web/app/assets/javascripts/react-components/stores/RecordingStore.js.jsx.coffee index d4fb8e447..6c6412f96 100644 --- a/web/app/assets/javascripts/react-components/stores/RecordingStore.js.jsx.coffee +++ b/web/app/assets/javascripts/react-components/stores/RecordingStore.js.jsx.coffee @@ -5,6 +5,8 @@ logger = context.JK.logger @RecordingStore = Reflux.createStore( { listenables: @RecordingActions + recordingWindow: null + init: -> # Register with the app store to get @app @@ -27,10 +29,14 @@ logger = context.JK.logger details.cause = 'starting' this.trigger(details) + @popupRecordingControls() unless @recordingWindow? + onStartedRecording: (details) -> details.cause = 'started' this.trigger(details) + @popupRecordingControls() unless @recordingWindow? + onStoppingRecording: (details) -> details.cause = 'stopping' this.trigger(details) @@ -42,5 +48,23 @@ logger = context.JK.logger onAbortedRecording: (details) -> details.cause = 'aborted' this.trigger(details) + + onOpenRecordingControls: () -> + logger.debug("recording controls opening") + + if @recordingWindow? + @recordingWindow.close() + + @popupRecordingControls() + + onRecordingControlsClosed: () -> + logger.debug("recording controls closed") + @recordingWindow = null + + popupRecordingControls: () -> + @recordingWindow = window.open("/popups/recording-controls", 'Recording', 'scrollbars=yes,toolbar=no,status=no,height=315,width=350') + @recordingWindow.ParentRecordingStore = context.RecordingStore + @recordingWindow.ParentIsRecording = @recordingModel.isRecording() + } ) diff --git a/web/app/assets/javascripts/react-components/stores/SessionNotificationStore.js.coffee b/web/app/assets/javascripts/react-components/stores/SessionNotificationStore.js.coffee index 23c5bc63d..54b42c1b7 100644 --- a/web/app/assets/javascripts/react-components/stores/SessionNotificationStore.js.coffee +++ b/web/app/assets/javascripts/react-components/stores/SessionNotificationStore.js.coffee @@ -23,7 +23,29 @@ rest = context.JK.Rest() processNotification: (notification) -> notification.id = ++@count - @notifications.unshift(notification) + + title = 'n/a' + extra = null + + if notification.backend_detail? + if notification.backend_detail == 'Network Issues' + title = 'Network Issues' + extra = notification.msg + else + title = notification.msg + extra = notification.backend_detail + else + title = notification.msg + + detail = if notification.detail? && notification.detail != "" then notification.detail else null + + data = + title: title + extra: extra + detail: detail + help: notification.help + + @notifications.unshift(data) if @notifications.length > 100 @notifications.pop(); diff --git a/web/app/assets/stylesheets/client/react-components/SessionScreen.css.scss b/web/app/assets/stylesheets/client/react-components/SessionScreen.css.scss index a280dd355..bbcd53031 100644 --- a/web/app/assets/stylesheets/client/react-components/SessionScreen.css.scss +++ b/web/app/assets/stylesheets/client/react-components/SessionScreen.css.scss @@ -302,6 +302,24 @@ $session-screen-divider: 1415px; @include border_box_sizing; padding:6px; margin:10px 0; + + &.has-details { + cursor:pointer; + } + + .msg { + font-size:14px; + } + .detail { + font-size:12px; + margin-top:5px; + } + .notify-help { + color:#ffcc00; + text-decoration: none; + font-size:12px; + margin-left:5px; + } } }