parent
5892e6d367
commit
79117723ed
@ -0,0 +1,3 @@
|
||||
{
|
||||
"lockfileVersion": 1
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
{
|
||||
"responsive-preview": {
|
||||
"Mobile": [
|
||||
320,
|
||||
675
|
||||
],
|
||||
"Tablet": [
|
||||
1024,
|
||||
765
|
||||
],
|
||||
"Desktop": [
|
||||
1400,
|
||||
800
|
||||
],
|
||||
"Desktop HD": [
|
||||
1920,
|
||||
1080
|
||||
]
|
||||
}
|
||||
}
|
@ -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>
|
||||
);
|
||||
}
|
||||
}
|
@ -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>
|
||||
);
|
||||
}
|
||||
}
|
@ -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;
|
@ -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;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -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"
|
||||
}
|
@ -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)}))}});
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue