diff options
Diffstat (limited to 'app/assets/javascripts/admin/deploy_keys')
-rw-r--r-- | app/assets/javascripts/admin/deploy_keys/components/table.vue | 54 | ||||
-rw-r--r-- | app/assets/javascripts/admin/deploy_keys/index.js | 23 |
2 files changed, 77 insertions, 0 deletions
diff --git a/app/assets/javascripts/admin/deploy_keys/components/table.vue b/app/assets/javascripts/admin/deploy_keys/components/table.vue new file mode 100644 index 00000000000..97a5a2f2f32 --- /dev/null +++ b/app/assets/javascripts/admin/deploy_keys/components/table.vue @@ -0,0 +1,54 @@ +<script> +import { GlTable, GlButton } from '@gitlab/ui'; + +import { __ } from '~/locale'; + +export default { + name: 'DeployKeysTable', + i18n: { + pageTitle: __('Public deploy keys'), + newDeployKeyButtonText: __('New deploy key'), + }, + fields: [ + { + key: 'title', + label: __('Title'), + }, + { + key: 'fingerprint', + label: __('Fingerprint'), + }, + { + key: 'projects', + label: __('Projects with write access'), + }, + { + key: 'created', + label: __('Created'), + }, + { + key: 'actions', + label: __('Actions'), + }, + ], + components: { + GlTable, + GlButton, + }, + inject: ['editPath', 'deletePath', 'createPath', 'emptyStateSvgPath'], +}; +</script> + +<template> + <div> + <div class="gl-display-flex gl-justify-content-space-between gl-align-items-center gl-py-5"> + <h4 class="gl-m-0"> + {{ $options.i18n.pageTitle }} + </h4> + <gl-button variant="confirm" :href="createPath">{{ + $options.i18n.newDeployKeyButtonText + }}</gl-button> + </div> + <gl-table :fields="$options.fields" data-testid="deploy-keys-list" /> + </div> +</template> diff --git a/app/assets/javascripts/admin/deploy_keys/index.js b/app/assets/javascripts/admin/deploy_keys/index.js new file mode 100644 index 00000000000..d86de4229de --- /dev/null +++ b/app/assets/javascripts/admin/deploy_keys/index.js @@ -0,0 +1,23 @@ +import Vue from 'vue'; +import DeployKeysTable from './components/table.vue'; + +export const initAdminDeployKeysTable = () => { + const el = document.getElementById('js-admin-deploy-keys-table'); + + if (!el) return false; + + const { editPath, deletePath, createPath, emptyStateSvgPath } = el.dataset; + + return new Vue({ + el, + provide: { + editPath, + deletePath, + createPath, + emptyStateSvgPath, + }, + render(createElement) { + return createElement(DeployKeysTable); + }, + }); +}; |