Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
L
luna
Project
Project
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
ops
luna
Commits
8b9c3d64
Unverified
Commit
8b9c3d64
authored
Feb 26, 2018
by
liuzheng712
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test'
parents
9c393722
ae90036c
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
117 additions
and
21 deletions
+117
-21
.dockerignore
.dockerignore
+1
-0
Dockerfile
Dockerfile
+1
-0
cn.json
i18n/cn.json
+2
-1
mock.py
mock.py
+2
-2
nginx.conf
nginx.conf
+4
-0
package-lock.json
package-lock.json
+8
-10
proxy.conf.json
proxy.conf.json
+1
-1
cleftbar.component.html
src/app/ControlPage/cleftbar/cleftbar.component.html
+1
-1
app.service.ts
src/app/app.service.ts
+5
-1
nav.component.ts
src/app/elements/nav/nav.component.ts
+51
-5
style.scss
src/sass/style.scss
+41
-0
No files found.
.dockerignore
View file @
8b9c3d64
*
!dist
!nginx.conf
!i18n
Dockerfile
View file @
8b9c3d64
FROM
nginx:alpine
COPY
./dist /opt/luna/
COPY
./i18n /opt/luna/i18n/
COPY
nginx.conf /etc/nginx/conf.d/default.conf
i18n/cn.json
View file @
8b9c3d64
...
...
@@ -39,5 +39,6 @@
"labels"
:
"标签管理"
,
"user"
:
"用户"
,
"user group"
:
"用户组"
,
"login logs"
:
"登陆日志"
"login logs"
:
"登陆日志"
,
"language"
:
"语言选择"
}
mock.py
View file @
8b9c3d64
...
...
@@ -233,9 +233,9 @@ def replay():
return
redirect
(
"http://jps.ilz.me/media/2017-12-24/ec87a486-0344-4f12-b27a-620321944f7f.gz"
)
@app.route
(
'/i18n/<i18n>'
)
@app.route
(
'/
luna/
i18n/<i18n>'
)
def
i18n
(
i18n
):
return
send_file
(
'./i18n/'
+
i18n
+
'.json'
)
return
send_file
(
'./i18n/'
+
i18n
)
def
read_file
(
filename
,
charset
=
'utf-8'
):
...
...
nginx.conf
View file @
8b9c3d64
...
...
@@ -5,4 +5,8 @@ server {
try_files
$uri
/
/index.html
;
alias
/opt/luna/
;
}
location
/i18n/
{
root
/opt/luna/i18n
;
}
}
package-lock.json
View file @
8b9c3d64
...
...
@@ -5390,6 +5390,10 @@
"is-glob"
:
"2.0.1"
}
},
"global"
:
{
"version"
:
"https://github.com/component/global/archive/v2.0.1.tar.gz"
,
"integrity"
:
"sha512-O91OcV/NbdmQJPHaRu2ekSP7bqFRLWgqSwaJvqHPZHUwmHBagQYTOra29+LnzzG3lZkXH1ANzHzfCxtAPM9HMA=="
},
"globals"
:
{
"version"
:
"9.18.0"
,
"resolved"
:
"https://registry.npmjs.org/globals/-/globals-9.18.0.tgz"
,
...
...
@@ -8070,10 +8074,6 @@
"requires"
:
{
"better-assert"
:
"1.0.2"
}
},
"xmlhttprequest"
:
{
"version"
:
"https://github.com/rase-/node-XMLHttpRequest/archive/a6b6f2.tar.gz"
,
"integrity"
:
"sha512-GO6pmHif8rvZ9YddEoem4hQo0OvcTZJnPGyKxBNsFwgEwNYxbpfewye2ulTDAanWXTcfl2+XKE6/DK7SAoKqMw=="
}
}
},
...
...
@@ -8104,12 +8104,6 @@
"integrity"
:
"sha1-UCrLmzEE2sM90mMOry+IiwuvTLM="
,
"requires"
:
{
"global"
:
"https://github.com/component/global/archive/v2.0.1.tar.gz"
},
"dependencies"
:
{
"global"
:
{
"version"
:
"https://github.com/component/global/archive/v2.0.1.tar.gz"
,
"integrity"
:
"sha512-O91OcV/NbdmQJPHaRu2ekSP7bqFRLWgqSwaJvqHPZHUwmHBagQYTOra29+LnzzG3lZkXH1ANzHzfCxtAPM9HMA=="
}
}
},
"json3"
:
{
...
...
@@ -15188,6 +15182,10 @@
"resolved"
:
"https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz"
,
"integrity"
:
"sha1-1QH5ezvbQDr4757MIFcxh6rawOk="
},
"xmlhttprequest"
:
{
"version"
:
"https://github.com/rase-/node-XMLHttpRequest/archive/a6b6f2.tar.gz"
,
"integrity"
:
"sha512-GO6pmHif8rvZ9YddEoem4hQo0OvcTZJnPGyKxBNsFwgEwNYxbpfewye2ulTDAanWXTcfl2+XKE6/DK7SAoKqMw=="
},
"xregexp"
:
{
"version"
:
"2.0.0"
,
"resolved"
:
"https://registry.npmjs.org/xregexp/-/xregexp-2.0.0.tgz"
,
...
...
proxy.conf.json
View file @
8b9c3d64
...
...
@@ -3,7 +3,7 @@
"target"
:
"http://127.0.0.1:5000"
,
"secure"
:
false
},
"/i18n"
:
{
"/
luna/
i18n"
:
{
"target"
:
"http://127.0.0.1:5000"
,
"secure"
:
false
},
...
...
src/app/ControlPage/cleftbar/cleftbar.component.html
View file @
8b9c3d64
<div
id=
"sidebar"
>
<div
class=
"search"
>
<input
class=
"left-search"
placeholder=
"
Search
..."
maxlength=
"2048"
name=
"q"
autocomplete=
"off"
<input
class=
"left-search"
placeholder=
"
{{'Search'| trans }}
..."
maxlength=
"2048"
name=
"q"
autocomplete=
"off"
title=
"Search"
type=
"text"
tabindex=
"1"
spellcheck=
"false"
autofocus
[(
ngModel
)]="
q
"
(
keyup
.
enter
)="
Search
(
q
)"
>
</div>
...
...
src/app/app.service.ts
View file @
8b9c3d64
...
...
@@ -150,6 +150,10 @@ export class LocalStorageService {
set
(
key
:
string
,
value
:
any
)
{
return
localStorage
.
setItem
(
key
,
value
);
}
delete
(
key
:
string
)
{
return
localStorage
.
removeItem
(
key
);
}
}
@
Injectable
()
...
...
@@ -194,7 +198,7 @@ export class AppService implements OnInit {
}
if
(
this
.
lang
!==
'en'
)
{
this
.
_http
.
get
(
'/
i18n/'
+
this
.
lang
).
subscribe
(
this
.
_http
.
get
(
'/
luna/i18n/'
+
this
.
lang
+
'.json'
).
subscribe
(
data
=>
{
this
.
_localStorage
.
set
(
'lang'
,
JSON
.
stringify
(
data
));
}
...
...
src/app/elements/nav/nav.component.ts
View file @
8b9c3d64
...
...
@@ -6,10 +6,10 @@
* @author liuzheng <liuzheng712@gmail.com>
*/
import
{
Component
,
OnInit
}
from
'@angular/core'
;
import
{
AppService
,
HttpService
,
LogService
}
from
'../../app.service'
;
import
{
AppService
,
HttpService
,
Lo
calStorageService
,
Lo
gService
}
from
'../../app.service'
;
import
{
CleftbarComponent
}
from
'../../ControlPage/cleftbar/cleftbar.component'
;
import
{
ControlComponent
,
NavList
}
from
'../../ControlPage/control/control.component'
;
import
{
DataStore
}
from
'../../globals'
;
import
{
DataStore
,
i18n
}
from
'../../globals'
;
import
*
as
jQuery
from
'jquery/dist/jquery.min.js'
;
// import * as layer from 'layui-layer/src/layer.js';
declare
let
layer
:
any
;
...
...
@@ -28,7 +28,8 @@ export class ElementNavComponent implements OnInit {
constructor
(
private
_appService
:
AppService
,
private
_http
:
HttpService
,
private
_logger
:
LogService
)
{
private
_logger
:
LogService
,
private
_localStorage
:
LocalStorageService
)
{
this
.
_logger
.
log
(
'nav.ts:NavComponent'
);
this
.
getnav
();
}
...
...
@@ -89,6 +90,14 @@ export class ElementNavComponent implements OnInit {
this
.
EnterLicense
();
break
;
}
case
'English'
:
{
this
.
English
();
break
;
}
case
'Chinese'
:
{
this
.
Language
(
'cn'
);
break
;
}
default
:
{
break
;
}
...
...
@@ -228,10 +237,25 @@ export class ElementNavComponent implements OnInit {
'click'
:
'BBS'
,
'name'
:
'BBS'
}]
}];
},
{
'id'
:
'Language'
,
'name'
:
'Language'
,
'children'
:
[
{
'id'
:
'English'
,
'click'
:
'English'
,
'name'
:
'English'
},
{
'id'
:
'Chinese'
,
'click'
:
'Chinese'
,
'name'
:
'中文'
}
]
}
];
}
Connect
()
{
layer
.
prompt
({
formType
:
2
,
...
...
@@ -248,4 +272,26 @@ export class ElementNavComponent implements OnInit {
});
}
English
()
{
this
.
_localStorage
.
delete
(
'lang'
);
i18n
.
clear
();
location
.
reload
();
}
Language
(
lan
:
string
)
{
this
.
_http
.
get
(
'/luna/i18n/'
+
lan
+
'.json'
).
subscribe
(
data
=>
{
this
.
_localStorage
.
set
(
'lang'
,
JSON
.
stringify
(
data
));
}
);
const
l
=
this
.
_localStorage
.
get
(
'lang'
);
if
(
l
)
{
const
data
=
JSON
.
parse
(
l
);
Object
.
keys
(
data
).
forEach
((
k
,
_
)
=>
{
i18n
.
set
(
k
,
data
[
k
]);
});
}
location
.
reload
();
}
}
src/sass/style.scss
View file @
8b9c3d64
...
...
@@ -24,3 +24,44 @@ $asset-path: '../static/imgs/inspinia';
@import
'~@swimlane/ngx-datatable/release/index.css'
;
@import
'~@swimlane/ngx-datatable/release/themes/material.css'
;
@import
'~@swimlane/ngx-datatable/release/assets/icons.css'
;
$material-design-icons-font-path
:
'~/material-design-icons/iconfont/'
;
//@import "~material-design-icons/iconfont/material-icons";
@font-face
{
font-family
:
'Material Icons'
;
font-style
:
normal
;
font-weight
:
400
;
src
:
url('
#{
$material-design-icons-font-path
}
/MaterialIcons-Regular.eot')
;
/* For IE6-8 */
src
:
local
(
'Material Icons'
)
,
local
(
'MaterialIcons-Regular'
)
,
url('
#{
$material-design-icons-font-path
}
/MaterialIcons-Regular.woff2')
format
(
'woff2'
)
,
url('
#{
$material-design-icons-font-path
}
/MaterialIcons-Regular.woff')
format
(
'woff'
)
,
url('
#{
$material-design-icons-font-path
}
/MaterialIcons-Regular.ttf')
format
(
'truetype'
);
}
.material-icons
{
font-family
:
'Material Icons'
;
font-weight
:
normal
;
font-style
:
normal
;
font-size
:
24px
;
/* Preferred icon size */
display
:
inline-block
;
line-height
:
1
;
text-transform
:
none
;
letter-spacing
:
normal
;
word-wrap
:
normal
;
white-space
:
nowrap
;
direction
:
ltr
;
/* Support for all WebKit browsers. */
-webkit-font-smoothing
:
antialiased
;
/* Support for Safari and Chrome. */
text-rendering
:
optimizeLegibility
;
/* Support for Firefox. */
-moz-osx-font-smoothing
:
grayscale
;
/* Support for IE. */
font-feature-settings
:
'liga'
;
}
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