diff --git a/docker/.dockerignore b/docker/.dockerignore deleted file mode 100644 index 46d0c1189235f96c2eedfcc2aab1d282c78097b6..0000000000000000000000000000000000000000 --- a/docker/.dockerignore +++ /dev/null @@ -1,2 +0,0 @@ -webapps -webroot diff --git a/docker/Dockerfile b/docker/Dockerfile index cd360765e5ce64635d1f4b4a717be37376f07bd5..4259dcf87ead2ef2104dc508a6281bd158cf8370 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -18,5 +18,7 @@ COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY tomcat-users.xml /tomcat/conf/tomcat-users.xml COPY elasticsearch.yml /elasticsearch/config/elasticsearch.yml COPY nginx.conf /etc/nginx/nginx.conf -EXPOSE 80 8080 9200 9300 27017 +COPY webapps /tomcat/webapps/ +COPY webroot /webroot/ +EXPOSE 80 9300 27017 CMD ["/usr/bin/supervisord"] \ No newline at end of file diff --git a/docker/docker-build.sh b/docker/docker-build.sh index 3351abcf6b4d23e025e37b8f25207c23d3870bac..572703a974f3d830591bbf9c869324380f555988 100755 --- a/docker/docker-build.sh +++ b/docker/docker-build.sh @@ -3,20 +3,9 @@ ####################################################################################### # CONFIGURATION -BUILD_WITH_BACKEND=1 -BUILD_WITH_FRONTEND=1 +# nothing ####################################################################################### -DIR="$(dirname "$(readlink -f "$0")")" - -if [ $BUILD_WITH_BACKEND -ne 1 ]; then - find webapps -maxdepth 1 -not -name ".*" -not -path webapps -exec rm -rf {} \; -fi - -if [ $BUILD_WITH_FRONTEND -ne 1 ]; then - find webroot -maxdepth 1 -not -name ".*" -not -path webroot -exec rm -rf {} \; -fi - docker build -t eikecochu/vipra . exit 0 \ No newline at end of file diff --git a/docker/docker-run.sh b/docker/docker-run.sh index 752761e737474afabc85ff306089fc17ca1aef6a..c77b960862a3bdfd76a88f7f1062811b3535c0a2 100755 --- a/docker/docker-run.sh +++ b/docker/docker-run.sh @@ -5,8 +5,6 @@ # set host machine ports HOST_NGINX=80 -HOST_TOMCAT=8080 -HOST_ELASTICSEARCH_REST=9200 HOST_ELASTICSEARCH_API=9300 HOST_MONGODB=27017 @@ -17,7 +15,7 @@ REPLACE_WEBROOT=1 ####################################################################################### DIR="$(dirname "$(readlink -f "$0")")" -PORT_MAPPING="-p $HOST_NGINX:80 -p $HOST_TOMCAT:8080 -p $HOST_ELASTICSEARCH_REST:9200 -p $HOST_ELASTICSEARCH_API:9300 -p $HOST_MONGODB:27017" +PORT_MAPPING="-p $HOST_NGINX:80 -p $HOST_ELASTICSEARCH_API:9300 -p $HOST_MONGODB:27017" if [ $REPLACE_WEBAPPS -eq 1 ]; then VOLUME_WEBAPPS="-v $DIR/webapps:/tomcat/webapps" diff --git a/vipra-ui/app/html/directives/word-evolution.html b/vipra-ui/app/html/directives/word-evolution.html index 45655308b47a199045c9284641804bc06a74730b..22939158ec1a00faa332f84f71ca9b0ec784c941 100644 --- a/vipra-ui/app/html/directives/word-evolution.html +++ b/vipra-ui/app/html/directives/word-evolution.html @@ -17,12 +17,11 @@ </div> <div class="panel-body"> <div class="topic-list sidebar"> - <ul class="list-unstyled"> + <ul class="list-unstyled item-choice"> <li ng-repeat="word in topic.words"> <div class="checkbox checkbox-condensed" ng-class="{selected:word.selected}"> <input tabindex="0" type="checkbox" ng-model="word.selected" ng-attr-id="{{::word.id}}" ng-change="redrawWordEvolutionChart()"> <label class="check" ng-attr-for="{{::word.id}}"> - <topic-menu topic="topic" class="menu-button" /> <span class="ellipsis"> <word-link word="::word" /> </span> diff --git a/vipra-ui/app/html/explorer.html b/vipra-ui/app/html/explorer.html index 8a95b5f7ff7d249d04df700c585d115159eb35db..a7efde87cd76d7f730a8da9b32b4f76da6abcc16 100644 --- a/vipra-ui/app/html/explorer.html +++ b/vipra-ui/app/html/explorer.html @@ -21,7 +21,7 @@ <input type="text" class="form-control" ng-model="search.$" placeholder="Filter"> <span class="glyphicon glyphicon-remove-circle searchclear" ng-click="search=''"></span> </div> - <ul class="list-unstyled topic-choice"> + <ul class="list-unstyled item-choice topic-choice"> <li ng-repeat="topic in topics | orderBy:explorerModels.sorttopics:explorerModels.sortdir | filter:search" ng-mouseenter="highlightSeries(topic.id, true)" ng-mouseleave="highlightSeries(topic.id, false)" ng-class="{selected:topic.selected}" class="text-muted"> <div class="checkbox checkbox-condensed"> <span class="valuebar" ng-style="{width:topic.topicCurrValue}"></span> @@ -71,7 +71,7 @@ </div> <div class="row row-50"> <div class="sidebar"> - <ul class="list-unstyled topic-choice no-offset"> + <ul class="list-unstyled item-choice no-offset"> <li ng-repeat="topic in selectedTopics = (topics | filter: {selected: true} | orderBy:explorerModels.sorttopics:explorerModels.sortdir)" ng-mouseenter="highlightSeries(topic.id, true)" ng-mouseleave="highlightSeries(topic.id, false)" ng-class="{active:explorerModels.activeTopic.id===topic.id}" class="pointer text-muted"> <div class="radio radio-condensed"> <span class="valuebar" ng-style="{width:topic.topicCurrValue}"></span> diff --git a/vipra-ui/app/index.html b/vipra-ui/app/index.html index 82f20d7e6dce05a87709c201764077a0985356e9..0e63f34c47274e8ee3acbd3b8dfe0005c045e44b 100644 --- a/vipra-ui/app/index.html +++ b/vipra-ui/app/index.html @@ -78,7 +78,7 @@ </div> </nav> <div class="main" ui-view ng-cloak></div> - <div id="topicModelModal" class="modal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false"> + <div id="topicModelModal" class="modal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" ng-show="!fatal"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> @@ -126,5 +126,8 @@ <div class="alerts"> <bs-alert ng-model="alert" type="alert.type" ng-repeat="alert in alerts"/> </div> + <div class="fatal message-container" ng-show="fatal"> + <div class="message" ng-bind="fatal"></div> + </div> </body> </html> \ No newline at end of file diff --git a/vipra-ui/app/js/app.js b/vipra-ui/app/js/app.js index d8346f8e4873ededfdbda55db90e28d1f0e19748..b4a58accc963979d03aede852ec4e2cc85464497 100644 --- a/vipra-ui/app/js/app.js +++ b/vipra-ui/app/js/app.js @@ -175,7 +175,10 @@ responseError: function(rejection) { requestDecrement(rejection.config); - if (rejection.data) { + if(rejection.status === -1) { + // backend unavailable + $rootScope.fatal = 'Backend unavailable'; + } else if (rejection.data) { if (angular.isArray(rejection.data)) { for (var i = 0; i < rejection.data.length; i++) { $rootScope.alerts.push(angular.extend({ diff --git a/vipra-ui/app/js/controllers.js b/vipra-ui/app/js/controllers.js index cb1934d3c46398e3a249d7e81d07418e80de0f6d..6977ff318dc1e0ae981b3ddd852058e72113c60a 100644 --- a/vipra-ui/app/js/controllers.js +++ b/vipra-ui/app/js/controllers.js @@ -1349,51 +1349,6 @@ } ]); - /**************************************************************************** - * Bug Report Controller - ****************************************************************************/ - - app.controller('BugReportController', ['$scope', '$state', '$q', 'BugReportFactory', - function($scope, $state, $q, BugReportFactory) { - - $scope.sendBugReport = function() { - var defer = $q.defer(), - file = document.getElementById('bugScreenshot').files[0]; - if (file) { - var reader = new FileReader(); - reader.onload = function() { - defer.resolve(reader.result); - }; - reader.onabort = function() { - defer.resolve(); - }; - reader.readAsDataURL(file); - } else { - defer.resolve(); - } - - defer.promise.then(function(screenshot) { - BugReportFactory.save({ - userAgent: navigator.userAgent, - route: $state.current.name, - reproducible: $scope.bug.reproducible, - description: $scope.bug.description, - screenshot: screenshot - }, function() { - $('#bugReportModal').modal('hide'); - $scope.clear(); - }); - }); - }; - - $scope.clear = function() { - delete $scope.bug; - document.forms.bugReportForm.reset(); - }; - - } - ]); - /**************************************************************************** * Error Controllers ****************************************************************************/ diff --git a/vipra-ui/app/less/app.less b/vipra-ui/app/less/app.less index b9408ef91b4a51cbd30ecb6d053d92cc41ef6727..f728684c197f9eb9760bc850882a2889382fbfd4 100644 --- a/vipra-ui/app/less/app.less +++ b/vipra-ui/app/less/app.less @@ -1,5 +1,7 @@ @basecolor: #007aa3; @topbarSpace: 70px; +@sidebar-padding: 5px; +@sidebar-width: 250px; html { position: relative; @@ -291,8 +293,6 @@ a:hover { } } -@sidebar-padding: 5px; -@sidebar-width: 250px; .sidebar { background: #f9f9f9; padding: @sidebar-padding; @@ -327,65 +327,72 @@ a:hover { .sequence { flex: 1 0 0; } - .topic-choice { - position: absolute; - top: 110px; - bottom: 0; - left: @sidebar-padding; - right: @sidebar-padding; - overflow-y: auto; - margin-bottom: 0; - > li { - position: relative; - height: 21px; - margin-top: 1px; - } - .ellipsis { - padding-right: 15px; - } - label { - margin: 0; - font-weight: normal; - &:before, - &:after { - margin-top: 2px; - margin-left: -18px; - } - } - &.no-offset { - top: 5px; - } - .popover-area { - position: absolute; - right: 0; - top: 0; - width: 250px; - height: 100%; - } - topic-menu { - position: absolute; - } - .selected, - .active { - color: #000; + .panel { + margin: 0; + } +} + +.item-choice { + position: absolute; + bottom: 0; + top: 0; + left: @sidebar-padding; + right: @sidebar-padding; + overflow-y: auto; + margin-bottom: 0; + > li { + position: relative; + height: 21px; + margin-top: 1px; + } + .ellipsis { + padding-right: 15px; + } + label { + margin: 0; + font-weight: normal; + &:before, + &:after { + margin-top: 2px; + margin-left: -18px; } } - .colorbox { + &.no-offset { + top: 5px; + } + .popover-area { position: absolute; right: 0; top: 0; - visibility: hidden; + width: 250px; + height: 100%; } - .checkbox:hover .colorbox, - .selected .colorbox, - .colorbox.shown { - visibility: visible; + topic-menu { + position: absolute; } - .panel { - margin: 0; + .selected, + .active { + color: #000; } } +.topic-choice { + top: 110px; +} + +.colorbox { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.checkbox:hover .colorbox, +.selected .colorbox, +.colorbox.shown { + visibility: visible; +} + .radio-inline { vertical-align: bottom; } @@ -670,6 +677,22 @@ entity-menu { overflow: auto; } +.fatal { + .noselect; + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 9999; + background: rgba(0,0,0,0.1); + .message { + color: #fff; + font-size: 35px; + text-shadow: 0 0 5px rgba(255,255,255,0.5); + } +} + @-moz-keyframes spin { 100% { -moz-transform: rotateY(360deg);