|
|
|
|
import React from "react";
|
|
|
|
|
import {
|
|
|
|
|
BrowserRouter as Router,
|
|
|
|
|
Switch,
|
|
|
|
|
Route,
|
|
|
|
|
NavLink
|
|
|
|
|
} from "react-router-dom";
|
|
|
|
|
//import TopPanel from "./Componets/TopPanel/topPanel";
|
|
|
|
|
import AppConteiner from "./Componets/AppContainer";
|
|
|
|
|
|
|
|
|
|
import MainPage from "./pages/main";
|
|
|
|
|
|
|
|
|
|
import PageOverlays from "./pages/overlays";
|
|
|
|
|
import PageSettings from "./pages/settings";
|
|
|
|
|
import PageDocs from "./pages/docs";
|
|
|
|
|
import New from "./pages/news/news";
|
|
|
|
|
import PkgList from "./pages/pks";
|
|
|
|
|
import InfoPage from "./pages/info";
|
|
|
|
|
//import PageCommunity from "./pages/Community";
|
|
|
|
|
// import style && data
|
|
|
|
|
import "./style.css";
|
|
|
|
|
|
|
|
|
|
//data
|
|
|
|
|
import all_pkgs from "./pkg.json";
|
|
|
|
|
import icons from "./icons.json";
|
|
|
|
|
import News from "./news.json";
|
|
|
|
|
|
|
|
|
|
import "react-pro-sidebar/dist/css/styles.css";
|
|
|
|
|
import PageCommunity from "./pages/Community";
|
|
|
|
|
|
|
|
|
|
const news = News.News;
|
|
|
|
|
print(News.News);
|
|
|
|
|
//Debug prtnt
|
|
|
|
|
function print(text) {
|
|
|
|
|
console.log(text);
|
|
|
|
|
}
|
|
|
|
|
//const communiy = {};
|
|
|
|
|
// dataApp
|
|
|
|
|
const pkgs = all_pkgs.Catalog;
|
|
|
|
|
const overlays = all_pkgs.overlays;
|
|
|
|
|
const recovers = all_pkgs.recovers;
|
|
|
|
|
const aliases = all_pkgs.aliases;
|
|
|
|
|
const useDes = all_pkgs.usesDecription;
|
|
|
|
|
//print(all_pkgs.InstallPkgs);
|
|
|
|
|
|
|
|
|
|
export default class BasicExample extends React.Component {
|
|
|
|
|
//const [null, setPackage] = useState('');
|
|
|
|
|
AdressServer = "http://127.0.0.1:8000";
|
|
|
|
|
menuItems = [
|
|
|
|
|
{
|
|
|
|
|
name: "home",
|
|
|
|
|
text: "Главная",
|
|
|
|
|
url: "/",
|
|
|
|
|
Component: MainPage,
|
|
|
|
|
params: {
|
|
|
|
|
rec: recovers,
|
|
|
|
|
category: pkgs,
|
|
|
|
|
aliases: all_pkgs.aliases
|
|
|
|
|
//ViewPackageInfo: this.ViewPackageInfo
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
//{ name: "catalog", text: "Программы", url: "/catalog" },
|
|
|
|
|
{
|
|
|
|
|
name: "overlays",
|
|
|
|
|
text: "Оверлеи",
|
|
|
|
|
url: "/overlays",
|
|
|
|
|
Component: PageOverlays
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: "settings",
|
|
|
|
|
text: "Настройки",
|
|
|
|
|
url: "/settings",
|
|
|
|
|
Component: PageSettings
|
|
|
|
|
},
|
|
|
|
|
{ name: "docs", text: "Документы", url: "/docs", Component: PageDocs },
|
|
|
|
|
{ name: "news", text: "Новости", url: "/news", Component: New },
|
|
|
|
|
{ name: "comm", text: "Сообщества", url: "/community" },
|
|
|
|
|
{ name: "info", text: "О проекте", url: "/info" }
|
|
|
|
|
];
|
|
|
|
|
icons_demo = icons.icons;
|
|
|
|
|
PkgName = {};
|
|
|
|
|
|
|
|
|
|
ViewListPkgs(listpkgs) {
|
|
|
|
|
listpkgs.map((p, i) => console.log(p + "\n"));
|
|
|
|
|
alert(listpkgs.length + "\n" + listpkgs.map((p, i) => String(p) + "\n"));
|
|
|
|
|
}
|
|
|
|
|
//<TopPanel menuItem={this.menuItems} />
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<div ClassName="app">
|
|
|
|
|
<Router>
|
|
|
|
|
{
|
|
|
|
|
//<NavBar category={pkgs} menuItem={this.menuItems} />
|
|
|
|
|
}
|
|
|
|
|
<AppConteiner
|
|
|
|
|
ServerAdress={this.AdressServer}
|
|
|
|
|
category={pkgs}
|
|
|
|
|
aliases={aliases}
|
|
|
|
|
menuItems={this.menuItems}
|
|
|
|
|
icons={this.icons_demo}
|
|
|
|
|
rec={recovers}
|
|
|
|
|
useDes={useDes.GlobalUSE}
|
|
|
|
|
Ipkg={all_pkgs.InstallPkgs}
|
|
|
|
|
>
|
|
|
|
|
<Switch>
|
|
|
|
|
{/*this.menuItems.map((route) => (
|
|
|
|
|
<Route exact path={route.url} component={route.Component} />
|
|
|
|
|
//))*/}
|
|
|
|
|
<Route exact path="/">
|
|
|
|
|
{}
|
|
|
|
|
<MainPage
|
|
|
|
|
icons={this.icons_demo}
|
|
|
|
|
rec={recovers}
|
|
|
|
|
useDes={useDes.GlobalUSE}
|
|
|
|
|
Ipkg={all_pkgs.InstallPkgs}
|
|
|
|
|
repositores={overlays}
|
|
|
|
|
/>
|
|
|
|
|
</Route>
|
|
|
|
|
<Route path={this.menuItems[1].url} component={PageOverlays}>
|
|
|
|
|
<PageOverlays repositores={overlays} />
|
|
|
|
|
</Route>
|
|
|
|
|
<Route path={this.menuItems[2].url}>
|
|
|
|
|
<PageSettings uses={useDes.GlobalUSE} />
|
|
|
|
|
</Route>
|
|
|
|
|
<Route path={this.menuItems[3].url}>
|
|
|
|
|
<PageDocs />
|
|
|
|
|
</Route>
|
|
|
|
|
<Route path={this.menuItems[4].url}>
|
|
|
|
|
<New news={news} />
|
|
|
|
|
</Route>
|
|
|
|
|
<Route path={this.menuItems[5].url}>
|
|
|
|
|
<PageCommunity />
|
|
|
|
|
</Route>
|
|
|
|
|
<Route path={this.menuItems[6].url}>
|
|
|
|
|
<InfoPage />
|
|
|
|
|
</Route>
|
|
|
|
|
|
|
|
|
|
<NavLink path="/pkg">
|
|
|
|
|
{console.log(this.PkgName)}
|
|
|
|
|
<PkgList PackageName={this.PkgName} />
|
|
|
|
|
</NavLink>
|
|
|
|
|
</Switch>
|
|
|
|
|
</AppConteiner>
|
|
|
|
|
</Router>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|