Browse Source

feat: add rows count in footer

re #946

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/973/head
Pranav C 3 years ago
parent
commit
9dae25d141
  1. 63
      packages/nc-gui/components/project/spreadsheet/components/pagination.vue
  2. 10
      packages/nocodb/src/example/dockerRunMysql.ts
  3. 6
      packages/nocodb/src/lib/utils/NcConfigFactory.ts

63
packages/nc-gui/components/project/spreadsheet/components/pagination.vue

@ -1,32 +1,41 @@
<template>
<v-pagination
v-if="count !== Infinity"
v-model="page"
style="max-width: 100%"
:length="Math.ceil(count / size)"
:total-visible="8"
color="primary lighten-2"
class="nc-pagination"
@input="$emit('input',page)"
/>
<div v-else class="mx-auto d-flex align-center mt-n1 " style="max-width:250px">
<span class="caption" style="white-space: nowrap"> Change page:</span>
<v-text-field
<div class="d-flex align-center">
<v-spacer />
<span v-if="count && count > 1 && count !== Infinity" class="caption ml-2">Total {{ count }} rows found</span>
<v-spacer />
<v-pagination
v-if="count !== Infinity"
v-model="page"
class="ml-1 caption"
:full-width="false"
outlined
dense
hide-details
type="number"
@keydown.enter="$emit('input',page)"
>
<template #append>
<x-icon tooltip="Change page" small icon.class="mt-1" @click="$emit('input',page)">
mdi-keyboard-return
</x-icon>
</template>
</v-text-field>
style="max-width: 100%"
:length="Math.ceil(count / size)"
:total-visible="8"
color="primary lighten-2"
class="nc-pagination"
@input="$emit('input',page)"
/>
<div v-else class="mx-auto d-flex align-center mt-n1 " style="max-width:250px">
<span class="caption" style="white-space: nowrap"> Change page:</span>
<v-text-field
v-model="page"
class="ml-1 caption"
:full-width="false"
outlined
dense
hide-details
type="number"
@keydown.enter="$emit('input',page)"
>
<template #append>
<x-icon tooltip="Change page" small icon.class="mt-1" @click="$emit('input',page)">
mdi-keyboard-return
</x-icon>
</template>
</v-text-field>
</div>
<v-spacer />
<v-spacer />
</div>
</template>

10
packages/nocodb/src/example/dockerRunMysql.ts

@ -16,8 +16,14 @@ server.set('view engine', 'ejs');
const date = new Date();
process.env[
`NC_DB`
] = `mysql2://localhost:3306?u=root&p=password&d=meta_${date.getFullYear()}_${date.getMonth() +
1}_${date.getDate()}`;
] = `mysql2://localhost:3306?u=root&p=password&d=meta_${date.getFullYear()}_${(
date.getMonth() + 1
)
.toString()
.padStart(2, '0')}_${date
.getDate()
.toString()
.padStart(2, '0')}`;
// process.env[`NC_DB`] = `pg://localhost:3306?u=root&p=password&d=mar_24`;
// process.env[`NC_DB`] = `pg://localhost:5432?u=postgres&p=password&d=abcde`;
// process.env[`NC_TRY`] = 'true';

6
packages/nocodb/src/lib/utils/NcConfigFactory.ts

@ -164,8 +164,7 @@ export default class NcConfigFactory implements NcConfig {
password:
url.searchParams.get('p') || url.searchParams.get('password'),
port: +url.port,
user: url.searchParams.get('u') || url.searchParams.get('user'),
timezone: 'utc'
user: url.searchParams.get('u') || url.searchParams.get('user')
},
// pool: {
// min: 1,
@ -561,8 +560,7 @@ export default class NcConfigFactory implements NcConfig {
db: {
client: 'sqlite3',
connection: {
filename: 'noco.db',
timezone: 'utc'
filename: 'noco.db'
}
}
};

Loading…
Cancel
Save