From 37fe035fcfe01e2b54c8cab7d2419802b26dd0e3 Mon Sep 17 00:00:00 2001 From: lsglsf Date: Wed, 28 Sep 2016 19:36:18 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=99=9A=E6=8B=9F=E6=9C=BA=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=B1=95=E7=A4=BA=EF=BC=8C=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E7=A3=81=E7=9B=98=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Aries/openstack/service.py | 2 +- Aries/openstack/views.py | 23 ++++++++++++- package/Aries/src/env.js | 2 +- .../functions/Openstack/instances/index.less | 2 +- .../Openstack/instances/instanses_tabs.jsx | 32 ++++++++++++++++--- .../functions/Openstack/volumes/index.less | 2 +- package/Aries/src/index.js | 2 +- package/Aries/webpack.config.js | 4 +-- 8 files changed, 56 insertions(+), 13 deletions(-) diff --git a/Aries/openstack/service.py b/Aries/openstack/service.py index 54b8c65..3feedb2 100644 --- a/Aries/openstack/service.py +++ b/Aries/openstack/service.py @@ -308,7 +308,7 @@ def instances_search(request): sys['image'] = '-' sys['flavor'] = flavorss.show_detail(host['flavor']['id'])['flavor']['name'] sys['created'] = host['created'] - sys['status'] = host['OS-EXT-STS:vm_state'] + sys['status'] = host['status'] for key, value in host['addresses'].items(): for ip in value: for keys, values in ip.items(): diff --git a/Aries/openstack/views.py b/Aries/openstack/views.py index c9e996f..d83faa2 100644 --- a/Aries/openstack/views.py +++ b/Aries/openstack/views.py @@ -83,6 +83,7 @@ def instances(request): login.proid_login() login.token_login() vm_manage = Vm_manage() + volume_s = Volume() if request.method == "GET": imagess = Image() flavorss = Flavor() @@ -107,7 +108,27 @@ def instances(request): sys['image'] = '-' sys['flavor'] = flavorss.show_detail(host['flavor']['id'])['flavor']['name'] sys['created'] = ' '.join( host['created'].split('Z')[0].split('T')) - sys['status'] = host['OS-EXT-STS:vm_state'] + sys['status'] = host['status'] + try: + volumes_list=host['os-extended-volumes:volumes_attached'] + volumes_name_list=[] + for volmes_dict in volumes_list: + volumes_name={} + volumes_details=volume_s.show_detail(volmes_dict['id']) + if volumes_details['volume']['displayName'] == None: + volumes_name['disk_name']=volumes_details['volume']['id'] + else: + volumes_name['disk_name']=volumes_details['volume']['displayName'] + volumes_name['disk_id']=volumes_details['volume']['id'] + volumes_name['size'] = volumes_details['volume']['size'] + volumes_name['voumetype'] = 'ceph' + volumes_name['device']=volumes_details['volume']['attachments'][0]['device'] + volumes_name_list.append(volumes_name) + sys['disk_list']=volumes_name_list + openstack_log.info("虚拟机磁盘:{0}..{1}".format(host['name'],volumes_name_list)) + except Exception,e: + sys['disk_list']=[] + openstack_log.error("虚拟机磁盘:{0}".format(e)) for key, value in host['addresses'].items(): for ip in value: for keys, values in ip.items(): diff --git a/package/Aries/src/env.js b/package/Aries/src/env.js index 2383396..9f9653c 100644 --- a/package/Aries/src/env.js +++ b/package/Aries/src/env.js @@ -23,7 +23,7 @@ if (process.env.NODE_ENV === 'production') { */ // 数据接口基础 URL - env.baseUrl = 'http://172.24.3.64:10010/'; + env.baseUrl = 'http://172.24.3.64:9191/'; // 页面根路径 env.basePath = '/' diff --git a/package/Aries/src/functions/Openstack/instances/index.less b/package/Aries/src/functions/Openstack/instances/index.less index 3ff6d0a..aaffdaa 100644 --- a/package/Aries/src/functions/Openstack/instances/index.less +++ b/package/Aries/src/functions/Openstack/instances/index.less @@ -38,7 +38,7 @@ .ant-btn { border-radius: 1px !important; - padding: 5px 15px ; + padding: 5px 7px !important; } fieldset.test { diff --git a/package/Aries/src/functions/Openstack/instances/instanses_tabs.jsx b/package/Aries/src/functions/Openstack/instances/instanses_tabs.jsx index 89ad3d6..0d279d5 100644 --- a/package/Aries/src/functions/Openstack/instances/instanses_tabs.jsx +++ b/package/Aries/src/functions/Openstack/instances/instanses_tabs.jsx @@ -10,6 +10,7 @@ import {Tabs, TabList, Tab, TabPanel} from 'bfd/Tabs' import {Row, Col} from 'bfd/Layout' import echarts from 'echarts' import {Timeline} from 'antd' +import TextOverflow from 'bfd/TextOverflow' const Host_Timeline = React.createClass({ @@ -141,21 +142,36 @@ const Echarts_s = React.createClass({ const Host_details = React.createClass({ - getInitialState: function () { + getInitialState() { return { - name: this.props.host_desc + column: [{ title: 'ID', order: false, key: 'disk_id'}, + { title: '磁盘名', order: false, key: 'disk_name'}, + { title: '盘符', order: false , key: 'device',}, + { title: '大小', order: false , key: 'size',}, + { title: '类型', order: false , key: 'device',}], } }, data(){ let host_desd = this.props.host_desc[0] - //console.log(host) return host_desd }, render(){ //console.log(this.props.host_desc,'.........aaaa') - //console.log(this.props.host_desc['name']) + const list=[1] + const nav = this.props.host_desc['disk_list'] && this.props.host_desc['disk_list'].map((item,i)=>{ + return ( + + + +

{item['disk_name']}

+
+ + {item['device']} + {item['size']}GB +
+ ) + }) let host_des = this.props.host_desc - return (
{host_des[0]}
@@ -180,6 +196,12 @@ const Host_details = React.createClass({ 已创建: 3小时 + + 磁盘: + +
+ {this.props.host_desc['disk_list'] ? nav : } +
) } diff --git a/package/Aries/src/functions/Openstack/volumes/index.less b/package/Aries/src/functions/Openstack/volumes/index.less index 468ca90..5850eb4 100644 --- a/package/Aries/src/functions/Openstack/volumes/index.less +++ b/package/Aries/src/functions/Openstack/volumes/index.less @@ -11,7 +11,7 @@ .ant-btn { border-radius: 1px !important; - padding: 5px 15px ; + padding: 5px 7px !important; } .DataTableFatherDiv_t { diff --git a/package/Aries/src/index.js b/package/Aries/src/index.js index 5716cc9..aee2fd7 100644 --- a/package/Aries/src/index.js +++ b/package/Aries/src/index.js @@ -37,7 +37,7 @@ function getCookie(name) { //xhr.baseUrl = env.baseUrl + '/' xhr.baseUrl = env.baseUrl xhr.header = { - "X-CSRFToken": getCookie('csrftoken') + //"X-CSRFToken": getCookie('csrftoken') } //xhr.baseUrl = 'http://172.24.3.64:10086/v1' xhr.success = (res, option) => { diff --git a/package/Aries/webpack.config.js b/package/Aries/webpack.config.js index fc10b90..f3dbd58 100644 --- a/package/Aries/webpack.config.js +++ b/package/Aries/webpack.config.js @@ -22,8 +22,8 @@ var config = { filename: '[name]' + (isProduction ? '.[hash]' : '') + '.js', chunkFilename: '[id]' + (isProduction ? '.[hash]' : '') + '.js', //静态资源全路径 - //publicPath: ((isProduction ? env.basePath : '') + '/build/').replace(/\/\//, '/') - publicPath: ((isProduction ? env.basePath : '') + '/static/aries/').replace(/\/\//, '/') + publicPath: ((isProduction ? env.basePath : '') + '/build/').replace(/\/\//, '/') + //publicPath: ((isProduction ? env.basePath : '') + '/static/aries/').replace(/\/\//, '/') }, module: { noParse: [], From 72d3908274a376e5c354bd70972889554517c782 Mon Sep 17 00:00:00 2001 From: lsglsf Date: Wed, 28 Sep 2016 20:52:35 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/Aries/src/env.js | 2 +- package/Aries/src/index.js | 2 +- package/Aries/webpack.config.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package/Aries/src/env.js b/package/Aries/src/env.js index 9f9653c..2383396 100644 --- a/package/Aries/src/env.js +++ b/package/Aries/src/env.js @@ -23,7 +23,7 @@ if (process.env.NODE_ENV === 'production') { */ // 数据接口基础 URL - env.baseUrl = 'http://172.24.3.64:9191/'; + env.baseUrl = 'http://172.24.3.64:10010/'; // 页面根路径 env.basePath = '/' diff --git a/package/Aries/src/index.js b/package/Aries/src/index.js index aee2fd7..5716cc9 100644 --- a/package/Aries/src/index.js +++ b/package/Aries/src/index.js @@ -37,7 +37,7 @@ function getCookie(name) { //xhr.baseUrl = env.baseUrl + '/' xhr.baseUrl = env.baseUrl xhr.header = { - //"X-CSRFToken": getCookie('csrftoken') + "X-CSRFToken": getCookie('csrftoken') } //xhr.baseUrl = 'http://172.24.3.64:10086/v1' xhr.success = (res, option) => { diff --git a/package/Aries/webpack.config.js b/package/Aries/webpack.config.js index f3dbd58..fc10b90 100644 --- a/package/Aries/webpack.config.js +++ b/package/Aries/webpack.config.js @@ -22,8 +22,8 @@ var config = { filename: '[name]' + (isProduction ? '.[hash]' : '') + '.js', chunkFilename: '[id]' + (isProduction ? '.[hash]' : '') + '.js', //静态资源全路径 - publicPath: ((isProduction ? env.basePath : '') + '/build/').replace(/\/\//, '/') - //publicPath: ((isProduction ? env.basePath : '') + '/static/aries/').replace(/\/\//, '/') + //publicPath: ((isProduction ? env.basePath : '') + '/build/').replace(/\/\//, '/') + publicPath: ((isProduction ? env.basePath : '') + '/static/aries/').replace(/\/\//, '/') }, module: { noParse: [], From cba67a2330f0033c32667fced3071659b1a72468 Mon Sep 17 00:00:00 2001 From: LuPan2015 <874325293@qq.com> Date: Thu, 29 Sep 2016 14:18:52 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E5=90=8E=E6=89=BE=E4=B8=8D=E5=88=B0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E9=97=AE=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Aries/hdfs/service.py | 2 +- docker-k8s/k8s_config/sirius-rc.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Aries/hdfs/service.py b/Aries/hdfs/service.py index 732c765..32ef399 100644 --- a/Aries/hdfs/service.py +++ b/Aries/hdfs/service.py @@ -73,7 +73,7 @@ def postshare(request,path): path = os.path.realpath("/%s/%s" %(os.path.sep,path)) space_name = request.GET.get("spaceName","") proxy_link = hashlib.md5("%s%s%s" %(space_name,path,int(time.time()))).hexdigest() - proxy_link = "{0}/{1}/{2}".format(settings.SHARE_PROXY_BASE_URI,"HDFS/ShowShare",proxy_link) + proxy_link = "{0}/{1}/{2}".format(settings.SHARE_PROXY_BASE_URI,"CloudService/HDFS/ShowShare",proxy_link) hdfs_logger.info("proxy_link:{0}".format(proxy_link)) # 设置目录权限 chmod -R 755 space_path/path exitCode,data = share_cmd(space_name,path,"755") diff --git a/docker-k8s/k8s_config/sirius-rc.yaml b/docker-k8s/k8s_config/sirius-rc.yaml index 4099461..44fa8bc 100644 --- a/docker-k8s/k8s_config/sirius-rc.yaml +++ b/docker-k8s/k8s_config/sirius-rc.yaml @@ -12,7 +12,7 @@ spec: spec: containers: - name: sirius - image: docker.baifendian.com/lupan/sirius_lugu:1 + image: docker.baifendian.com/lupan/sirius_lugu:latest ports: - containerPort: 10086 volumeMounts: @@ -29,5 +29,5 @@ spec: name: siriusdownload imagePullSecrets: - name: docker-registry-sys - nodeSelector: - kubernetes.io/hostname: 192.168.49.46 + #nodeSelector: + # kubernetes.io/hostname: 192.168.49.46 From a109bbd1655f6bda597580acf40f6852b98bf059 Mon Sep 17 00:00:00 2001 From: LuPan2015 <874325293@qq.com> Date: Thu, 29 Sep 2016 14:31:50 +0800 Subject: [PATCH 4/4] latest update to 1.0 --- docker-k8s/k8s_config/sirius-rc.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-k8s/k8s_config/sirius-rc.yaml b/docker-k8s/k8s_config/sirius-rc.yaml index 44fa8bc..92a0eff 100644 --- a/docker-k8s/k8s_config/sirius-rc.yaml +++ b/docker-k8s/k8s_config/sirius-rc.yaml @@ -12,7 +12,7 @@ spec: spec: containers: - name: sirius - image: docker.baifendian.com/lupan/sirius_lugu:latest + image: docker.baifendian.com/lupan/sirius_lugu:1.0 ports: - containerPort: 10086 volumeMounts: @@ -21,7 +21,7 @@ spec: - mountPath: /opt/Siurs/download name: siriusdownload imagePullSecrets: - - name: docker-registry-sys + - name: docker-registry-sys volumes: - emptyDir: {} name: siriuslog