2017-08-22 10:53:26 +03:00
|
|
|
import Controller from '@ember/controller';
|
2018-01-09 17:23:36 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
2015-10-28 14:36:45 +03:00
|
|
|
|
2022-01-14 16:27:32 +03:00
|
|
|
export default class WhatsNewController extends Controller {
|
|
|
|
@service config;
|
|
|
|
@service upgradeStatus;
|
|
|
|
@service whatsNew;
|
2021-09-08 15:00:24 +03:00
|
|
|
|
2022-01-14 16:27:32 +03:00
|
|
|
queryParams = ['entry'];
|
2016-01-23 20:14:12 +03:00
|
|
|
|
2022-01-14 16:27:32 +03:00
|
|
|
get copyrightYear() {
|
|
|
|
const date = new Date();
|
2016-01-23 20:14:12 +03:00
|
|
|
return date.getFullYear();
|
2022-01-14 16:27:32 +03:00
|
|
|
}
|
|
|
|
|
2022-08-09 09:30:02 +03:00
|
|
|
get linkToGitHubReleases() {
|
|
|
|
// Don't link to GitHub Releases if the version contains the
|
|
|
|
// pre-release identifier
|
|
|
|
return !this.config.get('version').includes('-pre.');
|
|
|
|
}
|
|
|
|
|
2022-05-10 15:52:25 +03:00
|
|
|
get showSystemInfo() {
|
2022-01-14 16:27:32 +03:00
|
|
|
const isPro = !!this.config.get('hostSettings')?.siteId;
|
|
|
|
|
2022-05-10 15:52:25 +03:00
|
|
|
// Don't show any system info for Pro
|
2022-01-18 14:05:53 +03:00
|
|
|
if (isPro) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-05-10 15:52:25 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
get showDatabaseWarning() {
|
|
|
|
const isProduction = !!this.config.get('environment').match?.(/production/i);
|
|
|
|
const database = this.config.get('database');
|
|
|
|
|
2022-01-17 20:50:19 +03:00
|
|
|
// Show a warning if we're in production and not using MySQL 8
|
2022-01-18 14:05:53 +03:00
|
|
|
if (isProduction && database !== 'mysql8') {
|
|
|
|
return true;
|
2022-01-17 20:50:19 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
// Show a warning if we're in development and using MySQL 5
|
2022-01-18 14:05:53 +03:00
|
|
|
if (!isProduction && database === 'mysql5') {
|
|
|
|
return true;
|
2022-01-14 16:27:32 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|