Fixed typos.
This commit is contained in:
parent
bd9a3353aa
commit
b20d1c4e07
4 changed files with 78 additions and 6 deletions
72
app/assets/javascripts/app/lib/app_post/delay.js.coffee
Normal file
72
app/assets/javascripts/app/lib/app_post/delay.js.coffee
Normal file
|
@ -0,0 +1,72 @@
|
||||||
|
class App.Delay
|
||||||
|
_instance = undefined
|
||||||
|
|
||||||
|
@set: ( callback, timeout, key, level ) ->
|
||||||
|
if _instance == undefined
|
||||||
|
_instance ?= new _Singleton
|
||||||
|
_instance.set( callback, timeout, key, level )
|
||||||
|
|
||||||
|
@clear: ( key ) ->
|
||||||
|
if _instance == undefined
|
||||||
|
_instance ?= new _Singleton
|
||||||
|
_instance.clear( key )
|
||||||
|
|
||||||
|
@clearLevel: ( level ) ->
|
||||||
|
if _instance == undefined
|
||||||
|
_instance ?= new _Singleton
|
||||||
|
_instance.clearLevel( level )
|
||||||
|
|
||||||
|
class _Singleton extends Spine.Module
|
||||||
|
@include App.Log
|
||||||
|
|
||||||
|
constructor: ->
|
||||||
|
@levelStack = {}
|
||||||
|
|
||||||
|
set: ( callback, timeout, key, level ) ->
|
||||||
|
|
||||||
|
if !level
|
||||||
|
level = '_all'
|
||||||
|
|
||||||
|
if !@levelStack[level]
|
||||||
|
@levelStack[level] = {}
|
||||||
|
|
||||||
|
if key
|
||||||
|
@clear( key )
|
||||||
|
|
||||||
|
# setTimeout
|
||||||
|
@log 'Delay', 'debug', 'set', key, timeout, level, callback
|
||||||
|
call = =>
|
||||||
|
@clear( key )
|
||||||
|
callback()
|
||||||
|
delay_id = setTimeout( call, timeout )
|
||||||
|
|
||||||
|
# remember all delays
|
||||||
|
@levelStack[ level ][ key ] = {
|
||||||
|
delay_id: delay_id
|
||||||
|
timeout: timeout
|
||||||
|
level: level
|
||||||
|
}
|
||||||
|
|
||||||
|
return delay_id
|
||||||
|
|
||||||
|
clear: ( key ) ->
|
||||||
|
|
||||||
|
if !level
|
||||||
|
level = '_all'
|
||||||
|
|
||||||
|
if !@levelStack[ level ]
|
||||||
|
@levelStack[ level ] = {}
|
||||||
|
|
||||||
|
# get global delay ids
|
||||||
|
data = @levelStack[ level ][ key ]
|
||||||
|
return if !data
|
||||||
|
|
||||||
|
@log 'Delay', 'debug', 'clear', data
|
||||||
|
clearTimeout( data['delay_id'] )
|
||||||
|
|
||||||
|
clearLevel: (level) ->
|
||||||
|
return if !@levelStack[ level ]
|
||||||
|
for key, data of @levelStack[ level ]
|
||||||
|
@clear( key )
|
||||||
|
@levelStack[level] = {}
|
||||||
|
|
|
@ -4,7 +4,7 @@ class App.Sla extends Spine.Model
|
||||||
@url: 'api/slas'
|
@url: 'api/slas'
|
||||||
@configure_attributes = [
|
@configure_attributes = [
|
||||||
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, null: false, 'class': 'span4' },
|
{ name: 'name', display: 'Name', tag: 'input', type: 'text', limit: 100, null: false, 'class': 'span4' },
|
||||||
{ name: 'first_response_time', display: 'First Resposne Time', tag: 'input', type: 'text', limit: 100, null: true, 'class': 'span4', note: 'In minutes, only business times are counted.' },
|
{ name: 'first_response_time', display: 'First Response Time', tag: 'input', type: 'text', limit: 100, null: true, 'class': 'span4', note: 'In minutes, only business times are counted.' },
|
||||||
{ name: 'update_time', display: 'Update Time', tag: 'input', type: 'text', limit: 100, null: true, 'class': 'span4', note: 'In minutes, only business times are counted.' },
|
{ name: 'update_time', display: 'Update Time', tag: 'input', type: 'text', limit: 100, null: true, 'class': 'span4', note: 'In minutes, only business times are counted.' },
|
||||||
{ name: 'close_time', display: 'Solution Time', tag: 'input', type: 'text', limit: 100, null: true, 'class': 'span4', note: 'In minutes, only business times are counted.' },
|
{ name: 'close_time', display: 'Solution Time', tag: 'input', type: 'text', limit: 100, null: true, 'class': 'span4', note: 'In minutes, only business times are counted.' },
|
||||||
{ name: 'condition', display: 'Conditions where SLA is used', tag: 'ticket_attribute_selection', null: true, class: 'span4' },
|
{ name: 'condition', display: 'Conditions where SLA is used', tag: 'ticket_attribute_selection', null: true, class: 'span4' },
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<th <% if row.style: %>style="<%= row.style %>"<% end %>><%- @T( row.display ) %></th>
|
<th <% if row.style: %>style="<%= row.style %>"<% end %>><%- @T( row.display ) %></th>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if @destroy: %>
|
<% if @destroy: %>
|
||||||
<th class="span2"><%- @T('Destory') %></th>
|
<th class="span2"><%- @T('Destroy') %></th>
|
||||||
<% end %>
|
<% end %>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
@ -90,7 +90,7 @@ Setting.create_if_not_exists(
|
||||||
:title => 'http type',
|
:title => 'http type',
|
||||||
:name => 'http_type',
|
:name => 'http_type',
|
||||||
:area => 'System::Base',
|
:area => 'System::Base',
|
||||||
:description => 'Defines the type of protocol, used by the web server, to serve the application. If https protocol will be used instead of plain http, it must be specified it here. Since this has no affect on the web server\'s settings or behavior, it will not change the method of access to the application and, if it is wrong, it will not prevent you from logging into the application. This setting is used as a variable, #{setting.http_type} which is found in all forms of messaging used by the application, to build links to the tickets within your system.',
|
:description => 'Defines the type of protocol, used by the web server, to serve the application. If https protocol will be used instead of plain http, it must be specified in here. Since this has no affect on the web server\'s settings or behavior, it will not change the method of access to the application and, if it is wrong, it will not prevent you from logging into the application. This setting is used as a variable, #{setting.http_type} which is found in all forms of messaging used by the application, to build links to the tickets within your system.',
|
||||||
:options => {
|
:options => {
|
||||||
:form => [
|
:form => [
|
||||||
{
|
{
|
||||||
|
@ -115,7 +115,7 @@ Setting.create_if_not_exists(
|
||||||
:title => 'Storage Mechanism',
|
:title => 'Storage Mechanism',
|
||||||
:name => 'storage',
|
:name => 'storage',
|
||||||
:area => 'System::Storage',
|
:area => 'System::Storage',
|
||||||
:description => '"Database" stores all attachments in the database (not recommended for storing big). "Filesystem" stores the data on the filesystem; this is faster but the webserver should run under the Zammad user. You can switch between the modules even on a system that is already in production without any loss of data.',
|
:description => '"Database" stores all attachments in the database (not recommended for storing large amounts of data). "Filesystem" stores the data on the filesystem. You can switch between the modules even on a system that is already in production without any loss of data.',
|
||||||
:options => {
|
:options => {
|
||||||
:form => [
|
:form => [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue