Add site_setting to disable version checks
This commit is contained in:
parent
cf595a56a8
commit
560411eece
5 changed files with 33 additions and 25 deletions
app
assets/javascripts/admin
models
config/locales
lib/jobs
|
@ -2,11 +2,13 @@
|
||||||
|
|
||||||
Discourse.AdminDashboardRoute = Discourse.Route.extend({
|
Discourse.AdminDashboardRoute = Discourse.Route.extend({
|
||||||
setupController: function(c) {
|
setupController: function(c) {
|
||||||
|
if( Discourse.SiteSettings.version_checks ) {
|
||||||
return Discourse.VersionCheck.find().then(function(vc) {
|
return Discourse.VersionCheck.find().then(function(vc) {
|
||||||
c.set('versionCheck', vc);
|
c.set('versionCheck', vc);
|
||||||
return c.set('loading', false);
|
return c.set('loading', false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<h3>{{i18n admin.dashboard.welcome}}</h3>
|
<h3>{{i18n admin.dashboard.welcome}}</h3>
|
||||||
|
|
||||||
|
{{#if Discourse.SiteSettings.version_checks}}
|
||||||
<p {{bindAttr class="priorityClass"}}>
|
<p {{bindAttr class="priorityClass"}}>
|
||||||
{{#if loading }}
|
{{#if loading }}
|
||||||
{{i18n loading}}
|
{{i18n loading}}
|
||||||
|
@ -19,3 +20,4 @@
|
||||||
</span>
|
</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</p>
|
</p>
|
||||||
|
{{/if}}
|
|
@ -31,6 +31,7 @@ class SiteSetting < ActiveRecord::Base
|
||||||
client_setting(:flush_timings_secs, 5)
|
client_setting(:flush_timings_secs, 5)
|
||||||
client_setting(:supress_reply_directly_below, true)
|
client_setting(:supress_reply_directly_below, true)
|
||||||
client_setting(:email_domains_blacklist, 'mailinator.com')
|
client_setting(:email_domains_blacklist, 'mailinator.com')
|
||||||
|
client_setting(:version_checks, true)
|
||||||
|
|
||||||
# settings only available server side
|
# settings only available server side
|
||||||
setting(:auto_track_topics_after, 300000)
|
setting(:auto_track_topics_after, 300000)
|
||||||
|
|
|
@ -294,6 +294,7 @@ en:
|
||||||
supress_reply_directly_below: "Don't show replies button below a post when the reply is directly below"
|
supress_reply_directly_below: "Don't show replies button below a post when the reply is directly below"
|
||||||
allow_index_in_robots_txt: "Site should be indexed by search engines (update robots.txt)"
|
allow_index_in_robots_txt: "Site should be indexed by search engines (update robots.txt)"
|
||||||
email_domains_blacklist: "A pipe-delimited list of email domains that are not allowed. Example: mailinator.com|trashmail.net"
|
email_domains_blacklist: "A pipe-delimited list of email domains that are not allowed. Example: mailinator.com|trashmail.net"
|
||||||
|
version_checks: 'Whether to check for Discourse updates and report them on the admin dashboard.'
|
||||||
|
|
||||||
port: "If you'd like to specify a port in the URL. Useful in development mode. Leave blank for none."
|
port: "If you'd like to specify a port in the URL. Useful in development mode. Leave blank for none."
|
||||||
force_hostname: "If you'd like to specify a hostname in the URL. Useful in development mode. Leave blank for none."
|
force_hostname: "If you'd like to specify a hostname in the URL. Useful in development mode. Leave blank for none."
|
||||||
|
|
|
@ -5,9 +5,11 @@ module Jobs
|
||||||
class VersionCheck < Jobs::Base
|
class VersionCheck < Jobs::Base
|
||||||
|
|
||||||
def execute(args)
|
def execute(args)
|
||||||
|
if SiteSetting.version_checks
|
||||||
json = DiscourseHub.discourse_version_check
|
json = DiscourseHub.discourse_version_check
|
||||||
DiscourseUpdates.latest_version = json['latestVersion']
|
DiscourseUpdates.latest_version = json['latestVersion']
|
||||||
DiscourseUpdates.critical_update_available = json['criticalUpdates']
|
DiscourseUpdates.critical_update_available = json['criticalUpdates']
|
||||||
|
end
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Reference in a new issue