mirror of https://github.com/Requarks/wiki.git
20 changed files with 284 additions and 400 deletions
Split View
Diff Options
-
4client/app.js
-
21client/components/admin-auth.vue
-
7client/components/admin-dev.vue
-
77client/components/admin-groups.vue
-
30client/components/admin-system.vue
-
19client/components/editor-code.vue
-
2client/components/editor-modal-access.vue
-
2client/components/editor-modal-properties.vue
-
25client/components/editor.vue
-
52client/components/login.vue
-
41client/components/nav-header.vue
-
155client/components/navigator.vue
-
103client/constants/graphql.js
-
5client/constants/index.js
-
16client/modules/localization.js
-
1client/scss/pages/_welcome.scss
-
2server/graph/resolvers/folder.js
-
20server/graph/resolvers/group.js
-
33server/graph/schemas/common.graphql
-
69server/graph/schemas/group.graphql
@ -1,155 +0,0 @@ |
|||
<template lang="pug"> |
|||
.navigator |
|||
.navigator-bar |
|||
.navigator-fab |
|||
.navigator-fab-button(@click='toggleMainMenu') |
|||
svg.icons.is-24(role='img') |
|||
title Navigation |
|||
use(xlink:href='#gg-apps-grid') |
|||
.navigator-title |
|||
h1 {{ siteTitle }} |
|||
.navigator-subtitle(:class='subtitleClass') |
|||
transition(name='navigator-subtitle-icon') |
|||
svg.icons.is-24.navigator-subtitle-icon(role='img', v-if='subtitleIcon') |
|||
title {{subtitleText}} |
|||
use(:xlink:href='subtitleIconClass') |
|||
h2 {{subtitleText}} |
|||
.navigator-action |
|||
.navigator-action-item(:class='{"is-active": userMenuShown}', @click='toggleUserMenu') |
|||
svg.icons.is-32(role='img') |
|||
title User |
|||
use(xlink:href='#nc-user-circle') |
|||
transition(name='navigator-action-item-dropdown') |
|||
ul.navigator-action-item-dropdown(v-show='userMenuShown', v-cloak) |
|||
li |
|||
label Account |
|||
svg.icons.is-24(role='img') |
|||
title Account |
|||
use(xlink:href='#nc-man-green') |
|||
li(@click='logout') |
|||
label Sign out |
|||
svg.icons.is-24(role='img') |
|||
title Sign Out |
|||
use(xlink:href='#nc-exit') |
|||
transition(name='navigator-sd') |
|||
.navigator-sd(v-show='sdShown', v-cloak) |
|||
.navigator-sd-actions |
|||
a.is-active(href='', title='Search') |
|||
svg.icons.is-24(role='img') |
|||
title Search |
|||
use(xlink:href='#gg-search') |
|||
a(href='', title='New Document') |
|||
svg.icons.is-24(role='img') |
|||
title New Document |
|||
use(xlink:href='#nc-plus-circle') |
|||
a(href='', title='Edit Document') |
|||
svg.icons.is-24(role='img') |
|||
title Edit Document |
|||
use(xlink:href='#nc-pen-red') |
|||
a(href='', title='History') |
|||
svg.icons.is-24(role='img') |
|||
title History |
|||
use(xlink:href='#nc-restore') |
|||
a(href='', title='View Source') |
|||
svg.icons.is-24(role='img') |
|||
title View Source |
|||
use(xlink:href='#nc-code-editor') |
|||
a(href='', title='Move Document') |
|||
svg.icons.is-24(role='img') |
|||
title Move Document |
|||
use(xlink:href='#nc-move') |
|||
a(href='', title='Delete Document') |
|||
svg.icons.is-24(role='img') |
|||
title Delete Document |
|||
use(xlink:href='#nc-trash') |
|||
.navigator-sd-search |
|||
input(type='text', ref='iptSearch', placeholder='Search') |
|||
.navigator-sd-results |
|||
.navigator-sd-footer |
|||
a(href='', title='Settings') |
|||
svg.icons.is-24(role='img') |
|||
title Settings |
|||
use(xlink:href='#nc-gear') |
|||
a(href='', title='Users') |
|||
svg.icons.is-24(role='img') |
|||
title Users |
|||
use(xlink:href='#nc-users') |
|||
a(href='', title='Assets') |
|||
svg.icons.is-24(role='img') |
|||
title Assets |
|||
use(xlink:href='#nc-image') |
|||
</template> |
|||
|
|||
<script> |
|||
/* global siteConfig */ |
|||
|
|||
import { mapState } from 'vuex' |
|||
|
|||
export default { |
|||
data() { |
|||
return { |
|||
sdShown: false, |
|||
userMenuShown: false |
|||
} |
|||
}, |
|||
computed: { |
|||
...mapState('navigator', [ |
|||
'subtitleShown', |
|||
'subtitleStyle', |
|||
'subtitleText', |
|||
'subtitleIcon' |
|||
]), |
|||
siteTitle() { |
|||
return siteConfig.title |
|||
}, |
|||
subtitleClass() { |
|||
return { |
|||
'is-active': this.subtitleShown, |
|||
'is-error': this.subtitleStyle === 'error', |
|||
'is-warning': this.subtitleStyle === 'warning', |
|||
'is-success': this.subtitleStyle === 'success', |
|||
'is-info': this.subtitleStyle === 'info' |
|||
} |
|||
}, |
|||
subtitleIconClass() { return '#' + this.subtitleIcon } |
|||
}, |
|||
methods: { |
|||
toggleMainMenu() { |
|||
this.sdShown = !this.sdShown |
|||
this.userMenuShown = false |
|||
if (this.sdShown) { |
|||
this.$nextTick(() => { |
|||
this.bindOutsideClick() |
|||
this.$refs.iptSearch.focus() |
|||
}) |
|||
} else { |
|||
this.unbindOutsideClick() |
|||
} |
|||
}, |
|||
toggleUserMenu() { |
|||
this.userMenuShown = !this.userMenuShown |
|||
this.sdShown = false |
|||
if (this.userMenuShown) { |
|||
this.bindOutsideClick() |
|||
} else { |
|||
this.unbindOutsideClick() |
|||
} |
|||
}, |
|||
bindOutsideClick() { |
|||
document.addEventListener('mousedown', this.handleOutsideClick, false) |
|||
}, |
|||
unbindOutsideClick() { |
|||
document.removeEventListener('mousedown', this.handleOutsideClick, false) |
|||
}, |
|||
handleOutsideClick(ev) { |
|||
if (!this.$el.contains(ev.target)) { |
|||
this.sdShown = false |
|||
this.userMenuShown = false |
|||
} |
|||
}, |
|||
logout() { |
|||
window.location.assign(this.$helpers.resolvePath('logout')) |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -1,103 +0,0 @@ |
|||
import gql from 'graphql-tag' |
|||
|
|||
export default { |
|||
AUTHENTICATION: { |
|||
QUERY_PROVIDERS: gql`
|
|||
query { |
|||
authentication { |
|||
providers { |
|||
isEnabled |
|||
key |
|||
props |
|||
title |
|||
useForm |
|||
config { |
|||
key |
|||
value |
|||
} |
|||
} |
|||
} |
|||
} |
|||
`,
|
|||
QUERY_LOGIN_PROVIDERS: gql`
|
|||
query { |
|||
authentication { |
|||
providers( |
|||
filter: "isEnabled eq true", |
|||
orderBy: "title ASC" |
|||
) { |
|||
key |
|||
title |
|||
useForm |
|||
icon |
|||
} |
|||
} |
|||
} |
|||
`,
|
|||
MUTATION_LOGIN: gql`
|
|||
mutation($username: String!, $password: String!, $provider: String!) { |
|||
authentication { |
|||
login(username: $username, password: $password, provider: $provider) { |
|||
operation { |
|||
succeeded |
|||
code |
|||
slug |
|||
message |
|||
} |
|||
tfaRequired |
|||
tfaLoginToken |
|||
} |
|||
} |
|||
} |
|||
`,
|
|||
MUTATION_LOGINTFA: gql`
|
|||
mutation($loginToken: String!, $securityCode: String!) { |
|||
authentication { |
|||
loginTFA(loginToken: $loginToken, securityCode: $securityCode) { |
|||
operation { |
|||
succeeded |
|||
code |
|||
slug |
|||
message |
|||
} |
|||
} |
|||
} |
|||
} |
|||
`
|
|||
}, |
|||
SYSTEM: { |
|||
QUERY_INFO: gql`
|
|||
query { |
|||
system { |
|||
info { |
|||
currentVersion |
|||
latestVersion |
|||
latestVersionReleaseDate |
|||
operatingSystem |
|||
hostname |
|||
cpuCores |
|||
ramTotal |
|||
workingDirectory |
|||
nodeVersion |
|||
redisVersion |
|||
redisUsedRAM |
|||
redisTotalRAM |
|||
redisHost |
|||
postgreVersion |
|||
postgreHost |
|||
} |
|||
} |
|||
} |
|||
`
|
|||
}, |
|||
TRANSLATIONS: { |
|||
QUERY_NAMESPACE: gql`
|
|||
query($locale: String!, $namespace: String!) { |
|||
translations(locale:$locale, namespace:$namespace) { |
|||
key |
|||
value |
|||
} |
|||
} |
|||
`
|
|||
} |
|||
} |
@ -1,5 +0,0 @@ |
|||
import GRAPH from './graphql' |
|||
|
|||
export default { |
|||
GRAPH |
|||
} |
@ -0,0 +1,69 @@ |
|||
# =============================================== |
|||
# GROUPS |
|||
# =============================================== |
|||
|
|||
extend type Query { |
|||
groups: GroupQuery |
|||
} |
|||
|
|||
extend type Mutation { |
|||
groups: GroupMutation |
|||
} |
|||
|
|||
# ----------------------------------------------- |
|||
# QUERIES |
|||
# ----------------------------------------------- |
|||
|
|||
type GroupQuery { |
|||
list( |
|||
filter: String |
|||
orderBy: String |
|||
): [Group] |
|||
} |
|||
|
|||
# ----------------------------------------------- |
|||
# MUTATIONS |
|||
# ----------------------------------------------- |
|||
|
|||
type GroupMutation { |
|||
create( |
|||
name: String! |
|||
): GroupResponse |
|||
|
|||
update( |
|||
id: Int! |
|||
name: String! |
|||
): GroupResponse |
|||
|
|||
delete( |
|||
id: Int! |
|||
): DefaultResponse |
|||
|
|||
assignUser( |
|||
groupId: Int! |
|||
userId: Int! |
|||
): DefaultResponse |
|||
|
|||
unassignUser( |
|||
groupId: Int! |
|||
userId: Int! |
|||
): DefaultResponse |
|||
} |
|||
|
|||
# ----------------------------------------------- |
|||
# TYPES |
|||
# ----------------------------------------------- |
|||
|
|||
type GroupResponse { |
|||
operation: ResponseStatus! |
|||
group: Group |
|||
} |
|||
|
|||
type Group { |
|||
id: Int! |
|||
name: String! |
|||
rights: [String] |
|||
users: [User] |
|||
createdAt: Date! |
|||
updatedAt: Date! |
|||
} |
Write
Preview
Loading…
Cancel
Save