Browse Source

fix req on '/find?pkg=<package_name>'

master
serkus01 2 months ago
parent
commit
79117723ed
  1. 3
      package-lock.json
  2. 20
      sources/.codesandbox/workspace.json
  3. 38
      sources/src/Componets/Acardion.js
  4. 19
      sources/src/Componets/AppContainer.js
  5. 67
      sources/src/Componets/Cards/fullCard.js
  6. 2
      sources/src/Componets/Cards/style.css
  7. 8
      sources/src/Componets/CheckField.js
  8. 29
      sources/src/Componets/Modal.js
  9. 6
      sources/src/Componets/style.css
  10. 19
      sources/src/example.js
  11. 218
      sources/src/navList.js
  12. 6
      sources/src/package.json
  13. 41
      sources/src/pages/auth/auth.js
  14. 33
      sources/src/pages/auth/style.css
  15. 117
      sources/src/pages/main.js
  16. 28
      sources/src/pages/overlays.js
  17. 12
      sources/src/pages/profile.js
  18. 117
      sources/src/pages/settings.js
  19. 6
      sources/src/pages/splash/spalsh.js
  20. 20
      sources/src/pages/style.css
  21. 2
      sources/src/pkg.json
  22. 8
      web/asset-manifest.json
  23. 2
      web/service-worker.js
  24. 2
      web/static/css/main.51ae4dfb.css
  25. 1
      web/static/css/main.51ae4dfb.css.map
  26. 2
      web/static/js/main.6919f021.js
  27. 1
      web/static/js/main.6919f021.js.map

3
package-lock.json

@ -0,0 +1,3 @@
{
"lockfileVersion": 1
}

20
sources/.codesandbox/workspace.json

@ -0,0 +1,20 @@
{
"responsive-preview": {
"Mobile": [
320,
675
],
"Tablet": [
1024,
765
],
"Desktop": [
1400,
800
],
"Desktop HD": [
1920,
1080
]
}
}

38
sources/src/Componets/Acardion.js

@ -0,0 +1,38 @@
import React from "react";
export default class Accordion extends React.Component {
style = {
uptitle: {
ontSize: "1.6em",
padding: "5px",
cursor: "pointer"
}
};
ViewGroup(id) {
if (document.getElementById(id + "_group").style.display === "none") {
document.getElementById(id + "_group").style.display = " block";
} else {
document.getElementById(id + "_group").style.display = "none";
}
}
render() {
return (
<div>
<div
id={this.props.title}
class="Accrordion"
onClick={() => this.ViewGroup(this.props.title)}
>
<h3>{this.props.title}</h3>
</div>
<div
id={this.props.title + "_group"}
style={{ display: "none", cursor: "pointer" }}
>
<div>{this.props.children}</div>
</div>
</div>
);
}
}

19
sources/src/Componets/AppContainer.js

@ -1,11 +1,13 @@
import React from "react";
import NavBar from "./NavList/navList";
import AuthForm from "../pages/auth/auth";
import MainPage from "../pages/main";
import FullCard from "../Componets/Cards/fullCard";
//import OverlaPage from "../pages/overlays";
import "./style.css";
import ReactDOM from "react-dom";
import { useState } from "react";
export default class AppConteiner extends React.Component {
ui = {
BackButton: {
@ -19,7 +21,8 @@ export default class AppConteiner extends React.Component {
}
}
};
title = () => this.viewSideBar();
Ptitle = () => this.viewSideBar();
findPakg(pkg) {
this.viewPakegeInfo(pkg);
}
@ -57,7 +60,7 @@ export default class AppConteiner extends React.Component {
//document.getElementById("conteinerInfo").style.display = "none";
document.getElementById("container").style.display = "block";
document.getElementById("pTitle").textContent = this.ViewTitle();
//document.getElementById("pTitle").textContent = "Рекомендации";
document.getElementById("pTitle").textContent = "Рекомендации";
ReactDOM.render(
<MainPage
icons={this.props.icons}
@ -74,6 +77,7 @@ export default class AppConteiner extends React.Component {
viewSideBar() {
if (!this.VVSB) {
document.getElementById("MainContent").style.paddingLeft = "300px";
//document.getElementById("MainContent").style.width =- "300px";
document.getElementById("btn-toggle").style.paddingLeft = "270px";
document.getElementById("btn-toggle").style.float = "right";
document.getElementById("navBar").style.left = "0px";
@ -88,13 +92,13 @@ export default class AppConteiner extends React.Component {
ViewTitle() {
for (let i = 0; i > this.props.menuItems.length; i++) {
if (
//this.props.menuItems[i].url ==
window.location.href.split(window.location.host)[1] ===
this.props.menuItems[i].url
this.props.menuItems[i].url ===
window.location.href.split(window.location.host)[1]
//this.props.menuItems[i].url
//window.location.href.split(window.location.host)[1]
) {
//document.getElementById("pTitle").textContent = this.props.menuItems[i].text;
this.title = this.props.menuItems[i].text;
this.Ptitle = this.props.menuItems[i].text;
}
console.log(this.title);
return (this.title = this.props.menuItems[i].text);
@ -105,6 +109,7 @@ export default class AppConteiner extends React.Component {
this.ViewTitle();
return (
<div>
<AuthForm />
<NavBar
ServerAdress={this.props.ServerAdress}
category={this.props.category}
@ -172,7 +177,7 @@ export default class AppConteiner extends React.Component {
color: "#FFF"
}}
>
{this.title}
{this.PackageName}
</div>
</b>
{

67
sources/src/Componets/Cards/fullCard.js

@ -1,5 +1,6 @@
import React from "react";
import ReactDOM from "react-dom";
import ModalForm from "../Modal";
import "./style.css";
class FullCard extends React.Component {
ui = {
@ -20,6 +21,15 @@ class FullCard extends React.Component {
USE: []
};
vInstall() {
//document.getElementById("conteinerInfo").display = "block";
ReactDOM.render(
<ModalForm title={this.props.PackageName.Name}></ModalForm>,
document.getElementById("mainpage")
);
}
addUse(use) {
if (
document.getElementById(use).style.background === "#0F0" ||
@ -100,22 +110,57 @@ class FullCard extends React.Component {
);
}
}
chech_targent(t) {
let lt = "";
if (t.split("+").length > 1) {
lt = t.split("+")[1];
} else {
lt = t;
}
if (lt.split("single_target_").length > 1) {
return (
String(t.split("single_target_")[0]).toUpperCase() +
"=\t" +
String(t.split("single_target_")[1])
);
} else if (lt.split("cpu_flags").length > 1) {
return "CPU_FLAGS=\t" + String(t.split("cpu_flags_")[1]);
} else {
return t;
}
}
VuseInfo(use) {
//console.log(use);
//console.log(this.props.useDes);
//console.log(Object.keys(this.props.uses));
//document.getElementById(uId).style.background = "orange";
if (use in this.props.useDes || use.split("+")[1] in this.props.useDes) {
if (use in this.props.useDes) {
document.getElementById("useInfo").textContent = this.props.useDes[use];
if (use.split("+").length > 1) {
use = use.split("+")[1];
}
if (
use in this.props.useDes.LocalUSE ||
use in this.props.useDes.GlobalUSE
//use.split("+")[1] in this.props.useDes.LocalUSE ||
//use.split("+")[1] in this.props.useDes.GlobalUSE
) {
if (use in this.props.useDes.LocalUSE) {
document.getElementById(
"useInfo"
).textContent = this.props.useDes.LocalUSE[use];
console.log(use);
} else {
} else if (use in this.props.useDes.GlobalUSE) {
document.getElementById(
"useInfo"
).textContent = this.props.useDes.GlobalUSE[use];
console.log(use);
} /*/else {
document.getElementById("useInfo").textContent = this.props.useDes[
use.split("+")[1]
];
console.log(this.props.useDes[use.split("+")[1]]);
}
}*/
//document.getElementById(uId).style.background = "orange";
//alert(this.props.useDes[use]);
} else {
@ -123,7 +168,12 @@ class FullCard extends React.Component {
}
//document.getElementById("useInfo").textContent = use;
}
clear_VuseInfo() {
document.getElementById("useInfo").textContent = "";
}
render() {
document.getElementById("HomePage").style.display = "block";
return (
<div className="fullCard">
<div className=" sCard">
@ -172,9 +222,10 @@ class FullCard extends React.Component {
onMouseOver={() =>
this.VuseInfo(this.props.PackageName.USE[j])
}
onMouseOut={() => this.clear_VuseInfo()}
onClick={() => this.addUse(this.props.PackageName.USE[j])}
>
{u}
{this.chech_targent(u)}
</span>
))}
<div>
@ -201,6 +252,7 @@ class FullCard extends React.Component {
className="btn right"
id={this.props.PackageName.Name}
style={{ cursor: "pointer" }}
onClick={() => this.vInstall()}
>
{this.ui.InstallButton.text}
</span>
@ -212,4 +264,5 @@ class FullCard extends React.Component {
);
}
}
export default FullCard;

2
sources/src/Componets/Cards/style.css

@ -27,7 +27,7 @@
cursor: pointer;
}
.cVer {
display: inline-flex;
display: flow-root;
}
.cVer li {
list-style: none;

8
sources/src/Componets/CheckField.js

@ -2,19 +2,21 @@ import React from "react";
export default class CheckField extends React.Component {
check = this.props.checking;
chengeStatus() {
chengeStatus(id) {
//this.check = !this.props.checking;
document.getElementById(id).checked = !this.check;
return !this.check;
}
render() {
return (
<p>
<p onClick={() => this.chengeStatus(this.props.id)}>
<span> {this.props.text}</span>
<input
id={this.props.id}
style={{ float: "right" }}
type="checkbox"
checked={this.check}
onClick={() => this.chengeStatus()}
//onClick={() => this.chengeStatus(this.props.id)}
/>
</p>
);

29
sources/src/Componets/Modal.js

@ -0,0 +1,29 @@
import React from "react";
export default class ModalForm extends React.Component {
styles = {
modal: {
//padding: "50px",
background: "#FFF",
position: "fixed",
top: "50%",
left: "50%",
WebkitTransform: "translate(-50%, -50%)",
MsTransform: "translate(-50%, -50%)",
transform: "translate(-50%, -50%)"
}
};
render() {
return (
<div style={this.styles.modal}>
<div style={{ display: "inline", background: "#CDC" }}>
/{this.props.title}{" "}
<div className="btn-group">
<div style={{ background: "#F00", color: "#FFF" }}>X</div>
</div>{" "}
</div>
<div>{this.props.children}</div>
</div>
);
}
}

6
sources/src/Componets/style.css

@ -37,7 +37,7 @@
/* height: 42px;*/
}
.d6 input {
height: 42px;
height: 27px;
width: 0;
padding: 0 42px 0 0px;
border: none;
@ -55,7 +55,7 @@
background: transparent;
width: 300px;
z-index: 1;
/*border-bottom: 2px solid #f9f0da;*/
border-bottom: 2px solid #f9f0da;
}
.d6 .button {
/* background: #683b4d;*/
@ -65,6 +65,8 @@
position: absolute;
top: 0px;
right: 0;
}
.d6 .button * {
cursor: pointer;
}
.d6 .button:before {

19
sources/src/example.js

@ -7,7 +7,6 @@ import {
} 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";
@ -36,6 +35,7 @@ function print(text) {
}
//const communiy = {};
// dataApp
const pkgs = all_pkgs.Catalog;
const overlays = all_pkgs.overlays;
const recovers = all_pkgs.recovers;
@ -45,7 +45,7 @@ const useDes = all_pkgs.usesDecription;
export default class BasicExample extends React.Component {
//const [null, setPackage] = useState('');
AdressServer = "http://127.0.0.1:8000";
AdressServer = "https://127.0.0.1:8000";
menuItems = [
{
name: "home",
@ -79,6 +79,16 @@ export default class BasicExample extends React.Component {
];
icons_demo = icons.icons;
PkgName = {};
loadData(){
fetch(this.AdressServer + "/")
}
checkInstall() {
for (let n = 0; n < Object.keys(all_pkgs.InstallPkgs).length; n++) {
if (all_pkgs.all_pkgs) {
}
}
}
ViewListPkgs(listpkgs) {
listpkgs.map((p, i) => console.log(p + "\n"));
@ -99,7 +109,7 @@ export default class BasicExample extends React.Component {
menuItems={this.menuItems}
icons={this.icons_demo}
rec={recovers}
useDes={useDes.GlobalUSE}
useDes={useDes}
Ipkg={all_pkgs.InstallPkgs}
>
<Switch>
@ -107,11 +117,10 @@ export default class BasicExample extends React.Component {
<Route exact path={route.url} component={route.Component} />
//))*/}
<Route exact path="/">
{}
<MainPage
icons={this.icons_demo}
rec={recovers}
useDes={useDes.GlobalUSE}
useDes={useDes} //LocalUSE
Ipkg={all_pkgs.InstallPkgs}
repositores={overlays}
/>

218
sources/src/navList.js

@ -0,0 +1,218 @@
import React, { Component } from "react";
import ReactDOM from "react-dom";
import axios from "axios";
import {
ProSidebar,
Menu,
MenuItem,
SubMenu,
SidebarHeader,
//SidebarFooter,
SidebarContent
} from "react-pro-sidebar";
//import "react-pro-sidebar/dist/css/styles.css";
import MenuPage from "../menu";
import "../../pages/style.css";
import FullCard from "../Cards/fullCard";
import UserProfilePage from "../../pages/profile";
//var view = false;
class NavBar extends Component {
ui = {
menu: {
text: "Меню"
},
catalog: {
text: "Каталог"
}
};
checkAlias(text) {
//console.log( "aliases:\t" + this.props.aliases)
//return text;
if (text in this.props.aliases) {
return this.props.aliases[text];
//console.log(this.props.aliases[text]);
} else {
return text;
//console.log(e);
}
}
viewPakegeInfo(pkgName) {
const url = this.props.ServerAdress + "/find?pkg=" + pkgName;
console.log(url);
const response = fetch(url);
/*try {
portage_list[pkgName];
} catch (e) {*/
if (response.ok) {
// если HTTP-статус в диапазоне 200-299
// получаем тело ответа (см. про этот метод ниже)
let res = response.json();
ReactDOM.render(
<FullCard
PackageName={res}
PropMain={this.props.rec}
icons={this.props.icons}
/>,
document.getElementById("HomePage")
);
document.getElementById("inS").value = "";
} else {
alert("Ошибка HTTP: " + response.status);
//}
}
console.log(pkgName);
}
findPakg(pkg) {
this.viewPakegeInfo(pkg);
}
render() {
return (
<ProSidebar
id="navBar"
style={{
background: "2e323f",
position: "fixed",
height: "100vh",
left: "-280px"
}}
>
<SidebarHeader>
<div
style={{
padding: "24px",
textTransform: "uppercase",
fontWeight: "bold",
fontSize: "14px",
letterSpacing: "1px",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
paddingLeft: "12px"
}}
>
Webport
</div>
<MenuItem>
<div
className="user-pic"
style={{
width: "60px",
marginRight: "3px",
float: "left",
paddingLeft: "12px"
}}
>
<img
style={{ width: "56px", height: "56px" }}
className="img-responsive img-rounded"
src="https://raw.githubusercontent.com/azouaoui-med/pro-sidebar-template/gh-pages/src/img/user.jpg"
alt="User picture"
onClick={() => (
(document.getElementById("backBtn").style.display = "block"),
//(document.getElementById("container").style.display = "none"),
//(document.getElementById("conteinerInfo").style.display =
// "block"),
ReactDOM.render(
<UserProfilePage
Ipkgs={this.props.Ipkgs}
catalog={this.props.category}
/>,
document.getElementById("HomePage")
)
)}
/>
</div>
<div
className="user-info"
style={{ float: "left", width: " 100%" }}
>
<span className="user-name">
Jhon
<strong>Smith</strong>
</span>
<span
className="user-role"
style={{ width: "100vw", color: "green" }}
>
Guest
</span>
{/* <span className="user-status">
<i className="fa fa-circle"></i>
<span>Online</span>
</span>*/}
</div>
</MenuItem>
<MenuItem style={{}}>
{/* <input
id="inS"
name="inS"
classname="form-control"
type="text"
placeholder="Введите имя пакета"
onChange={(e) => this.findPakg(e.target.value)}
style={{
fontSize: "1.2em",
margin: "10px",
backgroundColor: "rgba(81, 81, 81, 0.5)",
border: "none",
padding: "5px",
//ackground: "#2e233f",
//borderRadius: "15px",
//border: "3px inset #2e322f",
color: "#c7c7c7"
}}
/>*/}
</MenuItem>
</SidebarHeader>
<SidebarContent style={{ overflowX: "clip" }}>
<Menu>
<MenuPage
menuItem={this.props.menuItem}
title={this.ui.menu.text}
/>
<MenuItem
title={this.ui.catalog.text}
style={{ paddingRight: "0px" }}
>
{/*CATALOG */}
<SubMenu title={this.ui.catalog.text}>
{Object.keys(this.props.category).map((k, i) => (
<MenuItem
style={{
paddingRight: "0px",
width: "100vw"
}}
>
<SubMenu title={this.checkAlias(k)}>
{this.props.category[k].map((pn, j) => (
<MenuItem
onClick={() =>
this.viewPakegeInfo(
this.props.category[k][i] +
"/" +
this.props.category[k][j]
)
}
style={{
//borderBottom: "1px solid red ",
width: "100%"
}}
>
{pn}
</MenuItem>
))}
</SubMenu>
</MenuItem>
))}
</SubMenu>
</MenuItem>
</Menu>
</SidebarContent>
</ProSidebar>
);
}
}
export default NavBar;

6
sources/src/package.json

@ -3,10 +3,6 @@
"dependencies": {
"@emotion/react": "11.4.1",
"@emotion/styled": "11.3.0",
"@material-ui/core": "4.12.1",
"@mui/icons-material": "5.0.1",
"@mui/material": "5.0.2",
"material-ui": "0.20.2",
"react": "18.0.0-alpha-01be61c12",
"react-dom": "17.0.2",
"react-id-swiper": "4.0.0",
@ -14,4 +10,4 @@
"react-pro-sidebar": "0.6.0",
"react-router-dom": "5.2.0"
}
}
}

41
sources/src/pages/auth/auth.js

@ -1,21 +1,36 @@
import React from "react";
import "./style.css";
class AuthForm extends React.Component {
render() {
return (
<div>
<div className="formAuth'">
<div id="spAuth" className="spAuth ">
<div className="formAuth modal">
<h2>Авторизация</h2>
<p>
{" "}
Username: <input type="text" />
</p>
<p>
{" "}
Password:
<input type="password" />
</p>
<div className="authBtn">Войти</div>
<div>
<p>
{" "}
Username: <input type="text" placeholder="demo" />
</p>
<p>
{" "}
Password:
<input type="password" placeholder="demo" />
</p>
`
<p>
{" "}
Server:
<input type="password" placeholder={window.location.href} />
</p>
<div
className="authBtn"
onClick={() =>
(document.getElementById("spAuth").style.display = "none")
}
>
Войти
</div>
</div>
</div>
</div>
);

33
sources/src/pages/auth/style.css

@ -1,20 +1,47 @@
.modal {
padding: 50px;
background: #ccc;
position: fixed;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.spAuth {
position: fixed;
width: 100vw;
height: 100vh;
overflow: hidden;
background: #2e323f;
/*background: url("https://on-desktop.com/ru/images/wp.php?path=/wps/20213D-graphics_Beautiful_purple_fractal_pattern_with_golden_lines_151099_.jpg&wp=2");
&*/
z-index: 9999;
font-size: 1.2em;
}
.formAuth {
/*position: fixed;
background: rgba(255, 255, 255, 0.85);*/
top: 40%;
left: 40%;
padding: 20px;
margin: -100px 0 0 -200px; /* отступы равны половинным размера формы */
/* чтобы форма была поверх всех элементов страницы */
/*position: fixed;*/
box-shadow: 3px 4px 10px #ccc;
box-shadow: 3px 4px 10px #cdc;
margin: 0 auto;
}
.formAuth input {
border-radius: 10px;
float: right;
border-radius: 5px;
font-size: 0.9em;
}
.authBtn {
float: right;
padding: 10px;
background: #0f0;
background: #00f;
color: #fff;
border-radius: 10px;
}

117
sources/src/pages/main.js

@ -52,72 +52,85 @@ export default class MainPage extends React.Component {
console.log(e);
}
}
c = "column__list";
render() {
this.TitleView();
return (
<div id="HomePage" className="wrapper">
{}
<div id="HomePage" className={this.c}>
{Object.keys(this.props.rec).map((k) => (
<div>
<div>
<h2 className="column__title--wrapper" style={{}}>
<b stye={{}}>{k.split("[")[1]}</b>
</h2>
</div>
<div
className="column__list"
style={{
//paddingRight: "0px",
width: "100%",
marginTop: "20px",
overflow: "clip",
float: "left"
}}
>
<div
className="column__list"
className="colomn__list"
style={{
//paddingRight: "0px",
//width: "100%",
marginTop: "20px",
overflow: "clip"
//border: "1px solid #00F",
//padding: "10px",
borderRadius: "10px",
boxShadow: "3px 4px 10px #CCC"
}}
>
{this.props.rec[k].map((pn, i) => (
<div>
<div
className="card__list"
style={{
textAlign: "center",
fontSize: "1.6em",
padding: "5px",
//margin: "3px",
marginTop: "10px",
//width: "100vw",
display: "inline-flex",
border: "1px solid #CCC",
borderRadius: " 10px",
boxShadow: "3px 4px 10px #CDC"
//height:"75px"
borderBottom: "1px solid #CCC"
}}
onClick={() => this.viweinfo(this.props.rec[k][i])}
>
<img
className="card__img"
style={{
width: "64px",
height: "64px"
}}
src={this.props.icons[pn.Name.split("/")[1]]}
/>
<div style={{ marginLeft: "10px" }}>
<b>
{" "}
<span
className="card__title"
style={{
color: "red",
width: "100vw",
overflow: "clip",
fontSize: "1.1em"
}}
key={pn.Name}
>
{pn.Name.split("/")[1]}
</span>
</b>
<div style={{ overflow: "hidden" }}>{pn.Description}</div>
</div>
<b stye={{ fontSize: "1.4em", margin: "20px" }}>
{k.split("[")[1]}
</b>
</div>
))}
</div>
<div style={{ overflowX: "scroll", maxHeight: "375px" }}>
{this.props.rec[k].map((pn, i) => (
<div
className="card__item"
style={
{
//height:"75px"
}
}
onClick={() => this.viweinfo(this.props.rec[k][i])}
>
<img
className="card__img"
style={{
width: "64px",
height: "64px"
}}
src={this.props.icons[pn.Name.split("/")[1]]}
/>
<div style={{ marginLeft: "10px" }}>
<b>
{" "}
<span
className="card__title"
style={{
color: "red",
width: "100vw",
overflow: "clip",
fontSize: "1.1em"
}}
key={pn.Name}
>
{pn.Name.split("/")[1]}
</span>
</b>
<div style={{ overflow: "hidden" }}>{pn.Description}</div>
</div>
</div>
))}
</div>
</div>
</div>
))}

28
sources/src/pages/overlays.js

@ -12,22 +12,25 @@ class PageOverlays extends React.Component {
background: "orange",
color: "#FFF",
textDecoration: "none",
marginLefT: "10px",
padding: "10px",
marginLeft: "0px",
padding: " 10px",
borderRight: "1px solid #FFF",
cursor: "pointer"
cursor: "pointer",
position: "ralative",
left: "-40px",
borderRadius: "10px 20px 0px 0px"
};
menuButton = [
{ text: "Все", handler: this.viewAllOverlay },
{ text: "Подключеные", handler: this.viewIncludeOverlays },
{ text: "Категории", handler: this.viweategotyOverlays }
{ text: "Все", handler: () => this.viewAllOverlay() },
{ text: "Подключеные", handler: () => this.viewIncludeOverlays() },
{ text: "Категории", handler: () => this.viweategotyOverlays() }
];
slideNum = 1;
//routing overalays page
viewAllOverlay() {
return (
<div className="column__list">
{this.props.repositores.map((over, i) => (
{this.props.repositores.all.map((over, i) => (
<OvItem over={over} title={title} />
))}
</div>
@ -35,9 +38,10 @@ class PageOverlays extends React.Component {
}
viewIncludeOverlays() {
console.log(this.props.repositores.include);
return (
<div className="column__list">
{this.props.repositores.map((over, i) => (
{this.props.repositores.include.map((over, i) => (
<OvItem over={over} title={title} />
))}
</div>
@ -69,12 +73,12 @@ class PageOverlays extends React.Component {
// color: "#000"
}}
>
{this.menuButton.map((it) => (
{this.menuButton.map((it, p) => (
<div
style={this.menuBtn}
handler={() =>
onClick={() =>
ReactDOM.render(
it.handler(),
this.menuButton[p].handler(),
document.getElementById("listOve")
)
}
@ -83,7 +87,7 @@ class PageOverlays extends React.Component {
</div>
))}
</div>
<div id="listOve">{this.viewAllOverlay()}</div>
<div id="listOve">{this.menuButton[0].handler()}</div>
</div>
);
}

12
sources/src/pages/profile.js

@ -1,4 +1,5 @@
import React from "react";
//import Accordion from "../Componets/Acardion";
export default class UserProfilePage extends React.Component {
ViewGroup(group) {
if (document.getElementById(group + "_group").style.display === "none") {
@ -26,6 +27,7 @@ export default class UserProfilePage extends React.Component {
}
}
render() {
document.getElementById("HomePage").style.display = "block";
return (
<div>
{this.TitleView()}
@ -35,14 +37,14 @@ export default class UserProfilePage extends React.Component {
<li
style={{
textAlign: "left",
border: "1px dotted #AAA",
borderBottom: "1px dotted #AAA",
listStyle: "none"
}}
>
<div
style={{
background: "#2e323f",
color: "#FFF",
background: "#FFF", //"#2e323f",
color: "#444",
fontSize: "1.6em",
padding: "5px",
cursor: "pointer"
@ -61,7 +63,9 @@ export default class UserProfilePage extends React.Component {
width: "80vw",
padding: "10px",
fontSize: "1.2em",
border: "1px solid #2e323f"
borderBottom: "1px solid #CDC"
//background:"#AAA"
// #2e323f"
}}
>
{pkg}

117
sources/src/pages/settings.js

@ -1,4 +1,5 @@
import React from "react";
import Accordion from "../Componets/Acardion";
import CheckField from "../Componets/CheckField";
//import Menu from "../Componets/menu";
@ -9,11 +10,7 @@ import CheckField from "../Componets/CheckField";
class PageSettings extends React.Component {
settings = {
USE: [],
langs: [
{ title: "RU", link: "" },
{ title: "EN", link: "" },
{ title: "DE", link: "" }
]
lang: "RU"
};
styleUseinfo = {
mobile: {
@ -27,6 +24,11 @@ class PageSettings extends React.Component {
},
nomob: { margin: "5px" }
};
langs = [
{ title: "RU", link: "" },
{ title: "EN", link: "" },
{ title: "DE", link: "" }
];
isMobile() {
try {
@ -39,15 +41,21 @@ class PageSettings extends React.Component {
changLang(lang) {
console.log(lang);
if (
document.getElementById(lang).style.background === "#0F0" ||
document.getElementById(lang).style.background === "rgb(0, 255, 0)"
document.getElementById(lang).style.background !== "#0F0" ||
document.getElementById(lang).style.background !== "rgb(0, 255, 0)"
) {
document.getElementById(lang).style.background = "#FFF";
document.getElementById(lang).style.background = "#0F0";
document.getElementById(this.settings.lang).style.background = "#FFF";
this.settings.lang = lang;
//document.getElementById(lang).style.background = "#FFF";
//this.IntstallPackageParamms.USE.map((us, i)=>(
// if( us== use)this.IntstallPackageParamms.USE[i].delete
//))
} else {
document.getElementById(lang).style.background = "#0F0";
this.settings.lang = lang;
//this.settings.USE[this.IntstallPackageParamms.USE.length + 1] = use;
}
console.log(this.settings);
@ -105,56 +113,65 @@ class PageSettings extends React.Component {
<ul className="btn-group">{}</ul>
</div>
<div>
<span>Язык</span>
<ul
style={{ display: "inline-flex", listStyle: "none" }}
className="btn-group"
>
{Object.keys(this.settings.langs).map((lng) => (
<li style={{ marginLeft: "10px" }}>
{this.settings.langs[lng].title}
</li>
))}
</ul>
<Accordion title={"Язык"}>
<ul
style={{ display: "inline-flex", listStyle: "none" }}
className="btn-group"
>
{Object.keys(this.langs).map((lng) => (
<li
id={this.langs[lng].title}
style={{ marginLeft: "10px" }}
onClick={() => this.changLang(this.langs[lng].title)}
>
{this.langs[lng].title}
</li>
))}
</ul>
</Accordion>
</div>
</div>
<div>
<h3>Сервер</h3>
<hr />
<Accordion title={"Сервер"}>
<p>
Адресс сервера <input type="text" placeholder="loaclhost:8000" />{" "}
</p>
</div>
<div>
<h3>Portage</h3>
<hr />
<CheckField text={"Искать в оврелях"} checking={true} />
<CheckField text={"Устанавливать бинарные пакеты"} checking={true} />
</Accordion>
<Accordion title={"Portage"}>
<CheckField
text={"Искать в оврелях"}
checking={true}
id={"searchOverlays"}
/>
<CheckField
text={"Устанавливать бинарные пакеты"}
checking={true}
id={"statrBinInstlPKg"}
/>
<div className="sUse">
<b>USE:</b>
{Object.keys(this.props.uses).map((u, j) => (
<span
key={u}
id={u}
onMouseOver={() => this.VuseInfo(u, this.props.uses[u])}
onClick={() => this.addUse(u)}
>
{u}
</span>
))}
<b>
<div
id="useInfo"
className="useInfo"
style={
this.isMobile ? this.styleUseinfo.mobile : this.style.nomob
}
></div>
</b>
<Accordion title={"USE"} className="sUses">
{Object.keys(this.props.uses).map((u, j) => (
<span
key={u}
id={u}
onMouseOver={() => this.VuseInfo(u, this.props.uses[u])}
onClick={() => this.addUse(u)}
>
{u}
</span>
))}
<b>
<div
id="useInfo"
className="useInfo"
style={
this.isMobile ? this.styleUseinfo.mobile : this.style.nomob
}
></div>
</b>
</Accordion>
</div>
</div>
</Accordion>
</div>
);
}

6
sources/src/pages/splash/spalsh.js

@ -10,8 +10,10 @@ const styles = {
}
}
};
function loadData() {
console.log("load");
}
function Splash() {
return <div style={styles.splash}></div>;
return <div style={styles.splash}> Загрузка</div>;
}
export default Splash;

20
sources/src/pages/style.css

@ -500,6 +500,14 @@ body {
border-radius: 0.2rem;
background-color: #dfe3e6;
padding: 0.5rem;
/*padding: 5px;
/*margin: 3px;*
margin-top: 10px;
/*width: 100vw;*/
/*display: inline-flex;
border: 1px solid #ccc;
border-radius: 10px;
box-shadow: 3px 4px 10px #cdc;*/
}
.column__title--wrapper {
@ -540,10 +548,20 @@ body {
}
.card__item {
background-color: white;
/*background-color: white;
border-radius: 0.25rem;
box-shadow: 0 1px 0 rgba(9, 45, 66, 0.25);
padding: 0.5rem;
*/
padding: 5px;
/*margin: 3px;*/
/*margin-top: 10px;
width: 100vw;*/
display: flex;
/*display: inline-flex;*/
border: 1px solid #ccc;
/*border-radius: 10px;
box-shadow: 3px 4px 10px #cdc;*/
}
.card__tag {

2
sources/src/pkg.json
File diff suppressed because it is too large
View File

8
web/asset-manifest.json

@ -1,6 +1,6 @@
{
"main.css": "static/css/main.7da3c623.css",
"main.css.map": "static/css/main.7da3c623.css.map",
"main.js": "static/js/main.8250b8bd.js",
"main.js.map": "static/js/main.8250b8bd.js.map"
"main.css": "static/css/main.51ae4dfb.css",
"main.css.map": "static/css/main.51ae4dfb.css.map",
"main.js": "static/js/main.6919f021.js",
"main.js.map": "static/js/main.6919f021.js.map"
}

2
web/service-worker.js

@ -1 +1 @@
"use strict";function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}var precacheConfig=[["/index.html","958c9528534c690b4fa8005b789ea390"],["/static/css/main.7da3c623.css","41ec98d9bb3b128f5bf64823fc424839"],["/static/js/main.8250b8bd.js","e7b13c7c1b2fa4e5b888128d074f6d05"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(e){return e.redirected?("body"in e?Promise.resolve(e.body):e.blob()).then(function(t){return new Response(t,{headers:e.headers,status:e.status,statusText:e.statusText})}):Promise.resolve(e)},createCacheKey=function(e,t,n,r){var a=new URL(e);return r&&a.pathname.match(r)||(a.search+=(a.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),a.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,t){var n=new URL(e);return n.hash="",n.search=n.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(e){return t.every(function(t){return!t.test(e[0])})}).map(function(e){return e.join("=")}).join("&"),n.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],r=new URL(t,self.location),a=createCacheKey(r,hashParamName,n,/\.\w{8}\./);return[r.toString(),a]}));self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(e){return setOfCachedUrls(e).then(function(t){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(n){if(!t.has(n)){var r=new Request(n,{credentials:"same-origin"});return fetch(r).then(function(t){if(!t.ok)throw new Error("Request for "+n+" returned a response with status "+t.status);return cleanResponse(t).then(function(t){return e.put(n,t)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var t=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(e){return e.keys().then(function(n){return Promise.all(n.map(function(n){if(!t.has(n.url))return e.delete(n)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(e){if("GET"===e.request.method){var t,n=stripIgnoredUrlParameters(e.request.url,ignoreUrlParametersMatching);t=urlsToCacheKeys.has(n);t||(n=addDirectoryIndex(n,"index.html"),t=urlsToCacheKeys.has(n));!t&&"navigate"===e.request.mode&&isPathWhitelisted([],e.request.url)&&(n=new URL("/index.html",self.location).toString(),t=urlsToCacheKeys.has(n)),t&&e.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(t){return console.warn('Couldn\'t serve response for "%s" from cache: %O',e.request.url,t),fetch(e.request)}))}});
"use strict";function setOfCachedUrls(e){return e.keys().then(function(e){return e.map(function(e){return e.url})}).then(function(e){return new Set(e)})}var precacheConfig=[["/index.html","30a1057338832d0cc27c22ffde98bb4a"],["/static/css/main.51ae4dfb.css","86c0a2bcc996205e28fe2d2954681c84"],["/static/js/main.6919f021.js","193e4bd7375b62fe17a5d8ce57d8de4f"]],cacheName="sw-precache-v3-sw-precache-webpack-plugin-"+(self.registration?self.registration.scope:""),ignoreUrlParametersMatching=[/^utm_/],addDirectoryIndex=function(e,t){var n=new URL(e);return"/"===n.pathname.slice(-1)&&(n.pathname+=t),n.toString()},cleanResponse=function(e){return e.redirected?("body"in e?Promise.resolve(e.body):e.blob()).then(function(t){return new Response(t,{headers:e.headers,status:e.status,statusText:e.statusText})}):Promise.resolve(e)},createCacheKey=function(e,t,n,r){var a=new URL(e);return r&&a.pathname.match(r)||(a.search+=(a.search?"&":"")+encodeURIComponent(t)+"="+encodeURIComponent(n)),a.toString()},isPathWhitelisted=function(e,t){if(0===e.length)return!0;var n=new URL(t).pathname;return e.some(function(e){return n.match(e)})},stripIgnoredUrlParameters=function(e,t){var n=new URL(e);return n.hash="",n.search=n.search.slice(1).split("&").map(function(e){return e.split("=")}).filter(function(e){return t.every(function(t){return!t.test(e[0])})}).map(function(e){return e.join("=")}).join("&"),n.toString()},hashParamName="_sw-precache",urlsToCacheKeys=new Map(precacheConfig.map(function(e){var t=e[0],n=e[1],r=new URL(t,self.location),a=createCacheKey(r,hashParamName,n,/\.\w{8}\./);return[r.toString(),a]}));self.addEventListener("install",function(e){e.waitUntil(caches.open(cacheName).then(function(e){return setOfCachedUrls(e).then(function(t){return Promise.all(Array.from(urlsToCacheKeys.values()).map(function(n){if(!t.has(n)){var r=new Request(n,{credentials:"same-origin"});return fetch(r).then(function(t){if(!t.ok)throw new Error("Request for "+n+" returned a response with status "+t.status);return cleanResponse(t).then(function(t){return e.put(n,t)})})}}))})}).then(function(){return self.skipWaiting()}))}),self.addEventListener("activate",function(e){var t=new Set(urlsToCacheKeys.values());e.waitUntil(caches.open(cacheName).then(function(e){return e.keys().then(function(n){return Promise.all(n.map(function(n){if(!t.has(n.url))return e.delete(n)}))})}).then(function(){return self.clients.claim()}))}),self.addEventListener("fetch",function(e){if("GET"===e.request.method){var t,n=stripIgnoredUrlParameters(e.request.url,ignoreUrlParametersMatching);t=urlsToCacheKeys.has(n);t||(n=addDirectoryIndex(n,"index.html"),t=urlsToCacheKeys.has(n));!t&&"navigate"===e.request.mode&&isPathWhitelisted([],e.request.url)&&(n=new URL("/index.html",self.location).toString(),t=urlsToCacheKeys.has(n)),t&&e.respondWith(caches.open(cacheName).then(function(e){return e.match(urlsToCacheKeys.get(n)).then(function(e){if(e)return e;throw Error("The cached response that was expected is missing.")})}).catch(function(t){return console.warn('Couldn\'t serve response for "%s" from cache: %O',e.request.url,t),fetch(e.request)}))}});

2
web/static/css/main.51ae4dfb.css
File diff suppressed because it is too large
View File

1
web/static/css/main.51ae4dfb.css.map
File diff suppressed because it is too large
View File

2
web/static/js/main.6919f021.js
File diff suppressed because it is too large
View File

1
web/static/js/main.6919f021.js.map
File diff suppressed because it is too large
View File

Loading…
Cancel
Save