Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
console
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
console
Commits
19f5c588
Commit
19f5c588
authored
Apr 24, 2017
by
nano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix error
parent
2d0ab5c3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
26 deletions
+53
-26
.idea/workspace.xml
.idea/workspace.xml
+50
-23
src/routes/upload.ts
src/routes/upload.ts
+3
-3
No files found.
.idea/workspace.xml
View file @
19f5c588
...
...
@@ -2,7 +2,7 @@
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"f0cbce64-0ebc-4f60-8c2d-2fe9e214a8c0"
name=
"Default"
comment=
""
>
<change
type=
"MODIFICATION"
beforePath=
"$PROJECT_DIR$/src/
models/App.ts"
afterPath=
"$PROJECT_DIR$/src/models/App
.ts"
/>
<change
type=
"MODIFICATION"
beforePath=
"$PROJECT_DIR$/src/
routes/upload.ts"
afterPath=
"$PROJECT_DIR$/src/routes/upload
.ts"
/>
</list>
<ignored
path=
"mycard-console-backend.iws"
/>
<ignored
path=
".idea/workspace.xml"
/>
...
...
@@ -29,7 +29,7 @@
<entry
file=
"file://$PROJECT_DIR$/server.ts"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"306"
>
<caret
line=
"17"
column=
"0"
lean-forward=
"
true"
selection-start-line=
"17"
selection-start-column=
"0"
selection-end-line=
"17
"
selection-end-column=
"0"
/>
<caret
line=
"17"
column=
"0"
lean-forward=
"
false"
selection-start-line=
"17"
selection-start-column=
"0"
selection-end-line=
"18
"
selection-end-column=
"0"
/>
<folding>
<element
signature=
"e#77#104#0"
expanded=
"true"
/>
<element
signature=
"e#387#427#0"
expanded=
"true"
/>
...
...
@@ -38,6 +38,16 @@
</provider>
</entry>
</file>
<file
leaf-file-name=
"upload.ts"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/src/routes/upload.ts"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"180"
>
<caret
line=
"29"
column=
"36"
lean-forward=
"true"
selection-start-line=
"29"
selection-start-column=
"36"
selection-end-line=
"29"
selection-end-column=
"36"
/>
<folding
/>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component
name=
"FileTemplateManagerImpl"
>
...
...
@@ -103,7 +113,6 @@
<option
value=
"$PROJECT_DIR$/src/routes/app.ts"
/>
<option
value=
"$PROJECT_DIR$/src/models/Iridium.ts"
/>
<option
value=
"$PROJECT_DIR$/src/models/Package.ts"
/>
<option
value=
"$PROJECT_DIR$/src/routes/upload.ts"
/>
<option
value=
"$PROJECT_DIR$/src/inversify.config.ts"
/>
<option
value=
"$PROJECT_DIR$/src/types.ts"
/>
<option
value=
"$PROJECT_DIR$/src/utils.ts"
/>
...
...
@@ -113,6 +122,7 @@
<option
value=
"$PROJECT_DIR$/package.json"
/>
<option
value=
"$PROJECT_DIR$/docker-compose.yml"
/>
<option
value=
"$PROJECT_DIR$/src/models/App.ts"
/>
<option
value=
"$PROJECT_DIR$/src/routes/upload.ts"
/>
</list>
</option>
</component>
...
...
@@ -132,8 +142,8 @@
<handled-path
value=
"$PROJECT_DIR$/node_modules"
/>
</component>
<component
name=
"ProjectFrameBounds"
>
<option
name=
"x"
value=
"
401
"
/>
<option
name=
"y"
value=
"
260
"
/>
<option
name=
"x"
value=
"
357
"
/>
<option
name=
"y"
value=
"
162
"
/>
<option
name=
"width"
value=
"1232"
/>
<option
name=
"height"
value=
"777"
/>
</component>
...
...
@@ -181,6 +191,24 @@
<option
name=
"myItemType"
value=
"com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode"
/>
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option
name=
"myItemId"
value=
"moecube-console"
/>
<option
name=
"myItemType"
value=
"com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode"
/>
</PATH_ELEMENT>
<PATH_ELEMENT>
<option
name=
"myItemId"
value=
"moecube-console"
/>
<option
name=
"myItemType"
value=
"com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode"
/>
</PATH_ELEMENT>
<PATH_ELEMENT>
<option
name=
"myItemId"
value=
"src"
/>
<option
name=
"myItemType"
value=
"com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode"
/>
</PATH_ELEMENT>
<PATH_ELEMENT>
<option
name=
"myItemId"
value=
"routes"
/>
<option
name=
"myItemType"
value=
"com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode"
/>
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option
name=
"myItemId"
value=
"moecube-console"
/>
...
...
@@ -356,12 +384,12 @@
<workItem
from=
"1492655792313"
duration=
"22867000"
/>
<workItem
from=
"1492741754173"
duration=
"2869000"
/>
<workItem
from=
"1492753774887"
duration=
"9061000"
/>
<workItem
from=
"1493001126170"
duration=
"4
240
000"
/>
<workItem
from=
"1493001126170"
duration=
"4
804
000"
/>
</task>
<servers
/>
</component>
<component
name=
"TimeTrackingManager"
>
<option
name=
"totallyTimeSpent"
value=
"12
1931
000"
/>
<option
name=
"totallyTimeSpent"
value=
"12
2495
000"
/>
</component>
<component
name=
"TodoView"
>
<todo-panel
id=
"selected-file"
>
...
...
@@ -373,8 +401,7 @@
</todo-panel>
</component>
<component
name=
"ToolWindowManager"
>
<frame
x=
"401"
y=
"260"
width=
"1232"
height=
"777"
extended-state=
"0"
/>
<editor
active=
"true"
/>
<frame
x=
"357"
y=
"162"
width=
"1232"
height=
"777"
extended-state=
"0"
/>
<layout>
<window_info
id=
"TypeScript"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32846716"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Project"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.23947151"
sideWeight=
"0.49384886"
order=
"0"
side_tool=
"false"
content_ui=
"combo"
/>
...
...
@@ -385,7 +412,7 @@
<window_info
id=
"Run"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32975295"
sideWeight=
"0.5"
order=
"2"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Version Control"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.32990867"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Structure"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"1"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Terminal"
active=
"
fals
e"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.41167882"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Terminal"
active=
"
tru
e"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"true"
show_stripe_button=
"true"
weight=
"0.41167882"
sideWeight=
"0.5"
order=
"7"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Debug"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.4"
sideWeight=
"0.5"
order=
"3"
side_tool=
"false"
content_ui=
"tabs"
/>
<window_info
id=
"Favorites"
active=
"false"
anchor=
"left"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.23725356"
sideWeight=
"0.50615114"
order=
"2"
side_tool=
"true"
content_ui=
"tabs"
/>
<window_info
id=
"Cvs"
active=
"false"
anchor=
"bottom"
auto_hide=
"false"
internal_type=
"DOCKED"
type=
"DOCKED"
visible=
"false"
show_stripe_button=
"true"
weight=
"0.25"
sideWeight=
"0.5"
order=
"4"
side_tool=
"false"
content_ui=
"tabs"
/>
...
...
@@ -592,6 +619,7 @@
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"90"
>
<caret
line=
"5"
column=
"1"
lean-forward=
"false"
selection-start-line=
"5"
selection-start-column=
"1"
selection-end-line=
"5"
selection-end-column=
"1"
/>
<folding
/>
</state>
</provider>
</entry>
...
...
@@ -607,6 +635,7 @@
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"107"
>
<caret
line=
"1831"
column=
"15"
lean-forward=
"false"
selection-start-line=
"1831"
selection-start-column=
"15"
selection-end-line=
"1831"
selection-end-column=
"15"
/>
<folding
/>
</state>
</provider>
</entry>
...
...
@@ -622,7 +651,7 @@
<state
relative-caret-position=
"231"
>
<caret
line=
"61"
column=
"44"
lean-forward=
"true"
selection-start-line=
"61"
selection-start-column=
"44"
selection-end-line=
"61"
selection-end-column=
"44"
/>
<folding>
<element
signature=
"e#0#29#0"
expanded=
"
tru
e"
/>
<element
signature=
"e#0#29#0"
expanded=
"
fals
e"
/>
</folding>
</state>
</provider>
...
...
@@ -632,7 +661,7 @@
<state
relative-caret-position=
"72"
>
<caret
line=
"4"
column=
"0"
lean-forward=
"true"
selection-start-line=
"4"
selection-start-column=
"0"
selection-end-line=
"4"
selection-end-column=
"0"
/>
<folding>
<element
signature=
"e#0#39#0"
expanded=
"
tru
e"
/>
<element
signature=
"e#0#39#0"
expanded=
"
fals
e"
/>
</folding>
</state>
</provider>
...
...
@@ -673,16 +702,6 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/routes/upload.ts"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-2839"
>
<caret
line=
"20"
column=
"4"
lean-forward=
"true"
selection-start-line=
"20"
selection-start-column=
"4"
selection-end-line=
"20"
selection-end-column=
"4"
/>
<folding>
<element
signature=
"e#0#28#0"
expanded=
"false"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/inversify.config.ts"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"90"
>
...
...
@@ -771,10 +790,18 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/src/routes/upload.ts"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"180"
>
<caret
line=
"29"
column=
"36"
lean-forward=
"true"
selection-start-line=
"29"
selection-start-column=
"36"
selection-end-line=
"29"
selection-end-column=
"36"
/>
<folding
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/server.ts"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"306"
>
<caret
line=
"17"
column=
"0"
lean-forward=
"
true"
selection-start-line=
"17"
selection-start-column=
"0"
selection-end-line=
"17
"
selection-end-column=
"0"
/>
<caret
line=
"17"
column=
"0"
lean-forward=
"
false"
selection-start-line=
"17"
selection-start-column=
"0"
selection-end-line=
"18
"
selection-end-column=
"0"
/>
<folding>
<element
signature=
"e#77#104#0"
expanded=
"true"
/>
<element
signature=
"e#387#427#0"
expanded=
"true"
/>
...
...
src/routes/upload.ts
View file @
19f5c588
...
...
@@ -21,9 +21,9 @@ import config from '../../config';
// }
const
checkPackage
=
async
(
file
)
=>
{
if
([
'
zip
'
,
'
gz
'
,
'
rar
'
,
'
7z
'
,
'
application/x-gzip
'
].
indexOf
(
file
.
mime
)
===
-
1
)
{
throw
new
Error
(
'
Unsupported file type
'
);
if
([
'
application/zip
'
,
'
application/gz
'
,
'
application/rar
'
,
'
application/
7z
'
,
'
application/x-gzip
'
].
indexOf
(
file
.
mime
)
===
-
1
)
{
console
.
log
(
file
.
mime
)
throw
new
Error
(
`Unsupported file type:
${
file
.
mime
}
`
);
}
};
...
...
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