mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
0.2.23-A1
This commit is contained in:
parent
e686a979b8
commit
46e443989d
11
comty_dist.service
Normal file
11
comty_dist.service
Normal file
@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Comty_Development
|
||||
|
||||
[Service]
|
||||
ExecStart=serve ./dist
|
||||
Restart=always
|
||||
User=root
|
||||
WorkingDirectory=/ycore/development/comty-development
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
59
dist-server.sh
Normal file
59
dist-server.sh
Normal file
@ -0,0 +1,59 @@
|
||||
#!/bin/sh
|
||||
|
||||
pause(){
|
||||
read -p "Press [Enter] key to continue..." fackEnterKey
|
||||
}
|
||||
|
||||
start_cli_dev(){
|
||||
sudo serve ./dist
|
||||
}
|
||||
|
||||
start_dev(){
|
||||
sudo systemctl start comty_dist
|
||||
echo "Starting dev server..."
|
||||
}
|
||||
|
||||
stop_dev(){
|
||||
sudo systemctl stop comty_dist
|
||||
echo "Stoping dev server..."
|
||||
}
|
||||
show_logs(){
|
||||
sudo journalctl -u comty_dist
|
||||
pause
|
||||
}
|
||||
|
||||
|
||||
show_menus() {
|
||||
clear
|
||||
echo "~~~~~~~~~~~~~~~~~~~~~"
|
||||
echo " BuildServe Server "
|
||||
echo "~~~~~~~~~~~~~~~~~~~~~"
|
||||
echo "1. Start CLI Server"
|
||||
echo "2. Start Server"
|
||||
echo "3. Stop Server"
|
||||
echo "4. Show DevServer Logs"
|
||||
echo ""
|
||||
echo "0. Exit"
|
||||
}
|
||||
|
||||
read_options(){
|
||||
local choice
|
||||
read -p "Enter choice [ 1 - 4 ] " choice
|
||||
case $choice in
|
||||
0) exit 0;;
|
||||
1) start_cli_dev ;;
|
||||
2) start_dev ;;
|
||||
3) stop_dev ;;
|
||||
4) show_logs;;
|
||||
*) echo -e "${RED}Error...${STD}" && sleep 2
|
||||
esac
|
||||
}
|
||||
|
||||
trap '' SIGINT SIGQUIT SIGTSTP
|
||||
|
||||
while true
|
||||
do
|
||||
|
||||
show_menus
|
||||
read_options
|
||||
done
|
@ -3,7 +3,7 @@
|
||||
"UUID": "C8mVSr-4nmPp2-pr5Vrz-CU4kg4",
|
||||
"title": "Comty™",
|
||||
"DevBuild": true,
|
||||
"version": "0.2.22",
|
||||
"version": "0.2.23",
|
||||
"description": "",
|
||||
"main": "app/main.js",
|
||||
"author": "RageStudio",
|
||||
@ -16,6 +16,8 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/compatible": "^1.0.1",
|
||||
"@ant-design/pro-layout": "^5.0.6",
|
||||
"@lingui/react": "^2.9.1",
|
||||
"@material-ui/core": "^4.9.3",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"antd": "^4.0.2",
|
||||
@ -33,6 +35,7 @@
|
||||
"md5": "^2.2.1",
|
||||
"moment": "^2.24.0",
|
||||
"node-sass": "^4.13.1",
|
||||
"nprogress": "^0.2.0",
|
||||
"os-utils": "0.0.14",
|
||||
"path-to-regexp": "^6.1.0",
|
||||
"prop-types": "^15.7.2",
|
||||
@ -81,7 +84,7 @@
|
||||
"stylelint": "^13.1.0",
|
||||
"stylelint-config-prettier": "^8.0.1",
|
||||
"stylelint-config-standard": "^20.0.0",
|
||||
"typescript": "^3.7.5",
|
||||
"typescript": "^3.8.3",
|
||||
"umi": "^2.13.3",
|
||||
"umi-plugin-react": "^1.15.2",
|
||||
"wait-on": "^4.0.0",
|
||||
|
@ -3,4 +3,4 @@ export * from './libs/comty_ng/pre.js';
|
||||
export * from './libs/yulio_id/pre.js';
|
||||
export * from './libs/ycore_styles/pre.js';
|
||||
export * from './libs/ycore_sdcp/pre.js';
|
||||
export * from './libs/comty_layout/pre.js'
|
||||
export * from './libs/app_functions/pre.js'
|
15
src/@ycore/libs/comty_layout/pre.js → src/@ycore/libs/app_functions/pre.js
Executable file → Normal file
15
src/@ycore/libs/comty_layout/pre.js → src/@ycore/libs/app_functions/pre.js
Executable file → Normal file
@ -1,6 +1,21 @@
|
||||
import {SetControls, CloseControls} from "../../../components/Layout/Control"
|
||||
import {SwapMode} from '../../../components/Layout/Secondary'
|
||||
|
||||
|
||||
export function QueryRuntime() {
|
||||
|
||||
}
|
||||
export const CheckThisApp = {
|
||||
desktop_mode: () => {
|
||||
const a = localStorage.getItem('desktop_src')
|
||||
if (a == 'true') {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
export const SecondarySwap = {
|
||||
ext: ()=> {
|
||||
SwapMode.ext()
|
@ -1,7 +1,6 @@
|
||||
import * as ycore from 'ycore'
|
||||
import localforage from 'localforage'
|
||||
|
||||
|
||||
export const asyncSDCP = {
|
||||
setSDCP: function (value) {
|
||||
return Promise.resolve().then(function () {
|
||||
@ -111,6 +110,7 @@ export const CryptSDCP = {
|
||||
|
||||
export function SetupApp(){
|
||||
// TODO: Default sets
|
||||
ycore.notify.success('Authorised, please reload the app for login!')
|
||||
const resourceLoad = localStorage.getItem('resource_bundle')
|
||||
if (!resourceLoad) {
|
||||
localStorage.setItem('resource_bundle', 'light_ng')
|
||||
|
@ -12,7 +12,7 @@ export function userData(){
|
||||
return ycore.handlerYIDT.get()
|
||||
}
|
||||
|
||||
function __API__User (payload, sdcp){
|
||||
function __API__User (payload, sdcp, callback){
|
||||
const { UserID, UserToken } = payload
|
||||
|
||||
const a = ycore.CryptSDCP.atob_parse(sdcp)
|
||||
@ -30,7 +30,7 @@ function __API__User (payload, sdcp){
|
||||
exp: ycore.AppSettings.SignForNotExpire? 0 : Math.floor(Date.now() / 1000) + (60 * 60),
|
||||
}
|
||||
ycore.handlerYIDT.set(frame, done => {
|
||||
done? ycore.crouter.native('main') : null
|
||||
done? callback(false, true) : callback(true, false)
|
||||
})
|
||||
}
|
||||
|
||||
@ -202,8 +202,15 @@ export function __AppSetup__(EncUsername, EncPassword, callback) {
|
||||
ycore.yconsole.log(FramePayload)
|
||||
callback(null, '200')
|
||||
|
||||
ycore.GetSDCPfromCloud(FramePayload, (res) => res? __API__User(FramePayload, res) : null )
|
||||
ycore.GetSDCPfromCloud(FramePayload, (res) => res? __API__User(FramePayload, res,
|
||||
(err, done) => {
|
||||
if (err){
|
||||
ycore.notify.error('Critical error, token declined!')
|
||||
return false
|
||||
}
|
||||
ycore.SetupApp()
|
||||
}) : null )
|
||||
|
||||
}
|
||||
if (identState == 400) {
|
||||
callback(null, '400')
|
||||
|
@ -143,6 +143,13 @@ export const crouter = {
|
||||
}
|
||||
|
||||
export const notify = {
|
||||
success: (...res) => {
|
||||
antd.notification.success({
|
||||
message: 'Well',
|
||||
description: (res.toString()),
|
||||
placement: 'bottomLeft'
|
||||
})
|
||||
},
|
||||
error: (...res) => {
|
||||
antd.notification.error({
|
||||
message: 'Wopss',
|
||||
|
@ -90,9 +90,12 @@ export default class Secondary extends React.PureComponent{
|
||||
<img onClick={() => ycore.crouter.native(`@${userData.username}`)} src={userData.avatar} />
|
||||
</div>
|
||||
|
||||
<div className={styles.container} >
|
||||
<div className={classnames(styles.container, {[styles.desktop_mode]: this.props.desktop_mode})} >
|
||||
<div className={styles.container_body}>
|
||||
{this.state.swap? <antd.Button type="ghost" icon={<Icons.LeftOutlined />} onClick={() => this.closeSwap()} > Back </antd.Button> : null}
|
||||
{this.renderMode()}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
@ -16,7 +16,11 @@
|
||||
width: 96vw;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
>.container{
|
||||
border-radius: 12px 12px 12px 12px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
transition: all @SwapAnimDuration ease-in-out;
|
||||
|
||||
@ -53,8 +57,9 @@
|
||||
position: relative;
|
||||
background-color: #201F23;
|
||||
color: @DarkMode-color_container !important;
|
||||
border-radius: 32px 0 0 32px;
|
||||
padding: 30px 375px 30px 75px;
|
||||
&.desktop_mode{
|
||||
border-radius: 0 12px 12px 0;
|
||||
}
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
:global{
|
||||
@ -73,6 +78,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.container_body{
|
||||
padding: 30px 375px 30px 75px;
|
||||
}
|
||||
|
||||
.container_2{
|
||||
z-index: 201;
|
||||
|
@ -13,8 +13,6 @@ import * as ycore from 'ycore';
|
||||
import router from 'umi/router';
|
||||
import {CustomIcons} from 'components'
|
||||
|
||||
|
||||
|
||||
@withI18n()
|
||||
class Sider extends PureComponent {
|
||||
constructor(props) {
|
||||
@ -68,7 +66,7 @@ class Sider extends PureComponent {
|
||||
theme={this.StrictMode()}
|
||||
width="180"
|
||||
collapsed={collapsed}
|
||||
className={classnames(styles.sider, {[styles.darkmd]: this.isDarkMode()} )}
|
||||
className={classnames(styles.sider, {[styles.darkmd]: this.isDarkMode(), [styles.desktop_mode]: this.props.desktop_mode} )}
|
||||
onMouseEnter={() => this.setState({ collapsedWidth: '90' })}
|
||||
onMouseLeave={() => this.setState({ collapsedWidth: '35' })}
|
||||
>
|
||||
|
@ -109,10 +109,10 @@
|
||||
border-color: transparent;
|
||||
font-size: 13px;
|
||||
font-family: "Poppins", sans-serif;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
height: 100vh;
|
||||
z-index: 100;
|
||||
float: left;
|
||||
position: relative;
|
||||
|
||||
:global {
|
||||
.ant-layout-sider-dark {
|
||||
@ -154,9 +154,8 @@
|
||||
|
||||
.sider {
|
||||
border-right: transparent;
|
||||
border-radius: 0 10px 10px 0 ;
|
||||
&.darkmd {
|
||||
border: none;
|
||||
&.desktop_mode{
|
||||
border-radius: 12px 0 0 12px;
|
||||
}
|
||||
height: 100%;
|
||||
z-index: 50;
|
||||
|
38
src/components/Layout/WindowAppBar.js
Normal file
38
src/components/Layout/WindowAppBar.js
Normal file
@ -0,0 +1,38 @@
|
||||
import React from 'react'
|
||||
import styles from './WindowAppBar.less'
|
||||
import * as Icons from '@ant-design/icons'
|
||||
const remote = {
|
||||
getCurrentWindow: () =>{
|
||||
return
|
||||
},
|
||||
handleFullRescale: () => {
|
||||
return
|
||||
},
|
||||
app: {
|
||||
quit: () => {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
export default class WindowAppBar extends React.PureComponent {
|
||||
handleFullRescale(){
|
||||
return
|
||||
// const currentWindow = remote.getCurrentWindow()
|
||||
// if(currentWindow.isMaximized()) {
|
||||
// currentWindow.unmaximize()
|
||||
// } else {
|
||||
// currentWindow.maximize()
|
||||
// }
|
||||
}
|
||||
render(){
|
||||
return(
|
||||
<div className={styles.WindowAppBar}>
|
||||
<div className={styles.WindowControl}>
|
||||
<Icons.MinusOutlined onClick={() => remote.getCurrentWindow().minimize() } id="minimize-button" />
|
||||
<Icons.FullscreenOutlined onClick={() => this.handleFullRescale()} />
|
||||
<Icons.CloseOutlined onClick={() => remote.app.quit()} id="close-button" />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
31
src/components/Layout/WindowAppBar.less
Normal file
31
src/components/Layout/WindowAppBar.less
Normal file
@ -0,0 +1,31 @@
|
||||
.WindowAppBar {
|
||||
-webkit-app-region: drag;
|
||||
position: relative;
|
||||
vertical-align: top;
|
||||
width: 100%;
|
||||
height: 25px;
|
||||
z-index: 5000;
|
||||
background-color: #2d2d2d;
|
||||
}
|
||||
.WindowControl {
|
||||
float: right;
|
||||
height: 100%;
|
||||
padding: 0 20px 0 0;
|
||||
transition: all 140ms linear;
|
||||
:global {
|
||||
color: #747474;
|
||||
.anticon {
|
||||
margin: 0 15px 0 15px;
|
||||
display: inline-block;
|
||||
color: inherit;
|
||||
font-style: normal;
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
.WindowControl:hover{
|
||||
:global{
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
import Sider from './Sider'
|
||||
import Control from './Control'
|
||||
import Secondary from './Secondary/index.js'
|
||||
import WindowAppBar from './WindowAppBar'
|
||||
|
||||
export { Sider, Control, Secondary }
|
||||
export { Sider, Control, Secondary,WindowAppBar }
|
||||
|
@ -6,6 +6,8 @@ import { Button, Input, Drawer } from 'antd';
|
||||
import * as ycore from 'ycore'
|
||||
|
||||
import styles from './index.less';
|
||||
import { ANT_MARK } from 'antd/lib/locale-provider';
|
||||
import { validateLocaleAndSetLanguage } from 'typescript';
|
||||
|
||||
const FormItem = Form.Item
|
||||
|
||||
@ -101,6 +103,7 @@ class YulioID extends Component {
|
||||
<div><br/><br/><br/>
|
||||
<div className={styles.resultbox}>
|
||||
<h6 > {StateMessage} </h6>
|
||||
<Button onClick={() => ycore.RefreshONCE()}> Reload </Button>
|
||||
{StateException ? <div className={styles.retryBTN}><Button style={{ width: '270px' }} type='dashed' onClick={() => this.handleRetry()}>Retry</Button></div> : null}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -9,7 +9,7 @@
|
||||
pointer-events: none;
|
||||
|
||||
.bar {
|
||||
background: @primary-color;
|
||||
background: transparent;
|
||||
position: fixed;
|
||||
z-index: 2048;
|
||||
top: 0;
|
||||
|
@ -16,7 +16,7 @@ import * as Icons from '@ant-design/icons'
|
||||
import styles from './PrimaryLayout.less'
|
||||
|
||||
const { Content } = antd.Layout
|
||||
const { Sider, Control, Secondary } = MyLayout
|
||||
const { Sider, Control, Secondary, WindowAppBar } = MyLayout
|
||||
|
||||
@withRouter
|
||||
@connect(({ app, loading }) => ({ app, loading }))
|
||||
@ -27,12 +27,17 @@ class PrimaryLayout extends React.Component {
|
||||
this.state = {
|
||||
collapsed: (ycore.AppSettings.default_collapse_sider? true : false),
|
||||
isMobile: false,
|
||||
desktop_mode: false,
|
||||
userData: ''
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.setState({ userData: ycore.userData() })
|
||||
this.setState({
|
||||
userData: ycore.userData(),
|
||||
desktop_mode: ycore.CheckThisApp.desktop_mode()
|
||||
})
|
||||
|
||||
this.enquireHandler = enquireScreen(mobile => {
|
||||
const { isMobile } = this.state
|
||||
if (isMobile !== mobile) {
|
||||
@ -64,11 +69,12 @@ class PrimaryLayout extends React.Component {
|
||||
|
||||
render() {
|
||||
const { app, location, dispatch, children } = this.props
|
||||
const { userData, collapsed, isMobile } = this.state
|
||||
const { userData, collapsed, isMobile, desktop_mode } = this.state
|
||||
const { onCollapseChange } = this
|
||||
const { theme } = app
|
||||
|
||||
const SiderProps = {
|
||||
desktop_mode: desktop_mode,
|
||||
theme,
|
||||
userData,
|
||||
isMobile,
|
||||
@ -83,16 +89,18 @@ class PrimaryLayout extends React.Component {
|
||||
}
|
||||
|
||||
const SecondaryProps = {
|
||||
desktop_mode: desktop_mode,
|
||||
userData,
|
||||
isMobile,
|
||||
theme,
|
||||
}
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<React.Fragment >
|
||||
<div className={classnames(styles.AppWrapper, {[styles.desktop_mode]: desktop_mode})}>
|
||||
{isMobile? <MobileWarning /> : null}
|
||||
<div className={styles.BarControlWrapper}><Control /></div>
|
||||
<antd.Layout className={classnames( styles.layout, {[styles.md_dark]: this.isDarkMode() })}>
|
||||
<antd.Layout className={classnames( styles.layout, {[styles.md_dark]: this.isDarkMode(), [styles.desktop_mode]: desktop_mode })}>
|
||||
<Sider {...SiderProps}/>
|
||||
|
||||
<div id="primaryLayout" className={styles.leftContainer}>
|
||||
@ -107,6 +115,7 @@ class PrimaryLayout extends React.Component {
|
||||
<Secondary {...SecondaryProps} />
|
||||
|
||||
</antd.Layout>
|
||||
</div>
|
||||
</React.Fragment>
|
||||
)
|
||||
|
||||
|
@ -1,21 +1,9 @@
|
||||
@import '~themes/vars.less';
|
||||
|
||||
|
||||
.mobilewarning{
|
||||
background-color: rgba(0, 0, 0, 0.975);
|
||||
color: white;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
z-index: 100000;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
:global {
|
||||
.ant-result-title {
|
||||
color: white;
|
||||
}
|
||||
.AppWrapper{
|
||||
&.desktop_mode{
|
||||
padding: 0 30px 0 30px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,8 +20,12 @@
|
||||
}
|
||||
|
||||
.layout{
|
||||
|
||||
background-color: @Theme-Layout-Backgroud; //#E2E6E9;
|
||||
transition: background-color 200ms linear;
|
||||
&.desktop_mode{
|
||||
border-radius: 12px;
|
||||
}
|
||||
&.md_radius{
|
||||
width: 95%;
|
||||
margin: auto;
|
||||
|
@ -46,12 +46,12 @@ export default {
|
||||
effects: {
|
||||
*query({payload}, { call, put, select }) {
|
||||
const validBackup = ycore.ValidBackup();
|
||||
if ( ycore.ValidLoginSession() == true) {
|
||||
if (ycore.ValidLoginSession() == true) {
|
||||
if (pathMatchRegexp(['/', '/login'], window.location.pathname)) {
|
||||
router.push({pathname: '/main',})
|
||||
}
|
||||
ycore.MakeBackup()
|
||||
ycore.UpdateSDCP()
|
||||
ycore.QueryRuntime()
|
||||
return true
|
||||
}
|
||||
else if(!pathMatchRegexp(['','/login'], window.location.pathname)) {
|
||||
|
@ -4,13 +4,13 @@ import { Page } from 'components'
|
||||
import styles from './404.less'
|
||||
|
||||
const Error404 = () => (
|
||||
<Page inner>
|
||||
|
||||
<div className={styles.error}>
|
||||
<LegacyIcon type="api" />
|
||||
<h1>OBA BLYAT</h1>
|
||||
<p><strong>ERROR 404</strong></p>
|
||||
</div>
|
||||
</Page>
|
||||
|
||||
)
|
||||
|
||||
export default Error404
|
||||
|
@ -26,6 +26,7 @@
|
||||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
|
||||
}
|
||||
.error {
|
||||
background-color: transparent;
|
||||
color: black;
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
|
@ -46,6 +46,18 @@ export default class __m extends React.Component {
|
||||
this.setState({s_ses: res})
|
||||
})}
|
||||
}
|
||||
handleDesktop(){
|
||||
const a = localStorage.getItem('desktop_src')
|
||||
let to;
|
||||
if (a == 'false') {
|
||||
to = true
|
||||
}else {
|
||||
to = false
|
||||
}
|
||||
ycore.notify.proccess('Switching to ', to? 'Desktop Mode' : 'Normal Mode')
|
||||
localStorage.setItem('desktop_src', to)
|
||||
setTimeout(() => ycore.RefreshONCE(), 2000)
|
||||
}
|
||||
DescompileSDCP(){
|
||||
let result = {};
|
||||
for (var i = 0; i < UserData.length; i++) {
|
||||
@ -107,6 +119,7 @@ export default class __m extends React.Component {
|
||||
|
||||
<antd.Button onClick={() => ycore.notify.error('Error Mock 1')} > notify.error </antd.Button>
|
||||
<antd.Button onClick={() => ycore.notify.proccess('Proccess Mock 1')} > notify.proccess </antd.Button>
|
||||
<antd.Button onClick={() => this.handleDesktop()} > Switch to Desktop_mode </antd.Button>
|
||||
</div>
|
||||
|
||||
<div className={styles.titleHeader}>
|
||||
|
@ -1,7 +1,6 @@
|
||||
import React, { PureComponent } from 'react'
|
||||
import * as ycore from 'ycore'
|
||||
|
||||
@withI18n()
|
||||
class Index extends PureComponent {
|
||||
render() {
|
||||
ycore.crouter.native(`login`)
|
||||
|
@ -3,7 +3,7 @@
|
||||
body {
|
||||
height: 100%;
|
||||
overflow-y: hidden;
|
||||
background-color: rgb(249, 249, 249);
|
||||
background-color: transparent; // rgb(249, 249, 249);
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
|
Loading…
x
Reference in New Issue
Block a user