Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
f5a2346e
提交
f5a2346e
authored
3月 11, 2014
作者:
Seven Du
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
show sofia status on portal
上级
f80404c7
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
158 行增加
和
0 行删除
+158
-0
fsportal.js
htdocs/portal/assets/js/fsportal.js
+97
-0
index.html
htdocs/portal/index.html
+61
-0
没有找到文件。
htdocs/portal/assets/js/fsportal.js
浏览文件 @
f5a2346e
...
@@ -218,6 +218,12 @@ App.newUserRoute = Ember.Route.extend({
...
@@ -218,6 +218,12 @@ App.newUserRoute = Ember.Route.extend({
}
}
});
});
App
.
SofiaStatusRoute
=
Ember
.
Route
.
extend
({
setupController
:
function
(
controller
)
{
App
.
sofiaStatusController
.
load
();
}
});
App
.
Router
.
map
(
function
(){
App
.
Router
.
map
(
function
(){
this
.
route
(
"calls"
);
this
.
route
(
"calls"
);
this
.
route
(
"channels"
);
this
.
route
(
"channels"
);
...
@@ -241,6 +247,8 @@ App.Router.map(function(){
...
@@ -241,6 +247,8 @@ App.Router.map(function(){
this
.
route
(
"show"
);
this
.
route
(
"show"
);
this
.
route
(
"users"
);
this
.
route
(
"users"
);
this
.
route
(
"newUser"
);
this
.
route
(
"newUser"
);
this
.
route
(
"sofiaStatus"
);
this
.
route
(
"addGateway"
);
this
.
route
(
"about"
,
{
path
:
"/about"
});
this
.
route
(
"about"
,
{
path
:
"/about"
});
});
});
...
@@ -778,6 +786,95 @@ App.UsersController = Ember.ObjectController.extend({
...
@@ -778,6 +786,95 @@ App.UsersController = Ember.ObjectController.extend({
}
}
});
});
App
.
sofiaStatusController
=
Ember
.
ArrayController
.
create
({
content
:
[],
init
:
function
(){
},
load
:
function
()
{
var
me
=
this
;
$
.
get
(
"/xmlapi/sofia?xmlstatus"
,
function
(
data
){
console
.
log
(
data
);
var
row_count
=
0
;
var
aliases
=
data
.
getElementsByTagName
(
"alias"
);
var
profiles
=
data
.
getElementsByTagName
(
"profile"
);
var
gateways
=
data
.
getElementsByTagName
(
"gateway"
);
me
.
content
.
clear
();
for
(
var
i
=
0
;
i
<
aliases
.
length
;
i
++
)
{
var
row
=
{};
row
.
name
=
aliases
[
i
].
getElementsByTagName
(
"name"
)[
0
].
textContent
;
row
.
type
=
aliases
[
i
].
getElementsByTagName
(
"type"
)[
0
].
textContent
;
row
.
data
=
aliases
[
i
].
getElementsByTagName
(
"data"
)[
0
].
textContent
;
row
.
state
=
aliases
[
i
].
getElementsByTagName
(
"state"
)[
0
].
textContent
;
console
.
log
(
row
)
row_count
++
;
me
.
pushObject
(
row
);
}
for
(
var
i
=
0
;
i
<
profiles
.
length
;
i
++
)
{
var
row
=
{};
row
.
name
=
profiles
[
i
].
getElementsByTagName
(
"name"
)[
0
].
textContent
;
row
.
type
=
profiles
[
i
].
getElementsByTagName
(
"type"
)[
0
].
textContent
;
row
.
data
=
profiles
[
i
].
getElementsByTagName
(
"data"
)[
0
].
textContent
;
row
.
state
=
profiles
[
i
].
getElementsByTagName
(
"state"
)[
0
].
textContent
;
row
.
actions
=
"Start | Stop | Restart | More ..."
;
console
.
log
(
row
)
row_count
++
;
me
.
pushObject
(
row
);
}
for
(
var
i
=
0
;
i
<
gateways
.
length
;
i
++
)
{
var
row
=
{};
row
.
name
=
gateways
[
i
].
getElementsByTagName
(
"name"
)[
0
].
textContent
;
row
.
type
=
gateways
[
i
].
getElementsByTagName
(
"type"
)[
0
].
textContent
;
row
.
data
=
gateways
[
i
].
getElementsByTagName
(
"data"
)[
0
].
textContent
;
row
.
state
=
gateways
[
i
].
getElementsByTagName
(
"state"
)[
0
].
textContent
;
row
.
actions
=
"Reg | UnReg | Delete"
;
console
.
log
(
row
)
row_count
++
;
me
.
pushObject
(
row
);
}
me
.
set
(
'total'
,
row_count
);
});
}
});
App
.
SofiaStatusController
=
Ember
.
ObjectController
.
extend
({
newGatewayButtons
:
[
{
title
:
'Submit'
,
clicked
:
"submit"
},
{
title
:
'Cancel'
,
clicked
:
"cancel"
,
dismiss
:
'modal'
}
],
actions
:
{
//Submit the modal
submit
:
function
()
{
alert
(
"Not implemented"
);
return
false
;
$
.
post
(
"/txtapi/lua?create_gw.lua%20"
+
$
(
"#gateway_name"
).
val
(),
{
success
:
function
()
{
},
error
:
function
(
e
)
{
}
});
// Bootstrap.NM.push('Successfully submitted modal', 'success');
return
Bootstrap
.
ModalManager
.
hide
(
'newUserForm'
);
},
//Cancel the modal, we don't need to hide the model manually because we set {..., dismiss: 'modal'} on the button meta data
cancel
:
function
()
{
Bootstrap
.
ModalManager
.
hide
(
'newUserForm'
);
return
Bootstrap
.
NM
.
push
(
'Modal was cancelled'
,
'info'
);
},
//Show the modal
addGateway
:
function
()
{
return
Bootstrap
.
ModalManager
.
show
(
'newUserForm'
);
}
}
});
// App.initialize();
// App.initialize();
var
global_debug_event
=
false
;
var
global_debug_event
=
false
;
var
global_background_job
=
false
;
var
global_background_job
=
false
;
...
...
htdocs/portal/index.html
浏览文件 @
f5a2346e
...
@@ -92,6 +92,7 @@
...
@@ -92,6 +92,7 @@
<li><a
id=
"menu-calls"
href=
"#calls"
>
Calls
</a></li>
<li><a
id=
"menu-calls"
href=
"#calls"
>
Calls
</a></li>
<li><a
id=
"menu-channels"
href=
"#channels"
>
Channels
</a></li>
<li><a
id=
"menu-channels"
href=
"#channels"
>
Channels
</a></li>
<li><a
href=
"#show"
>
Show
</a></li>
<li><a
href=
"#show"
>
Show
</a></li>
<li><a
href=
"#sofiaStatus"
>
Sofia
</a></li>
<li><a
href=
"#about"
>
About
</a></li>
<li><a
href=
"#about"
>
About
</a></li>
</ul>
</ul>
</nav>
</nav>
...
@@ -640,6 +641,66 @@
...
@@ -640,6 +641,66 @@
<
/div
>
<
/div
>
</script>
</script>
<script
type=
"text/x-handlebars"
data-template-name=
"sofiaStatus"
>
<
div
class
=
"pull-right"
>
{{
#
bs
-
button
type
=
"primary"
clicked
=
"addGateway"
}}
Add
Gateway
{{
/
bs
-
button
}}
<
/div
>
{{
#
bs
-
modal
name
=
"newUserForm"
fade
=
"true"
footerButtonsBinding
=
"addGatewayButtons"
title
=
"Add Gateway"
}}
<
div
class
=
"control-group"
>
<
label
class
=
"control-label"
for
=
"gateway_name"
>
Name
<
/label
>
<
div
class
=
"controls"
>
<
input
type
=
"text"
class
=
"input-xlarge"
name
=
"gateway_name"
value
=
""
>
<
/div
>
<
/div
>
<
div
class
=
"control-group"
>
<
label
class
=
"control-label"
for
=
"gateway_realm"
>
Realm
<
/label
>
<
div
class
=
"controls"
>
<
input
type
=
"text"
class
=
"input-xlarge"
name
=
"gateway_realm"
value
=
""
>
<
/div
>
<
/div
>
<
div
class
=
"control-group"
>
<
label
class
=
"control-label"
for
=
"gateway_name"
>
Username
<
/label
>
<
div
class
=
"controls"
>
<
input
type
=
"text"
class
=
"input-xlarge"
name
=
"gateway_username"
value
=
""
>
<
/div
>
<
/div
>
<
div
class
=
"control-group"
>
<
label
class
=
"control-label"
for
=
"gateway_name"
>
Password
<
/label
>
<
div
class
=
"controls"
>
<
input
type
=
"text"
class
=
"input-xlarge"
name
=
"gateway_password"
value
=
""
>
<
/div
>
<
/div
>
<
div
class
=
"modal-footer"
>
{{
#
bs
-
button
type
=
"primary"
clicked
=
"submit"
}}
Add
{{
/
bs
-
button
}}
{{
#
bs
-
button
clicked
=
"cancel"
}}
Cancel
{{
/
bs
-
button
}}
<
/div
>
{{
/
bs
-
modal
}}
<
h1
>
Sofia
Status
<
/h1
>
<
div
>
<
table
class
=
"table"
>
<
tr
>
<
th
>
Type
<
/th
>
<
th
>
Name
<
/th
>
<
th
>
Data
<
/th
>
<
th
>
State
<
/th
>
<
th
>
Action
<
/th
>
<
/tr
>
{{
#
each
App
.
sofiaStatusController
.
content
}}
<
tr
>
<
td
>
{{
type
}}
<
/td
>
<
td
>
{{
name
}}
<
/td
>
<
td
>
{{
data
}}
<
/td
>
<
td
>
{{
state
}}
<
/td
>
<
td
>
{{
actions
}}
<
/td
>
<
/tr
>
{{
/
each
}}
<
/table
>
<
/div
>
</script>
<script
type=
"text/x-handlebars"
data-template-name=
"calls"
>
<script
type=
"text/x-handlebars"
data-template-name=
"calls"
>
<
div
class
=
"pull-right"
>
<
div
class
=
"pull-right"
>
<
label
><
input
type
=
"checkbox"
id
=
"auto_update_calls"
value
=
"1"
onclick
=
"auto_update_calls();"
>
Auto
Update
<
/label
>
<
label
><
input
type
=
"checkbox"
id
=
"auto_update_calls"
value
=
"1"
onclick
=
"auto_update_calls();"
>
Auto
Update
<
/label
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论