Fixed "About Ghost" missing system information

- the template code had moved to a model in Settings but the controller code
  hadn't been moved over so the getters were missing
- this moves all the relevant code from What's New to the About modal
This commit is contained in:
Daniel Lockyer 2022-09-13 12:21:52 +01:00
parent 067bfe92a4
commit 790d9a7920
No known key found for this signature in database
GPG Key ID: D21186F0B47295AD
2 changed files with 39 additions and 43 deletions

View File

@ -12,4 +12,43 @@ export default class AboutModal extends Component {
this.isTesting = config.environment === 'test';
}
}
get copyrightYear() {
const date = new Date();
return date.getFullYear();
}
get linkToGitHubReleases() {
// Don't link to GitHub Releases if the version contains the
// pre-release identifier
return !this.config.get('version').includes('-pre.');
}
get showSystemInfo() {
const isPro = !!this.config.get('hostSettings')?.siteId;
// Don't show any system info for Pro
if (isPro) {
return false;
}
return true;
}
get showDatabaseWarning() {
const isProduction = !!this.config.get('environment').match?.(/production/i);
const database = this.config.get('database');
// Show a warning if we're in production and not using MySQL 8
if (isProduction && database !== 'mysql8') {
return true;
}
// Show a warning if we're in development and using MySQL 5
if (!isProduction && database === 'mysql5') {
return true;
}
return false;
}
}

View File

@ -2,48 +2,5 @@ import Controller from '@ember/controller';
import {inject as service} from '@ember/service';
export default class WhatsNewController extends Controller {
@service config;
@service upgradeStatus;
@service whatsNew;
queryParams = ['entry'];
get copyrightYear() {
const date = new Date();
return date.getFullYear();
}
get linkToGitHubReleases() {
// Don't link to GitHub Releases if the version contains the
// pre-release identifier
return !this.config.get('version').includes('-pre.');
}
get showSystemInfo() {
const isPro = !!this.config.get('hostSettings')?.siteId;
// Don't show any system info for Pro
if (isPro) {
return false;
}
return true;
}
get showDatabaseWarning() {
const isProduction = !!this.config.get('environment').match?.(/production/i);
const database = this.config.get('database');
// Show a warning if we're in production and not using MySQL 8
if (isProduction && database !== 'mysql8') {
return true;
}
// Show a warning if we're in development and using MySQL 5
if (!isProduction && database === 'mysql5') {
return true;
}
return false;
}
}