feat: add remark in proxy hosts list
This commit is contained in:
parent
63d06da8a8
commit
ee7fd13bdf
9 changed files with 76 additions and 10 deletions
|
@ -0,0 +1,36 @@
|
||||||
|
const migrate_name = 'identifier_for_migrate';
|
||||||
|
const logger = require('../logger').migrate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Migrate
|
||||||
|
*
|
||||||
|
* @see http://knexjs.org/#Schema
|
||||||
|
*
|
||||||
|
* @param {Object} knex
|
||||||
|
* @param {Promise} Promise
|
||||||
|
* @returns {Promise}
|
||||||
|
*/
|
||||||
|
exports.up = function (knex) {
|
||||||
|
logger.info('[' + migrate_name + '] Migrating Up...');
|
||||||
|
|
||||||
|
return knex.schema.table('proxy_host', function (table) {
|
||||||
|
table.string('remark', 100).nullable().defaultTo('');
|
||||||
|
logger.info('[' + migrate_name + '] Migrating Up Complete');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Undo Migrate
|
||||||
|
*
|
||||||
|
* @param {Object} knex
|
||||||
|
* @param {Promise} Promise
|
||||||
|
* @returns {Promise}
|
||||||
|
*/
|
||||||
|
exports.down = function (knex) {
|
||||||
|
logger.info('[' + migrate_name + '] Migrating Down...');
|
||||||
|
|
||||||
|
return knex.schema.table('proxy_host', function (table) {
|
||||||
|
table.dropColumn('remark');
|
||||||
|
logger.info('[' + migrate_name + '] Migrating Down Complete');
|
||||||
|
});
|
||||||
|
};
|
|
@ -46,7 +46,7 @@ class ProxyHost extends Model {
|
||||||
}
|
}
|
||||||
|
|
||||||
static get jsonAttributes () {
|
static get jsonAttributes () {
|
||||||
return ['domain_names', 'meta', 'locations'];
|
return ['domain_names', 'meta', 'locations', 'remark'];
|
||||||
}
|
}
|
||||||
|
|
||||||
static get relationMappings () {
|
static get relationMappings () {
|
||||||
|
|
|
@ -107,6 +107,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"remark": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Remark",
|
||||||
|
"maxLength": 100
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -169,6 +174,9 @@
|
||||||
},
|
},
|
||||||
"locations": {
|
"locations": {
|
||||||
"$ref": "#/definitions/locations"
|
"$ref": "#/definitions/locations"
|
||||||
|
},
|
||||||
|
"remark": {
|
||||||
|
"$ref": "#/definitions/remark"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"links": [
|
"links": [
|
||||||
|
@ -259,6 +267,9 @@
|
||||||
},
|
},
|
||||||
"locations": {
|
"locations": {
|
||||||
"$ref": "#/definitions/locations"
|
"$ref": "#/definitions/locations"
|
||||||
|
},
|
||||||
|
"remark": {
|
||||||
|
"$ref": "#/definitions/remark"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -332,6 +343,9 @@
|
||||||
},
|
},
|
||||||
"locations": {
|
"locations": {
|
||||||
"$ref": "#/definitions/locations"
|
"$ref": "#/definitions/locations"
|
||||||
|
},
|
||||||
|
"remark": {
|
||||||
|
"$ref": "#/definitions/remark"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -90,6 +90,14 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- remark -->
|
||||||
|
<div class="col-sm-12 col-md-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="form-label"><%- i18n('proxy-hosts', 'remark') %></label>
|
||||||
|
<input type="text" name="remark" class="form-control text-monospace" placeholder="" value="<%- remark %>" autocomplete="off" maxlength="255" required>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ module.exports = Mn.View.extend({
|
||||||
form: 'form',
|
form: 'form',
|
||||||
domain_names: 'input[name="domain_names"]',
|
domain_names: 'input[name="domain_names"]',
|
||||||
forward_host: 'input[name="forward_host"]',
|
forward_host: 'input[name="forward_host"]',
|
||||||
|
remark: 'input[name="remark"]',
|
||||||
buttons: '.modal-footer button',
|
buttons: '.modal-footer button',
|
||||||
cancel: 'button.cancel',
|
cancel: 'button.cancel',
|
||||||
save: 'button.save',
|
save: 'button.save',
|
||||||
|
|
|
@ -25,6 +25,9 @@
|
||||||
<td>
|
<td>
|
||||||
<div class="text-monospace"><%- forward_scheme %>://<%- forward_host %>:<%- forward_port %></div>
|
<div class="text-monospace"><%- forward_scheme %>://<%- forward_host %>:<%- forward_port %></div>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="text-monospace"><%- remark %></div>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div><%- certificate && certificate_id ? i18n('ssl', certificate.provider) : i18n('ssl', 'none') %></div>
|
<div><%- certificate && certificate_id ? i18n('ssl', certificate.provider) : i18n('ssl', 'none') %></div>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
<th width="30"> </th>
|
<th width="30"> </th>
|
||||||
<th><%- i18n('str', 'source') %></th>
|
<th><%- i18n('str', 'source') %></th>
|
||||||
<th><%- i18n('str', 'destination') %></th>
|
<th><%- i18n('str', 'destination') %></th>
|
||||||
|
<th><%- i18n('str', 'remark') %></th>
|
||||||
<th><%- i18n('str', 'ssl') %></th>
|
<th><%- i18n('str', 'ssl') %></th>
|
||||||
<th><%- i18n('str', 'access') %></th>
|
<th><%- i18n('str', 'access') %></th>
|
||||||
<th><%- i18n('str', 'status') %></th>
|
<th><%- i18n('str', 'status') %></th>
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
"choose-file": "Choose file",
|
"choose-file": "Choose file",
|
||||||
"source": "Source",
|
"source": "Source",
|
||||||
"destination": "Destination",
|
"destination": "Destination",
|
||||||
|
"remark": "Remark",
|
||||||
"ssl": "SSL",
|
"ssl": "SSL",
|
||||||
"access": "Access",
|
"access": "Access",
|
||||||
"public": "Public",
|
"public": "Public",
|
||||||
|
@ -133,7 +134,8 @@
|
||||||
"allow-websocket-upgrade": "Websockets Support",
|
"allow-websocket-upgrade": "Websockets Support",
|
||||||
"ignore-invalid-upstream-ssl": "Ignore Invalid SSL",
|
"ignore-invalid-upstream-ssl": "Ignore Invalid SSL",
|
||||||
"custom-forward-host-help": "Add a path for sub-folder forwarding.\nExample: 203.0.113.25/path/",
|
"custom-forward-host-help": "Add a path for sub-folder forwarding.\nExample: 203.0.113.25/path/",
|
||||||
"search": "Search Host…"
|
"search": "Search Host…",
|
||||||
|
"remark": "Remark"
|
||||||
},
|
},
|
||||||
"redirection-hosts": {
|
"redirection-hosts": {
|
||||||
"title": "Redirection Hosts",
|
"title": "Redirection Hosts",
|
||||||
|
|
|
@ -9,6 +9,7 @@ const model = Backbone.Model.extend({
|
||||||
created_on: null,
|
created_on: null,
|
||||||
modified_on: null,
|
modified_on: null,
|
||||||
domain_names: [],
|
domain_names: [],
|
||||||
|
remark: '',
|
||||||
forward_scheme: 'http',
|
forward_scheme: 'http',
|
||||||
forward_host: '',
|
forward_host: '',
|
||||||
forward_port: null,
|
forward_port: null,
|
||||||
|
|
Loading…
Reference in a new issue