mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-10-06 04:40:09 +00:00
Streams Basic Load Balancing (Allows multiple Forwarding Hosts)
This commit is contained in:
@@ -13,6 +13,11 @@ class Stream extends Model {
|
||||
this.created_on = now();
|
||||
this.modified_on = now();
|
||||
|
||||
// Default for forwarding_hosts
|
||||
if (typeof this.forwarding_hosts === 'undefined') {
|
||||
this.forwarding_hosts = [];
|
||||
}
|
||||
|
||||
// Default for meta
|
||||
if (typeof this.meta === 'undefined') {
|
||||
this.meta = {};
|
||||
@@ -21,6 +26,11 @@ class Stream extends Model {
|
||||
|
||||
$beforeUpdate () {
|
||||
this.modified_on = now();
|
||||
|
||||
// Sort domain_names
|
||||
if (typeof this.forwarding_hosts !== 'undefined') {
|
||||
this.forwarding_hosts.sort();
|
||||
}
|
||||
}
|
||||
|
||||
static get name () {
|
||||
@@ -32,7 +42,7 @@ class Stream extends Model {
|
||||
}
|
||||
|
||||
static get jsonAttributes () {
|
||||
return ['meta'];
|
||||
return ['forwarding_hosts', 'meta'];
|
||||
}
|
||||
|
||||
static get relationMappings () {
|
||||
|
Reference in New Issue
Block a user