Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
de1fae4d
F
Flowable Engine
项目概览
开发团队
/
Flowable Engine
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Flowable Engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
de1fae4d
编写于
4月 23, 2013
作者:
J
Joram Barrez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Demo ui for refreshed REST API : task pagination cont. + group queries
上级
cb117f1c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
138 addition
and
16 deletion
+138
-16
modules/activiti-webapp-angular/src/main/webapp/app/img/vertical-separator.png
...pp-angular/src/main/webapp/app/img/vertical-separator.png
+0
-0
modules/activiti-webapp-angular/src/main/webapp/app/scripts/app.js
...ctiviti-webapp-angular/src/main/webapp/app/scripts/app.js
+6
-0
modules/activiti-webapp-angular/src/main/webapp/app/scripts/controllers/task.js
...p-angular/src/main/webapp/app/scripts/controllers/task.js
+63
-8
modules/activiti-webapp-angular/src/main/webapp/app/styles/main.css
...tiviti-webapp-angular/src/main/webapp/app/styles/main.css
+49
-7
modules/activiti-webapp-angular/src/main/webapp/app/views/tasks.html
...iviti-webapp-angular/src/main/webapp/app/views/tasks.html
+20
-1
未找到文件。
modules/activiti-webapp-angular/src/main/webapp/app/img/vertical-separator.png
0 → 100644
浏览文件 @
de1fae4d
157 字节
modules/activiti-webapp-angular/src/main/webapp/app/scripts/app.js
浏览文件 @
de1fae4d
'
use strict
'
;
'
use strict
'
;
angular
.
module
(
'
activitiApp
'
,
[
'
ui
'
,
'
filters
'
,
'
ui.bootstrap
'
])
angular
.
module
(
'
activitiApp
'
,
[
'
ui
'
,
'
filters
'
,
'
ui.bootstrap
'
])
// Temporary until we have a login page: always log in with kermit:kermit
.
config
([
'
$httpProvider
'
,
function
(
$httpProvider
)
{
$httpProvider
.
defaults
.
headers
.
common
[
'
Authorization
'
]
=
'
Basic a2VybWl0Omtlcm1pdA==
'
;
}])
.
config
([
'
$routeProvider
'
,
function
(
$routeProvider
)
{
.
config
([
'
$routeProvider
'
,
function
(
$routeProvider
)
{
$routeProvider
$routeProvider
.
when
(
'
/
'
,
{
.
when
(
'
/
'
,
{
...
...
modules/activiti-webapp-angular/src/main/webapp/app/scripts/controllers/task.js
浏览文件 @
de1fae4d
...
@@ -7,8 +7,12 @@ angular.module('activitiApp')
...
@@ -7,8 +7,12 @@ angular.module('activitiApp')
$scope
.
loadingTasks
=
true
;
$scope
.
loadingTasks
=
true
;
$scope
.
pageSize
=
10
;
$scope
.
pageSize
=
10
;
$scope
.
currentPage
=
1
;
$scope
.
currentPage
=
1
;
var
noGroupId
=
'
_activiti_invalid_group
'
;
var
noGroupElement
=
{
'
name
'
:
''
,
'
id
'
:
noGroupId
};
/* Fetch tasks async when controller instantiates */
/*
* Fetch tasks async when controller instantiates
*/
$http
.
get
(
'
http://localhost:8080/activiti-webapp-rest2/service/runtime/tasks
'
).
$http
.
get
(
'
http://localhost:8080/activiti-webapp-rest2/service/runtime/tasks
'
).
success
(
function
(
data
,
status
,
headers
,
config
)
{
success
(
function
(
data
,
status
,
headers
,
config
)
{
showTasks
(
data
);
showTasks
(
data
);
...
@@ -18,17 +22,48 @@ angular.module('activitiApp')
...
@@ -18,17 +22,48 @@ angular.module('activitiApp')
$scope
.
loadingTasks
=
false
;
$scope
.
loadingTasks
=
false
;
});
});
/* Task searching */
// TODO: extract this in separate logic later!
// TODO: remove hardcoded kermit dependency
/*
* Fetch user async when controller instantiates
*/
$http
.
get
(
'
http://localhost:8080/activiti-webapp-rest2/service/user/kermit/groups
'
).
success
(
function
(
data
,
status
,
headers
,
config
)
{
var
groups
=
[];
groups
.
push
(
noGroupElement
);
for
(
var
i
=
0
;
i
<
data
.
data
.
length
;
i
++
)
{
if
(
data
.
data
[
i
].
type
==
'
assignment
'
)
{
groups
.
push
(
data
.
data
[
i
]);
}
}
if
(
groups
.
length
>
0
)
{
$scope
.
groups
=
groups
;
$scope
.
candidateGroup
=
groups
[
0
];
}
}).
error
(
function
(
data
,
status
,
headers
,
config
)
{
console
.
log
(
'
Couldn
\'
t fetch user groups :
'
+
status
);
});
/*
* Task searching
*/
$scope
.
search
=
function
()
{
$scope
.
search
=
function
()
{
executeSearch
();
executeSearch
();
};
};
/* Task pagination */
/*
* Task pagination
*/
$scope
.
switchPage
=
function
(
page
)
{
$scope
.
switchPage
=
function
(
page
)
{
executeSearch
(
page
);
executeSearch
(
page
);
};
};
/** Builds the URL */
/**
* Builds the URL
*/
var
createUrl
=
function
(
page
)
{
var
createUrl
=
function
(
page
)
{
var
url
=
encodeURI
(
"
http://localhost:8080/activiti-webapp-rest2/service/runtime/tasks?size=
"
+
$scope
.
pageSize
);
var
url
=
encodeURI
(
"
http://localhost:8080/activiti-webapp-rest2/service/runtime/tasks?size=
"
+
$scope
.
pageSize
);
...
@@ -44,12 +79,19 @@ angular.module('activitiApp')
...
@@ -44,12 +79,19 @@ angular.module('activitiApp')
url
=
url
+
"
&start=0
"
;
url
=
url
+
"
&start=0
"
;
}
}
// Group
if
(
$scope
.
candidateGroup
&&
$scope
.
candidateGroup
.
id
!=
noGroupId
)
{
url
=
url
+
"
&candidateGroup=
"
+
$scope
.
candidateGroup
.
id
;
}
url
=
encodeURI
(
url
);
url
=
encodeURI
(
url
);
console
.
log
(
"
Calling URL
"
+
url
);
console
.
log
(
"
Calling URL
"
+
url
);
return
url
;
return
url
;
};
};
/* Execute the async search */
/*
* Execute the async search
*/
var
executeSearch
=
function
(
page
)
{
var
executeSearch
=
function
(
page
)
{
$scope
.
loadingTasks
=
true
;
$scope
.
loadingTasks
=
true
;
$http
.
get
(
createUrl
(
page
)).
$http
.
get
(
createUrl
(
page
)).
...
@@ -60,24 +102,28 @@ angular.module('activitiApp')
...
@@ -60,24 +102,28 @@ angular.module('activitiApp')
console
.
log
(
'
Couldn
\'
t fetch tasks :
'
+
status
);
console
.
log
(
'
Couldn
\'
t fetch tasks :
'
+
status
);
$scope
.
loadingTasks
=
false
;
$scope
.
loadingTasks
=
false
;
});
});
}
}
;
/* Show the results from a rest call on the screen */
/*
* Show the results from a rest call on the screen
*/
var
showTasks
=
function
(
data
)
{
var
showTasks
=
function
(
data
)
{
// Task data
// Task data
$scope
.
tasks
=
data
.
data
;
$scope
.
tasks
=
data
.
data
;
$scope
.
loadingTasks
=
false
;
$scope
.
loadingTasks
=
false
;
// Pagination
var
total
=
data
.
total
;
var
total
=
data
.
total
;
var
pageSize
=
$scope
.
pageSize
;
var
pageSize
=
$scope
.
pageSize
;
var
realSize
=
data
.
size
;
var
start
=
data
.
start
;
var
start
=
data
.
start
;
console
.
log
(
"
Total =
"
+
total
);
console
.
log
(
"
Total =
"
+
total
);
console
.
log
(
"
size =
"
+
pageSize
);
console
.
log
(
"
size =
"
+
pageSize
);
console
.
log
(
"
Start =
"
+
start
);
console
.
log
(
"
Start =
"
+
start
);
// Pagination
if
(
total
>
pageSize
)
{
if
(
total
>
pageSize
)
{
$scope
.
numberOfPages
=
Math
.
floor
(
total
/
pageSize
);
$scope
.
numberOfPages
=
Math
.
floor
(
total
/
pageSize
);
...
@@ -95,6 +141,15 @@ angular.module('activitiApp')
...
@@ -95,6 +141,15 @@ angular.module('activitiApp')
}
}
// Description above tasks
if
(
total
>
0
)
{
$scope
.
indexOfFirstTask
=
start
+
1
;
$scope
.
indexOfLastTask
=
start
+
realSize
;
$scope
.
totalNumberOfTasks
=
total
;
}
else
{
$scope
.
totalNumberOfTasks
=
0
;
}
console
.
log
(
"
Current page is
"
+
$scope
.
currentPage
);
console
.
log
(
"
Current page is
"
+
$scope
.
currentPage
);
};
};
...
...
modules/activiti-webapp-angular/src/main/webapp/app/styles/main.css
浏览文件 @
de1fae4d
...
@@ -23,6 +23,13 @@
...
@@ -23,6 +23,13 @@
height
:
40px
;
height
:
40px
;
}
}
.panel-header-text
{
color
:
#7c8280
;
font-size
:
smaller
;
display
:
inline-block
;
padding
:
2px
;
}
.task-panel
{
.task-panel
{
border
:
1px
solid
lightgrey
;
border
:
1px
solid
lightgrey
;
border-radius
:
10px
;
border-radius
:
10px
;
...
@@ -41,26 +48,61 @@
...
@@ -41,26 +48,61 @@
#tasks
{
#tasks
{
border-bottom
:
1px
solid
lightgrey
;
border-bottom
:
1px
solid
lightgrey
;
overflow
:
auto
;
overflow
:
auto
;
max-height
:
4
9
0px
;
max-height
:
4
6
0px
;
min-height
:
4
9
0px
;
min-height
:
4
6
0px
;
}
}
.task
{
.task
{
border-bottom
:
1px
solid
transparent
;
border-top
:
1px
solid
transparent
;
cursor
:
pointer
;
cursor
:
pointer
;
height
:
2
0px
;
height
:
3
0px
;
line-height
:
2
0px
;
line-height
:
3
0px
;
padding
:
10px
;
padding
:
10px
;
}
}
.task
:hover
{
.task
:hover
{
background-color
:
#C3D9FF
;
background-color
:
#f5f5f5
;
border-bottom
:
1px
solid
lightgrey
;
border-top
:
1px
solid
lightgrey
;
}
}
#task-search
{
#task-search
{
float
:
left
;
margin-left
:
10px
;
margin-left
:
10px
;
margin-top
:
5px
;
}
}
#task-paging
{
#task-paging
{
margin-top
:
5px
;
float
:
right
;
height
:
24px
;
margin
:
7px
15px
0
0
;
width
:
60px
;
width
:
60px
;
}
}
\ No newline at end of file
.task-counts
{
background-color
:
#F0F0F0
;
border-bottom
:
1px
solid
lightgrey
;
color
:
dimgray
;
font-size
:
smaller
;
text-align
:
center
;
}
#task-pagination
li
{
cursor
:
pointer
;
}
#panel-header-section-group
{
background
:
url('../img/vertical-separator.png')
no-repeat
center
left
;
display
:
inline-block
;
float
:
right
;
margin-right
:
10px
;
padding-left
:
10px
;
}
#task-group-select
{
height
:
24px
;
margin-top
:
7px
;
width
:
130px
;
}
modules/activiti-webapp-angular/src/main/webapp/app/views/tasks.html
浏览文件 @
de1fae4d
...
@@ -16,8 +16,18 @@
...
@@ -16,8 +16,18 @@
<option>
100
</option>
<option>
100
</option>
</select>
</select>
<!-- Group selection -->
<div
id=
"panel-header-section-group"
>
<span
class=
"panel-header-text"
>
Group:
</span>
<select
id=
"task-group-select"
ng-model=
"candidateGroup"
ng-options=
"group.name for group in groups"
ng-change=
"search()"
ng-show=
"groups != undefined"
>
</select>
</div>
</div>
</div>
<div
style=
"clear: both;"
></div>
<div
id=
"tasks"
>
<div
id=
"tasks"
>
<img
src=
"img/loading.gif"
ng-show=
"loadingTasks"
>
<img
src=
"img/loading.gif"
ng-show=
"loadingTasks"
>
...
@@ -27,7 +37,16 @@
...
@@ -27,7 +37,16 @@
</div>
</div>
<div
ng-show=
"numberOfPages && numberOfPages > 0"
>
<div
class=
"task-counts"
>
<span
ng-show=
"totalNumberOfTasks > 0"
>
Showing {{indexOfFirstTask}}-{{indexOfLastTask}} of {{totalNumberOfTasks}} tasks
</span>
<span
ng-show=
"totalNumberOfTasks == 0"
>
No tasks found
</span>
</div>
<div
id=
"task-pagination"
ng-show=
"numberOfPages && numberOfPages > 0"
>
<pagination
boundary-links=
"true"
num-pages=
"numberOfPages"
current-page=
"currentPage"
<pagination
boundary-links=
"true"
num-pages=
"numberOfPages"
current-page=
"currentPage"
max-size=
"5"
class=
"pagination-centered"
on-select-page=
"switchPage(page)"
></pagination>
max-size=
"5"
class=
"pagination-centered"
on-select-page=
"switchPage(page)"
></pagination>
</div>
</div>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录