diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 00000000..2873e2fc --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,13 @@ +module.exports = { + root: true, + parserOptions: { + ecmaVersion: 2017, + sourceType: 'module' + }, + extends: 'eslint:recommended', + env: { + browser: true + }, + rules: { + } +}; diff --git a/app/adapters/harvest-log.js b/app/adapters/harvest-log.js new file mode 100644 index 00000000..da21142c --- /dev/null +++ b/app/adapters/harvest-log.js @@ -0,0 +1,13 @@ +import ApplicationAdapter from './application'; + +export default ApplicationAdapter.extend({ + pathForType() { + return 'HarvestLog'; + }, + ajax(url, type, options) { + if (options) { + options.traditional = true; + } + return this._super(...arguments); + } +}); diff --git a/app/adapters/source-config.js b/app/adapters/source-config.js new file mode 100644 index 00000000..ba4b7e5c --- /dev/null +++ b/app/adapters/source-config.js @@ -0,0 +1,7 @@ +import ApplicationAdapter from './application'; + +export default ApplicationAdapter.extend({ + pathForType() { + return 'SourceConfig'; + } +}); diff --git a/app/adapters/source.js b/app/adapters/source.js new file mode 100644 index 00000000..fb4e74fb --- /dev/null +++ b/app/adapters/source.js @@ -0,0 +1,7 @@ +import ApplicationAdapter from './application'; + +export default ApplicationAdapter.extend({ + pathForType() { + return 'sources'; + } +}); diff --git a/app/components/details-page.js b/app/components/details-page.js new file mode 100644 index 00000000..926b6130 --- /dev/null +++ b/app/components/details-page.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ +}); diff --git a/app/components/page-nav.js b/app/components/page-nav.js new file mode 100644 index 00000000..ccbd5130 --- /dev/null +++ b/app/components/page-nav.js @@ -0,0 +1,15 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + actions: { + nextPage() { + let page = this.get('page'); + this.set('page', page + 1); + }, + prevPage() { + let page = this.get('page'); + this.set('page', this.get('page') - 1); + } + } + } +}); diff --git a/app/components/recent-harvest.js b/app/components/recent-harvest.js new file mode 100644 index 00000000..0cb24aa2 --- /dev/null +++ b/app/components/recent-harvest.js @@ -0,0 +1,11 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + + store: Ember.inject.service(), + + sourceHealth: Ember.computed('sourceConfigId', 'status', function(){ + return this.get('store').query('harvest-log', { source_config_id: this.get('sourceConfigId'), status: '2'} ); + }), + +}); diff --git a/app/components/source-health.js b/app/components/source-health.js new file mode 100644 index 00000000..8aed91cb --- /dev/null +++ b/app/components/source-health.js @@ -0,0 +1,10 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + + store: Ember.inject.service(), + sourceHealth: Ember.computed('sourceConfigId', 'status', function(){ + return this.get('store').query('harvest-log', {source_config_id: this.get('sourceConfigId'), status: [2,3]}); + }), + +}); diff --git a/app/components/status-board.js b/app/components/status-board.js new file mode 100644 index 00000000..5ced7d92 --- /dev/null +++ b/app/components/status-board.js @@ -0,0 +1,5 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + +}); diff --git a/app/components/status-context.js b/app/components/status-context.js new file mode 100644 index 00000000..926b6130 --- /dev/null +++ b/app/components/status-context.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ +}); diff --git a/app/components/status-emoji.js b/app/components/status-emoji.js new file mode 100644 index 00000000..ced03746 --- /dev/null +++ b/app/components/status-emoji.js @@ -0,0 +1,5 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + tagName: 'span', +}); diff --git a/app/components/status-test.js b/app/components/status-test.js new file mode 100644 index 00000000..ced03746 --- /dev/null +++ b/app/components/status-test.js @@ -0,0 +1,5 @@ +import Ember from 'ember'; + +export default Ember.Component.extend({ + tagName: 'span', +}); diff --git a/app/controllers/details.js b/app/controllers/details.js new file mode 100644 index 00000000..1ccc6c1c --- /dev/null +++ b/app/controllers/details.js @@ -0,0 +1,8 @@ +import Ember from 'ember'; + +export default Ember.Controller.extend({ + +// id = this.get('model.source-config'); +// label = this.get('model.source-config'); + +}); diff --git a/app/controllers/harvestlog.js b/app/controllers/harvestlog.js new file mode 100644 index 00000000..f14c3fe9 --- /dev/null +++ b/app/controllers/harvestlog.js @@ -0,0 +1,5 @@ +import Ember from 'ember'; +export default Ember.Controller.extend({ + queryParams: ['source_confgi_id', 'status'], + status: [], +}); diff --git a/app/controllers/harvestloglist.js b/app/controllers/harvestloglist.js new file mode 100644 index 00000000..4531b262 --- /dev/null +++ b/app/controllers/harvestloglist.js @@ -0,0 +1,23 @@ +import Ember from 'ember'; + +export default Ember.Controller.extend({ + queryParams: [ + 'links', + ], + + meta: Ember.computed('model', function() { + let metadata = this.store.metadataFor('harvest-log'); + return Ember.get(metadata, 'links'); + }), + actions: { + nextLink() { + let page = this.get('links'); + this.set('links', page + 1); + }, + + prevLink() { + this.set('links', this.get('links') - 1); + } + } + +}); diff --git a/app/controllers/source.js b/app/controllers/source.js new file mode 100644 index 00000000..55ff9aa5 --- /dev/null +++ b/app/controllers/source.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Controller.extend({ +}); diff --git a/app/controllers/sourceconfig.js b/app/controllers/sourceconfig.js new file mode 100644 index 00000000..45fb0c59 --- /dev/null +++ b/app/controllers/sourceconfig.js @@ -0,0 +1,5 @@ +import Ember from 'ember'; +// checked +export default Ember.Controller.extend({ + + }); diff --git a/app/controllers/status-board.js b/app/controllers/status-board.js new file mode 100644 index 00000000..b5fa0333 --- /dev/null +++ b/app/controllers/status-board.js @@ -0,0 +1,9 @@ +import Ember from 'ember'; + +export default Ember.Controller.extend({ + queryParams: [ + 'page', + ], + page: 1, + +}); diff --git a/app/controllers/statusboard.js b/app/controllers/statusboard.js new file mode 100644 index 00000000..55ff9aa5 --- /dev/null +++ b/app/controllers/statusboard.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +export default Ember.Controller.extend({ +}); diff --git a/app/helpers/equals.js b/app/helpers/equals.js new file mode 100644 index 00000000..5cb74bd2 --- /dev/null +++ b/app/helpers/equals.js @@ -0,0 +1,4 @@ +import Ember from 'ember'; + +const equals = (params) => params[0] === params[1]; +export default Ember.Helper.helper(equals); diff --git a/app/models/details.js b/app/models/details.js new file mode 100644 index 00000000..ca6bd1b7 --- /dev/null +++ b/app/models/details.js @@ -0,0 +1,5 @@ +import DS from 'ember-data'; + +export default DS.Model.extend({ + +}); diff --git a/app/models/harvest-log.js b/app/models/harvest-log.js new file mode 100644 index 00000000..079c0d4a --- /dev/null +++ b/app/models/harvest-log.js @@ -0,0 +1,22 @@ +import DS from 'ember-data'; +import Model from 'ember-data/model'; +import { belongsTo } from 'ember-data/relationships'; + + +const { + attr, +} = DS; + + +export default Model.extend({ + sourceConfig: DS.belongsTo('source-config', {async: true}), + + status: attr('string'), + context: attr('string'), + completions: attr('string'), + dateStarted: attr('string'), + endDate: attr('string'), + startDate: attr('string'), + harvesterVersion: attr('string'), + +}); diff --git a/app/models/source-config.js b/app/models/source-config.js new file mode 100644 index 00000000..b4e06549 --- /dev/null +++ b/app/models/source-config.js @@ -0,0 +1,15 @@ +import DS from 'ember-data'; +import Model from 'ember-data/model'; +import { hasMany } from 'ember-data/relationships'; + +const{ + attr, +}= DS + +export default Model.extend({ + harvestLog: DS.hasMany('harvest-log', {async: true}), + + label: attr('string'), + base_url: attr('string'), + +}); diff --git a/app/models/source.js b/app/models/source.js new file mode 100644 index 00000000..90364d75 --- /dev/null +++ b/app/models/source.js @@ -0,0 +1,15 @@ +import DS from 'ember-data'; +import Model from 'ember-data/model'; + +const { + attr, + belongsTo +} = DS; + +export default Model.extend({ + + long_Title: attr('string'), + name: attr('string'), + home_Page: attr('string'), + icon: attr('string') +}); diff --git a/app/router.js b/app/router.js index df24902f..5a0eda49 100644 --- a/app/router.js +++ b/app/router.js @@ -21,22 +21,28 @@ const Router = Ember.Router.extend({ }); Router.map(function() { - this.route('changes'); - this.route('discover'); - this.route('profile'); - this.route('settings'); - this.route('sources'); - this.route('registration', function() { - this.route('form', { path: '/' }); - this.route('confirmation', { path: '/confirmation/' }); - }); - - this.route('detail', { path: '/:type/:id' }); - this.route('curate', { path: '/curate/:type/:id' }); - - this.route('elastic-down'); - this.route('notfound', { path: '/*path' }); - this.route('notfound'); + this.route('changes'); + this.route('discover'); + this.route('profile'); + this.route('settings'); + this.route('sources'); + this.route('registration', function() { + this.route('form', { path: '/' }); + this.route('confirmation', { path: '/confirmation/' }); + }); + + this.route('detail', { path: '/:type/:id' }); + this.route('curate', { path: '/curate/:type/:id' }); + + this.route('elastic-down'); + this.route('notfound', { path: '/*path' }); + this.route('notfound'); + this.route('status-board'); + this.route('harvestloglist', { path: '/harvestloglist/:label/:id' }); + this.route('details', { path: 'details/:id'}); + this.route('source'); + this.route('source-config'); }); + export default Router; diff --git a/app/routes/details.js b/app/routes/details.js new file mode 100644 index 00000000..c9e26112 --- /dev/null +++ b/app/routes/details.js @@ -0,0 +1,8 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + model: function(params) { + return this.get('store').findRecord('harvest-log', params.id); + } + +}); diff --git a/app/routes/harvest-log.js b/app/routes/harvest-log.js new file mode 100644 index 00000000..0b2672c6 --- /dev/null +++ b/app/routes/harvest-log.js @@ -0,0 +1,10 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + model(){ + return Ember.RSVP.hash({ + harvestlog: this.store.findAll('harvest-log'), + sourceconfig: this.store.findAll('source-config'), + }); + } +}); diff --git a/app/routes/harvestloglist.js b/app/routes/harvestloglist.js new file mode 100644 index 00000000..e0c310b0 --- /dev/null +++ b/app/routes/harvestloglist.js @@ -0,0 +1,7 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + model: function(params) { + return this.get('store').query('harvest-log', {source_config_id: params.id}); + }, +}); diff --git a/app/routes/record.js b/app/routes/record.js new file mode 100644 index 00000000..e00c90d9 --- /dev/null +++ b/app/routes/record.js @@ -0,0 +1,8 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + + model: function(params) { + return this.get('store').find('source-config', params.id); + }, +}); diff --git a/app/routes/source-config.js b/app/routes/source-config.js new file mode 100644 index 00000000..0b2672c6 --- /dev/null +++ b/app/routes/source-config.js @@ -0,0 +1,10 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + model(){ + return Ember.RSVP.hash({ + harvestlog: this.store.findAll('harvest-log'), + sourceconfig: this.store.findAll('source-config'), + }); + } +}); diff --git a/app/routes/source.js b/app/routes/source.js new file mode 100644 index 00000000..1161ae59 --- /dev/null +++ b/app/routes/source.js @@ -0,0 +1,12 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + + model() { + return Ember.RSVP.hash({ + harvestlog: this.store.findAll('harvest-log'), + sourceconfig: this.store.findAll('source-config'), + source: this.store.findAll('source'), + }); + } +}); diff --git a/app/routes/status-board.js b/app/routes/status-board.js new file mode 100644 index 00000000..e6e932e9 --- /dev/null +++ b/app/routes/status-board.js @@ -0,0 +1,12 @@ +import Ember from 'ember'; + +export default Ember.Route.extend({ + queryParams: { + page: { + refreshModel: true + } + }, + model(params) { + return this.get('store').query('source-config', params); + }, +}); diff --git a/app/serializers/harvest-log.js b/app/serializers/harvest-log.js new file mode 100644 index 00000000..70d38386 --- /dev/null +++ b/app/serializers/harvest-log.js @@ -0,0 +1,13 @@ +import ApplicationSerializer from './application'; + +export default ApplicationSerializer.extend({ + + keyForAttribute: function(attr) { + return attr; + }, + + keyForRelationship: function(key){ + return key; + }, + +}); diff --git a/app/serializers/source-config.js b/app/serializers/source-config.js new file mode 100644 index 00000000..9678f197 --- /dev/null +++ b/app/serializers/source-config.js @@ -0,0 +1,4 @@ +import ApplicationSerializer from './application'; + +export default ApplicationSerializer.extend({ +}); diff --git a/app/serializers/source.js b/app/serializers/source.js new file mode 100644 index 00000000..15498b03 --- /dev/null +++ b/app/serializers/source.js @@ -0,0 +1,5 @@ +import ApplicationSerializer from './application'; + +export default ApplicationSerializer.extend({ + +}); diff --git a/app/templates/application.hbs b/app/templates/application.hbs index eb480f5c..28e1d554 100644 --- a/app/templates/application.hbs +++ b/app/templates/application.hbs @@ -3,3 +3,4 @@ {{site-banner banners=banners}} {{outlet}} {{cos-footer}} +{{status-board}} diff --git a/app/templates/components/details-page.hbs b/app/templates/components/details-page.hbs new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/app/templates/components/details-page.hbs @@ -0,0 +1 @@ + diff --git a/app/templates/components/page-nav.hbs b/app/templates/components/page-nav.hbs new file mode 100644 index 00000000..64833cc4 --- /dev/null +++ b/app/templates/components/page-nav.hbs @@ -0,0 +1,4 @@ + diff --git a/app/templates/components/recent-harvest.hbs b/app/templates/components/recent-harvest.hbs new file mode 100644 index 00000000..6ec9cc02 --- /dev/null +++ b/app/templates/components/recent-harvest.hbs @@ -0,0 +1,11 @@ +
+ +{{#each recentHarvests as |hl|}} + {{#link-to "details" hl}} + {{#status-emoji status=hl.status}} + {{/status-emoji}} + {{/link-to}} + +{{/each}} + +
diff --git a/app/templates/components/source-health.hbs b/app/templates/components/source-health.hbs new file mode 100644 index 00000000..c11ebb82 --- /dev/null +++ b/app/templates/components/source-health.hbs @@ -0,0 +1,11 @@ +
+ +{{#each sourceHealth as |hl|}} +{{#link-to "details" hl}} + + {{#status-emoji status=hl.status}} + {{/status-emoji}} + +{{/link-to}} +{{/each}} +
diff --git a/app/templates/components/status-board.hbs b/app/templates/components/status-board.hbs new file mode 100644 index 00000000..70729570 --- /dev/null +++ b/app/templates/components/status-board.hbs @@ -0,0 +1,3 @@ +
+ {{title}} +
diff --git a/app/templates/components/status-context.hbs b/app/templates/components/status-context.hbs new file mode 100644 index 00000000..20001874 --- /dev/null +++ b/app/templates/components/status-context.hbs @@ -0,0 +1,35 @@ +
+ +{{#if (equals status "0")}} + Created +{{/if}} + +{{#if (equals status "1")}} + Started +{{/if}} + +{{#if (equals status "2")}} + Failed +{{/if}} + +{{#if (equals status "3")}} + Succeded +{{/if}} + +{{#if (equals status "4")}} + Rescheduled +{{/if}} + +{{#if (equals status "6")}} + Forced +{{/if}} + +{{#if (equals status "7")}} + Skipped +{{/if}} + +{{#if (equals status "8")}} + Retried +{{/if}} + +
diff --git a/app/templates/components/status-emoji.hbs b/app/templates/components/status-emoji.hbs new file mode 100644 index 00000000..6401fdba --- /dev/null +++ b/app/templates/components/status-emoji.hbs @@ -0,0 +1,37 @@ +
+ +
+{{#if (equals status "0")}} + +{{/if}} + +{{#if (equals status "1")}} + +{{/if}} + +{{#if (equals status "2")}} + +{{/if}} + +{{#if (equals status "3")}} + +{{/if}} + +{{#if (equals status "4")}} + +{{/if}} + +{{#if (equals status "6")}} + +{{/if}} + +{{#if (equals status "7")}} + +{{/if}} + +{{#if (equals status "8")}} + +{{/if}} +
+ +
diff --git a/app/templates/components/status-test.hbs b/app/templates/components/status-test.hbs new file mode 100644 index 00000000..b2cdf251 --- /dev/null +++ b/app/templates/components/status-test.hbs @@ -0,0 +1,5 @@ +
+ + test + +
diff --git a/app/templates/details.hbs b/app/templates/details.hbs new file mode 100644 index 00000000..097ee03b --- /dev/null +++ b/app/templates/details.hbs @@ -0,0 +1,45 @@ +{{outlet}} + +{{log label}} +{{log id}} +{{log model}} +

{{model.id}}

+ +

+ {{#status-emoji status=model.status}}{{/status-emoji}} +

+ +

+ {{#status-context status=model.status}}{{/status-context}} +

+ +

+ {{model.context}} +

+ + diff --git a/app/templates/harvest.hbs b/app/templates/harvest.hbs new file mode 100644 index 00000000..64ac097e --- /dev/null +++ b/app/templates/harvest.hbs @@ -0,0 +1,39 @@ + +

SHARE HARVESTER STATUS BOARD

+ +
+ + + + + + + + + + {{#each harvests as |harvest|}} + + + + {{/each}} +
STATUSNAMELAST HARVESTIDDESCRIPTION
+ +
+
diff --git a/app/templates/harvestloglist.hbs b/app/templates/harvestloglist.hbs new file mode 100644 index 00000000..63b49313 --- /dev/null +++ b/app/templates/harvestloglist.hbs @@ -0,0 +1,88 @@ +{{outlet}} + + +
+ < Prev + Next > +
+ +

+

{{label}}

+ + +
+ + + + + + + + + + + + + + {{#each model as |hl|}} + + + + + + + + + + + +{{/each}} +
STATUSCONTEXTHARVEST LOG IDDATE STARTEDDATE ENDEDSHARE VERSION
+ {{#link-to "details" hl}} + {{#status-emoji status=hl.status}} + {{/status-emoji}} + {{/link-to}} + + {{#status-context status=hl.status}}{{/status-context}} + {{hl.id}}{{hl.startDate}}{{hl.endDate}}{{hl.harvesterVersion}}
+
+{{log model}} diff --git a/app/templates/loading.hbs b/app/templates/loading.hbs new file mode 100644 index 00000000..ed1fc1bc --- /dev/null +++ b/app/templates/loading.hbs @@ -0,0 +1 @@ +{{loading-bars}} diff --git a/app/templates/record.hbs b/app/templates/record.hbs new file mode 100644 index 00000000..b077d922 --- /dev/null +++ b/app/templates/record.hbs @@ -0,0 +1,113 @@ +{{outlet}} +

{{#link-to "status-board"}}return{{/link-to}}

+

{{model.label}}

+ +
+ + + + + + + + + + + + + +{{#each model.recentHarvests as |hl|}} + + + + + + + + + + + +{{/each}} +
STATUSCONTEXTHARVEST LOG IDDATE STARTEDDATE ENDEDSHARE VERSION
+ {{#if (equals hl.status "0")}} + + {{/if}} + + {{#if (equals hl.status "1")}} + + {{/if}} + + {{#if (equals hl.status "2")}} + + {{/if}} + + {{#if (equals hl.status "3")}} + + {{/if}} + + {{#if (equals hl.status "4")}} + + {{/if}} + + {{#if (equals hl.status "6")}} + + {{/if}} + + {{#if (equals hl.status "7")}} + + {{/if}} + + {{#if (equals hl.status "8")}} + + {{/if}} + + {{#if (equals hl.status "0")}} + Created + {{/if}} + + {{#if (equals hl.status "1")}} + Started + {{/if}} + + {{#if (equals hl.status "2")}} + Failed + {{/if}} + + {{#if (equals hl.status "3")}} + Succeded + {{/if}} + + {{#if (equals hl.status "4")}} + Rescheduled + {{/if}} + + {{#if (equals hl.status "6")}} + Forced + {{/if}} + + {{#if (equals hl.status "7")}} + Skipped + {{/if}} + + {{#if (equals hl.status "8")}} + Retried + {{/if}} + {{hl.id}}{{hl.startDate}}{{hl.endDate}}{{hl.harvesterVersion}}
+
diff --git a/app/templates/source.hbs b/app/templates/source.hbs new file mode 100644 index 00000000..98e65e09 --- /dev/null +++ b/app/templates/source.hbs @@ -0,0 +1,47 @@ +{{outlet}} + +

Harvest log Data

+{{#each model as |harvest-log|}} + + {{harvest-log.status}}
+
+ {{harvest-log.completions}}
+{{/each}} +
+

HARVEST LOG

+
+ +
+ + + {{#each sources as |source index|}} + {{log source}} + + + + + + + + + {{/each}} +
{{source.attributes.longTitle}}
+
diff --git a/app/templates/sources.hbs b/app/templates/sources.hbs index 4bfbd6c3..d3094d42 100644 --- a/app/templates/sources.hbs +++ b/app/templates/sources.hbs @@ -31,6 +31,9 @@ {{else}}