debian-mirror-gitlab/app/assets/javascripts/operation_settings/components/external_dashboard.vue

73 lines
2.1 KiB
Vue
Raw Normal View History

2019-07-31 22:56:46 +05:30
<script>
2019-09-04 21:01:54 +05:30
import { mapState, mapActions } from 'vuex';
2019-07-31 22:56:46 +05:30
import { GlButton, GlFormGroup, GlFormInput, GlLink } from '@gitlab/ui';
export default {
components: {
GlButton,
GlFormGroup,
GlFormInput,
GlLink,
},
2019-09-04 21:01:54 +05:30
computed: {
...mapState([
'externalDashboardHelpPagePath',
'externalDashboardUrl',
'operationsSettingsEndpoint',
]),
userDashboardUrl: {
get() {
return this.externalDashboardUrl;
},
set(url) {
this.setExternalDashboardUrl(url);
},
2019-07-31 22:56:46 +05:30
},
},
2019-09-04 21:01:54 +05:30
methods: {
...mapActions(['setExternalDashboardUrl', 'updateExternalDashboardUrl']),
},
2019-07-31 22:56:46 +05:30
};
</script>
<template>
2019-09-04 21:01:54 +05:30
<section class="settings no-animate">
2019-07-31 22:56:46 +05:30
<div class="settings-header">
<h4 class="js-section-header">
{{ s__('ExternalMetrics|External Dashboard') }}
</h4>
2019-09-04 21:01:54 +05:30
<gl-button class="js-settings-toggle">{{ __('Expand') }}</gl-button>
2019-07-31 22:56:46 +05:30
<p class="js-section-sub-header">
{{
s__(
'ExternalMetrics|Add a button to the metrics dashboard linking directly to your existing external dashboards.',
)
}}
<gl-link :href="externalDashboardHelpPagePath">{{ __('Learn more') }}</gl-link>
</p>
</div>
<div class="settings-content">
<form>
<gl-form-group
:label="s__('ExternalMetrics|Full dashboard URL')"
2019-10-12 21:52:04 +05:30
label-for="full-dashboard-url"
2019-07-31 22:56:46 +05:30
:description="s__('ExternalMetrics|Enter the URL of the dashboard you want to link to')"
>
2019-10-12 21:52:04 +05:30
<!-- placeholder with a url is a false positive -->
<!-- eslint-disable @gitlab/vue-i18n/no-bare-attribute-strings -->
2019-07-31 22:56:46 +05:30
<gl-form-input
2019-10-12 21:52:04 +05:30
id="full-dashboard-url"
2019-09-04 21:01:54 +05:30
v-model="userDashboardUrl"
2019-07-31 22:56:46 +05:30
placeholder="https://my-org.gitlab.io/my-dashboards"
2019-09-04 21:01:54 +05:30
@keydown.enter.native.prevent="updateExternalDashboardUrl"
2019-07-31 22:56:46 +05:30
/>
2019-10-12 21:52:04 +05:30
<!-- eslint-enable @gitlab/vue-i18n/no-bare-attribute-strings -->
2019-07-31 22:56:46 +05:30
</gl-form-group>
2019-09-04 21:01:54 +05:30
<gl-button variant="success" @click="updateExternalDashboardUrl">
2019-07-31 22:56:46 +05:30
{{ __('Save Changes') }}
</gl-button>
</form>
</div>
</section>
</template>