---迁移任务分类

This commit is contained in:
wu ming 2017-02-13 15:50:37 +08:00
parent fdb373e0a9
commit b2e2df347b
12 changed files with 724 additions and 526 deletions

View File

@ -28,6 +28,8 @@ declare module Developer {
data: Array<any>;
paramOptions: OptionsParams;
transferTasks: Array<any>;
doneTask: Array<any>;
runningTask: Array<any>;
constructor();
protected getDataModel(paramOptions: any): any;
initParamOptions(): void;

View File

@ -8,4 +8,5 @@ declare module Kubernetes {
var Status: ng.IModule;
var TaskEdit: ng.IModule;
var LoadMask: ng.IModule;
var TaskRecordEdit: ng.IModule;
}

View File

@ -271,484 +271,20 @@ legend {
left: 47.5%;
top: 48%;
}
.environment-row a {
color: black;
}
.environment-row .panel {
min-width: 255px;
min-height: 160px;
}
.environment-row .panel-group {
margin-left: 10px;
margin-right: 10px;
}
.environment-row .panel-title > a:before {
display: none;
}
.environment-rows {
/*
background-color: rgb(238, 238, 238);
*/
padding-top: 5px;
vertical-align: top;
}
.environment-name-block {
width: 200px;
}
.environment-name-block,
.environment-deploy-block {
background: white;
-moz-border-radius: 10px;
border-radius: 10px;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 20px;
padding-right: 20px;
margin-top: 10px;
margin-bottom: 10px;
margin-left: 20px;
margin-right: 20px;
}
.environment-name-block {
padding-top: 0px;
}
.environment-block {
vertical-align: top;
}
.environment-deploy-block {
border: 1px dashed;
border-color: silver;
}
.environment-deploy-version-and-pods {
padding-bottom: 5px;
}
.project-dashboard .page-header-row {
background: white;
margin-left: -20px;
margin-right: -20px;
margin-top: -20px;
border-bottom: 1px solid #d1d1d1;
margin-bottom: 13px;
padding-bottom: 7px;
}
.project-dashboard .card-pf-title {
margin-right: 1em;
}
.project-dashboard .no-border {
border: none;
margin-bottom: 0;
}
.project-dashboard .no-top-margin {
margin-top: 0;
}
.project-dashboard .full-card-width {
margin-left: -20px;
margin-right: -20px;
}
.project-dashboard .card-pf.pipeline .panel-group {
border-width: 0;
}
.project-dashboard .card-pf.pipeline .panel-group .panel {
box-shadow: none;
}
.project-dashboard .card-pf.pipeline .panel-group .panel.panel-default {
border-width: 0;
border-top-width: 1px;
}
.project-dashboard .card-pf.pipeline .panel-group .panel.panel-default .log-panel {
border: 1px solid #d4d4d4;
}
.filter-header .btn,
.filter-header form {
margin-top: 1.05em;
margin-bottom: 1em;
}
.log-window {
border-top: 1px solid #d4d4d4;
overflow: auto;
}
.log-window-inner * {
font-family: "DroidSansMonoRegular", monospace;
line-height: 13px;
}
.log-panel {
position: static;
height: 100%;
width: 100%;
overflow: auto;
border: none;
padding: 3px;
}
.log-panel-inner * {
font-family: "DroidSansMonoRegular", monospace;
line-height: 13px;
}
.project-selector {
margin-top: 10px;
margin-bottom: 10px;
list-style-type: none;
}
.project-selector a,
.project-selector a:hover {
color: #fff;
text-decoration: none;
font-size: 13px;
line-height: 21px;
}
/* 样式重置 */
body,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
p,
blockquote,
dl,
dt,
dd,
ul,
ol,
li,
pre,
form,
fieldset,
legend,
button,
input,
textarea,
th,
td {
margin: 0;
padding: 0;
}
body,
table,
input,
textarea,
select,
button {
font-family: "微软雅黑", "宋体";
font-size: 12px;
line-height: 1.5;
background: #fff;
}
div,
img,
tr,
td,
table {
border: 0;
}
table,
tr,
td {
border: 0;
cellspacing: 0;
cellpadding: 0;
}
ol,
ul,
li {
list-style-type: none;
}
a:link,
a:visited {
color: #7f7f7f;
text-decoration: none;
}
a:hover,
a:active {
color: #000;
}
.fl {
float: left;
}
.fr {
.system-info-danger-red-char {
float: right;
}
.cl {
clear: both;
overflow: hidden;
}
/* 数据页面 */
.data_container {
width: 100%;
margin: 0 auto;
}
.data_heaer {
height: 66px;
width: 100%;
background-color: #3499db;
text-align: center;
}
.data_heaer h2 {
font-size: 30px;
font-weight: 300;
color: #fff;
line-height: 66px;
}
.data_content {
width: 1280px;
height: 838px;
margin: 0 auto;
background-color: #fff;
border: 1px solid #e0dede;
border-top: none;
}
.data_leftside {
width: 611px;
border-right: 1px solid #e0dede;
}
.data_h3 {
width: 100%;
text-align: center;
height: 50px;
font-size: 18px;
color: #444;
line-height: 50px;
}
.data_leftside_files {
border-right: 1px solid #e0dede;
border-bottom: 1px solid #e0dede;
height: 710px;
overflow: auto;
}
.data_leftside_files input {
margin-top: 15px;
width: 15px;
height: 15px;
}
.data_leftside_files li {
height: 40px;
line-height: 40px;
border-bottom: 1px solid #e0dede;
padding: 0 10px;
}
.data_leftside_files li.data_title {
width: 210px;
height: 36px;
line-height: 36px;
text-align: center;
background-color: #e9f3fb;
border: none;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
}
.date_label {
display: block;
width: 168px;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
}
.data_leftside_shu {
border-right: none;
}
.data_leftside_shu li {
border-bottom: none;
}
.data_conbar {
width: 149px;
height: 834px;
border-right: 1px solid #e0dede;
border-left: 1px solid #e0dede;
}
.date_btns {
width: 260px;
margin: 20px auto;
}
.date_btns_w {
width: 390px;
}
.date_btns button {
margin: 10px 20px;
}
.data_btn {
border: none;
width: 108px;
height: 35px;
line-height: 35px;
text-align: center;
background-color: #3499db;
color: #fff;
font-size: 14px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
}
.data_btn:hover {
background-color: #2989da;
}
.data_rightside {
width: 667px;
}
.data_rightside_w {
width: 407px;
}
.data_leftside_files li.data_title_w {
width: 184px;
}
.date_label_w {
width: 150px;
}
.data_leftside_shu li {
border-bottom: none;
}
a.data_file_btn {
display: block;
position: relative;
width: 108px;
height: 35px;
margin: 15px auto;
line-height: 35px;
font-size: 14px;
color: #fff;
text-align: center;
background-color: #79b4e7;
background-image: -webkit-linear-gradient(#79b4e7, #1377cf);
background-image: linear-gradient(#79b4e7, #1377cf);
border-color: #076bc2;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
vertical-align: middle;
cursor: pointer;
margin: 0 10px;
}
a:hover.data_file_btn {
background-color: #076bc2;
background-image: -webkit-linear-gradient(#79b4e7, #076bc2);
background-image: linear-gradient(#79b4e7, #076bc2);
border-color: #076bc2;
}
.data_file_btn input {
position: absolute;
left: 0px;
opacity: 0;
filter: alpha(opacity=0);
width: 108px;
height: 35px;
}
.data_conbox {
width: 407px;
height: 709px;
border-top: 1px solid #e0dede;
border-bottom: 1px solid #e0dede;
overflow: auto;
}
.data_con_title {
width: 49.8%;
height: 36px;
line-height: 36px;
text-align: center;
background-color: #e9f3fb;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
}
.data_con_line {
border-right: 1px solid #e0dede;
}
.data_con_li {
width: 49.8%;
height: 36px;
line-height: 36px;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
border-bottom: 1px solid #e0dede;
}
.mt15 {
margin-top: 15px;
}
#file-uploads {
opacity: 0;
position: absolute;
z-index: 10;
width: 118px;
height: 35px;
}
/* 树形结构 */
.data_rightside_tree {
width: 259px;
height: 709px;
border-right: 1px solid #e0dede;
border-top: 1px solid #e0dede;
border-bottom: 1px solid #e0dede;
overflow: auto;
}
.tree {
min-height: 20px;
padding: 15px;
padding-left: 30px;
border-bottom: 1px dashed #ccc;
}
.tree li {
list-style-type: none;
margin: 0;
padding: 10px 5px 0 20px;
position: relative;
}
.tree li::before,
.tree li::after {
content: '';
left: -30px;
position: absolute;
right: auto;
}
.tree li::before {
border-left: 1px solid #999;
bottom: 50px;
height: 100%;
top: 0;
width: 0px;
}
.tree li::after {
border-top: 1px solid #999;
height: 20px;
top: 25px;
width: 35px;
}
.tree li p {
display: inline-block;
padding: 3px 10px;
border: 1px solid #fff;
margin-left: -15px;
width: 150px;
}
.tree li.parent_li > p {
cursor: pointer;
}
.tree > ul > li::before,
.tree > ul > li::after {
border: 0;
}
.tree li:last-child::before {
width: 52%;
height: 30px;
border: 0px;
background-color: #FFFFFF;
font-family: '微软雅黑', '宋体';
font-size: 16px;
line-height: 1.5;
color: #cc0000;
}
.icon-plus-sign {
margin-left: -15px;
background: url(../img/icons1.gif) -5px 10px no-repeat;
}
.icon-minus-sign {
margin-left: -15px;
background: url(../img/icons2.gif) -6px 9px no-repeat;
.system-info-danger-input {
float: left;
height: 32px;
}
/* This is for the 'Overview' page with all the rows of boxes */
@ -1098,6 +634,494 @@ kubernetes-container-terminal .terminal-actions {
overflow-x: hidden;
}
.environment-row a {
color: black;
}
.environment-row .panel {
min-width: 255px;
min-height: 160px;
}
.environment-row .panel-group {
margin-left: 10px;
margin-right: 10px;
}
.environment-row .panel-title > a:before {
display: none;
}
.environment-rows {
/*
background-color: rgb(238, 238, 238);
*/
padding-top: 5px;
vertical-align: top;
}
.environment-name-block {
width: 200px;
}
.environment-name-block,
.environment-deploy-block {
background: white;
-moz-border-radius: 10px;
border-radius: 10px;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 20px;
padding-right: 20px;
margin-top: 10px;
margin-bottom: 10px;
margin-left: 20px;
margin-right: 20px;
}
.environment-name-block {
padding-top: 0px;
}
.environment-block {
vertical-align: top;
}
.environment-deploy-block {
border: 1px dashed;
border-color: silver;
}
.environment-deploy-version-and-pods {
padding-bottom: 5px;
}
.project-dashboard .page-header-row {
background: white;
margin-left: -20px;
margin-right: -20px;
margin-top: -20px;
border-bottom: 1px solid #d1d1d1;
margin-bottom: 13px;
padding-bottom: 7px;
}
.project-dashboard .card-pf-title {
margin-right: 1em;
}
.project-dashboard .no-border {
border: none;
margin-bottom: 0;
}
.project-dashboard .no-top-margin {
margin-top: 0;
}
.project-dashboard .full-card-width {
margin-left: -20px;
margin-right: -20px;
}
.project-dashboard .card-pf.pipeline .panel-group {
border-width: 0;
}
.project-dashboard .card-pf.pipeline .panel-group .panel {
box-shadow: none;
}
.project-dashboard .card-pf.pipeline .panel-group .panel.panel-default {
border-width: 0;
border-top-width: 1px;
}
.project-dashboard .card-pf.pipeline .panel-group .panel.panel-default .log-panel {
border: 1px solid #d4d4d4;
}
.filter-header .btn,
.filter-header form {
margin-top: 1.05em;
margin-bottom: 1em;
}
.log-window {
border-top: 1px solid #d4d4d4;
overflow: auto;
}
.log-window-inner * {
font-family: "DroidSansMonoRegular", monospace;
line-height: 13px;
}
.log-panel {
position: static;
height: 100%;
width: 100%;
overflow: auto;
border: none;
padding: 3px;
}
.log-panel-inner * {
font-family: "DroidSansMonoRegular", monospace;
line-height: 13px;
}
.project-selector {
margin-top: 10px;
margin-bottom: 10px;
list-style-type: none;
}
.project-selector a,
.project-selector a:hover {
color: #fff;
text-decoration: none;
font-size: 13px;
line-height: 21px;
}
/* 样式重置 */
body,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
p,
blockquote,
dl,
dt,
dd,
ul,
ol,
li,
pre,
form,
fieldset,
legend,
button,
input,
textarea,
th,
td {
margin: 0;
padding: 0;
}
body,
table,
input,
textarea,
select,
button {
font-family: "微软雅黑", "宋体";
font-size: 12px;
line-height: 1.5;
background: #fff;
}
div,
img,
tr,
td,
table {
border: 0;
}
table,
tr,
td {
border: 0;
cellspacing: 0;
cellpadding: 0;
}
ol,
ul,
li {
list-style-type: none;
}
a:link,
a:visited {
color: #7f7f7f;
text-decoration: none;
}
a:hover,
a:active {
color: #000;
}
.fl {
float: left;
}
.data_manager_button {
width: 280px;
height: 30px;
border: 0px;
position: fixed;
float: right;
left: 13%;
top: 95%;
}
.fr {
float: right;
}
.cl {
clear: both;
overflow: hidden;
}
/* 数据页面 */
.data_container {
width: 100%;
margin: 0 auto;
}
.data_heaer {
height: 66px;
width: 100%;
background-color: #3499db;
text-align: center;
}
.data_heaer h2 {
font-size: 30px;
font-weight: 300;
color: #fff;
line-height: 66px;
}
.data_content {
width: 1280px;
height: 838px;
margin: 0 auto;
background-color: #fff;
border: 1px solid #e0dede;
border-top: none;
}
.data_leftside {
width: 611px;
border-right: 1px solid #e0dede;
}
.data_h3 {
width: 100%;
text-align: center;
height: 50px;
font-size: 18px;
color: #444;
line-height: 50px;
}
.data_leftside_files {
border-right: 1px solid #e0dede;
border-bottom: 1px solid #e0dede;
height: 710px;
overflow: auto;
}
.data_leftside_files input {
margin-top: 15px;
width: 15px;
height: 15px;
}
.data_leftside_files li {
height: 40px;
line-height: 40px;
border-bottom: 1px solid #e0dede;
padding: 0 10px;
}
.data_leftside_files li.data_title {
width: 210px;
height: 36px;
line-height: 36px;
text-align: center;
background-color: #e9f3fb;
border: none;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
}
.date_label {
display: block;
width: 168px;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
}
.data_leftside_shu {
border-right: none;
}
.data_leftside_shu li {
border-bottom: none;
}
.data_conbar {
width: 149px;
height: 834px;
border-right: 1px solid #e0dede;
border-left: 1px solid #e0dede;
}
.date_btns {
width: 260px;
margin: 20px auto;
}
.date_btns_w {
width: 390px;
}
.date_btns button {
margin: 10px 20px;
}
.data_btn {
border: none;
width: 108px;
height: 35px;
line-height: 35px;
text-align: center;
background-color: #3499db;
color: #fff;
font-size: 14px;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
}
.data_btn:hover {
background-color: #2989da;
}
.data_rightside {
width: 667px;
}
.data_rightside_w {
width: 407px;
}
.data_leftside_files li.data_title_w {
width: 184px;
}
.date_label_w {
width: 150px;
}
.data_leftside_shu li {
border-bottom: none;
}
a.data_file_btn {
display: block;
position: relative;
width: 108px;
height: 35px;
margin: 15px auto;
line-height: 35px;
font-size: 14px;
color: #fff;
text-align: center;
background-color: #79b4e7;
background-image: -webkit-linear-gradient(#79b4e7, #1377cf);
background-image: linear-gradient(#79b4e7, #1377cf);
border-color: #076bc2;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
-o-border-radius: 5px;
border-radius: 5px;
vertical-align: middle;
cursor: pointer;
margin: 0 10px;
}
a:hover.data_file_btn {
background-color: #076bc2;
background-image: -webkit-linear-gradient(#79b4e7, #076bc2);
background-image: linear-gradient(#79b4e7, #076bc2);
border-color: #076bc2;
}
.data_file_btn input {
position: absolute;
left: 0px;
opacity: 0;
filter: alpha(opacity=0);
width: 108px;
height: 35px;
}
.data_conbox {
width: 407px;
height: 709px;
border-top: 1px solid #e0dede;
border-bottom: 1px solid #e0dede;
overflow: auto;
}
.data_con_title {
width: 49.8%;
height: 36px;
line-height: 36px;
text-align: center;
background-color: #e9f3fb;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
}
.data_con_line {
border-right: 1px solid #e0dede;
}
.data_con_li {
width: 49.8%;
height: 36px;
line-height: 36px;
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
border-bottom: 1px solid #e0dede;
}
.mt15 {
margin-top: 15px;
}
#file-uploads {
opacity: 0;
position: absolute;
z-index: 10;
width: 118px;
height: 35px;
}
/* 树形结构 */
.data_rightside_tree {
width: 259px;
height: 709px;
border-right: 1px solid #e0dede;
border-top: 1px solid #e0dede;
border-bottom: 1px solid #e0dede;
overflow: auto;
}
.tree {
min-height: 20px;
padding: 15px;
padding-left: 30px;
border-bottom: 1px dashed #ccc;
}
.tree li {
list-style-type: none;
margin: 0;
padding: 10px 5px 0 20px;
position: relative;
}
.tree li::before,
.tree li::after {
content: '';
left: -30px;
position: absolute;
right: auto;
}
.tree li::before {
border-left: 1px solid #999;
bottom: 50px;
height: 100%;
top: 0;
width: 0px;
}
.tree li::after {
border-top: 1px solid #999;
height: 20px;
top: 25px;
width: 35px;
}
.tree li p {
display: inline-block;
padding: 3px 10px;
border: 1px solid #fff;
margin-left: -15px;
width: 150px;
}
.tree li.parent_li > p {
cursor: pointer;
}
.tree > ul > li::before,
.tree > ul > li::after {
border: 0;
}
.tree li:last-child::before {
height: 30px;
}
.icon-plus-sign {
margin-left: -15px;
background: url(../img/icons1.gif) -5px 10px no-repeat;
}
.icon-minus-sign {
margin-left: -15px;
background: url(../img/icons2.gif) -6px 9px no-repeat;
}
.layout-pf.layout-pf-fixed .container-pf-nav-pf-vertical {
margin-left: 170px;
}

File diff suppressed because one or more lines are too long

View File

@ -248,8 +248,8 @@ gulp.task('connect', ['watch'], function() {
targetPath: '/hawtio/git'
}, {
proto: "http",
port: "8080",
hostname: "192.168.0.181",
port: "8088",
hostname: "192.168.0.110",
path: '/java/console/api',
targetPath: "/"
}];

View File

@ -6,10 +6,10 @@
<div hawtio-tabs></div>
</div>
<div class="container-content sj_fluid">
<div class="row align-center mb10" ng-hide="model.transferTasks.length">
<div class="row align-center mb10" ng-hide="flag">
<p class="alert alert-info">当前没有可以查看的任务列表!</p>
</div>
<div class="row mb10" ng-show="model.transferTasks.length" >
<div class="row mb10" ng-show="flag" >
<table class="table table-bordered table-striped sj_content_table" hawtio-simple-table="tableConfig" />
</div>
</div>

View File

@ -46,18 +46,18 @@ module Developer{
}]
},
{
href: UrlHelpers.join(context,"Overview/","task"),
href: UrlHelpers.join(context,"Overview/","task/done"),
label: "任务管理",
title: "任务查看",
items: [{
href: UrlHelpers.join(context,"Overview","hot/data-type/all"),
label: "全部",
title: "全部数据"
href: UrlHelpers.join(context,"Overview","task/done"),
label: "已完成的任务",
title: "已完成的迁移任务"
},
{
href: UrlHelpers.join(context,"Overview/","hot/data-type/social-security"),
label: "社保",
title: "社保数据"
href: UrlHelpers.join(context,"Overview/","task/running"),
label: "正在迁移的任务",
title: "正在迁移的任务"
}]
},
]);

View File

@ -147,6 +147,8 @@ module Developer{
public data:Array<any> = [];
public paramOptions: OptionsParams = new OptionsParams();
public transferTasks: Array<any> = [];
public doneTask: Array<any> = [];
public runningTask: Array<any> = [];
constructor(){
this.updateModel();
@ -200,8 +202,10 @@ module Developer{
public startIntervalTask($interval, $http){
var result;
var timer = $interval(() => {
this.doneTask = [];
this.runningTask = [];
$.ajax({
async: false,
async: true,
type : "POST",
url : "/java/console/api/task/transfer/list",
success : function(data) {
@ -211,6 +215,12 @@ module Developer{
}
});
this.transferTasks = formatTask(result);
angular.forEach(this.transferTasks, (task) => {
if(task.completeStatus == 2)
this.doneTask.push(task);
else
this.runningTask.push(task);
})
},1500);
timer.then(() =>{
@ -225,6 +235,7 @@ module Developer{
//创建数据模型服务
_module.factory("DataModel", ['$rootScope', '$http', '$interval', '$location', '$resource', ($rootScope, $http, $interval, $location, $resource) => {
var webSocket = new WebSocket('ws://192.168.0.101:9000/java/console/api/transferTask');
var $scope = new DataModelService();
$scope.startIntervalTask($interval, $http);
return $scope;

View File

@ -13,7 +13,8 @@ module Developer {
.when(UrlHelpers.join(context, 'Overview/:type/data-type/all'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/data-type/financial'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/:type/data-type/social-security'), route('workspaces.html', false))
.when(UrlHelpers.join(context, 'Overview/task'), route('fileMigrationTask.html', false))
.when(UrlHelpers.join(context, 'Overview/task/done'), route('fileMigrationTask.html', false))
.when(UrlHelpers.join(context, 'Overview/task/running'), route('fileMigrationTask.html', false))
.otherwise(context);
}]);

View File

@ -7,9 +7,10 @@ module Developer {
export var KubeTaskController = controller("KubeTaskController", ["$scope", "$http", "$location", "$routeParams", "DataModel", "$templateCache", ($scope, $http, $location, $routeParams, DataModel, $templateCache) => {
$scope.model = DataModel;
$scope.subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
init();
$scope.tableConfig = {
data: 'model.transferTasks',
data: $scope.dataString,
showSelectionCheckbox: false,
enableRowClickSelection: false,
multiSelect: true,
@ -50,24 +51,53 @@ module Developer {
displayName: '迁移状态',
cellTemplate: $templateCache.get("taskStatus.html")
},
{
field: "process",
displayName: '迁移进度',
cellTemplate: $templateCache.get("taskProcess.html")
},
{
field: "entity",
displayName: '操作',
cellTemplate: $templateCache.get("taskEdit.html")
cellTemplate: $templateCache.get($scope.template)
}
]};
$scope.$on("deleteRow", (event, data) =>{
Configs.oracleInfoOperate($http, "/java/console/api/task/transfer", Configs.OperateType.DELETE, data, (data, status) =>{
if(status === 200)
console.log("删除成功");
});
});
function init() {
var path = $location.path().split("/");
console.log(path[4]);
switch (path[4]) {
case "done":
if($scope.model.doneTask.length > 0)
$scope.flag = true;
else
$scope.flag = false;
$scope.dataString = 'model.doneTask';
$scope.template = "taskRecordEdit.html";
break;
case "running":
if($scope.model.runningTask.length > 0)
$scope.flag = true;
else
$scope.flag = false;
$scope.dataString = 'model.runningTask';
$scope.template = "taskEdit.html";
break;
default:
if($scope.model.doneTask.length > 0)
$scope.flag = true;
else
$scope.flag = false;
$scope.dataString = 'model.doneTask';
$scope.template = "taskRecordEdit.html";
break;
}
console.log($scope.template);
}
}]);
}

View File

@ -233,6 +233,20 @@
</div>
</div>
</script>
<script type="text/ng-template" id="taskRecordEdit.html">
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Kubernetes.TaskRecordEdit">
<button class="btn sj_btn" style="border:0;background:none;" ng-click="showDeleteOne.open(entity)" ng-disabled="entity.status == 1 || entity.status == 0">
<span class="glyphicon glyphicon-trash"></span>&nbsp;&nbsp;删除
</button>
<div hawtio-confirm-dialog="showDeleteOne.show" title="是否删除任务?" ok-button-text="确认" cancel-button-text="取消" on-cancel="showDeleteOne.onCancelled()" on-ok="showDeleteOne.onOk()">
<div class="dialog-body">
<p>
是否删除:{{entity.name}}-{{entity.systemName}} 记录?
</p>
</div>
</div>
</script>
<!-- 迁移进度条 -->
<script type="text/ng-template" id="taskProcess.html">
<!-- <div style="height:80%;" class="ngCellText progress" ng-init="entity=row.entity"> -->

View File

@ -162,4 +162,26 @@ module Kubernetes {
export var LoadMask = controller('LoadMask', ['$scope', ($scope) => {
}]);
export var TaskRecordEdit = controller('TaskRecordEdit', ['$scope', ($scope) => {
$scope.showDeleteOne = {
show: false,
item: null,
open: (entity) => {
var showDeleteOne = $scope.showDeleteOne;
showDeleteOne.show = true;
showDeleteOne.item = entity;
},
onOk: () => {
var showDeleteOne = $scope.showDeleteOne;
$scope.$emit('deleteRow', showDeleteOne.item);
},
onCancel: ()=>{
var showDeleteOne = $scope.showDeleteOne;
showDeleteOne.show = false;
showDeleteOne.item = null;
}
}
}]);
}