mirror of https://github.com/Requarks/wiki.git
28 changed files with 445 additions and 183 deletions
Split View
Diff Options
-
64client/components/admin-groups.vue
-
59client/components/admin-system.vue
-
19client/components/admin.vue
-
61client/components/login.vue
-
7client/components/nav-header.vue
-
18client/graph/admin-groups-mutation-create.gql
-
11client/graph/admin-groups-query-list.gql
-
21client/graph/admin-system-query-info.gql
-
14client/graph/login-mutation-login.gql
-
12client/graph/login-mutation-tfa.gql
-
13client/graph/login-query-strategies.gql
-
43client/store/index.js
-
40client/store/modules/navigator.js
-
9config.sample.yml
-
8dev/webpack/webpack.dev.js
-
6dev/webpack/webpack.prod.js
-
2package.json
-
2server/app/data.yml
-
12server/core/db.js
-
4server/graph/resolvers/authentication.js
-
30server/graph/resolvers/group.js
-
2server/graph/schemas/authentication.graphql
-
4server/graph/schemas/common.graphql
-
3server/graph/schemas/group.graphql
-
6server/helpers/graph.js
-
2server/models/file.js
-
2server/models/setting.js
-
154yarn.lock
@ -0,0 +1,18 @@ |
|||
mutation ($name: String!) { |
|||
groups { |
|||
create(name: $name) { |
|||
responseResult { |
|||
succeeded |
|||
errorCode |
|||
slug |
|||
message |
|||
} |
|||
group { |
|||
id |
|||
name |
|||
createdAt |
|||
updatedAt |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,11 @@ |
|||
query { |
|||
groups { |
|||
list { |
|||
id |
|||
name |
|||
userCount |
|||
createdAt |
|||
updatedAt |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,21 @@ |
|||
query { |
|||
system { |
|||
info { |
|||
currentVersion |
|||
latestVersion |
|||
latestVersionReleaseDate |
|||
operatingSystem |
|||
hostname |
|||
cpuCores |
|||
ramTotal |
|||
workingDirectory |
|||
nodeVersion |
|||
redisVersion |
|||
redisUsedRAM |
|||
redisTotalRAM |
|||
redisHost |
|||
postgreVersion |
|||
postgreHost |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,14 @@ |
|||
mutation($username: String!, $password: String!, $provider: String!) { |
|||
authentication { |
|||
login(username: $username, password: $password, provider: $provider) { |
|||
responseResult { |
|||
succeeded |
|||
errorCode |
|||
slug |
|||
message |
|||
} |
|||
tfaRequired |
|||
tfaLoginToken |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
mutation($loginToken: String!, $securityCode: String!) { |
|||
authentication { |
|||
loginTFA(loginToken: $loginToken, securityCode: $securityCode) { |
|||
responseResult { |
|||
succeeded |
|||
errorCode |
|||
slug |
|||
message |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,13 @@ |
|||
query { |
|||
authentication { |
|||
providers( |
|||
filter: "isEnabled eq true", |
|||
orderBy: "title ASC" |
|||
) { |
|||
key |
|||
title |
|||
useForm |
|||
icon |
|||
} |
|||
} |
|||
} |
@ -1,24 +1,41 @@ |
|||
import _ from 'lodash' |
|||
import Vue from 'vue' |
|||
import Vuex from 'vuex' |
|||
|
|||
import navigator from './modules/navigator' |
|||
|
|||
Vue.use(Vuex) |
|||
|
|||
export default new Vuex.Store({ |
|||
state: { |
|||
loading: false |
|||
loadingStack: [], |
|||
notification: { |
|||
message: '', |
|||
style: 'primary', |
|||
icon: 'cached', |
|||
isActive: false |
|||
} |
|||
}, |
|||
mutations: { |
|||
loadingChange: (state, loadingState) => { state.loading = loadingState } |
|||
getters: { |
|||
isLoading: state => { return state.loadingStack.length > 0 } |
|||
}, |
|||
actions: { |
|||
alert({ dispatch }, opts) { dispatch('navigator/alert', opts) }, |
|||
startLoading({ commit }) { commit('loadingChange', true) }, |
|||
stopLoading({ commit }) { commit('loadingChange', false) } |
|||
mutations: { |
|||
loadingStart (state, stackName) { |
|||
state.loadingStack = _.union(state.loadingStack, [stackName]) |
|||
}, |
|||
loadingStop (state, stackName) { |
|||
state.loadingStack = _.without(state.loadingStack, stackName) |
|||
}, |
|||
showNotification (state, opts) { |
|||
state.notification = _.defaults(opts, { |
|||
message: '', |
|||
style: 'primary', |
|||
icon: 'cached', |
|||
isActive: true |
|||
}) |
|||
}, |
|||
updateNotificationState (state, newState) { |
|||
state.notification.isActive = newState |
|||
} |
|||
}, |
|||
getters: {}, |
|||
modules: { |
|||
navigator |
|||
} |
|||
actions: { }, |
|||
modules: { } |
|||
}) |
@ -1,40 +0,0 @@ |
|||
import debounce from 'lodash/debounce' |
|||
|
|||
export default { |
|||
namespaced: true, |
|||
state: { |
|||
subtitleShown: false, |
|||
subtitleStyle: '', |
|||
subtitleIcon: false, |
|||
subtitleText: '', |
|||
subtitleStatic: 'Welcome' |
|||
}, |
|||
getters: {}, |
|||
mutations: { |
|||
subtitleChange (state, opts) { |
|||
state.subtitleShown = (opts.shown === true) |
|||
state.subtitleStyle = opts.style || '' |
|||
state.subtitleIcon = opts.icon || false |
|||
state.subtitleText = opts.msg || '' |
|||
}, |
|||
subtitleStatic (state, text) { |
|||
state.subtitleText = text |
|||
state.subtitleStatic = text |
|||
} |
|||
}, |
|||
actions: { |
|||
alert ({ commit, dispatch }, opts) { |
|||
opts.shown = true |
|||
commit('subtitleChange', opts) |
|||
dispatch('alertDismiss') |
|||
}, |
|||
alertDismiss: debounce(({ commit, state }) => { |
|||
let opts = { |
|||
shown: false, |
|||
style: state.subtitleStyle, |
|||
msg: state.subtitleStatic |
|||
} |
|||
commit('subtitleChange', opts) |
|||
}, 5000) |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save