You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ro...@apache.org on 2020/07/05 01:51:44 UTC

[cloudstack-primate] branch master updated: autogenview: use pagesize 20 for desktop users, 10 otherwise

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 3cf7d47  autogenview: use pagesize 20 for desktop users, 10 otherwise
3cf7d47 is described below

commit 3cf7d4784375c8fb04724aa1de96e9a106cbc99b
Author: Rohit Yadav <ro...@shapeblue.com>
AuthorDate: Sun Jul 5 07:20:26 2020 +0530

    autogenview: use pagesize 20 for desktop users, 10 otherwise
    
    Fixes #489
    
    Set default page size based on screentype, for FHD/4K displays if device
    type is desktop use pagesize 20; otherwise use default pagesize of 10.
    
    Signed-off-by: Rohit Yadav <ro...@shapeblue.com>
---
 src/locales/en.json       | 2 +-
 src/views/AutogenView.vue | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/locales/en.json b/src/locales/en.json
index a466815..ca73163 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -503,7 +503,7 @@
 "label.character": "Character",
 "label.chassis": "Chassis",
 "label.checksum": "Checksum",
-"label.cidr": "Super CIDR for Guest Networks",
+"label.cidr": "CIDR",
 "label.cidr.account": "CIDR or Account/Security Group",
 "label.cidr.destination.network": "Destination Network CIDR",
 "label.cidr.of.destination.network": "CIDR of destination network",
diff --git a/src/views/AutogenView.vue b/src/views/AutogenView.vue
index 0fb8ffb..f1b5f22 100644
--- a/src/views/AutogenView.vue
+++ b/src/views/AutogenView.vue
@@ -304,8 +304,8 @@
         :current="page"
         :pageSize="pageSize"
         :total="itemCount"
-        :showTotal="total => `Total ${total} items`"
-        :pageSizeOptions="['10', '20', '40', '80', '100', '500']"
+        :showTotal="total => `Showing ${1+((page-1)*pageSize)}-${Math.min(page*pageSize, total)} of ${total} items`"
+        :pageSizeOptions="device === 'desktop' ? ['20', '50', '100', '500'] : ['10', '20', '50', '100', '500']"
         @change="changePage"
         @showSizeChange="changePageSize"
         showSizeChanger
@@ -376,6 +376,9 @@ export default {
     this.form = this.$form.createForm(this)
   },
   mounted () {
+    if (this.device === 'desktop') {
+      this.pageSize = 20
+    }
     this.currentPath = this.$route.fullPath
     this.fetchData()
     if ('projectid' in this.$route.query) {