diff options
Diffstat (limited to 'server/sonar-web/src/main/js')
16 files changed, 0 insertions, 329 deletions
diff --git a/server/sonar-web/src/main/js/apps/computation/app.js b/server/sonar-web/src/main/js/apps/computation/app.js deleted file mode 100644 index ed7d8ede521..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/app.js +++ /dev/null @@ -1,57 +0,0 @@ -import Backbone from 'backbone'; -import Marionette from 'backbone.marionette'; -import Router from './router'; -import Layout from './layout'; -import Reports from './reports'; -import HeaderView from './header-view'; -import SearchView from './search-view'; -import ListView from './list-view'; -import ListFooterView from './list-footer-view'; - -var App = new Marionette.Application(), - init = function (options) { - // Collection - this.reports = new Reports(); - - // Router - this.router = new Router({ reports: this.reports }); - - // Layout - this.layout = new Layout({ el: options.el }); - this.layout.render(); - - // Header View - this.headerView = new HeaderView({ collection: this.reports }); - this.layout.headerRegion.show(this.headerView); - - // Search View - this.searchView = new SearchView({ - collection: this.reports, - router: this.router - }); - this.layout.searchRegion.show(this.searchView); - - // List View - this.listView = new ListView({ collection: this.reports }); - this.layout.listRegion.show(this.listView); - - // List Footer View - this.listFooterView = new ListFooterView({ collection: this.reports }); - this.layout.listFooterRegion.show(this.listFooterView); - - // Go! - Backbone.history.start({ - pushState: true, - root: options.urlRoot - }); - }; - -App.on('start', function (options) { - window.requestMessages().done(function () { - init.call(App, options); - }); -}); - -export default App; - - diff --git a/server/sonar-web/src/main/js/apps/computation/header-view.js b/server/sonar-web/src/main/js/apps/computation/header-view.js deleted file mode 100644 index 570ea82cde2..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/header-view.js +++ /dev/null @@ -1,8 +0,0 @@ -import Marionette from 'backbone.marionette'; -import './templates'; - -export default Marionette.ItemView.extend({ - template: Templates['computation-header'] -}); - - diff --git a/server/sonar-web/src/main/js/apps/computation/layout.js b/server/sonar-web/src/main/js/apps/computation/layout.js deleted file mode 100644 index 7ac5b7007bd..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/layout.js +++ /dev/null @@ -1,15 +0,0 @@ -import Marionette from 'backbone.marionette'; -import './templates'; - -export default Marionette.LayoutView.extend({ - template: Templates['computation-layout'], - - regions: { - headerRegion: '#computation-header', - searchRegion: '#computation-search', - listRegion: '#computation-list', - listFooterRegion: '#computation-list-footer' - } -}); - - diff --git a/server/sonar-web/src/main/js/apps/computation/list-footer-view.js b/server/sonar-web/src/main/js/apps/computation/list-footer-view.js deleted file mode 100644 index 89ee3120934..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/list-footer-view.js +++ /dev/null @@ -1,34 +0,0 @@ -import _ from 'underscore'; -import Marionette from 'backbone.marionette'; -import './templates'; - -export default Marionette.ItemView.extend({ - template: Templates['computation-list-footer'], - - collectionEvents: { - 'all': 'render' - }, - - events: { - 'click #computation-fetch-more': 'onMoreClick' - }, - - onMoreClick: function (e) { - e.preventDefault(); - this.fetchMore(); - }, - - fetchMore: function () { - this.collection.fetchMore(); - }, - - serializeData: function () { - return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { - total: this.collection.total, - count: this.collection.length, - more: this.collection.hasMore() - }); - } -}); - - diff --git a/server/sonar-web/src/main/js/apps/computation/list-item-view.js b/server/sonar-web/src/main/js/apps/computation/list-item-view.js deleted file mode 100644 index e891effd244..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/list-item-view.js +++ /dev/null @@ -1,27 +0,0 @@ -import _ from 'underscore'; -import Marionette from 'backbone.marionette'; -import './templates'; - -export default Marionette.ItemView.extend({ - tagName: 'li', - className: 'panel', - template: Templates['computation-list-item'], - - onRender: function () { - this.$el.attr('data-id', this.model.id); - this.$el.toggleClass('panel-danger', this.model.isDanger()); - this.$('[data-toggle="tooltip"]').tooltip({ container: 'body', placement: 'bottom' }); - }, - - onDestroy: function () { - this.$('[data-toggle="tooltip"]').tooltip('destroy'); - }, - - serializeData: function () { - return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { - duration: this.model.getDuration() - }); - } -}); - - diff --git a/server/sonar-web/src/main/js/apps/computation/list-view.js b/server/sonar-web/src/main/js/apps/computation/list-view.js deleted file mode 100644 index 695bf2ac034..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/list-view.js +++ /dev/null @@ -1,10 +0,0 @@ -import Marionette from 'backbone.marionette'; -import ListItemView from './list-item-view'; -import './templates'; - -export default Marionette.CollectionView.extend({ - tagName: 'ul', - childView: ListItemView -}); - - diff --git a/server/sonar-web/src/main/js/apps/computation/report.js b/server/sonar-web/src/main/js/apps/computation/report.js deleted file mode 100644 index 3dec4d50324..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/report.js +++ /dev/null @@ -1,26 +0,0 @@ -import Backbone from 'backbone'; - -export default Backbone.Model.extend({ - idAttribute: 'id', - - getDuration: function () { - var duration = null; - if (this.has('startedAt')) { - var startedAtMoment = moment(this.get('startedAt')), - finishedAtMoment = moment(this.get('executedAt') || new Date()), - diff = finishedAtMoment.diff(startedAtMoment); - duration = { - seconds: Math.floor(diff / 1000) % 60, - minutes: Math.floor(diff / (1000 * 60)) % 60, - hours: Math.floor(diff / (1000 * 60 * 60)) % 24 - }; - } - return duration; - }, - - isDanger: function () { - var dangerStatuses = ['CANCELED', 'FAILED']; - return dangerStatuses.indexOf(this.get('status')) !== -1; - } -}); - diff --git a/server/sonar-web/src/main/js/apps/computation/reports.js b/server/sonar-web/src/main/js/apps/computation/reports.js deleted file mode 100644 index 2281cc88150..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/reports.js +++ /dev/null @@ -1,33 +0,0 @@ -import _ from 'underscore'; -import Backbone from 'backbone'; -import Report from './report'; - -export default Backbone.Collection.extend({ - model: Report, - url: '', - - parse: function (r) { - this.total = (r.paging && r.paging.total) || r.tasks.length; - this.p = (r.paging && r.paging.pageIndex) || 1; - this.ps = r.paging && r.paging.pageSize; - return r.tasks; - }, - - fetch: function (options) { - var opts = _.defaults(options || {}, { q: this.q }, { q: 'activity', data: { ps: 250 } }); - opts.url = baseUrl + '/api/ce/' + opts.q; - this.q = opts.q; - return Backbone.Collection.prototype.fetch.call(this, opts); - }, - - fetchMore: function () { - var p = this.p + 1; - return this.fetch({ add: true, remove: false, data: { p: p, ps: this.ps } }); - }, - - hasMore: function () { - return this.total > this.p * this.ps; - } - -}); - diff --git a/server/sonar-web/src/main/js/apps/computation/router.js b/server/sonar-web/src/main/js/apps/computation/router.js deleted file mode 100644 index a7543e934a5..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/router.js +++ /dev/null @@ -1,28 +0,0 @@ -import Backbone from 'backbone'; - -export default Backbone.Router.extend({ - routes: { - '': 'index', - 'index': 'index', - 'current': 'current', - 'past': 'past' - }, - - initialize: function (options) { - this.options = options; - }, - - index: function () { - this.navigate('current'); - this.current(); - }, - - current: function () { - this.options.reports.fetch({ q: 'queue' }); - }, - - past: function () { - this.options.reports.fetch({ q: 'activity' }); - } -}); - diff --git a/server/sonar-web/src/main/js/apps/computation/search-view.js b/server/sonar-web/src/main/js/apps/computation/search-view.js deleted file mode 100644 index 1e896df0c16..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/search-view.js +++ /dev/null @@ -1,34 +0,0 @@ -import _ from 'underscore'; -import Marionette from 'backbone.marionette'; -import './templates'; - -export default Marionette.ItemView.extend({ - template: Templates['computation-search'], - - collectionEvents: { - 'all': 'render' - }, - - events: { - 'click .js-queue': 'queue', - 'click .js-history': 'history' - }, - - queue: function (e) { - e.preventDefault(); - this.options.router.navigate('current', { trigger: true }); - }, - - history: function (e) { - e.preventDefault(); - this.options.router.navigate('past', { trigger: true }); - }, - - serializeData: function () { - return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), { - tab: this.collection.q - }); - } -}); - - diff --git a/server/sonar-web/src/main/js/apps/computation/templates/computation-header.hbs b/server/sonar-web/src/main/js/apps/computation/templates/computation-header.hbs deleted file mode 100644 index 1995afdb34c..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/templates/computation-header.hbs +++ /dev/null @@ -1,5 +0,0 @@ -<header class="page-header"> - <h1 class="page-title">Project Computation</h1> - <p class="page-description">The server is in charge to process reports submitted by batch analyses. This page allows - to monitor the queue of pending reports to process, and gives access to the history of past analyses.</p> -</header> diff --git a/server/sonar-web/src/main/js/apps/computation/templates/computation-layout.hbs b/server/sonar-web/src/main/js/apps/computation/templates/computation-layout.hbs deleted file mode 100644 index 0d6d7f04ac5..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/templates/computation-layout.hbs +++ /dev/null @@ -1,6 +0,0 @@ -<div class="page"> - <div id="computation-header"></div> - <div id="computation-search"></div> - <div id="computation-list"></div> - <div id="computation-list-footer"></div> -</div> diff --git a/server/sonar-web/src/main/js/apps/computation/templates/computation-list-footer.hbs b/server/sonar-web/src/main/js/apps/computation/templates/computation-list-footer.hbs deleted file mode 100644 index 5a612644148..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/templates/computation-list-footer.hbs +++ /dev/null @@ -1,6 +0,0 @@ -<footer class="spacer-top note text-center"> - {{count}}/{{total}} shown - {{#if more}} - <a id="computation-fetch-more" class="spacer-left" href="#">show more</a> - {{/if}} -</footer> diff --git a/server/sonar-web/src/main/js/apps/computation/templates/computation-list-item.hbs b/server/sonar-web/src/main/js/apps/computation/templates/computation-list-item.hbs deleted file mode 100644 index dcc4feb1bfc..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/templates/computation-list-item.hbs +++ /dev/null @@ -1,32 +0,0 @@ -<div class="display-inline-block text-top width-30"> - <i class="icon-qualifier-trk"></i> - <a href="{{dashboardUrl componentKey}}">{{componentName}}</a> -</div> - -<div class="display-inline-block text-top width-30"> - <ul> - {{#if submittedAt}} - <li>Submitted: {{dt submittedAt}}</li> - {{/if}} - {{#if startedAt}} - <li>Started: {{dt startedAt}}</li> - {{/if}} - {{#if executedAt}} - <li>Executed: {{dt executedAt}}</li> - {{/if}} - </ul> -</div> - - -{{#if duration}} - <div class="display-inline-block text-top width-30"> - Duration: - {{#gt duration.hours 0}}{{duration.hours}}h{{/gt}} - {{#gt duration.minutes 0}}{{duration.minutes}}m{{/gt}} - {{duration.seconds}}s - </div> -{{/if}} - -<div class="pull-right"> - {{status}} -</div> diff --git a/server/sonar-web/src/main/js/apps/computation/templates/computation-search.hbs b/server/sonar-web/src/main/js/apps/computation/templates/computation-search.hbs deleted file mode 100644 index a41e880792d..00000000000 --- a/server/sonar-web/src/main/js/apps/computation/templates/computation-search.hbs +++ /dev/null @@ -1,6 +0,0 @@ -<div class="spacer-top"> - <ul class="tabs"> - <li><a class="js-queue {{#eq tab 'queue'}}selected{{/eq}}">{{t 'analysis_reports.current_activity'}}</a></li> - <li><a class="js-history {{#eq tab 'activity'}}selected{{/eq}}">{{t 'analysis_reports.past_reports'}}</a></li> - </ul> -</div> diff --git a/server/sonar-web/src/main/js/apps/nav/settings/settings-nav.jsx b/server/sonar-web/src/main/js/apps/nav/settings/settings-nav.jsx index b6f77e505fe..e6e316a9ed4 100644 --- a/server/sonar-web/src/main/js/apps/nav/settings/settings-nav.jsx +++ b/server/sonar-web/src/main/js/apps/nav/settings/settings-nav.jsx @@ -57,8 +57,6 @@ export default React.createClass({ <ul className="dropdown-menu"> {this.renderLink('/projects', 'Management')} {this.renderLink('/background_tasks', 'Background Tasks')} - <li className="divider"/> - {this.renderLink('/computation', window.t('analysis_reports.page'))} </ul> </li> |