From 10df1b4b0cc0328bbd88d010e10a9f86a8f91c27 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 6 Apr 2019 19:05:47 -0400 Subject: [PATCH] feat: storage actions + git module actions --- client/components/admin/admin-storage.vue | 57 +++++- .../storage-mutation-executeaction.gql | 12 ++ .../admin/storage/storage-query-targets.gql | 5 + server/graph/resolvers/storage.js | 10 + server/graph/schemas/storage.graphql | 12 ++ server/helpers/page.js | 20 ++ server/models/pages.js | 16 +- server/models/storage.js | 24 ++- server/modules/storage/git/definition.yml | 8 +- server/modules/storage/git/storage.js | 180 ++++++++++++------ 10 files changed, 261 insertions(+), 83 deletions(-) create mode 100644 client/graph/admin/storage/storage-mutation-executeaction.gql diff --git a/client/components/admin/admin-storage.vue b/client/components/admin/admin-storage.vue index ddc7d939..c6588194 100644 --- a/client/components/admin/admin-storage.vue +++ b/client/components/admin/admin-storage.vue @@ -158,6 +158,24 @@ .caption.mt-3 Currently set to every #[strong {{getDefaultSchedule(tgt.syncInterval)}}]. .caption The default is every #[strong {{getDefaultSchedule(tgt.syncIntervalDefault)}}]. + template(v-if='tgt.actions && tgt.actions.length > 0') + v-divider.mt-3 + v-subheader.pl-0 Actions + v-container.pt-0(grid-list-xl, fluid) + v-layout(row, wrap, fill-height) + v-flex(xs12, lg6, xl4, v-for='act of tgt.actions') + v-card.radius-7.grey(flat, :class='$vuetify.dark ? `darken-3-d5` : `lighten-3`', height='100%') + v-card-text + .subheading(v-html='act.label') + .body-1.mt-2(v-html='act.hint') + v-btn.mx-0.mt-3( + @click='executeAction(tgt.key, act.handler)' + outline + :color='$vuetify.dark ? `blue` : `primary`' + :disabled='runningAction' + :loading='runningActionHandler === act.handler' + ) Run +