1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-23 01:27:14 +02:00

Add restart/reset warnings #569

This commit is contained in:
Patrik J. Braun 2023-01-06 20:16:33 +01:00
parent 0de249f32a
commit be2cfbdd4b
4 changed files with 67 additions and 11 deletions

View File

@ -98,6 +98,7 @@ export class MySQLConfig {
tags:
{
name: $localize`Host`,
uiResetNeeded: {server: true},
priority: ConfigPriority.advanced
},
})
@ -107,6 +108,7 @@ export class MySQLConfig {
tags:
{
name: $localize`Port`,
uiResetNeeded: {server: true},
priority: ConfigPriority.advanced
},
})
@ -116,6 +118,7 @@ export class MySQLConfig {
tags:
{
name: $localize`Database`,
uiResetNeeded: {server: true},
priority: ConfigPriority.advanced
},
})
@ -125,6 +128,7 @@ export class MySQLConfig {
tags:
{
name: $localize`Username`,
uiResetNeeded: {server: true},
priority: ConfigPriority.advanced
},
})
@ -134,6 +138,7 @@ export class MySQLConfig {
tags:
{
name: $localize`Password`,
uiResetNeeded: {server: true},
priority: ConfigPriority.advanced
}
})
@ -146,6 +151,7 @@ export class SQLiteConfig {
tags:
{
name: $localize`Sqlite db filename`,
uiResetNeeded: {server: true},
priority: ConfigPriority.underTheHood
},
description: $localize`Sqlite will save the db with this filename.`,
@ -224,6 +230,7 @@ export class ServerDataBaseConfig {
{
name: $localize`Type`,
priority: ConfigPriority.advanced,
uiResetNeeded: {db: true},
githubIssue: 573
} as TAGS,
description: $localize`SQLite is recommended.`
@ -234,6 +241,7 @@ export class ServerDataBaseConfig {
tags:
{
name: $localize`Database folder`,
uiResetNeeded: {server: true},
priority: ConfigPriority.advanced
},
description: $localize`All file-based data will be stored here (sqlite database, user database in case of memory db, job history data).`,
@ -244,6 +252,7 @@ export class ServerDataBaseConfig {
tags:
{
name: $localize`SQLite`,
uiResetNeeded: {db: true},
relevant: (c: any) => c.type === DatabaseType.sqlite,
}
})
@ -253,6 +262,7 @@ export class ServerDataBaseConfig {
tags:
{
name: $localize`MySQL`,
uiResetNeeded: {db: true},
relevant: (c: any) => c.type === DatabaseType.mysql,
}
})
@ -270,6 +280,7 @@ export class ServerUserConfig extends ClientUserConfig {
{
name: $localize`Enforced users`,
priority: ConfigPriority.underTheHood,
uiResetNeeded: {server: true},
uiOptional: true,
githubIssue: 575
} as TAGS,
@ -411,6 +422,7 @@ export class ServerIndexingConfig {
{
name: $localize`Exclude Folder List`,
priority: ConfigPriority.advanced,
uiResetNeeded: {server: true, db: true},
uiOptional: true,
uiAllowSpaces: true
} as TAGS,
@ -423,6 +435,7 @@ export class ServerIndexingConfig {
{
name: $localize`Exclude File List`,
priority: ConfigPriority.advanced,
uiResetNeeded: {server: true, db: true},
uiOptional: true,
hint: $localize`.ignore;.pg2ignore`
} as TAGS,
@ -437,6 +450,7 @@ export class ServerThreadingConfig {
tags:
{
name: $localize`Threading`,
uiResetNeeded: {server: true},
priority: ConfigPriority.underTheHood
},
description: $localize`Runs directory scanning and thumbnail generation in a different thread.`
@ -446,6 +460,7 @@ export class ServerThreadingConfig {
tags:
{
name: $localize`Thumbnail threads`,
uiResetNeeded: {server: true},
priority: ConfigPriority.underTheHood
},
description: $localize`Number of threads that are used to generate thumbnails. If 0, number of 'CPU cores -1' threads will be used.`,
@ -819,6 +834,7 @@ export class ServerPreviewConfig {
type: 'object',
tags: {
name: $localize`Preview Filter query`,
uiResetNeeded: {db: true},
priority: ConfigPriority.advanced,
uiType: 'SearchQuery'
},
@ -832,6 +848,7 @@ export class ServerPreviewConfig {
arrayType: SortingMethods,
tags: {
name: $localize`Preview Sorting`,
uiResetNeeded: {db: true},
priority: ConfigPriority.advanced
},
description: $localize`If multiple preview is available sorts them by these methods and selects the first one.`,
@ -848,6 +865,7 @@ export class ServerMediaConfig extends ClientMediaConfig {
tags: {
name: $localize`Images folder`,
priority: ConfigPriority.basic,
uiResetNeeded: {server: true},
dockerSensitive: true
},
description: $localize`Images are loaded from this folder (read permission required)`,
@ -857,6 +875,7 @@ export class ServerMediaConfig extends ClientMediaConfig {
@ConfigProperty({
tags: {
name: $localize`Temp folder`,
uiResetNeeded: {server: true},
priority: ConfigPriority.basic,
dockerSensitive: true
},
@ -940,6 +959,7 @@ export class ServerServiceConfig extends ClientServiceConfig {
tags: {
name: $localize`Port`,
priority: ConfigPriority.advanced,
uiResetNeeded: {server: true},
dockerSensitive: true
},
description: $localize`Port number. Port 80 is usually what you need.`,
@ -951,6 +971,7 @@ export class ServerServiceConfig extends ClientServiceConfig {
tags: {
name: $localize`Host`,
priority: ConfigPriority.advanced,
uiResetNeeded: {server: true},
dockerSensitive: true
},
description: $localize`Server will accept connections from this IPv6 or IPv4 address.`,

View File

@ -45,7 +45,11 @@ export type TAGS = {
hideProgress: boolean,
relevant?: (c: ClientConfig) => boolean,
description: string
}[]
}[],
uiResetNeeded?: {
server?: boolean,
db?: boolean
}
};
@SubConfigClass<TAGS>({tags: {client: true}, softReadonly: true})
@ -533,6 +537,7 @@ export class ClientVideoConfig {
tags: {
name: $localize`Enable`,
priority: ConfigPriority.advanced,
uiResetNeeded: {db: true}
}
})
enabled: boolean = true;
@ -541,7 +546,8 @@ export class ClientVideoConfig {
tags: {
name: $localize`Supported formats with transcoding`,
priority: ConfigPriority.underTheHood,
uiDisabled: (sb: ClientVideoConfig) => !sb.enabled
uiDisabled: (sb: ClientVideoConfig) => !sb.enabled,
uiResetNeeded: {db: true}
} as TAGS,
description: $localize`Video formats that are supported after transcoding (with the build-in ffmpeg support).`
})
@ -553,7 +559,8 @@ export class ClientVideoConfig {
tags: {
name: $localize`Supported formats without transcoding`,
priority: ConfigPriority.underTheHood,
uiDisabled: (sb: ClientVideoConfig) => !sb.enabled
uiDisabled: (sb: ClientVideoConfig) => !sb.enabled,
uiResetNeeded: {db: true}
},
description: $localize`Video formats that are supported also without transcoding. Browser supported formats: https://www.w3schools.com/html/html5_video.asp`
})
@ -597,7 +604,8 @@ export class ClientPhotoConfig {
arrayType: 'string',
tags: {
name: $localize`Supported photo formats`,
priority: ConfigPriority.underTheHood
priority: ConfigPriority.underTheHood,
uiResetNeeded: {db: true}
},
description: $localize`Photo formats that are supported. Browser needs to support these formats natively. Also sharp (libvips) package should be able to convert these formats.`,
})
@ -649,6 +657,7 @@ export class ClientMetaFileConfig {
tags: {
name: $localize`*.gpx files`,
priority: ConfigPriority.advanced,
uiResetNeeded: {db: true},
uiDisabled: (sb, c) => !c.Map.enabled
} as TAGS,
description: $localize`Reads *.gpx files and renders them on the map.`
@ -667,6 +676,7 @@ export class ClientMetaFileConfig {
@ConfigProperty({
tags: {
name: $localize`Markdown files`,
uiResetNeeded: {db: true},
priority: ConfigPriority.advanced
},
description: $localize`Reads *.md files in a directory and shows the next to the map.`
@ -676,6 +686,7 @@ export class ClientMetaFileConfig {
@ConfigProperty({
tags: {
name: $localize`*.pg2conf files`,
uiResetNeeded: {db: true},
priority: ConfigPriority.advanced
},
description: $localize`Reads *.pg2conf files (You can use it for custom sorting and saved search (albums)).`
@ -685,6 +696,7 @@ export class ClientMetaFileConfig {
arrayType: 'string',
tags: {
name: $localize`Supported formats`,
uiResetNeeded: {db: true},
priority: ConfigPriority.underTheHood
},
description: $localize`The app will read and process these files.`
@ -697,15 +709,17 @@ export class ClientFacesConfig {
@ConfigProperty({
tags: {
name: $localize`Enabled`,
priority: ConfigPriority.advanced
priority: ConfigPriority.advanced,
uiResetNeeded: {db: true}
}
})
enabled: boolean = true;
@ConfigProperty({
tags: {
name: $localize`Override keywords`,
priority: ConfigPriority.underTheHood
},
priority: ConfigPriority.underTheHood,
uiResetNeeded: {db: true}
} as TAGS,
description: $localize`If a photo has the same face (person) name and keyword, the app removes the duplicate, keeping the face only.`
})
keywordsToPersons: boolean = true;
@ -752,6 +766,7 @@ export class ClientServiceConfig {
tags: {
name: $localize`Url Base`,
hint: '/myGallery',
uiResetNeeded: {server: true},
priority: ConfigPriority.advanced,
uiOptional: true
}
@ -762,6 +777,7 @@ export class ClientServiceConfig {
description: 'PiGallery api path.',
tags: {
name: $localize`Api path`,
uiResetNeeded: {server: true},
priority: ConfigPriority.underTheHood
}
})
@ -775,6 +791,7 @@ export class ClientServiceConfig {
tags: {
name: $localize`Custom HTML Head`,
priority: ConfigPriority.advanced,
uiResetNeeded: {server: true},
githubIssue: 404,
uiOptional: true
}
@ -792,6 +809,7 @@ export class ClientUserConfig {
}
},
tags: {
uiResetNeeded: {server: true},
name: $localize`Password protection`,
},
description: $localize`Enables user management with login to password protect the gallery.`,
@ -802,6 +820,7 @@ export class ClientUserConfig {
type: UserRoles, tags: {
name: $localize`Default user right`,
priority: ConfigPriority.advanced,
uiResetNeeded: {server: true},
relevant: (c: any) => c.authenticationRequired === false
},
description: $localize`Default user right when password protection is disabled.`,

View File

@ -284,25 +284,33 @@
</div>
</ng-container>
</ng-container>
<div class="input-group-append">
<div class="input-group-append" *ngIf="dockerWarning && changed">
<span
triggers="mouseenter:mouseleave"
placement="bottom"
[popover]="popTemplate"
class="oi oi-warning text-warning warning-icon ms-2" *ngIf="dockerWarning && changed"></span>
class="oi oi-warning text-warning warning-icon ms-2" ></span>
</div>
</div>
<small class="form-text text-muted" *ngIf="description">
<small class="form-text text-muted">
<ng-container *ngIf="experimental">
<span class="oi oi-warning"></span>[Experimental]
</ng-container>
{{description}}
<ng-container *ngIf="description">{{description}}</ng-container>
<span *ngIf="type==='array' && (state.arrayType === 'string' || isNumberArray)" i18n>';' separated list.</span>
<a *ngIf="state.tags?.githubIssue"
[href]="'https://github.com/bpatrik/pigallery2/issues/'+state.tags?.githubIssue">
<ng-container i18n>See</ng-container>
#{{state.tags?.githubIssue}}.</a>
<ng-container *ngIf="state.tags?.uiResetNeeded?.db && !isOriginal">
<br/>
<span class="oi oi-warning" i18n>Reset database after changing this settings!</span>
</ng-container>
<ng-container *ngIf="state.tags?.uiResetNeeded?.server && !isOriginal">
<br/>
<span class="oi oi-warning" i18n>Restart server after changing this settings!</span>
</ng-container>
</small>
</div>
</div>

View File

@ -96,6 +96,14 @@ export class SettingsEntryComponent
return !Utils.equalsFilter(this.state.value, this.state.default);
}
get isOriginal(): boolean {
if (this.Disabled) {
return true;
}
return Utils.equalsFilter(this.state.value, this.state.original);
}
get shouldHide(): boolean {
return this.state.shouldHide && this.state.shouldHide();
}