Merge branch 'NginxProxyManager:develop' into stream-ssl

This commit is contained in:
jbowring
2024-12-02 21:29:22 +00:00
178 changed files with 7895 additions and 5240 deletions

View File

@@ -2,6 +2,7 @@
// http://vincit.github.io/objection.js/
const db = require('../db');
const helpers = require('../lib/helpers');
const Model = require('objection').Model;
const User = require('./user');
const now = require('./now_helper');
@@ -9,6 +10,12 @@ const Certificate = require('./certificate');
Model.knex(db);
const boolFields = [
'is_deleted',
'tcp_forwarding',
'udp_forwarding',
];
class Stream extends Model {
$beforeInsert () {
this.created_on = now();
@@ -24,6 +31,16 @@ class Stream extends Model {
this.modified_on = now();
}
$parseDatabaseJson(json) {
json = super.$parseDatabaseJson(json);
return helpers.convertIntFieldsToBool(json, boolFields);
}
$formatDatabaseJson(json) {
json = helpers.convertBoolFieldsToInt(json, boolFields);
return super.$formatDatabaseJson(json);
}
static get name () {
return 'Stream';
}