feat: admin UI fixes + SAML strategy + dashboard gql
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
persistent-hint
|
||||
:class='cfg.value.hint ? "mb-2" : ""'
|
||||
)
|
||||
v-switch(
|
||||
v-switch.mb-3(
|
||||
v-else-if='cfg.value.type === "boolean"'
|
||||
:key='cfg.key'
|
||||
:label='cfg.value.title'
|
||||
|
@@ -6,68 +6,142 @@
|
||||
v-container(fluid, grid-list-lg)
|
||||
v-layout(row, wrap)
|
||||
v-flex(xs12 md6 lg4 xl3 d-flex)
|
||||
v-card.primary(dark)
|
||||
v-card.primary.dashboard-card(dark)
|
||||
v-card-text
|
||||
v-icon.dashboard-icon insert_drive_file
|
||||
.subheading Pages
|
||||
animated-number.display-1(
|
||||
:value='357'
|
||||
:value='info.pagesTotal'
|
||||
:duration='2000'
|
||||
:formatValue='round'
|
||||
easing='easeOutQuint'
|
||||
)
|
||||
v-flex(xs12 md6 lg4 xl3 d-flex)
|
||||
v-card.indigo.lighten-1(dark)
|
||||
v-card.indigo.lighten-1.dashboard-card(dark)
|
||||
v-card-text
|
||||
v-icon.dashboard-icon person
|
||||
.subheading Users
|
||||
animated-number.display-1(
|
||||
:value='34'
|
||||
:value='info.usersTotal'
|
||||
:duration='2000'
|
||||
:formatValue='round'
|
||||
easing='easeOutQuint'
|
||||
)
|
||||
v-flex(xs12 md6 lg4 xl3 d-flex)
|
||||
v-card.indigo.lighten-2(dark)
|
||||
v-card.indigo.lighten-2.dashboard-card(dark)
|
||||
v-card-text
|
||||
v-icon.dashboard-icon people
|
||||
.subheading Groups
|
||||
animated-number.display-1(
|
||||
:value='5'
|
||||
:value='info.groupsTotal'
|
||||
:duration='2000'
|
||||
:formatValue='round'
|
||||
easing='easeOutQuint'
|
||||
)
|
||||
v-flex(xs12 md6 lg12 xl3 d-flex)
|
||||
v-card.teal.lighten-2(dark)
|
||||
v-card.dashboard-card(
|
||||
:class='isLatestVersion ? "teal lighten-2" : "red lighten-2"'
|
||||
dark
|
||||
)
|
||||
v-btn(fab, absolute, right, top, small, light, to='system')
|
||||
v-icon(v-if='isLatestVersion', color='teal') build
|
||||
v-icon(v-else, color='red darken-4') get_app
|
||||
v-card-text
|
||||
v-icon.dashboard-icon blur_on
|
||||
.subheading Wiki.js 2.0.0
|
||||
.body-2 You are running the latest version.
|
||||
.subheading Wiki.js {{info.currentVersion}}
|
||||
.body-2(v-if='isLatestVersion') You are running the latest version.
|
||||
.body-2(v-else) A new version is available: {{info.latestVersion}}
|
||||
v-flex(xs12)
|
||||
v-card
|
||||
v-card-text ---
|
||||
v-card-title.subheading Recent Pages
|
||||
v-data-table.pb-2(
|
||||
:items='recentPages'
|
||||
hide-actions
|
||||
hide-headers
|
||||
)
|
||||
template(slot='items' slot-scope='props')
|
||||
td(width='20', style='padding-right: 0;'): v-icon insert_drive_file
|
||||
td
|
||||
.body-2.primary--text {{ props.item.title }}
|
||||
.caption.grey--text.text--darken-2 {{ props.item.description }}
|
||||
td.caption /{{ props.item.path }}
|
||||
td.grey--text.text--darken-2(width='250')
|
||||
.caption: strong Updated {{ props.item.updatedAt | moment('from') }}
|
||||
.caption Created {{ props.item.createdAt | moment('calendar') }}
|
||||
v-flex(xs12)
|
||||
v-card
|
||||
v-card-title.subheading Most Popular Pages
|
||||
v-data-table.pb-2(
|
||||
:items='popularPages'
|
||||
hide-actions
|
||||
hide-headers
|
||||
)
|
||||
template(slot='items' slot-scope='props')
|
||||
td(width='20', style='padding-right: 0;'): v-icon insert_drive_file
|
||||
td
|
||||
.body-2.primary--text {{ props.item.title }}
|
||||
.caption.grey--text.text--darken-2 {{ props.item.description }}
|
||||
td.caption /{{ props.item.path }}
|
||||
td.grey--text.text--darken-2(width='250')
|
||||
.caption: strong Updated {{ props.item.updatedAt | moment('from') }}
|
||||
.caption Created {{ props.item.createdAt | moment('calendar') }}
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AnimatedNumber from 'animated-number-vue'
|
||||
|
||||
import statsQuery from 'gql/admin/dashboard/dashboard-query-stats.gql'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
AnimatedNumber
|
||||
},
|
||||
data() {
|
||||
return {}
|
||||
return {
|
||||
info: {
|
||||
currentVersion: 'n/a',
|
||||
latestVersion: 'n/a',
|
||||
groupsTotal: 0,
|
||||
pagesTotal: 0,
|
||||
usersTotal: 0
|
||||
},
|
||||
recentPages: [],
|
||||
popularPages: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isLatestVersion() {
|
||||
return this.info.currentVersion === this.info.latestVersion
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
round(val) { return Math.round(val) }
|
||||
},
|
||||
apollo: {
|
||||
info: {
|
||||
query: statsQuery,
|
||||
fetchPolicy: 'network-only',
|
||||
update: (data) => data.system.info,
|
||||
watchLoading (isLoading) {
|
||||
this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'admin-system-refresh')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang='scss'>
|
||||
|
||||
.dashboard-card {
|
||||
display: flex;
|
||||
|
||||
.v-card__text {
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
}
|
||||
|
||||
.dashboard-icon {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
|
@@ -14,7 +14,7 @@
|
||||
)
|
||||
v-icon.mr-2 line_weight
|
||||
.subheading Pipeline
|
||||
v-expansion-panel.adm-rendering-pipeline
|
||||
v-expansion-panel.adm-rendering-pipeline(v-model='selectedCore')
|
||||
v-expansion-panel-content(
|
||||
hide-actions
|
||||
v-for='core in cores'
|
||||
@@ -31,20 +31,21 @@
|
||||
v-icon.mx-2 arrow_forward
|
||||
.caption {{core.output}}
|
||||
v-list(two-line, dense)
|
||||
v-list-tile(
|
||||
avatar
|
||||
v-for='rdr in core.children'
|
||||
:key='rdr.key'
|
||||
)
|
||||
v-list-tile-avatar
|
||||
v-icon(color='grey') {{rdr.icon}}
|
||||
v-list-tile-content
|
||||
v-list-tile-title {{rdr.title}}
|
||||
v-list-tile-sub-title {{rdr.description}}
|
||||
v-list-tile-avatar
|
||||
v-icon(color='green', small, v-if='rdr.isEnabled') lens
|
||||
v-icon(color='red', small, v-else) trip_origin
|
||||
v-divider.my-0
|
||||
template(v-for='(rdr, n) in core.children')
|
||||
v-list-tile(
|
||||
avatar
|
||||
:key='rdr.key'
|
||||
@click=''
|
||||
)
|
||||
v-list-tile-avatar
|
||||
v-icon(color='grey') {{rdr.icon}}
|
||||
v-list-tile-content
|
||||
v-list-tile-title {{rdr.title}}
|
||||
v-list-tile-sub-title {{rdr.description}}
|
||||
v-list-tile-avatar
|
||||
v-icon(color='green', small, v-if='rdr.isEnabled') lens
|
||||
v-icon(color='red', small, v-else) trip_origin
|
||||
v-divider.my-0(v-if='n < core.children.length - 1')
|
||||
|
||||
v-flex(lg9 xs12)
|
||||
v-card
|
||||
@@ -112,6 +113,7 @@ import renderersQuery from 'gql/admin/rendering/rendering-query-renderers.gql'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectedCore: 0,
|
||||
linkify: true,
|
||||
codeTheme: 'Light',
|
||||
renderers: []
|
||||
@@ -125,6 +127,13 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
renderers(newValue, oldValue) {
|
||||
_.delay(() => {
|
||||
this.selectedCore = _.findIndex(this.cores, ['key', 'markdownCore'])
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
apollo: {
|
||||
renderers: {
|
||||
query: renderersQuery,
|
||||
|
Reference in New Issue
Block a user