mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
added PluginsOverview Page
This commit is contained in:
@@ -10,6 +10,16 @@
|
|||||||
"currentAppVersion": "Aktuelle Software-Versionsnummer"
|
"currentAppVersion": "Aktuelle Software-Versionsnummer"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"plugins": {
|
||||||
|
"title": "Plugins",
|
||||||
|
"installedSubtitle": "Installierte Plugins",
|
||||||
|
"availableSubtitle": "Verfügbare Plugins",
|
||||||
|
"menu": {
|
||||||
|
"pluginsNavLink": "Plugins",
|
||||||
|
"installedNavLink": "Installiert",
|
||||||
|
"availableNavLink": "Verfügbar"
|
||||||
|
}
|
||||||
|
},
|
||||||
"repositoryRole": {
|
"repositoryRole": {
|
||||||
"navLink": "Berechtigungsrollen",
|
"navLink": "Berechtigungsrollen",
|
||||||
"title": "Berechtigungsrollen",
|
"title": "Berechtigungsrollen",
|
||||||
|
|||||||
@@ -10,6 +10,16 @@
|
|||||||
"currentAppVersion": "Current Application Version"
|
"currentAppVersion": "Current Application Version"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"plugins": {
|
||||||
|
"title": "Plugins",
|
||||||
|
"installedSubtitle": "Installed Plugins",
|
||||||
|
"availableSubtitle": "Available Plugins",
|
||||||
|
"menu": {
|
||||||
|
"pluginsNavLink": "Plugins",
|
||||||
|
"installedNavLink": "Installed",
|
||||||
|
"availableNavLink": "Available"
|
||||||
|
}
|
||||||
|
},
|
||||||
"repositoryRole": {
|
"repositoryRole": {
|
||||||
"navLink": "Permission Roles",
|
"navLink": "Permission Roles",
|
||||||
"title": "Permission Roles",
|
"title": "Permission Roles",
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import type { Links } from "@scm-manager/ui-types";
|
|||||||
import { Page, Navigation, NavLink, Section, SubNavigation } from "@scm-manager/ui-components";
|
import { Page, Navigation, NavLink, Section, SubNavigation } from "@scm-manager/ui-components";
|
||||||
import { getLinks } from "../../modules/indexResource";
|
import { getLinks } from "../../modules/indexResource";
|
||||||
import AdminDetails from "./AdminDetails";
|
import AdminDetails from "./AdminDetails";
|
||||||
|
import PluginsOverview from "../plugins/containers/PluginsOverview";
|
||||||
import GlobalConfig from "./GlobalConfig";
|
import GlobalConfig from "./GlobalConfig";
|
||||||
import RepositoryRoles from "../roles/containers/RepositoryRoles";
|
import RepositoryRoles from "../roles/containers/RepositoryRoles";
|
||||||
import SingleRepositoryRole from "../roles/containers/SingleRepositoryRole";
|
import SingleRepositoryRole from "../roles/containers/SingleRepositoryRole";
|
||||||
@@ -62,6 +63,35 @@ class Admin extends React.Component<Props> {
|
|||||||
<Redirect exact from={url} to={`${url}/info`} />
|
<Redirect exact from={url} to={`${url}/info`} />
|
||||||
<Route path={`${url}/info`} exact component={AdminDetails} />
|
<Route path={`${url}/info`} exact component={AdminDetails} />
|
||||||
<Route path={`${url}/settings/general`} exact component={GlobalConfig} />
|
<Route path={`${url}/settings/general`} exact component={GlobalConfig} />
|
||||||
|
<Redirect exact from={`${url}/plugins`} to={`${url}/plugins/installed/`} />
|
||||||
|
<Route
|
||||||
|
path={`${url}/plugins/installed`}
|
||||||
|
exact
|
||||||
|
render={() => (
|
||||||
|
<PluginsOverview baseUrl={`${url}/plugins/installed`} installed={true} />
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<Route
|
||||||
|
path={`${url}/plugins/installed/:page`}
|
||||||
|
exact
|
||||||
|
render={() => (
|
||||||
|
<PluginsOverview baseUrl={`${url}/plugins/installed`} installed={true} />
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<Route
|
||||||
|
path={`${url}/plugins/available`}
|
||||||
|
exact
|
||||||
|
render={() => (
|
||||||
|
<PluginsOverview baseUrl={`${url}/plugins/available`} installed={false} />
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<Route
|
||||||
|
path={`${url}/plugins/available/:page`}
|
||||||
|
exact
|
||||||
|
render={() => (
|
||||||
|
<PluginsOverview baseUrl={`${url}/plugins/available`} installed={false} />
|
||||||
|
)}
|
||||||
|
/>
|
||||||
<Route
|
<Route
|
||||||
path={`${url}/role/:role`}
|
path={`${url}/role/:role`}
|
||||||
render={() => (
|
render={() => (
|
||||||
@@ -106,6 +136,20 @@ class Admin extends React.Component<Props> {
|
|||||||
icon="fas fa-info-circle"
|
icon="fas fa-info-circle"
|
||||||
label={t("admin.menu.informationNavLink")}
|
label={t("admin.menu.informationNavLink")}
|
||||||
/>
|
/>
|
||||||
|
<SubNavigation
|
||||||
|
to={`${url}/plugins/`}
|
||||||
|
icon="fas fa-puzzle-piece"
|
||||||
|
label={t("plugins.menu.pluginsNavLink")}
|
||||||
|
>
|
||||||
|
<NavLink
|
||||||
|
to={`${url}/plugins/installed/`}
|
||||||
|
label={t("plugins.menu.installedNavLink")}
|
||||||
|
/>
|
||||||
|
<NavLink
|
||||||
|
to={`${url}/plugins/available/`}
|
||||||
|
label={t("plugins.menu.availableNavLink")}
|
||||||
|
/>
|
||||||
|
</SubNavigation>
|
||||||
<NavLink
|
<NavLink
|
||||||
to={`${url}/roles/`}
|
to={`${url}/roles/`}
|
||||||
icon="fas fa-user-shield"
|
icon="fas fa-user-shield"
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
// @flow
|
// @flow
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { translate } from "react-i18next";
|
|
||||||
import {Loading, Subtitle} from "@scm-manager/ui-components";
|
|
||||||
import {getAppVersion} from "../../modules/indexResource";
|
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import Title from "@scm-manager/ui-components/src/layout/Title";
|
import { translate } from "react-i18next";
|
||||||
|
import { Loading, Title, Subtitle } from "@scm-manager/ui-components";
|
||||||
|
import { getAppVersion } from "../../modules/indexResource";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
loading: boolean,
|
loading: boolean,
|
||||||
@@ -24,10 +23,12 @@ class AdminDetails extends React.Component<Props> {
|
|||||||
return <Loading />;
|
return <Loading />;
|
||||||
}
|
}
|
||||||
|
|
||||||
return <>
|
return (
|
||||||
|
<>
|
||||||
<Title title={t("admin.information.currentAppVersion")} />
|
<Title title={t("admin.information.currentAppVersion")} />
|
||||||
<Subtitle subtitle={this.props.version} />
|
<Subtitle subtitle={this.props.version} />
|
||||||
</>;
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
57
scm-ui/src/admin/plugins/containers/PluginsOverview.js
Normal file
57
scm-ui/src/admin/plugins/containers/PluginsOverview.js
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
// @flow
|
||||||
|
import React from "react";
|
||||||
|
import { translate } from "react-i18next";
|
||||||
|
import { Loading, Title, Subtitle, LinkPaginator, Notification } from "@scm-manager/ui-components";
|
||||||
|
import PluginsList from "../components/PluginsList";
|
||||||
|
|
||||||
|
type Props = {
|
||||||
|
loading: boolean,
|
||||||
|
error: Error,
|
||||||
|
baseUrl: string,
|
||||||
|
installed: boolean,
|
||||||
|
|
||||||
|
// context objects
|
||||||
|
t: string => string
|
||||||
|
};
|
||||||
|
|
||||||
|
class PluginsOverview extends React.Component<Props> {
|
||||||
|
render() {
|
||||||
|
const { loading, installed, t } = this.props;
|
||||||
|
|
||||||
|
if (loading) {
|
||||||
|
return <Loading />;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Title title={t("plugins.title")} />
|
||||||
|
<Subtitle
|
||||||
|
subtitle={
|
||||||
|
installed
|
||||||
|
? t("plugins.installedSubtitle")
|
||||||
|
: t("plugins.availableSubtitle")
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
{this.renderPluginsList()}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
renderPluginsList() {
|
||||||
|
const { collection, page, t } = this.props;
|
||||||
|
|
||||||
|
if (collection._embedded && collection._embedded.plugins.length > 0) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<PluginsList plugins={collection._embedded.plugins} />
|
||||||
|
<LinkPaginator collection={collection} page={page} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<Notification type="info">{t("plugins.noPlugins")}</Notification>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default translate("admin")(PluginsOverview);
|
||||||
0
scm-ui/src/admin/roles/containers/PluginsList.js
Normal file
0
scm-ui/src/admin/roles/containers/PluginsList.js
Normal file
Reference in New Issue
Block a user