Skip to content

Commit 324c9e0

Browse files
committed
Merge pull request #592 from spinlock/dev3.0
Add codis-fe
2 parents 0e50fba + 4688b4d commit 324c9e0

519 files changed

Lines changed: 314346 additions & 11 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
.PHONY: codis-server codis-dashboard codis-proxy codis-admin docker
1+
.PHONY: codis-server codis-dashboard codis-proxy codis-admin codis-fe docker
22

3-
build-all: codis-server codis-dashboard codis-proxy codis-admin
3+
build-all: codis-server codis-dashboard codis-proxy codis-admin codis-fe
44

55
godep-env:
66
@bash version
@@ -16,6 +16,10 @@ codis-admin: godep-env
1616
codis-dashboard: godep-env
1717
godep go build -i -o bin/codis-dashboard ./cmd/dashboard
1818

19+
codis-fe: godep-env
20+
godep go build -i -o bin/codis-fe ./cmd/fe
21+
@rm -rf bin/assets; cp -rf cmd/fe/assets bin/
22+
1923
codis-server:
2024
@mkdir -p bin
2125
make -j4 -C extern/redis-2.8.21/

cmd/admin/admin.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ func (t *cmdAdmin) Main(d map[string]interface{}) {
3333
t.handleConfigConvert(d)
3434
case d["--config-restore"] != nil:
3535
t.handleConfigRestore(d)
36-
case d["--list-dashboard"].(bool):
37-
t.handleListDashboard(d)
36+
case d["--dashboard-list"].(bool):
37+
t.handleDashboardList(d)
3838
}
3939
}
4040

@@ -412,7 +412,7 @@ func (t *cmdAdmin) handleConfigRestore(d map[string]interface{}) {
412412
}
413413
}
414414

415-
func (t *cmdAdmin) handleListDashboard(d map[string]interface{}) {
415+
func (t *cmdAdmin) handleDashboardList(d map[string]interface{}) {
416416
client := t.newTopomClient(d)
417417
defer client.Close()
418418

cmd/admin/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Usage:
4646
codis-admin [-v] --config-dump --product=NAME (--zookeeper=ADDR|--etcd=ADDR) [-1]
4747
codis-admin [-v] --config-convert=FILE
4848
codis-admin [-v] --config-restore=FILE --product=NAME (--zookeeper=ADDR|--etcd=ADDR) [--confirm]
49-
codis-admin [-v] --list-dashboard (--zookeeper=ADDR|--etcd=ADDR)
49+
codis-admin [-v] --dashboard-list (--zookeeper=ADDR|--etcd=ADDR)
5050
5151
Options:
5252
-a AUTH, --auth=AUTH
139 KB
Binary file not shown.
81.6 KB
Binary file not shown.
65.1 KB
Binary file not shown.

cmd/fe/assets/css/main.css

Lines changed: 302 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,302 @@
1+
body {
2+
min-height: 20000px;
3+
min-width: 1600px;
4+
}
5+
6+
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
7+
display: none !important;
8+
}
9+
10+
#main {
11+
margin-left: 200px;
12+
margin-top: 0px;
13+
position: relative;
14+
height: 100%;
15+
}
16+
17+
.container-full {
18+
margin: 20px 60px 20px 60px;
19+
}
20+
21+
#main > .container-full > .row {
22+
margin-bottom: 40px;
23+
}
24+
25+
.status_label_error {
26+
background-color: red;
27+
color: white;
28+
font-weight: bold;
29+
padding: 3px
30+
}
31+
32+
.status_label_warning {
33+
background-color: yellow;
34+
font-weight: bold;
35+
padding: 3px
36+
}
37+
38+
.status_label_pending {
39+
background-color: palevioletred;
40+
font-weight: bold;
41+
padding: 3px
42+
}
43+
44+
.button_tight_column {
45+
padding: 1px;
46+
vertical-align: middle;
47+
}
48+
49+
#sidebar {
50+
position: fixed;
51+
left: 0;
52+
bottom: 0;
53+
top: 0px;
54+
width: 200px;
55+
z-index: 8;
56+
background-color: #fff;
57+
-webkit-box-shadow: 0 0 10px 0 rgba(0, 0, 0, .2);
58+
-moz-box-shadow: 0 0 10px 0 rgba(0, 0, 0, .2)
59+
}
60+
61+
.sidebar-cover {
62+
position: absolute;
63+
left: 0;
64+
right: 0;
65+
top: 0;
66+
bottom: 46px;
67+
background: rgba(255, 255, 255, .5);
68+
z-index: 11
69+
}
70+
71+
.sidebar-cover:hover {
72+
background: rgba(220, 220, 220, .5)
73+
}
74+
75+
.sidebar-cover:hover::before {
76+
width: 100%;
77+
text-align: center;
78+
content: "Disabled";
79+
color: #888;
80+
position: absolute;
81+
top: 45%
82+
}
83+
84+
#sidebar .title {
85+
position: absolute;
86+
left: 0;
87+
right: 0;
88+
top: 0;
89+
font-size: 13px;
90+
font-weight: 700;
91+
border-bottom: 1px solid #ccc;
92+
padding: 8px;
93+
background: #DFF2FF
94+
}
95+
96+
#sidebar .items {
97+
margin: 0;
98+
list-style: none;
99+
position: absolute;
100+
left: 0;
101+
right: 0;
102+
bottom: 0;
103+
top: 36px;
104+
overflow-y: auto
105+
}
106+
107+
#sidebar > .selected-node,
108+
#sidebar > .selected-node > .info {
109+
display: none
110+
}
111+
112+
#sidebar > .tabs {
113+
position: absolute;
114+
left: 0;
115+
right: 0;
116+
bottom: 0;
117+
height: 35px;
118+
border-top: 1px solid #ddd;
119+
margin: 0;
120+
padding: 0;
121+
background: #f9f9f9
122+
}
123+
124+
#sidebar > .tabs > li {
125+
display: inline-block
126+
}
127+
128+
#sidebar > .tabs > li > a {
129+
display: inline-block;
130+
padding: 10px;
131+
width: 60px;
132+
font-size: 13px;
133+
text-align: center;
134+
border-right: 1px solid #ddd;
135+
position: relative;
136+
top: -1px
137+
}
138+
139+
#sidebar > .tabs > li.active > a {
140+
background: #fff
141+
}
142+
143+
#sidebar > .content {
144+
position: absolute;
145+
left: 0;
146+
right: 0;
147+
top: 0;
148+
bottom: 46px;
149+
overflow-y: auto
150+
}
151+
152+
#sidebar > .actions {
153+
position: absolute;
154+
left: 0;
155+
right: 0;
156+
bottom: 0;
157+
height: 30px;
158+
padding: 8px;
159+
background: #f0f0f0
160+
}
161+
162+
#sidebar > .actions > button {
163+
width: 34px;
164+
height: 30px;
165+
padding: 0
166+
}
167+
168+
#sidebar > .actions > .search {
169+
display: inline-block;
170+
border: 0;
171+
background: #fff;
172+
border-radius: 3px;
173+
padding: 5px 6px;
174+
height: 22px;
175+
outline: 0;
176+
width: 157px;
177+
margin-right: 6px;
178+
box-shadow: inset 0 0 2px 0 rgba(80, 80, 80, .5);
179+
color: #333;
180+
position: relative;
181+
top: -1px
182+
}
183+
184+
#sidebar > .actions > .fn-clear-search {
185+
position: absolute;
186+
top: 15px;
187+
right: 65px;
188+
font-weight: 100;
189+
color: #888;
190+
cursor: pointer
191+
}
192+
193+
#sidebar > .actions > .fn-collapse {
194+
float: right;
195+
background-image: linear-gradient(transparent, rgba(0, 0, 0, .08) 40%, rgba(0, 0, 0, .1))
196+
}
197+
198+
#sidebar > .actions > .fn-collapse:hover {
199+
background-image: linear-gradient(rgba(0, 0, 0, .01), rgba(0, 0, 0, .14) 40%, rgba(0, 0, 0, .16))
200+
}
201+
202+
body.sidebar-collapsed #sidebar {
203+
width: 50px;
204+
background: #fff
205+
}
206+
207+
body.sidebar-collapsed #main {
208+
margin-left: 50px
209+
}
210+
211+
body.sidebar-collapsed #sidebar .actions .search,
212+
body.sidebar-collapsed #sidebar .content {
213+
display: none
214+
}
215+
216+
body.sidebar-collapsed #sidebar > .selected-node {
217+
display: block;
218+
position: relative
219+
}
220+
221+
body.sidebar-collapsed #sidebar > .selected-node > .cube {
222+
width: 50px;
223+
background: #eee;
224+
height: 45px;
225+
line-height: 45px;
226+
text-align: center;
227+
font-size: 15px;
228+
color: #2494F2;
229+
cursor: pointer
230+
}
231+
232+
body.sidebar-collapsed #sidebar > .selected-node:hover > .info {
233+
display: block;
234+
position: absolute;
235+
left: 50px;
236+
top: 0;
237+
padding-left: 10px;
238+
width: 169px;
239+
height: 45px;
240+
line-height: 45px;
241+
background: #fff;
242+
border-right: 1px solid #2494F2;
243+
border-bottom: 1px solid #2494F2;
244+
font-size: 13px
245+
}
246+
247+
body.sidebar-collapsed #sidebar > .selected-node:hover > .cube {
248+
border-bottom: 1px solid #2494F2
249+
}
250+
251+
.ui-itemlist {
252+
margin: 0;
253+
padding: 0;
254+
list-style: none
255+
}
256+
257+
.ui-itemlist > li {
258+
border-bottom: 1px solid #eee;
259+
position: relative;
260+
transition: all .2s ease
261+
}
262+
263+
.ui-itemlist > li > i {
264+
opacity: 0;
265+
position: absolute;
266+
left: 12px;
267+
top: 9px;
268+
transition: all .2s ease;
269+
font-size: 13px;
270+
z-index: 1
271+
}
272+
273+
.ui-itemlist > li > a {
274+
display: block;
275+
position: relative;
276+
padding: 8px 12px;
277+
transition: all .2s ease;
278+
font-size: 13px;
279+
color: #2083D6
280+
}
281+
282+
.ui-itemlist > li:hover {
283+
background: #fafafa
284+
}
285+
286+
.ui-itemlist > li.selected {
287+
background: #eee
288+
}
289+
290+
.ui-itemlist > li.selected:hover {
291+
background: #f4f4f4
292+
}
293+
294+
.ui-itemlist > li.selected > a,
295+
.ui-itemlist > li:hover > a {
296+
margin-left: 12px
297+
}
298+
299+
.ui-itemlist > li.selected > i,
300+
.ui-itemlist > li:hover > i {
301+
opacity: 1
302+
}

0 commit comments

Comments
 (0)