mirror of
https://github.com/Alvin-Zilverstand/nginx-proxy-manager.git
synced 2026-11-25 15:43:14 +01:00
Certificates polish
This commit is contained in:
1 parent
c8592503e3
commit
065727fba2
15 files changed
+563
-256
No files matched your search
@@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const numeral = require('numeral');
|
||||
const moment = require('moment');
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -10,5 +11,18 @@ module.exports = {
|
||||
*/
|
||||
niceNumber: function (number) {
|
||||
return numeral(number).format('0,0');
|
||||
},
|
||||
|
||||
/**
|
||||
* @param {String|Number} date
|
||||
* @param {String} format
|
||||
* @returns {String}
|
||||
*/
|
||||
formatDbDate: function (date, format) {
|
||||
if (typeof date === 'number') {
|
||||
return moment.unix(date).format(format);
|
||||
}
|
||||
|
||||
return moment(date).format(format);
|
||||
}
|
||||
};
|
||||
@@ -1,30 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
const _ = require('underscore');
|
||||
const Mn = require('backbone.marionette');
|
||||
const moment = require('moment');
|
||||
const i18n = require('../app/i18n');
|
||||
const _ = require('underscore');
|
||||
const Mn = require('backbone.marionette');
|
||||
const i18n = require('../app/i18n');
|
||||
const Helpers = require('./helpers');
|
||||
|
||||
let render = Mn.Renderer.render;
|
||||
|
||||
Mn.Renderer.render = function (template, data, view) {
|
||||
|
||||
data = _.clone(data);
|
||||
|
||||
data.i18n = i18n;
|
||||
|
||||
/**
|
||||
* @param {String} date
|
||||
* @param {String} format
|
||||
* @returns {String}
|
||||
*/
|
||||
data.formatDbDate = function (date, format) {
|
||||
if (typeof date === 'number') {
|
||||
return moment.unix(date).format(format);
|
||||
}
|
||||
|
||||
return moment(date).format(format);
|
||||
};
|
||||
data = _.clone(data);
|
||||
data.i18n = i18n;
|
||||
data.formatDbDate = Helpers.formatDbDate;
|
||||
|
||||
return render.call(this, template, data, view);
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user