Code cleanup.
This commit is contained in:
parent
556dbb7bb8
commit
ba611c377e
1 changed files with 11 additions and 15 deletions
|
@ -15,7 +15,7 @@ class Index extends App.ControllerContent
|
||||||
success: (data) =>
|
success: (data) =>
|
||||||
@stopLoading()
|
@stopLoading()
|
||||||
@config = data.config
|
@config = data.config
|
||||||
App.Collection.load( type: 'ReportProfile', data: data.profiles )
|
App.Collection.load(type: 'ReportProfile', data: data.profiles)
|
||||||
@render()
|
@render()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -326,11 +326,9 @@ class TimeRangePicker extends App.Controller
|
||||||
@el.find('.js-timeRange[data-type="' + @ui.params.timeRange + '"]').addClass('active')
|
@el.find('.js-timeRange[data-type="' + @ui.params.timeRange + '"]').addClass('active')
|
||||||
|
|
||||||
select: (e) =>
|
select: (e) =>
|
||||||
console.log('TS click')
|
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
@ui.params.timeRange = $(e.target).data('type')
|
@ui.params.timeRange = $(e.target).data('type')
|
||||||
console.log 'SLOT', @ui.params.timeRange
|
App.Event.trigger('ui:report:rerender')
|
||||||
App.Event.trigger( 'ui:report:rerender' )
|
|
||||||
|
|
||||||
|
|
||||||
class TimePicker extends App.Controller
|
class TimePicker extends App.Controller
|
||||||
|
@ -369,7 +367,7 @@ class TimePicker extends App.Controller
|
||||||
@ui.params.day = $(e.target).data('type')
|
@ui.params.day = $(e.target).data('type')
|
||||||
$(e.target).parent().parent().find('li').removeClass('active')
|
$(e.target).parent().parent().find('li').removeClass('active')
|
||||||
$(e.target).parent().addClass('active')
|
$(e.target).parent().addClass('active')
|
||||||
App.Event.trigger( 'ui:report:rerender' )
|
App.Event.trigger('ui:report:rerender')
|
||||||
@ui.storeParams()
|
@ui.storeParams()
|
||||||
|
|
||||||
selectTimeMonth: (e) =>
|
selectTimeMonth: (e) =>
|
||||||
|
@ -377,7 +375,7 @@ class TimePicker extends App.Controller
|
||||||
@ui.params.month = $(e.target).data('type')
|
@ui.params.month = $(e.target).data('type')
|
||||||
$(e.target).parent().parent().find('li').removeClass('active')
|
$(e.target).parent().parent().find('li').removeClass('active')
|
||||||
$(e.target).parent().addClass('active')
|
$(e.target).parent().addClass('active')
|
||||||
App.Event.trigger( 'ui:report:rerender' )
|
App.Event.trigger('ui:report:rerender')
|
||||||
@ui.storeParams()
|
@ui.storeParams()
|
||||||
|
|
||||||
selectTimeWeek: (e) =>
|
selectTimeWeek: (e) =>
|
||||||
|
@ -385,7 +383,7 @@ class TimePicker extends App.Controller
|
||||||
@ui.params.week = $(e.target).data('type')
|
@ui.params.week = $(e.target).data('type')
|
||||||
$(e.target).parent().parent().find('li').removeClass('active')
|
$(e.target).parent().parent().find('li').removeClass('active')
|
||||||
$(e.target).parent().addClass('active')
|
$(e.target).parent().addClass('active')
|
||||||
App.Event.trigger( 'ui:report:rerender' )
|
App.Event.trigger('ui:report:rerender')
|
||||||
@ui.storeParams()
|
@ui.storeParams()
|
||||||
|
|
||||||
selectTimeYear: (e) =>
|
selectTimeYear: (e) =>
|
||||||
|
@ -393,7 +391,7 @@ class TimePicker extends App.Controller
|
||||||
@ui.params.year = $(e.target).data('type')
|
@ui.params.year = $(e.target).data('type')
|
||||||
$(e.target).parent().parent().find('li').removeClass('active')
|
$(e.target).parent().parent().find('li').removeClass('active')
|
||||||
$(e.target).parent().addClass('active')
|
$(e.target).parent().addClass('active')
|
||||||
App.Event.trigger( 'ui:report:rerender' )
|
App.Event.trigger('ui:report:rerender')
|
||||||
@ui.storeParams()
|
@ui.storeParams()
|
||||||
|
|
||||||
_timeSlotPicker: ->
|
_timeSlotPicker: ->
|
||||||
|
@ -488,7 +486,6 @@ class Sidebar extends App.Controller
|
||||||
|
|
||||||
metrics = @config.metric
|
metrics = @config.metric
|
||||||
profiles = App.ReportProfile.all()
|
profiles = App.ReportProfile.all()
|
||||||
console.log('Si', @params)
|
|
||||||
@html App.view('report/sidebar')(
|
@html App.view('report/sidebar')(
|
||||||
metrics: metrics
|
metrics: metrics
|
||||||
params: @params
|
params: @params
|
||||||
|
@ -500,16 +497,15 @@ class Sidebar extends App.Controller
|
||||||
metric = $(e.target).closest('.panel').data('metric')
|
metric = $(e.target).closest('.panel').data('metric')
|
||||||
return if @params.metric is metric
|
return if @params.metric is metric
|
||||||
@params.metric = metric
|
@params.metric = metric
|
||||||
App.Event.trigger( 'ui:report:rerender' )
|
App.Event.trigger('ui:report:rerender')
|
||||||
@ui.storeParams()
|
@ui.storeParams()
|
||||||
|
|
||||||
selectProfile: (e) =>
|
selectProfile: (e) =>
|
||||||
profile_id = $(e.target).val()
|
profile_id = $(e.target).val()
|
||||||
console.log('llll', profile_id)
|
|
||||||
for key, value of @params.profileSelected
|
for key, value of @params.profileSelected
|
||||||
delete @params.profileSelected[key]
|
delete @params.profileSelected[key]
|
||||||
@params.profileSelected[profile_id] = true
|
@params.profileSelected[profile_id] = true
|
||||||
App.Event.trigger( 'ui:report:rerender' )
|
App.Event.trigger('ui:report:rerender')
|
||||||
@ui.storeParams()
|
@ui.storeParams()
|
||||||
|
|
||||||
selectBackend: (e) =>
|
selectBackend: (e) =>
|
||||||
|
@ -519,8 +515,8 @@ class Sidebar extends App.Controller
|
||||||
@params.backendSelected[backend] = true
|
@params.backendSelected[backend] = true
|
||||||
else
|
else
|
||||||
delete @params.backendSelected[backend]
|
delete @params.backendSelected[backend]
|
||||||
App.Event.trigger( 'ui:report:rerender' )
|
App.Event.trigger('ui:report:rerender')
|
||||||
@ui.storeParams()
|
@ui.storeParams()
|
||||||
|
|
||||||
App.Config.set( 'report', Index, 'Routes' )
|
App.Config.set('report', Index, 'Routes')
|
||||||
App.Config.set( 'Reporting', { prio: 8000, parent: '', name: 'Reporing', translate: true, target: '#report', icon: 'report', role: ['Report'] }, 'NavBarRight' )
|
App.Config.set('Reporting', { prio: 8000, parent: '', name: 'Reporing', translate: true, target: '#report', icon: 'report', role: ['Report'] }, 'NavBarRight')
|
||||||
|
|
Loading…
Reference in a new issue