This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cloudstack-primate.git


The following commit(s) were added to refs/heads/master by this push:
     new d6b7c29  src: layout and notification fixes
d6b7c29 is described below

commit d6b7c299534312a5e8eabe2b228342a7289fc6d3
Author: Rohit Yadav <rohit.ya...@shapeblue.com>
AuthorDate: Mon Jun 1 01:01:28 2020 +0530

    src: layout and notification fixes
    
    Signed-off-by: Rohit Yadav <rohit.ya...@shapeblue.com>
---
 src/assets/403.png                    | Bin 28168 -> 39320 bytes
 src/assets/404.png                    | Bin 39320 -> 33621 bytes
 src/assets/500.png                    | Bin 33621 -> 28168 bytes
 src/components/header/ProjectMenu.vue |   2 +-
 src/layouts/ResourceLayout.vue        |   9 ++++++---
 src/utils/request.js                  |  24 +++++++++++++-----------
 src/views/AutogenView.vue             |  14 ++++++++------
 7 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/src/assets/403.png b/src/assets/403.png
index bdb9418..5ce416c 100644
Binary files a/src/assets/403.png and b/src/assets/403.png differ
diff --git a/src/assets/404.png b/src/assets/404.png
index 5ce416c..4720b68 100644
Binary files a/src/assets/404.png and b/src/assets/404.png differ
diff --git a/src/assets/500.png b/src/assets/500.png
index 4720b68..bdb9418 100644
Binary files a/src/assets/500.png and b/src/assets/500.png differ
diff --git a/src/components/header/ProjectMenu.vue 
b/src/components/header/ProjectMenu.vue
index dc3eb35..bddbf3f 100644
--- a/src/components/header/ProjectMenu.vue
+++ b/src/components/header/ProjectMenu.vue
@@ -97,7 +97,7 @@ export default {
 <style lang="less" scoped>
 .project {
   &-select {
-    width: 30vw;
+    width: 40vw;
   }
 
   &-icon {
diff --git a/src/layouts/ResourceLayout.vue b/src/layouts/ResourceLayout.vue
index 4a84f1d..b2aa1e5 100644
--- a/src/layouts/ResourceLayout.vue
+++ b/src/layouts/ResourceLayout.vue
@@ -18,11 +18,11 @@
 <template>
   <div class="page-header-index-wide page-header-wrapper-grid-content-main">
     <a-row :gutter="12">
-      <a-col :md="24" :lg="7" style="margin-bottom: 12px">
+      <a-col :md="24" :lg="device === 'desktop' ? 7 : 8" style="margin-bottom: 
12px">
         <slot name="left">
         </slot>
       </a-col>
-      <a-col :md="24" :lg="17">
+      <a-col :md="24" :lg="device === 'desktop' ? 17 : 16">
         <slot name="right">
         </slot>
       </a-col>
@@ -31,8 +31,11 @@
 </template>
 
 <script>
+import { mixinDevice } from '@/utils/mixin.js'
+
 export default {
-  name: 'ResourceLayout'
+  name: 'ResourceLayout',
+  mixins: [mixinDevice]
 }
 </script>
 
diff --git a/src/utils/request.js b/src/utils/request.js
index 79f55a5..0582ee8 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -21,7 +21,7 @@ import config from '@/config/settings'
 import store from '@/store'
 import { VueAxios } from './axios'
 import notification from 'ant-design-vue/es/notification'
-import { ACCESS_TOKEN, CURRENT_PROJECT } from '@/store/mutation-types'
+import { CURRENT_PROJECT } from '@/store/mutation-types'
 
 const service = axios.create({
   baseURL: config.apiBase,
@@ -32,7 +32,6 @@ const err = (error) => {
   const response = error.response
   if (response) {
     console.log(response)
-    const token = Vue.ls.get(ACCESS_TOKEN)
     if (response.status === 403) {
       const data = response.data
       notification.error({ message: 'Forbidden', description: data.message })
@@ -41,14 +40,16 @@ const err = (error) => {
       if (response.config && response.config.params && 
['listIdps'].includes(response.config.params.command)) {
         return
       }
-      notification.error({ message: 'Unauthorized', description: 'Session 
expired, authorization verification failed' })
-      if (token) {
-        store.dispatch('Logout').then(() => {
-          setTimeout(() => {
-            window.location.reload()
-          }, 1500)
-        })
-      }
+      notification.error({
+        message: 'Unauthorized',
+        description: 'Session expired, authorization verification failed',
+        key: 'http-401'
+      })
+      store.dispatch('Logout').then(() => {
+        setTimeout(() => {
+          window.location.reload()
+        }, 1500)
+      })
     }
     if (response.status === 404) {
       notification.error({ message: 'Not Found', description: 'Resource not 
found' })
@@ -58,7 +59,8 @@ const err = (error) => {
   if (error.isAxiosError && !error.response) {
     notification.warn({
       message: error.message || 'Network Error',
-      description: 'Unable to reach the management server or a browser 
extension may be blocking the network request.'
+      description: 'Unable to reach the management server or a browser 
extension may be blocking the network request.',
+      key: 'network-error'
     })
   }
   return Promise.reject(error)
diff --git a/src/views/AutogenView.vue b/src/views/AutogenView.vue
index 0b34d31..14d7a3a 100644
--- a/src/views/AutogenView.vue
+++ b/src/views/AutogenView.vue
@@ -19,11 +19,11 @@
   <div>
     <a-card class="breadcrumb-card">
       <a-row>
-        <a-col :span="12" style="padding-left: 6px">
+        <a-col :span="device === 'mobile' ? 24 : 12" style="padding-left: 
12px">
           <breadcrumb :resource="resource">
             <a-tooltip placement="bottom" slot="end">
               <template slot="title">
-                {{ "Refresh" }}
+                {{ $t('label.refresh') }}
               </template>
               <a-button
                 style="margin-top: 4px"
@@ -32,13 +32,15 @@
                 size="small"
                 icon="reload"
                 @click="fetchData()">
-                {{ "Refresh" }}
+                {{ $t('label.refresh') }}
               </a-button>
             </a-tooltip>
           </breadcrumb>
         </a-col>
-        <a-col :span="12">
-          <span style="float: right">
+        <a-col
+          :span="device === 'mobile' ? 24 : 12"
+          :style="device !== 'mobile' ? { 'margin-bottom': '-6px' } : { 
'margin-top': '12px', 'margin-bottom': '-6px' }">
+          <span :style="device !== 'mobile' ? { float: 'right' } : {}">
             <action-button
               style="margin-bottom: 5px"
               :loading="loading"
@@ -896,7 +898,7 @@ export default {
 .breadcrumb-card {
   margin-left: -24px;
   margin-right: -24px;
-  margin-top: -16px;
+  margin-top: -18px;
   margin-bottom: 12px;
 }
 

Reply via email to