Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Administrator
pve-manager
Commits
c0e19158
Commit
c0e19158
authored
Nov 16, 2011
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use new LogViewer inside TaskViewer
parent
7ae2cba5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
72 deletions
+41
-72
LogView.js
www/manager/panel/LogView.js
+31
-28
TaskViewer.js
www/manager/window/TaskViewer.js
+10
-44
No files found.
www/manager/panel/LogView.js
View file @
c0e19158
Ext
.
define
(
'
PVE.LogView
'
,
{
Ext
.
define
(
'
PVE.
panel.
LogView
'
,
{
extend
:
'
Ext.panel.Panel
'
,
extend
:
'
Ext.panel.Panel
'
,
alias
:
[
'
widget.pveLogView
'
],
alias
:
[
'
widget.pveLogView
'
],
...
@@ -102,20 +102,14 @@ Ext.define('PVE.LogView', {
...
@@ -102,20 +102,14 @@ Ext.define('PVE.LogView', {
me
.
loadTask
.
delay
(
200
,
me
.
doAttemptLoad
,
me
,
[
start
]);
me
.
loadTask
.
delay
(
200
,
me
.
doAttemptLoad
,
me
,
[
start
]);
},
},
requestUpdate
:
function
(
top
,
force
)
{
initComponent
:
function
()
{
var
me
=
this
;
var
me
=
this
;
if
(
!
me
.
url
)
{
if
(
top
===
undefined
)
{
throw
"
no url specified
"
;
var
target
=
me
.
getTargetEl
();
top
=
target
.
dom
.
scrollTop
;
}
}
me
.
dataCmp
=
Ext
.
create
(
'
Ext.Component
'
,
{
style
:
'
font:normal 11px tahoma, arial, verdana, sans-serif;
'
+
'
line-height:
'
+
me
.
lineHeight
+
'
px; white-space: pre;
'
});
var
requestUpdate
=
function
(
top
,
force
)
{
var
viewStart
=
parseInt
((
top
/
me
.
lineHeight
)
-
1
);
var
viewStart
=
parseInt
((
top
/
me
.
lineHeight
)
-
1
);
if
(
viewStart
<
0
)
{
if
(
viewStart
<
0
)
{
viewStart
=
0
;
viewStart
=
0
;
...
@@ -133,7 +127,20 @@ Ext.define('PVE.LogView', {
...
@@ -133,7 +127,20 @@ Ext.define('PVE.LogView', {
}
}
me
.
attemptLoad
(
line
);
me
.
attemptLoad
(
line
);
};
},
initComponent
:
function
()
{
var
me
=
this
;
if
(
!
me
.
url
)
{
throw
"
no url specified
"
;
}
me
.
dataCmp
=
Ext
.
create
(
'
Ext.Component
'
,
{
style
:
'
font:normal 11px tahoma, arial, verdana, sans-serif;
'
+
'
line-height:
'
+
me
.
lineHeight
+
'
px; white-space: pre;
'
});
var
autoScrollTask
=
{
var
autoScrollTask
=
{
run
:
function
()
{
run
:
function
()
{
...
@@ -141,16 +148,12 @@ Ext.define('PVE.LogView', {
...
@@ -141,16 +148,12 @@ Ext.define('PVE.LogView', {
return
;
return
;
}
}
var
target
=
me
.
getTargetEl
();
var
maxDown
=
me
.
getMaxDown
();
var
dom
=
target
.
dom
;
var
maxDown
=
dom
.
scrollHeight
-
dom
.
clientHeight
-
dom
.
scrollTop
;
if
(
maxDown
>
0
)
{
if
(
maxDown
>
0
)
{
return
;
return
;
}
}
requestUpdate
(
dom
.
scrollTop
,
true
);
me
.
requestUpdate
(
undefined
,
true
);
},
},
interval
:
1000
interval
:
1000
};
};
...
@@ -167,9 +170,9 @@ Ext.define('PVE.LogView', {
...
@@ -167,9 +170,9 @@ Ext.define('PVE.LogView', {
afterrender
:
Ext
.
Function
.
createDelayed
(
function
()
{
afterrender
:
Ext
.
Function
.
createDelayed
(
function
()
{
var
target
=
me
.
getTargetEl
();
var
target
=
me
.
getTargetEl
();
target
.
on
(
'
scroll
'
,
function
(
e
)
{
target
.
on
(
'
scroll
'
,
function
(
e
)
{
requestUpdate
(
target
.
dom
.
scrollTop
);
me
.
requestUpdate
(
);
});
});
requestUpdate
(
0
);
me
.
requestUpdate
(
0
);
},
20
),
},
20
),
show
:
function
()
{
show
:
function
()
{
var
target
=
me
.
getTargetEl
();
var
target
=
me
.
getTargetEl
();
...
...
www/manager/window/TaskViewer.js
View file @
c0e19158
...
@@ -48,18 +48,6 @@ Ext.define('PVE.window.TaskViewer', {
...
@@ -48,18 +48,6 @@ Ext.define('PVE.window.TaskViewer', {
}
}
};
};
var
store
=
Ext
.
create
(
'
Ext.data.Store
'
,
{
model
:
'
pve-string-list
'
,
pageSize
:
200
,
buffered
:
true
,
proxy
:
{
type
:
'
pve
'
,
startParam
:
'
start
'
,
limitParam
:
'
limit
'
,
url
:
"
/api2/json/nodes/
"
+
task
.
node
+
"
/tasks/
"
+
me
.
upid
+
"
/log
"
}
});
var
statstore
=
Ext
.
create
(
'
PVE.data.ObjectStore
'
,
{
var
statstore
=
Ext
.
create
(
'
PVE.data.ObjectStore
'
,
{
url
:
"
/api2/json/nodes/
"
+
task
.
node
+
"
/tasks/
"
+
me
.
upid
+
"
/status
"
,
url
:
"
/api2/json/nodes/
"
+
task
.
node
+
"
/tasks/
"
+
me
.
upid
+
"
/status
"
,
interval
:
1000
,
interval
:
1000
,
...
@@ -75,9 +63,6 @@ Ext.define('PVE.window.TaskViewer', {
...
@@ -75,9 +63,6 @@ Ext.define('PVE.window.TaskViewer', {
method
:
'
DELETE
'
,
method
:
'
DELETE
'
,
failure
:
function
(
response
,
opts
)
{
failure
:
function
(
response
,
opts
)
{
Ext
.
Msg
.
alert
(
'
Error
'
,
response
.
htmlStatus
);
Ext
.
Msg
.
alert
(
'
Error
'
,
response
.
htmlStatus
);
},
callback
:
function
()
{
store
.
load
();
}
}
});
});
};
};
...
@@ -103,12 +88,19 @@ Ext.define('PVE.window.TaskViewer', {
...
@@ -103,12 +88,19 @@ Ext.define('PVE.window.TaskViewer', {
border
:
false
border
:
false
});
});
var
logView
=
Ext
.
create
(
'
PVE.panel.LogView
'
,
{
title
:
'
Output
'
,
tbar
:
[
stop_btn2
],
border
:
false
,
url
:
"
/api2/extjs/nodes/
"
+
task
.
node
+
"
/tasks/
"
+
me
.
upid
+
"
/log
"
});
me
.
mon
(
statstore
,
'
load
'
,
function
()
{
me
.
mon
(
statstore
,
'
load
'
,
function
()
{
var
status
=
statgrid
.
getObjectValue
(
'
status
'
);
var
status
=
statgrid
.
getObjectValue
(
'
status
'
);
store
.
load
();
if
(
status
===
'
stopped
'
)
{
if
(
status
===
'
stopped
'
)
{
logView
.
requestUpdate
(
undefined
,
true
);
logView
.
scrollToEnd
=
false
;
statstore
.
stopUpdate
();
statstore
.
stopUpdate
();
}
}
...
@@ -128,37 +120,11 @@ Ext.define('PVE.window.TaskViewer', {
...
@@ -128,37 +120,11 @@ Ext.define('PVE.window.TaskViewer', {
items
:
[{
items
:
[{
xtype
:
'
tabpanel
'
,
xtype
:
'
tabpanel
'
,
region
:
'
center
'
,
region
:
'
center
'
,
items
:
[
items
:
[
logView
,
statgrid
]
{
title
:
'
Output
'
,
tbar
:
[
stop_btn2
],
border
:
false
,
xtype
:
'
gridpanel
'
,
features
:
[
{
ftype
:
'
selectable
'
}],
store
:
store
,
stateful
:
false
,
verticalScrollerType
:
'
paginggridscroller
'
,
disableSelection
:
true
,
invalidateScrollerOnRefresh
:
false
,
viewConfig
:
{
loadMask
:
false
,
trackOver
:
false
,
stripeRows
:
false
},
hideHeaders
:
true
,
columns
:
[
//{ header: "Line", dataIndex: 'n', width: 50 },
{
header
:
"
Text
"
,
dataIndex
:
'
t
'
,
flex
:
1
}
]
},
statgrid
]
}]
}]
});
});
me
.
callParent
();
me
.
callParent
();
store
.
guaranteeRange
(
0
,
store
.
pageSize
-
1
);
}
}
});
});
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