Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Openstack uifix #361

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions package/Aries/src/functions/Openstack/flavors/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ export default React.createClass({
//console.log(this.state.flavors_list)
},
componentDidMount(){
try{
let table_trlengt = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes.length
}
catch (err){
let tdheight = ReactDOM.findDOMNode(this.refs.Table).scrollHeight
let height_table = (totallength) * tdheight
let totalHeight = document.body.clientHeight
totalHeight -= document.getElementById('header').clientHeight
totalHeight -= document.getElementById('footer').clientHeight
let flavors_nav = ReactDOM.findDOMNode(this.refs.flavors_nav).clientHeight
let flavors_bu = ReactDOM.findDOMNode(this.refs.flavors_bu).clientHeight
totalHeight = totalHeight - flavors_nav - flavors_bu - 110
ReactDOM.findDOMNode(this.refs.Table).style.height = totalHeight + 'px'
return
}
let table_trlengt = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes.length
let totallength = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].childNodes.length
let tdheight = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].scrollHeight
Expand Down
25 changes: 20 additions & 5 deletions package/Aries/src/functions/Openstack/images/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,24 @@ export default React.createClass({
//console.log(this.state.images_list)
},
componentDidMount(){
let table_trlengt = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes.length
let totallength = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].childNodes.length
let tdheight = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].scrollHeight
try {
let table_trlengt = ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes.length
}
catch(err) {
let tdheight = ReactDOM.findDOMNode(this.refs.Table).scrollHeight
let height_table = (totallength) * tdheight
let totalHeight = document.body.clientHeight
totalHeight -= document.getElementById('header').clientHeight
totalHeight -= document.getElementById('footer').clientHeight
let images_nav = ReactDOM.findDOMNode(this.refs.images_nav).clientHeight
let images_bu = ReactDOM.findDOMNode(this.refs.images_bu).clientHeight
totalHeight = totalHeight - images_nav - images_bu - 110
ReactDOM.findDOMNode(this.refs.Table).style.height = totalHeight + 'px'
return
}
let table_trlengt = ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes.length
let totallength = ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes.length
let tdheight = ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes[0].scrollHeight
let height_table = (totallength) * tdheight
let totalwidth = (ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].clientWidth - 17) / table_trlengt
let totalHeight = document.body.clientHeight
Expand All @@ -65,9 +80,9 @@ export default React.createClass({
for (let i=0; i< ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes.length;i++) {
if (i == (table_trlengt - 1)) {
totalwidth = totalwidth + 17
ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes[i].style.width = totalwidth + 'px'
ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes[i].style.width = totalwidth + 'px'
} else {
ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes[i].style.width = totalwidth + 'px'
ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes[i].style.width = totalwidth + 'px'
}
}
}
Expand Down
49 changes: 35 additions & 14 deletions package/Aries/src/functions/Openstack/instances/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {Tabs_List} from './instanses_tabs'

export default React.createClass({
getInitialState: function () {
var self =this;
return {
title_status:'内容加载中',
height_log:'',
Expand All @@ -48,6 +49,7 @@ export default React.createClass({
title: '名称',
order: false,
render: (text, item) => {
self.count_initialization()
return (
<div>
<div>
Expand Down Expand Up @@ -156,9 +158,9 @@ export default React.createClass({
})
},
count_height(){
let table_trlengt = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes.length
let totallength = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].childNodes.length
let tdheight = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].scrollHeight
let table_trlengt = ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes.length
let totallength = ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes.length
let tdheight = ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes[0].scrollHeight
let height_table = (totallength + 1) * tdheight
let totalwidth_t = ReactDOM.findDOMNode(this.refs.instances_bu).clientWidth
//let totalwidth=(ReactDOM.findDOMNode( this.refs.Table).childNodes[1].childNodes[0].clientWidth-32.5)/table_trlengt
Expand All @@ -176,23 +178,41 @@ export default React.createClass({
ReactDOM.findDOMNode(this.refs.SplitPanel).childNodes[0].style.height = totalHeight2 + "px"
ReactDOM.findDOMNode(this.refs.SplitPanel).childNodes[1].style.top = totalHeight2 + "px"
ReactDOM.findDOMNode(this.refs.Table_t).childNodes[0].style.width = totalwidth_t + 'px'
ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].style.height = totalHeight + 'px'
ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].style.height = totalHeight + 'px'
ReactDOM.findDOMNode(this.refs.Tabs_list).childNodes[1].style.height=(totalHeight1-totalHeight2-35)+'px'
if (totalHeight <= height_table) {
for (let i = 0; i < ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes.length; i++) {
for (let i = 0; i < ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes.length; i++) {
if (i == (table_trlengt - 1)) {
totalwidth = totalwidth + 17
ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes[i].style.width = totalwidth + 'px'
ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes[i].style.width = totalwidth + 'px'
} else {
ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes[i].style.width = totalwidth + 'px'
ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes[i].style.width = totalwidth + 'px'
}
}
}
},
count_initialization(){
let table_trlengt = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes.length
let totallength = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].childNodes.length
let tdheight = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].scrollHeight
try {
let table_trlengt = ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes.length
}
catch (err){
let totalHeight = document.body.clientHeight
totalHeight -= document.getElementById('header').clientHeight
totalHeight -= document.getElementById('footer').clientHeight
let instances_nav = ReactDOM.findDOMNode(this.refs.instances_nav).clientHeight
let instances_bu = ReactDOM.findDOMNode(this.refs.instances_bu).clientHeight
let totalHeight1 = totalHeight - 120
totalHeight = totalHeight - instances_nav - instances_bu - 140 - 10
let totalHeight2 = totalHeight + 82
ReactDOM.findDOMNode(this.refs.SplitPanel).style.height = totalHeight1 + "px"
ReactDOM.findDOMNode(this.refs.SplitPanel).childNodes[0].style.height = totalHeight1 + "px"
ReactDOM.findDOMNode(this.refs.SplitPanel).childNodes[1].style.top = totalHeight1 + "px"
ReactDOM.findDOMNode(this.refs.Table).style.height = totalHeight + 'px'
return
}
let table_trlengt = ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes.length
let totallength = ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes.length
let tdheight = ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes[0].scrollHeight
let height_table = (totallength + 1) * tdheight
// let totalwidth=(ReactDOM.findDOMNode( this.refs.Table).childNodes[1].childNodes[0].clientWidth-32.5)/7
let totalwidth_t = ReactDOM.findDOMNode(this.refs.instances_bu).clientWidth
Expand All @@ -209,17 +229,17 @@ export default React.createClass({
ReactDOM.findDOMNode(this.refs.SplitPanel).style.height = totalHeight1 + "px"
ReactDOM.findDOMNode(this.refs.SplitPanel).childNodes[0].style.height = totalHeight1 + "px"
ReactDOM.findDOMNode(this.refs.SplitPanel).childNodes[1].style.top = totalHeight1 + "px"
ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].style.height = totalHeight + 'px'
ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].style.height = totalHeight + 'px'
ReactDOM.findDOMNode(this.refs.Table_t).childNodes[0].style.width = totalwidth_t + 'px'
if (totalHeight <= height_table) {
// ReactDOM.findDOMNode( this.refs.Table_t).childNodes[0].style.width=totalwidth_t+'px'
// ReactDOM.findDOMNode( this.refs.Table).childNodes[1].childNodes[1].style.height=totalHeight+'px'
for (let i = 0; i < ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes.length; i++) {
for (let i = 0; i < ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes.length; i++) {
if (i == (table_trlengt - 1)) {
totalwidth = totalwidth + 17
ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes[i].style.width = totalwidth + 'px'
ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes[i].style.width = totalwidth + 'px'
} else {
ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes[i].style.width = totalwidth + 'px'
ReactDOM.findDOMNode(this.refs.Table).childNodes[0].childNodes[1].childNodes[i].style.width = totalwidth + 'px'
}
}
}
Expand Down Expand Up @@ -353,6 +373,7 @@ export default React.createClass({
}
}
this.count_initialization()

},
handleSplit(){
let hand_height=ReactDOM.findDOMNode(this.refs.SplitPanel).childNodes[2].style.height
Expand Down
16 changes: 15 additions & 1 deletion package/Aries/src/functions/Openstack/volumes/backup.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -382,11 +382,25 @@ export default React.createClass({
},

componentDidMount(){
try{
let table_trlengt = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes.length
}
catch (err){
let tdheight = ReactDOM.findDOMNode(this.refs.Table).scrollHeight
let height_table = (totallength) * tdheight
let totalHeight = document.body.clientHeight
totalHeight -= document.getElementById('header').clientHeight
totalHeight -= document.getElementById('footer').clientHeight
let backup_nav = ReactDOM.findDOMNode(this.refs.backup_nav).clientHeight
let backup_bu = ReactDOM.findDOMNode(this.refs.backup_bu).clientHeight
totalHeight = totalHeight - backup_nav - backup_bu - 120
ReactDOM.findDOMNode(this.refs.Table).style.height = totalHeight + 'px'
return
}
let table_trlengt = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes.length
let totallength = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].childNodes.length
let tdheight = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].scrollHeight
let height_table = (totallength) * tdheight
let totalwidth = (ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].clientWidth - 17) / table_trlengt
let totalHeight = document.body.clientHeight
totalHeight -= document.getElementById('header').clientHeight
totalHeight -= document.getElementById('footer').clientHeight
Expand Down
15 changes: 15 additions & 0 deletions package/Aries/src/functions/Openstack/volumes/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,21 @@ export default React.createClass({
OPEN.volumes_data(this,this.state.select_all)
},
componentDidMount(){
try{
let table_trlengt=ReactDOM.findDOMNode(this.refs.volumes_table).childNodes[1].childNodes[0].childNodes[0].childNodes.length
}
catch (err){
let tdheight = ReactDOM.findDOMNode(this.refs.volumes_table).scrollHeight
let height_table=(totallength)*tdheight
let totalHeight = document.body.clientHeight
totalHeight -= document.getElementById('header').clientHeight
totalHeight -= document.getElementById('footer').clientHeight
let volumes_nav = ReactDOM.findDOMNode(this.refs.volumes_nav).clientHeight
let volumes_bu = ReactDOM.findDOMNode(this.refs.volumes_bu).clientHeight
totalHeight = totalHeight - volumes_nav - volumes_bu - 120
ReactDOM.findDOMNode( this.refs.volumes_table).style.height=totalHeight+'px'
return
}
let table_trlengt=ReactDOM.findDOMNode(this.refs.volumes_table).childNodes[1].childNodes[0].childNodes[0].childNodes.length
let totallength=ReactDOM.findDOMNode( this.refs.volumes_table).childNodes[1].childNodes[1].childNodes.length
let tdheight=ReactDOM.findDOMNode( this.refs.volumes_table).childNodes[1].childNodes[1].scrollHeight
Expand Down
15 changes: 15 additions & 0 deletions package/Aries/src/functions/Openstack/volumes/snapshot.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,21 @@ export default React.createClass({
},

componentDidMount(){
try{
let table_trlengt = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes.length
}
catch (err){
let tdheight = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].scrollHeight
let height_table = (totallength) * tdheight
let totalHeight = document.body.clientHeight
totalHeight -= document.getElementById('header').clientHeight
totalHeight -= document.getElementById('footer').clientHeight
let backup_nav = ReactDOM.findDOMNode(this.refs.backup_nav).clientHeight
let backup_bu = ReactDOM.findDOMNode(this.refs.backup_bu).clientHeight
totalHeight = totalHeight - backup_nav - backup_bu - 120
ReactDOM.findDOMNode(this.refs.Table).style.height = totalHeight + 'px'
return
}
let table_trlengt = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[0].childNodes[0].childNodes.length
let totallength = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].childNodes.length
let tdheight = ReactDOM.findDOMNode(this.refs.Table).childNodes[1].childNodes[1].scrollHeight
Expand Down