Merge branch 'develop' into interface
This commit is contained in:
commit
3d60e6ff0a
7 changed files with 114 additions and 12 deletions
|
@ -311,7 +311,6 @@ class App.ControllerNavSidbar extends App.ControllerContent
|
|||
|
||||
group.items = _.sortBy( itemsUnsorted, (item) -> return item.prio )
|
||||
|
||||
|
||||
# set active item
|
||||
selectedItem = undefined
|
||||
for group in @groupsSorted
|
||||
|
@ -328,11 +327,6 @@ class App.ControllerNavSidbar extends App.ControllerContent
|
|||
|
||||
@render(selectedItem)
|
||||
|
||||
if selectedItem
|
||||
new selectedItem.controller(
|
||||
el: @el.find('.main')
|
||||
)
|
||||
|
||||
@bind(
|
||||
'ui:rerender'
|
||||
=>
|
||||
|
@ -349,6 +343,10 @@ class App.ControllerNavSidbar extends App.ControllerContent
|
|||
@el.find('li').removeClass('active')
|
||||
@el.find('a[href="' + selectedItem.target + '"]').parent().addClass('active')
|
||||
|
||||
new selectedItem.controller(
|
||||
el: @el.find('.main')
|
||||
)
|
||||
|
||||
class App.GenericHistory extends App.ControllerModal
|
||||
events:
|
||||
'click [data-type=sortorder]': 'sortorder',
|
||||
|
|
|
@ -67,10 +67,12 @@ class App.SettingsAreaItem extends App.Controller
|
|||
state = {
|
||||
value: params
|
||||
}
|
||||
#App.Config.set((@setting.name, params)
|
||||
else
|
||||
state = {
|
||||
value: directData
|
||||
}
|
||||
#App.Config.set(@setting.name, directData)
|
||||
|
||||
@setting['state'] = state
|
||||
ui = @
|
||||
|
@ -83,6 +85,7 @@ class App.SettingsAreaItem extends App.Controller
|
|||
timeout: 1500
|
||||
}
|
||||
ui.render()
|
||||
#App.Event.trigger( 'ui:rerender' )
|
||||
# login check
|
||||
# App.Auth.loginCheck()
|
||||
App.Auth.loginCheck()
|
||||
)
|
||||
|
|
|
@ -10,6 +10,7 @@ class System extends App.ControllerTabs
|
|||
# { name: 'Log', 'target': 'log', controller: App.SettingsSystem, params: { area: 'System::Log' } },
|
||||
{ name: 'Storage', 'target': 'storage', controller: App.SettingsArea, params: { area: 'System::Storage' } },
|
||||
{ name: 'Geo Services', 'target': 'geo', controller: App.SettingsArea, params: { area: 'System::Geo' } },
|
||||
{ name: 'Frontend', 'target': 'ui', controller: App.SettingsArea, params: { area: 'System::UI' } },
|
||||
]
|
||||
|
||||
# render page
|
||||
|
|
|
@ -89,8 +89,8 @@ class _trackSingleton
|
|||
return
|
||||
)
|
||||
|
||||
|
||||
log: ( area, level, args ) ->
|
||||
return if !App.Config.get('ui_send_client_stats')
|
||||
info =
|
||||
time: Math.round( new Date().getTime() / 1000 )
|
||||
area: area
|
||||
|
@ -100,6 +100,7 @@ class _trackSingleton
|
|||
@data.push info
|
||||
|
||||
send: (async = true) =>
|
||||
return if !App.Config.get('ui_send_client_stats')
|
||||
return if _.isEmpty @data
|
||||
newData = _.clone( @data )
|
||||
@data = []
|
||||
|
|
|
@ -46,6 +46,7 @@ class _storeSingleton
|
|||
write: (key, value) ->
|
||||
@store[key] = value
|
||||
return if !@support
|
||||
return if !App.Config.get('ui_client_storage')
|
||||
try
|
||||
sessionStorage.setItem( key, JSON.stringify( value ) )
|
||||
catch e
|
||||
|
@ -56,6 +57,7 @@ class _storeSingleton
|
|||
# get item
|
||||
get: (key) ->
|
||||
return @store[key] if !@support
|
||||
return @store[key] if !App.Config.get('ui_client_storage')
|
||||
value = sessionStorage.getItem( key )
|
||||
return if !value
|
||||
object = JSON.parse( value )
|
||||
|
@ -65,6 +67,7 @@ class _storeSingleton
|
|||
delete: (key) ->
|
||||
delete @store[key]
|
||||
return if !@support
|
||||
return if !App.Config.get('ui_client_storage')
|
||||
sessionStorage.removeItem( key )
|
||||
|
||||
# clear local storage
|
||||
|
@ -75,7 +78,7 @@ class _storeSingleton
|
|||
# return list of all keys
|
||||
list: ->
|
||||
list = []
|
||||
if !@support
|
||||
if !@support || !App.Config.get('ui_client_storage')
|
||||
for key of @store
|
||||
list.push key
|
||||
return list
|
||||
|
|
51
db/migrate/20140728000001_update_setting1.rb
Normal file
51
db/migrate/20140728000001_update_setting1.rb
Normal file
|
@ -0,0 +1,51 @@
|
|||
class UpdateSetting1 < ActiveRecord::Migration
|
||||
def up
|
||||
Setting.create_if_not_exists(
|
||||
:title => 'Send client stats.',
|
||||
:name => 'ui_send_client_stats',
|
||||
:area => 'System::UI',
|
||||
:description => 'Send client stats to central server.',
|
||||
:options => {
|
||||
:form => [
|
||||
{
|
||||
:display => '',
|
||||
:null => true,
|
||||
:name => 'ui_send_client_stats',
|
||||
:tag => 'boolean',
|
||||
:options => {
|
||||
true => 'yes',
|
||||
false => 'no',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
:state => true,
|
||||
:frontend => true
|
||||
)
|
||||
Setting.create_if_not_exists(
|
||||
:title => 'Client storage.',
|
||||
:name => 'ui_client_storage',
|
||||
:area => 'System::UI',
|
||||
:description => 'Use client storage to cache data to perform speed of application.',
|
||||
:options => {
|
||||
:form => [
|
||||
{
|
||||
:display => '',
|
||||
:null => true,
|
||||
:name => 'ui_client_storage',
|
||||
:tag => 'boolean',
|
||||
:options => {
|
||||
true => 'yes',
|
||||
false => 'no',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
:state => false,
|
||||
:frontend => true
|
||||
)
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
45
db/seeds.rb
45
db/seeds.rb
|
@ -178,6 +178,51 @@ Setting.create_if_not_exists(
|
|||
:frontend => false
|
||||
)
|
||||
|
||||
Setting.create_if_not_exists(
|
||||
:title => 'Send client stats.',
|
||||
:name => 'ui_send_client_stats',
|
||||
:area => 'System::UI',
|
||||
:description => 'Send client stats to central server.',
|
||||
:options => {
|
||||
:form => [
|
||||
{
|
||||
:display => '',
|
||||
:null => true,
|
||||
:name => 'ui_send_client_stats',
|
||||
:tag => 'boolean',
|
||||
:options => {
|
||||
true => 'yes',
|
||||
false => 'no',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
:state => true,
|
||||
:frontend => true
|
||||
)
|
||||
Setting.create_if_not_exists(
|
||||
:title => 'Client storage.',
|
||||
:name => 'ui_client_storage',
|
||||
:area => 'System::UI',
|
||||
:description => 'Use client storage to cache data to perform speed of application.',
|
||||
:options => {
|
||||
:form => [
|
||||
{
|
||||
:display => '',
|
||||
:null => true,
|
||||
:name => 'ui_client_storage',
|
||||
:tag => 'boolean',
|
||||
:options => {
|
||||
true => 'yes',
|
||||
false => 'no',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
:state => false,
|
||||
:frontend => true
|
||||
)
|
||||
|
||||
Setting.create_if_not_exists(
|
||||
:title => 'New User Accounts',
|
||||
:name => 'user_create_account',
|
||||
|
|
Loading…
Reference in a new issue