Merge branch 'master' of github.com:standardnotes/web into privs
This commit is contained in:
@@ -11,7 +11,9 @@ class ActionsMenu {
|
|||||||
controller($scope, modelManager, actionsManager) {
|
controller($scope, modelManager, actionsManager) {
|
||||||
'ngInject';
|
'ngInject';
|
||||||
|
|
||||||
$scope.extensions = actionsManager.extensions.sort((a, b) => {return a.name.toLowerCase() > b.name.toLowerCase()});
|
$scope.extensions = actionsManager.extensions.sort((a, b) => {
|
||||||
|
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
|
||||||
|
});
|
||||||
|
|
||||||
for(let ext of $scope.extensions) {
|
for(let ext of $scope.extensions) {
|
||||||
ext.loading = true;
|
ext.loading = true;
|
||||||
|
|||||||
@@ -15,8 +15,13 @@ class EditorMenu {
|
|||||||
|
|
||||||
$scope.formData = {};
|
$scope.formData = {};
|
||||||
|
|
||||||
$scope.editors = componentManager.componentsForArea("editor-editor").sort((a, b) => {return a.name.toLowerCase() > b.name.toLowerCase()});
|
$scope.editors = componentManager.componentsForArea("editor-editor").sort((a, b) => {
|
||||||
$scope.stack = componentManager.componentsForArea("editor-stack").sort((a, b) => {return a.name.toLowerCase() > b.name.toLowerCase()});
|
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.stack = componentManager.componentsForArea("editor-stack").sort((a, b) => {
|
||||||
|
return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1;
|
||||||
|
});
|
||||||
|
|
||||||
$scope.isDesktop = isDesktopApplication();
|
$scope.isDesktop = isDesktopApplication();
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,14 @@ class SessionHistoryMenu {
|
|||||||
$scope.autoOptimize = sessionHistory.autoOptimize;
|
$scope.autoOptimize = sessionHistory.autoOptimize;
|
||||||
|
|
||||||
$scope.reloadHistory = function() {
|
$scope.reloadHistory = function() {
|
||||||
$scope.history = sessionHistory.historyForItem($scope.item);
|
let history = sessionHistory.historyForItem($scope.item);
|
||||||
|
// make copy as not to sort inline
|
||||||
|
$scope.entries = history.entries.slice(0).sort((a, b) => {
|
||||||
|
return a.item.updated_at < b.item.updated_at ? 1 : -1;
|
||||||
|
})
|
||||||
|
$scope.history = history;
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.reloadHistory();
|
$scope.reloadHistory();
|
||||||
|
|
||||||
$scope.openRevision = function(revision) {
|
$scope.openRevision = function(revision) {
|
||||||
|
|||||||
@@ -78,7 +78,11 @@ class SingletonManager {
|
|||||||
*/
|
*/
|
||||||
if(allExtantItemsMatchingPredicate.length >= 2) {
|
if(allExtantItemsMatchingPredicate.length >= 2) {
|
||||||
let sorted = allExtantItemsMatchingPredicate.sort((a, b) => {
|
let sorted = allExtantItemsMatchingPredicate.sort((a, b) => {
|
||||||
return a.created_at > b.created_at;
|
/*
|
||||||
|
If compareFunction(a, b) is less than 0, sort a to an index lower than b, i.e. a comes first.
|
||||||
|
If compareFunction(a, b) is greater than 0, sort b to an index lower than a, i.e. b comes first.
|
||||||
|
*/
|
||||||
|
return a.created_at < b.created_at ? -1 : 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
// The item that will be chosen to be kept
|
// The item that will be chosen to be kept
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
.sublabel
|
.sublabel
|
||||||
Saving to disk may increase app loading time and memory footprint.
|
Saving to disk may increase app loading time and memory footprint.
|
||||||
|
|
||||||
%menu-row{"ng-repeat" => "revision in history.entries",
|
%menu-row{"ng-repeat" => "revision in entries",
|
||||||
"action" => "openRevision(revision);",
|
"action" => "openRevision(revision);",
|
||||||
"label" => "revision.previewTitle()"}
|
"label" => "revision.previewTitle()"}
|
||||||
.sublabel.opaque{"ng-class" => "classForRevision(revision)"}
|
.sublabel.opaque{"ng-class" => "classForRevision(revision)"}
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ Rails.application.configure do
|
|||||||
# Do not eager load code on boot.
|
# Do not eager load code on boot.
|
||||||
config.eager_load = false
|
config.eager_load = false
|
||||||
|
|
||||||
|
require 'custom_log_formatter'
|
||||||
|
config.log_formatter = CustomLogFormatter.new
|
||||||
|
|
||||||
# Show full error reports and disable caching.
|
# Show full error reports and disable caching.
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = true
|
||||||
config.action_controller.perform_caching = false
|
config.action_controller.perform_caching = false
|
||||||
|
|||||||
@@ -10,7 +10,12 @@ Rails.application.configure do
|
|||||||
# require 'syslog/logger'
|
# require 'syslog/logger'
|
||||||
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
||||||
|
|
||||||
config.logger = ActiveSupport::Logger.new(config.paths['log'].first, 1, 50 * 1024 * 1024)
|
MAX_LOG_MEGABYTES = 50
|
||||||
|
config.logger = ActiveSupport::Logger.new(config.paths['log'].first, 1, MAX_LOG_MEGABYTES * 1024 * 1024)
|
||||||
|
|
||||||
|
require 'custom_log_formatter'
|
||||||
|
config.log_formatter = CustomLogFormatter.new
|
||||||
|
config.logger.formatter = config.log_formatter
|
||||||
|
|
||||||
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
||||||
logger = ActiveSupport::Logger.new(STDOUT)
|
logger = ActiveSupport::Logger.new(STDOUT)
|
||||||
|
|||||||
18
lib/custom_log_formatter.rb
Normal file
18
lib/custom_log_formatter.rb
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
class CustomLogFormatter < ActiveSupport::Logger::SimpleFormatter
|
||||||
|
SEVERITY_TO_COLOR_MAP = {'DEBUG'=>'0;37', 'INFO'=>'32', 'WARN'=>'33', 'ERROR'=>'31', 'FATAL'=>'31', 'UNKNOWN'=>'37'}
|
||||||
|
|
||||||
|
IPRegexp = /\b(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b/
|
||||||
|
FilteredString = '**FILTERED**'
|
||||||
|
|
||||||
|
def call(severity, time, progname, msg)
|
||||||
|
formatted_severity = sprintf("%-5s","#{severity}")
|
||||||
|
formatted_time = time.strftime("%Y-%m-%d %H:%M:%S.") << time.usec.to_s[0..2].rjust(3)
|
||||||
|
color = SEVERITY_TO_COLOR_MAP[severity]
|
||||||
|
|
||||||
|
"\033[0;37m#{formatted_time}\033[0m [\033[#{color}m#{formatted_severity}\033[0m] #{filter_ip(msg.strip)} (pid:#{$$})\n"
|
||||||
|
end
|
||||||
|
|
||||||
|
def filter_ip(msg)
|
||||||
|
msg.gsub(IPRegexp, FilteredString)
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "standard-notes-web",
|
"name": "standard-notes-web",
|
||||||
"version": "2.3.17",
|
"version": "2.3.18",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
Reference in New Issue
Block a user