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
0d9e9220
Commit
0d9e9220
authored
Jan 16, 2012
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comp.setLoading() is buggy in ExtJS 4.0.7, so we use el.mask() instead
parent
0f75822f
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
56 additions
and
66 deletions
+56
-66
Utils.js
www/manager/Utils.js
+47
-0
HAConfig.js
www/manager/dc/HAConfig.js
+1
-1
ObjectGrid.js
www/manager/grid/ObjectGrid.js
+1
-26
NetworkView.js
www/manager/node/NetworkView.js
+1
-8
ServiceView.js
www/manager/node/ServiceView.js
+1
-26
Network.js
www/manager/openvz/Network.js
+3
-3
LogView.js
www/manager/panel/LogView.js
+2
-2
No files found.
www/manager/Utils.js
View file @
0d9e9220
...
@@ -739,6 +739,53 @@ Ext.define('PVE.Utils', { statics: {
...
@@ -739,6 +739,53 @@ Ext.define('PVE.Utils', { statics: {
var
nw
=
window
.
open
(
"
?
"
+
url
,
'
_blank
'
,
var
nw
=
window
.
open
(
"
?
"
+
url
,
'
_blank
'
,
"
innerWidth=745,innerheight=427
"
);
"
innerWidth=745,innerheight=427
"
);
nw
.
focus
();
nw
.
focus
();
},
// comp.setLoading() is buggy in ExtJS 4.0.7, so we
// use el.mask() instead
setErrorMask
:
function
(
comp
,
msg
)
{
var
el
=
comp
.
el
;
if
(
!
el
)
{
return
;
}
if
(
!
msg
)
{
el
.
unmask
();
}
else
{
if
(
msg
===
true
)
{
el
.
mask
(
gettext
(
"
Loading...
"
));
}
else
{
el
.
mask
(
msg
);
}
}
},
monStoreErrors
:
function
(
me
,
store
)
{
me
.
mon
(
store
,
'
beforeload
'
,
function
(
s
,
operation
,
eOpts
)
{
if
(
!
me
.
loadCount
)
{
me
.
loadCount
=
0
;
// make sure it is numeric
PVE
.
Utils
.
setErrorMask
(
me
,
true
);
}
});
// only works with 'pve' proxy
me
.
mon
(
store
.
proxy
,
'
afterload
'
,
function
(
proxy
,
request
,
success
)
{
me
.
loadCount
++
;
if
(
success
)
{
PVE
.
Utils
.
setErrorMask
(
me
,
false
);
return
;
}
var
msg
;
var
operation
=
request
.
operation
;
var
error
=
operation
.
getError
();
if
(
error
.
statusText
)
{
msg
=
error
.
statusText
+
'
(
'
+
error
.
status
+
'
)
'
;
}
else
{
msg
=
gettext
(
'
Connection error
'
);
}
PVE
.
Utils
.
setErrorMask
(
me
,
msg
);
});
}
}
}});
}});
...
...
www/manager/dc/HAConfig.js
View file @
0d9e9220
...
@@ -88,7 +88,7 @@ Ext.define('PVE.dc.HAConfig', {
...
@@ -88,7 +88,7 @@ Ext.define('PVE.dc.HAConfig', {
method
:
'
GET
'
,
method
:
'
GET
'
,
failure
:
function
(
response
,
opts
)
{
failure
:
function
(
response
,
opts
)
{
me
.
clusterInfo
=
{};
me
.
clusterInfo
=
{};
me
.
setLoading
(
response
.
htmlStatus
);
PVE
.
Utils
.
setErrorMask
(
me
,
response
.
htmlStatus
);
},
},
success
:
function
(
response
,
opts
)
{
success
:
function
(
response
,
opts
)
{
me
.
clusterInfo
=
getClusterInfo
(
response
.
result
.
data
);
me
.
clusterInfo
=
getClusterInfo
(
response
.
result
.
data
);
...
...
www/manager/grid/ObjectGrid.js
View file @
0d9e9220
...
@@ -86,32 +86,7 @@ Ext.define('PVE.grid.ObjectGrid', {
...
@@ -86,32 +86,7 @@ Ext.define('PVE.grid.ObjectGrid', {
}
}
}));
}));
var
load_count
=
0
;
PVE
.
Utils
.
monStoreErrors
(
me
,
rstore
);
me
.
mon
(
rstore
,
'
beforeload
'
,
function
(
s
,
operation
,
eOpts
)
{
if
(
!
load_count
)
{
me
.
setLoading
(
true
);
}
});
me
.
mon
(
rstore
.
proxy
,
'
afterload
'
,
function
(
proxy
,
request
,
success
)
{
load_count
++
;
me
.
setLoading
(
false
);
if
(
success
)
{
return
;
}
var
msg
;
var
operation
=
request
.
operation
;
var
error
=
operation
.
getError
();
if
(
error
.
statusText
)
{
msg
=
error
.
statusText
+
'
(
'
+
error
.
status
+
'
)
'
;
}
else
{
msg
=
gettext
(
'
Connection error
'
);
}
me
.
setLoading
(
msg
);
});
Ext
.
applyIf
(
me
,
{
Ext
.
applyIf
(
me
,
{
store
:
store
,
store
:
store
,
...
...
www/manager/node/NetworkView.js
View file @
0d9e9220
...
@@ -111,14 +111,7 @@ Ext.define('PVE.node.NetworkView', {
...
@@ -111,14 +111,7 @@ Ext.define('PVE.node.NetworkView', {
del_btn
.
setDisabled
(
!
rec
);
del_btn
.
setDisabled
(
!
rec
);
};
};
me
.
mon
(
rstore
,
'
load
'
,
function
(
s
,
records
,
success
)
{
PVE
.
Utils
.
monStoreErrors
(
me
,
rstore
);
if
(
!
success
)
{
me
.
setLoading
(
"
Data load error
"
);
return
;
}
else
{
me
.
setLoading
(
false
);
}
});
var
render_ports
=
function
(
value
,
metaData
,
record
)
{
var
render_ports
=
function
(
value
,
metaData
,
record
)
{
if
(
value
===
'
bridge
'
)
{
if
(
value
===
'
bridge
'
)
{
...
...
www/manager/node/ServiceView.js
View file @
0d9e9220
...
@@ -107,32 +107,7 @@ Ext.define('PVE.node.ServiceView', {
...
@@ -107,32 +107,7 @@ Ext.define('PVE.node.ServiceView', {
me
.
mon
(
store
,
'
datachanged
'
,
set_button_status
);
me
.
mon
(
store
,
'
datachanged
'
,
set_button_status
);
var
load_count
=
0
;
PVE
.
Utils
.
monStoreErrors
(
me
,
rstore
);
me
.
mon
(
rstore
,
'
beforeload
'
,
function
(
s
,
operation
,
eOpts
)
{
if
(
!
load_count
)
{
me
.
setLoading
(
true
);
}
});
me
.
mon
(
rstore
.
proxy
,
'
afterload
'
,
function
(
proxy
,
request
,
success
)
{
load_count
++
;
me
.
setLoading
(
false
);
if
(
success
)
{
return
;
}
var
msg
;
var
operation
=
request
.
operation
;
var
error
=
operation
.
getError
();
if
(
error
.
statusText
)
{
msg
=
error
.
statusText
+
'
(
'
+
error
.
status
+
'
)
'
;
}
else
{
msg
=
gettext
(
'
Connection error
'
);
}
me
.
setLoading
(
msg
);
});
Ext
.
apply
(
me
,
{
Ext
.
apply
(
me
,
{
store
:
store
,
store
:
store
,
...
...
www/manager/openvz/Network.js
View file @
0d9e9220
...
@@ -178,15 +178,15 @@ Ext.define('PVE.openvz.NetworkView', {
...
@@ -178,15 +178,15 @@ Ext.define('PVE.openvz.NetworkView', {
load
:
function
()
{
load
:
function
()
{
var
me
=
this
;
var
me
=
this
;
me
.
setLoading
(
true
);
PVE
.
Utils
.
setErrorMask
(
me
,
true
);
PVE
.
Utils
.
API2Request
({
PVE
.
Utils
.
API2Request
({
url
:
me
.
url
,
url
:
me
.
url
,
failure
:
function
(
response
,
opts
)
{
failure
:
function
(
response
,
opts
)
{
me
.
setLoading
(
'
Error:
'
+
response
.
htmlStatus
);
PVE
.
Utils
.
setErrorMask
(
me
,
'
Error:
'
+
response
.
htmlStatus
);
},
},
success
:
function
(
response
,
opts
)
{
success
:
function
(
response
,
opts
)
{
me
.
setLoading
(
false
);
PVE
.
Utils
.
setErrorMask
(
me
,
false
);
var
result
=
Ext
.
decode
(
response
.
responseText
);
var
result
=
Ext
.
decode
(
response
.
responseText
);
var
data
=
result
.
data
||
{};
var
data
=
result
.
data
||
{};
me
.
dataCache
=
data
;
me
.
dataCache
=
data
;
...
...
www/manager/panel/LogView.js
View file @
0d9e9220
...
@@ -66,7 +66,7 @@ Ext.define('PVE.panel.LogView', {
...
@@ -66,7 +66,7 @@ Ext.define('PVE.panel.LogView', {
},
},
method
:
'
GET
'
,
method
:
'
GET
'
,
success
:
function
(
response
)
{
success
:
function
(
response
)
{
me
.
setLoading
(
false
);
PVE
.
Utils
.
setErrorMask
(
me
,
false
);
var
list
=
response
.
result
.
data
;
var
list
=
response
.
result
.
data
;
var
total
=
response
.
result
.
total
;
var
total
=
response
.
result
.
total
;
var
first
=
0
,
last
=
0
;
var
first
=
0
,
last
=
0
;
...
@@ -89,7 +89,7 @@ Ext.define('PVE.panel.LogView', {
...
@@ -89,7 +89,7 @@ Ext.define('PVE.panel.LogView', {
},
},
failure
:
function
(
response
)
{
failure
:
function
(
response
)
{
var
msg
=
response
.
htmlStatus
;
var
msg
=
response
.
htmlStatus
;
me
.
setLoading
(
msg
);
PVE
.
Utils
.
setErrorMask
(
me
,
msg
);
}
}
});
});
},
},
...
...
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