mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
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:
parent
067bfe92a4
commit
790d9a7920
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user