feat: storage actions + git module actions
This commit is contained in:
@@ -77,6 +77,16 @@ module.exports = {
|
||||
} catch (err) {
|
||||
return graphHelper.generateError(err)
|
||||
}
|
||||
},
|
||||
async executeAction(obj, args, context) {
|
||||
try {
|
||||
await WIKI.models.storage.executeAction(args.targetKey, args.handler)
|
||||
return {
|
||||
responseResult: graphHelper.generateSuccess('Action completed.')
|
||||
}
|
||||
} catch (err) {
|
||||
return graphHelper.generateError(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -31,6 +31,11 @@ type StorageMutation {
|
||||
updateTargets(
|
||||
targets: [StorageTargetInput]!
|
||||
): DefaultResponse @auth(requires: ["manage:system"])
|
||||
|
||||
executeAction(
|
||||
targetKey: String!
|
||||
handler: String!
|
||||
): DefaultResponse @auth(requires: ["manage:system"])
|
||||
}
|
||||
|
||||
# -----------------------------------------------
|
||||
@@ -51,6 +56,7 @@ type StorageTarget {
|
||||
syncInterval: String
|
||||
syncIntervalDefault: String
|
||||
config: [KeyValuePair]
|
||||
actions: [StorageTargetAction]
|
||||
}
|
||||
|
||||
input StorageTargetInput {
|
||||
@@ -68,3 +74,9 @@ type StorageStatus {
|
||||
message: String!
|
||||
lastAttempt: String!
|
||||
}
|
||||
|
||||
type StorageTargetAction {
|
||||
handler: String!
|
||||
label: String!
|
||||
hint: String!
|
||||
}
|
||||
|
Reference in New Issue
Block a user