Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kus-admin
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Кубота
kus-admin
Commits
157731ed
Commit
157731ed
authored
Jan 17, 2020
by
Иван Кубота
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jsx with working sourcemaps
parent
4ddca06e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
8 deletions
+47
-8
index.html
index.html
+1
-1
index.js
index.js
+38
-3
package.json
package.json
+1
-1
export.jsx
public/js/view/page/export.jsx
+4
-0
products.js
public/js/view/page/products.js
+3
-3
yarn.lock
yarn.lock
+0
-0
No files found.
index.html
View file @
157731ed
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
<script
src=
"js/view/cmp/tagfield.js"
></script>
<script
src=
"js/view/cmp/tagfield.js"
></script>
<script
src=
"js/view/page/products.js"
></script>
<script
src=
"js/view/page/products.js"
></script>
<script
src=
"js/view/page/export.js"
></script>
<script
src=
"js/view/page/export.js
x
"
></script>
<script
src=
"js/view/page/generate.js"
></script>
<script
src=
"js/view/page/generate.js"
></script>
<script
src=
"js/view/page/components.js"
></script>
<script
src=
"js/view/page/components.js"
></script>
...
...
index.js
View file @
157731ed
...
@@ -6,7 +6,7 @@ const DB_PATH = env.DB_PATH || "./db/users.json";
...
@@ -6,7 +6,7 @@ const DB_PATH = env.DB_PATH || "./db/users.json";
const
data
=
require
(
"./db.js"
);
const
data
=
require
(
"./db.js"
);
const
App
=
require
(
'express'
);
const
App
=
require
(
'express'
);
const
Router
=
require
(
'node-async-router'
);
const
Router
=
require
(
'node-async-router'
);
const
app
=
App
(),
const
app
=
App
(),
router
=
Router
();
router
=
Router
();
...
@@ -32,9 +32,44 @@ router.all('/', function(req, res) {
...
@@ -32,9 +32,44 @@ router.all('/', function(req, res) {
res
.
end
(
print
(
JSON
.
stringify
(
data
)));
res
.
end
(
print
(
JSON
.
stringify
(
data
)));
});
});
app
.
use
(
router
);
app
.
use
(
App
.
static
(
'public'
))
var
path
=
require
(
'path'
);
var
cache
=
{};
app
.
use
(
function
(
req
,
res
,
next
)
{
if
(
req
.
url
in
cache
)
{
return
res
.
end
(
cache
[
req
.
url
])
}
if
(
req
.
url
.
substr
(
-
8
)
===
'.jsx.map'
)
{
debugger
}
if
(
req
.
url
.
substr
(
-
4
)
===
'.jsx'
)
{
require
(
"@babel/core"
).
transform
(
fs
.
readFileSync
(
'./public/js/view/page/export.jsx'
),
{
"plugins"
:
[
[
"@babel/plugin-transform-react-jsx"
,
{
"pragma"
:
"D.h"
,
// default pragma is React.createElement
"pragmaFrag"
:
"D.f"
,
// default is React.Fragment
"throwIfNamespace"
:
false
// defaults to true
}]
],
sourceMaps
:
'both'
,
sourceFileName
:
'/js/view/page/export.jsx'
},
function
(
c
,
d
,
e
)
{
cache
[
'/js/view/page/export.jsx.map'
]
=
JSON
.
stringify
(
d
.
map
);
res
.
set
(
'SourceMap'
,
'/js/view/page/export.jsx.map'
);
res
.
end
(
d
.
code
)
});
}
else
{
next
();
}
});
app
.
use
(
App
.
static
(
'public'
))
app
.
use
(
'/'
,
function
(
req
,
res
)
{
res
.
end
(
print
(
JSON
.
stringify
(
data
)));
});
app
.
listen
(
APP_PORT
);
app
.
listen
(
APP_PORT
);
...
...
package.json
View file @
157731ed
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
"
yargs
"
:
"^15.1.0"
"
yargs
"
:
"^15.1.0"
},
},
"scripts"
:
{
"scripts"
:
{
"start"
:
"node"
"start"
:
"node
index.js
"
},
},
"bin"
:
{
"bin"
:
{
"kus-quizard"
:
"./bin/index.js"
"kus-quizard"
:
"./bin/index.js"
...
...
public/js/view/page/export.jsx
View file @
157731ed
...
@@ -18,5 +18,8 @@ view.page.Export = function() {
...
@@ -18,5 +18,8 @@ view.page.Export = function() {
</
div
>
</
div
>
{
exportLogic
(
D
.
textarea
({
cls
:
'export-data'
}))
}
{
exportLogic
(
D
.
textarea
({
cls
:
'export-data'
}))
}
<
div
cls=
"export-comment"
>
Connetction type
{
'<Enum>'
}
: 0 — продукт, 1 — компонент`
</
div
>
<
div
cls=
"export-comment"
>
Connetction type
{
'<Enum>'
}
: 0 — продукт, 1 — компонент`
</
div
>
<
button
on=
{
{
click
:(
e
)
=>
{
console
.
log
(
e
)}}
}
>
btn
</
button
>
</
div
>
</
div
>
console
.
log
(
this
.
dom
)
};
};
\ No newline at end of file
public/js/view/page/products.js
View file @
157731ed
...
@@ -22,7 +22,7 @@ view.page.Products = function() {
...
@@ -22,7 +22,7 @@ view.page.Products = function() {
type
:
'checkbox'
,
type
:
'checkbox'
,
checked
:
(
update
)
=>
store
.
sub
(
'productFilterByTitle'
,
(
val
)
=>
update
(
val
))},
checked
:
(
update
)
=>
store
.
sub
(
'productFilterByTitle'
,
(
val
)
=>
update
(
val
))},
on
:
{
input
:
(
e
)
=>
{
store
.
set
(
'productFilterByTitle'
,
e
.
target
.
checked
)}}
on
:
{
change
:
(
e
)
=>
{
store
.
set
(
'productFilterByTitle'
,
e
.
target
.
checked
)}}
}),
'Название'
}),
'Название'
),
),
D
.
label
({
cls
:
'product-filter__label'
},
D
.
label
({
cls
:
'product-filter__label'
},
...
@@ -31,7 +31,7 @@ view.page.Products = function() {
...
@@ -31,7 +31,7 @@ view.page.Products = function() {
type
:
'checkbox'
,
type
:
'checkbox'
,
checked
:
(
update
)
=>
store
.
sub
(
'productFilterByComponent'
,
(
val
)
=>
update
(
val
))},
checked
:
(
update
)
=>
store
.
sub
(
'productFilterByComponent'
,
(
val
)
=>
update
(
val
))},
on
:
{
input
:
(
e
)
=>
{
store
.
set
(
'productFilterByComponent'
,
e
.
target
.
checked
)}}
on
:
{
change
:
(
e
)
=>
{
store
.
set
(
'productFilterByComponent'
,
e
.
target
.
checked
)}}
}),
'Ингредиенты'
}),
'Ингредиенты'
),
),
D
.
label
({
cls
:
'product-filter__label'
},
D
.
label
({
cls
:
'product-filter__label'
},
...
@@ -40,7 +40,7 @@ view.page.Products = function() {
...
@@ -40,7 +40,7 @@ view.page.Products = function() {
type
:
'checkbox'
,
type
:
'checkbox'
,
checked
:
(
update
)
=>
store
.
sub
(
'productFilterByTag'
,
(
val
)
=>
update
(
val
))},
checked
:
(
update
)
=>
store
.
sub
(
'productFilterByTag'
,
(
val
)
=>
update
(
val
))},
on
:
{
input
:
(
e
)
=>
{
store
.
set
(
'productFilterByTag'
,
e
.
target
.
checked
)}}
on
:
{
change
:
(
e
)
=>
{
store
.
set
(
'productFilterByTag'
,
e
.
target
.
checked
)}}
}),
'Тэги'
}),
'Тэги'
)
)
)
)
...
...
yarn.lock
View file @
157731ed
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment