+++ /dev/null
-/*
- * SonarQube
- * Copyright (C) 2009-2023 SonarSource SA
- * mailto:info AT sonarsource DOT com
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-import * as React from 'react';
-import { Helmet } from 'react-helmet-async';
-import { getSystemInfo } from '../../../api/system';
-import UpdateNotification from '../../../app/components/update-notification/UpdateNotification';
-import Suggestions from '../../../components/embed-docs-modal/Suggestions';
-import { Location, Router, withRouter } from '../../../components/hoc/withRouter';
-import { translate } from '../../../helpers/l10n';
-import { SysInfoCluster, SysInfoStandalone } from '../../../types/types';
-import '../styles.css';
-import {
- getClusterVersion,
- getServerId,
- getSystemLogsLevel,
- getVersion,
- isCluster,
- parseQuery,
- Query,
- serializeQuery,
-} from '../utils';
-import ClusterSysInfos from './ClusterSysInfos';
-import PageHeader from './PageHeader';
-import StandaloneSysInfos from './StandaloneSysInfos';
-
-interface Props {
- location: Location;
- router: Router;
-}
-
-interface State {
- loading: boolean;
- sysInfoData?: SysInfoCluster | SysInfoStandalone;
-}
-
-export class App extends React.PureComponent<Props, State> {
- mounted = false;
- state: State = { loading: true };
-
- componentDidMount() {
- this.mounted = true;
- this.fetchSysInfo();
- }
-
- componentWillUnmount() {
- this.mounted = false;
- }
-
- fetchSysInfo = () => {
- this.setState({ loading: true });
- getSystemInfo().then(
- (sysInfoData) => {
- if (this.mounted) {
- this.setState({ loading: false, sysInfoData });
- }
- },
- () => {
- if (this.mounted) {
- this.setState({ loading: false });
- }
- }
- );
- };
-
- toggleSysInfoCards = (toggledCard: string) => {
- const query = parseQuery(this.props.location.query);
- let expandedCards;
- if (query.expandedCards.includes(toggledCard)) {
- expandedCards = query.expandedCards.filter((card) => card !== toggledCard);
- } else {
- expandedCards = query.expandedCards.concat(toggledCard);
- }
- this.updateQuery({ expandedCards });
- };
-
- updateQuery = (newQuery: Query) => {
- const query = serializeQuery({ ...parseQuery(this.props.location.query), ...newQuery });
- this.props.router.replace({ pathname: this.props.location.pathname, query });
- };
-
- renderSysInfo() {
- const { sysInfoData } = this.state;
- if (!sysInfoData) {
- return null;
- }
-
- const query = parseQuery(this.props.location.query);
- if (isCluster(sysInfoData)) {
- return (
- <ClusterSysInfos
- expandedCards={query.expandedCards}
- sysInfoData={sysInfoData}
- toggleCard={this.toggleSysInfoCards}
- />
- );
- }
- return (
- <StandaloneSysInfos
- expandedCards={query.expandedCards}
- sysInfoData={sysInfoData}
- toggleCard={this.toggleSysInfoCards}
- />
- );
- }
-
- render() {
- const { loading, sysInfoData } = this.state;
- return (
- <main className="page page-limited">
- <Suggestions suggestions="system_info" />
- <Helmet defer={false} title={translate('system_info.page')} />
- <div className="page-notifs">
- <UpdateNotification dismissable={false} />
- </div>
- {sysInfoData && (
- <PageHeader
- isCluster={isCluster(sysInfoData)}
- loading={loading}
- logLevel={getSystemLogsLevel(sysInfoData)}
- onLogLevelChange={this.fetchSysInfo}
- serverId={getServerId(sysInfoData)}
- showActions={sysInfoData !== undefined}
- version={
- isCluster(sysInfoData) ? getClusterVersion(sysInfoData) : getVersion(sysInfoData)
- }
- />
- )}
- {this.renderSysInfo()}
- </main>
- );
- }
-}
-
-export default withRouter(App);
className="spacer-left button-small"
id="edit-logs-level-button"
onClick={this.handleLogsLevelOpen}
+ aria-label={translate('system.logs_level.change')}
/>
</span>
{this.props.canDownloadLogs && (
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2023 SonarSource SA
+ * mailto:info AT sonarsource DOT com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+import * as React from 'react';
+import { Helmet } from 'react-helmet-async';
+import { getSystemInfo } from '../../../api/system';
+import UpdateNotification from '../../../app/components/update-notification/UpdateNotification';
+import Suggestions from '../../../components/embed-docs-modal/Suggestions';
+import { Location, Router, withRouter } from '../../../components/hoc/withRouter';
+import { translate } from '../../../helpers/l10n';
+import { SysInfoCluster, SysInfoStandalone } from '../../../types/types';
+import '../styles.css';
+import {
+ getClusterVersion,
+ getServerId,
+ getSystemLogsLevel,
+ getVersion,
+ isCluster,
+ parseQuery,
+ Query,
+ serializeQuery,
+} from '../utils';
+import ClusterSysInfos from './ClusterSysInfos';
+import PageHeader from './PageHeader';
+import StandaloneSysInfos from './StandaloneSysInfos';
+
+interface Props {
+ location: Location;
+ router: Router;
+}
+
+interface State {
+ loading: boolean;
+ sysInfoData?: SysInfoCluster | SysInfoStandalone;
+}
+
+export class SystemApp extends React.PureComponent<Props, State> {
+ mounted = false;
+ state: State = { loading: true };
+
+ componentDidMount() {
+ this.mounted = true;
+ this.fetchSysInfo();
+ }
+
+ componentWillUnmount() {
+ this.mounted = false;
+ }
+
+ fetchSysInfo = () => {
+ this.setState({ loading: true });
+ getSystemInfo().then(
+ (sysInfoData) => {
+ if (this.mounted) {
+ this.setState({ loading: false, sysInfoData });
+ }
+ },
+ () => {
+ if (this.mounted) {
+ this.setState({ loading: false });
+ }
+ }
+ );
+ };
+
+ toggleSysInfoCards = (toggledCard: string) => {
+ const query = parseQuery(this.props.location.query);
+ let expandedCards;
+ if (query.expandedCards.includes(toggledCard)) {
+ expandedCards = query.expandedCards.filter((card) => card !== toggledCard);
+ } else {
+ expandedCards = query.expandedCards.concat(toggledCard);
+ }
+ this.updateQuery({ expandedCards });
+ };
+
+ updateQuery = (newQuery: Query) => {
+ const query = serializeQuery({ ...parseQuery(this.props.location.query), ...newQuery });
+ this.props.router.replace({ pathname: this.props.location.pathname, query });
+ };
+
+ renderSysInfo() {
+ const { sysInfoData } = this.state;
+ if (!sysInfoData) {
+ return null;
+ }
+
+ const query = parseQuery(this.props.location.query);
+ if (isCluster(sysInfoData)) {
+ return (
+ <ClusterSysInfos
+ expandedCards={query.expandedCards}
+ sysInfoData={sysInfoData}
+ toggleCard={this.toggleSysInfoCards}
+ />
+ );
+ }
+ return (
+ <StandaloneSysInfos
+ expandedCards={query.expandedCards}
+ sysInfoData={sysInfoData}
+ toggleCard={this.toggleSysInfoCards}
+ />
+ );
+ }
+
+ render() {
+ const { loading, sysInfoData } = this.state;
+ return (
+ <main className="page page-limited">
+ <Suggestions suggestions="system_info" />
+ <Helmet defer={false} title={translate('system_info.page')} />
+ <div className="page-notifs">
+ <UpdateNotification dismissable={false} />
+ </div>
+ {sysInfoData && (
+ <PageHeader
+ isCluster={isCluster(sysInfoData)}
+ loading={loading}
+ logLevel={getSystemLogsLevel(sysInfoData)}
+ onLogLevelChange={this.fetchSysInfo}
+ serverId={getServerId(sysInfoData)}
+ showActions={sysInfoData !== undefined}
+ version={
+ isCluster(sysInfoData) ? getClusterVersion(sysInfoData) : getVersion(sysInfoData)
+ }
+ />
+ )}
+ {this.renderSysInfo()}
+ </main>
+ );
+ }
+}
+
+export default withRouter(SystemApp);
mockStandaloneSysInfo,
} from '../../../../helpers/testMocks';
import { waitAndUpdate } from '../../../../helpers/testUtils';
-import { App } from '../App';
+import { SystemApp } from '../SystemApp';
jest.mock('../../../../api/system', () => ({
getSystemInfo: jest.fn().mockResolvedValue(null),
);
});
-function shallowRender(props: Partial<App['props']> = {}) {
- return shallow<App>(<App location={mockLocation()} router={mockRouter()} {...props} />);
+function shallowRender(props: Partial<SystemApp['props']> = {}) {
+ return shallow<SystemApp>(
+ <SystemApp location={mockLocation()} router={mockRouter()} {...props} />
+ );
}
</strong>
</span>
<EditButton
+ aria-label="system.logs_level.change"
className="spacer-left button-small"
id="edit-logs-level-button"
onClick={[Function]}
</strong>
</span>
<EditButton
+ aria-label="system.logs_level.change"
className="spacer-left button-small"
id="edit-logs-level-button"
onClick={[Function]}
*/
import React from 'react';
import { Route } from 'react-router-dom';
-import App from './components/App';
+import SystemApp from './components/SystemApp';
-export const routes = () => <Route path="system" element={<App />} />;
+export const routes = () => <Route path="system" element={<SystemApp />} />;
export default routes;
refresh=Refresh
reload=Reload
remove=Remove
+remove_x=Remove {x}
rename=Rename
replaces=Replaces
reset_verb=Reset
system.log_level.warning.short=Current logs level has performance impacts, get back to INFO level.
system.log_level.info=Your selection does not affect the Search Engine.
system.logs_level=Logs level
+system.logs_level.change=Change logs level
system.new_version_available=A new version of SonarQube is available.
system.restart_does_not_reload_sonar_properties=Also note that a restart will not reload the sonar.properties file.
system.see_whats_new=See what's new!