1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00

adding host config to UI.

fixing toastr error
This commit is contained in:
Patrik J. Braun 2018-12-28 00:48:39 +01:00
parent 113c723d3f
commit 08d8a8eeb8
9 changed files with 81 additions and 41 deletions

View File

@ -305,6 +305,7 @@ export class AdminMWs {
const settings: BasicConfigDTO = req.body.settings;
await ConfigDiagnostics.testImageFolder(settings.imagesFolder);
Config.Server.port = settings.port;
Config.Server.host = settings.host;
Config.Server.imagesFolder = settings.imagesFolder;
Config.Client.publicUrl = settings.publicUrl;
Config.Client.urlBase = settings.urlBase;
@ -312,6 +313,7 @@ export class AdminMWs {
// only updating explicitly set config (not saving config set by the diagnostics)
const original = Config.original();
original.Server.port = settings.port;
original.Server.host = settings.host;
original.Server.imagesFolder = settings.imagesFolder;
original.Client.publicUrl = settings.publicUrl;
original.Client.urlBase = settings.urlBase;

View File

@ -2,6 +2,7 @@ import * as _express from 'express';
import * as _bodyParser from 'body-parser';
import * as cookieParser from 'cookie-parser';
import * as _http from 'http';
import {Server as HttpServer} from 'http';
// @ts-ignore
import * as locale from 'locale';
import {PublicRouter} from './routes/PublicRouter';
@ -29,7 +30,7 @@ const LOG_TAG = '[server]';
export class Server {
private app: _express.Express;
private server: any;
private server: HttpServer;
/**
* Event listener for HTTP server "error" event.

View File

@ -2,7 +2,6 @@ import {PublicConfigClass} from '../public/ConfigClass';
import {DatabaseType, IPrivateConfig, ReIndexingSensitivity, ServerConfig, ThumbnailProcessingLib} from './IPrivateConfig';
import * as path from 'path';
import {ConfigLoader} from 'typeconfig';
import {UserService} from '../../../frontend/app/model/network/user.service';
import {Utils} from '../../Utils';
import {UserRoles} from '../../entities/UserDTO';

View File

@ -4,4 +4,5 @@ export interface BasicConfigDTO {
urlBase: string;
applicationTitle: string;
port: number;
host: string;
}

View File

@ -16,6 +16,18 @@
name="applicationTitle" required>
</div>
</div>
<div class="form-group row" [hidden]="simplifiedMode">
<label class="col-md-2 control-label" for="host" i18n>Host</label>
<div class="col-md-10">
<input type="text" class="form-control" placeholder="0.0.0.0"
id="host"
[(ngModel)]="settings.host"
name="host" required>
<small class="form-text text-muted" i18n>Server will accept connections from this IPv6 or IPv4 address.</small>
</div>
</div>
<div class="form-group row" [hidden]="simplifiedMode">
<label class="col-md-2 control-label" for="port" i18n>Port</label>
<div class="col-md-10">

View File

@ -27,6 +27,7 @@ export class BasicSettingsComponent extends SettingsComponent<BasicConfigDTO> {
i18n: I18n) {
super(i18n('Basic'), _authService, _navigation, _settingsService, notification, i18n, s => ({
port: s.Server.port,
host: s.Server.host,
imagesFolder: s.Server.imagesFolder,
applicationTitle: s.Client.applicationTitle,
publicUrl: s.Client.publicUrl,

View File

@ -180,14 +180,6 @@
</context-group>
<target>Zoom in, key: '+'</target>
</trans-unit>
<trans-unit id="7e892ba15f2c6c17e83510e273b3e10fc32ea016" datatype="html">
<source>Search</source>
<context-group purpose="location">
<context context-type="sourcefile">app/gallery/search/search.gallery.component.html</context>
<context context-type="linenumber">6</context>
</context-group>
<target>Search</target>
</trans-unit>
<trans-unit id="f3cda2936c4e70d5b920b2c243ec634222743ba1" datatype="html">
<source>Link availability</source>
<context-group purpose="location">
@ -230,6 +222,14 @@
</context-group>
<target>Logout</target>
</trans-unit>
<trans-unit id="7e892ba15f2c6c17e83510e273b3e10fc32ea016" datatype="html">
<source>Search</source>
<context-group purpose="location">
<context context-type="sourcefile">app/gallery/search/search.gallery.component.html</context>
<context context-type="linenumber">6</context>
</context-group>
<target>Search</target>
</trans-unit>
<trans-unit id="0bd8b27f60a1f098a53e06328426d818e3508ff9" datatype="html">
<source>Share</source>
<context-group purpose="location">
@ -564,6 +564,10 @@
<context context-type="sourcefile">app/settings/database/database.settings.component.html</context>
<context context-type="linenumber">19</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">21</context>
</context-group>
<target>Host</target>
</trans-unit>
<trans-unit id="fb324ec7da611c6283caa6fc6257c39a56d6aaf7" datatype="html">
@ -681,7 +685,7 @@
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">79</context>
<context context-type="linenumber">94</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/other/other.settings.component.html</context>
@ -722,7 +726,7 @@
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">82</context>
<context context-type="linenumber">97</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/other/other.settings.component.html</context>
@ -1028,11 +1032,19 @@
</context-group>
<target>Page title</target>
</trans-unit>
<trans-unit id="497b92e92e1682d5c9bf9fee8801d601b17d0833" datatype="html">
<source>Server will accept connections from this IPv6 or IPv4 address.</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">30</context>
</context-group>
<target>Server will accept connections from this IPv6 or IPv4 address.</target>
</trans-unit>
<trans-unit id="cb2741a46e3560f6bc6dfd99d385e86b08b26d72" datatype="html">
<source>Port</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">20</context>
<context context-type="linenumber">35</context>
</context-group>
<target>Port</target>
</trans-unit>
@ -1040,7 +1052,7 @@
<source>Port number. Port 80 is usually what you need.</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">29</context>
<context context-type="linenumber">44</context>
</context-group>
<target>Port number. Port 80 is usually what you need.</target>
</trans-unit>
@ -1048,7 +1060,7 @@
<source>Images folder</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">34</context>
<context context-type="linenumber">49</context>
</context-group>
<target>Images folder</target>
</trans-unit>
@ -1056,7 +1068,7 @@
<source>Images are loaded from this folder (read permission required)</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">40</context>
<context context-type="linenumber">55</context>
</context-group>
<target>Images are loaded from this folder (read permission required)</target>
</trans-unit>
@ -1064,7 +1076,7 @@
<source>Page public url</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">45</context>
<context context-type="linenumber">60</context>
</context-group>
<target>Page public url</target>
</trans-unit>
@ -1074,7 +1086,7 @@
</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">52</context>
<context context-type="linenumber">67</context>
</context-group>
<target>If you access the page form local network its good to know the public url for creating sharing link</target>
</trans-unit>
@ -1082,7 +1094,7 @@
<source>Url Base</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">59</context>
<context context-type="linenumber">74</context>
</context-group>
<target>Url Base</target>
</trans-unit>
@ -1093,7 +1105,7 @@
</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">66</context>
<context context-type="linenumber">81</context>
</context-group>
<target>If you access the gallery under a sub url (like: http://mydomain.com/myGallery), set it here. If not working you might miss the '/' from the beginning of the url.</target>
</trans-unit>
@ -1103,7 +1115,7 @@
</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">73</context>
<context context-type="linenumber">88</context>
</context-group>
<target>The public url and the url base are not matching. Some of the functionality might not work.</target>
</trans-unit>

View File

@ -180,14 +180,6 @@
</context-group>
<target>Nagyítás, gyorsgomb: '+'</target>
</trans-unit>
<trans-unit id="7e892ba15f2c6c17e83510e273b3e10fc32ea016" datatype="html">
<source>Search</source>
<context-group purpose="location">
<context context-type="sourcefile">app/gallery/search/search.gallery.component.html</context>
<context context-type="linenumber">6</context>
</context-group>
<target>Keresés</target>
</trans-unit>
<trans-unit id="f3cda2936c4e70d5b920b2c243ec634222743ba1" datatype="html">
<source>Link availability</source>
<context-group purpose="location">
@ -230,6 +222,14 @@
</context-group>
<target>Kijelentkezés</target>
</trans-unit>
<trans-unit id="7e892ba15f2c6c17e83510e273b3e10fc32ea016" datatype="html">
<source>Search</source>
<context-group purpose="location">
<context context-type="sourcefile">app/gallery/search/search.gallery.component.html</context>
<context context-type="linenumber">6</context>
</context-group>
<target>Keresés</target>
</trans-unit>
<trans-unit id="0bd8b27f60a1f098a53e06328426d818e3508ff9" datatype="html">
<source>Share</source>
<context-group purpose="location">
@ -564,6 +564,10 @@
<context context-type="sourcefile">app/settings/database/database.settings.component.html</context>
<context context-type="linenumber">19</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">21</context>
</context-group>
<target>Host</target>
</trans-unit>
<trans-unit id="fb324ec7da611c6283caa6fc6257c39a56d6aaf7" datatype="html">
@ -681,7 +685,7 @@
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">79</context>
<context context-type="linenumber">94</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/other/other.settings.component.html</context>
@ -722,7 +726,7 @@
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">82</context>
<context context-type="linenumber">97</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/other/other.settings.component.html</context>
@ -1028,11 +1032,19 @@
</context-group>
<target>Oldal címe</target>
</trans-unit>
<trans-unit id="497b92e92e1682d5c9bf9fee8801d601b17d0833" datatype="html">
<source>Server will accept connections from this IPv6 or IPv4 address.</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">30</context>
</context-group>
<target>A szerver csak erről az (IPv6 vagy az IPv4) címből származó kapcsolatokat fog fogadni.</target>
</trans-unit>
<trans-unit id="cb2741a46e3560f6bc6dfd99d385e86b08b26d72" datatype="html">
<source>Port</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">20</context>
<context context-type="linenumber">35</context>
</context-group>
<target>Port</target>
</trans-unit>
@ -1040,7 +1052,7 @@
<source>Port number. Port 80 is usually what you need.</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">29</context>
<context context-type="linenumber">44</context>
</context-group>
<target>Portszám. A 80-as port általában az, amire szükséged van.</target>
</trans-unit>
@ -1048,7 +1060,7 @@
<source>Images folder</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">34</context>
<context context-type="linenumber">49</context>
</context-group>
<target>Képek mappa</target>
</trans-unit>
@ -1056,7 +1068,7 @@
<source>Images are loaded from this folder (read permission required)</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">40</context>
<context context-type="linenumber">55</context>
</context-group>
<target>A képek ebből a mappából töltődnek be (olvasási engedély szükséges a mappára)</target>
</trans-unit>
@ -1064,7 +1076,7 @@
<source>Page public url</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">45</context>
<context context-type="linenumber">60</context>
</context-group>
<target>Oldal nyilvános url-je</target>
</trans-unit>
@ -1074,7 +1086,7 @@
</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">52</context>
<context context-type="linenumber">67</context>
</context-group>
<target>Ha az oldalt a helyi hálózaton keresztül éred el, jó tudni a nyilvánosságot URL-t megosztási link létrehozásához</target>
</trans-unit>
@ -1082,7 +1094,7 @@
<source>Url Base</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">59</context>
<context context-type="linenumber">74</context>
</context-group>
<target>Al cím</target>
</trans-unit>
@ -1093,7 +1105,7 @@
</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">66</context>
<context context-type="linenumber">81</context>
</context-group>
<target>Ha a galériát egy al-url alatt érheti el (például: http://mydomain.com/myGallery), állítsa be itt. Ha nem működik, akkor hiányozhat a "/" a kezdetétől url.</target>
</trans-unit>
@ -1103,7 +1115,7 @@
</source>
<context-group purpose="location">
<context context-type="sourcefile">app/settings/basic/basic.settings.component.html</context>
<context context-type="linenumber">73</context>
<context context-type="linenumber">88</context>
</context-group>
<target>A nyilvános url és az al url nem eggyeznek meg. Néhány funkció lehet hogy nem fog működni.</target>
</trans-unit>

View File

@ -73,7 +73,7 @@
"@types/sharp": "0.21.0",
"@types/winston": "2.3.9",
"@yaga/leaflet-ng2": "^1.0.0",
"bootstrap": "4.2.1",
"bootstrap": "4.1.3",
"chai": "4.2.0",
"codelyzer": "4.5.0",
"core-js": "2.6.1",