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

73 lines
2.2 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';
2020-04-22 19:07:51 +05:30
import { GlDeprecatedButton, GlFormGroup, GlFormInput, GlLink } from '@gitlab/ui';
2019-07-31 22:56:46 +05:30
export default {
components: {
2020-04-22 19:07:51 +05:30
GlDeprecatedButton,
2019-07-31 22:56:46 +05:30
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">
2020-04-08 14:13:33 +05:30
<h3 class="js-section-header h4">
2019-07-31 22:56:46 +05:30
{{ s__('ExternalMetrics|External Dashboard') }}
2020-04-08 14:13:33 +05:30
</h3>
2020-04-22 19:07:51 +05:30
<gl-deprecated-button class="js-settings-toggle">{{ __('Expand') }}</gl-deprecated-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 -->
2020-04-22 19:07:51 +05:30
<!-- eslint-disable @gitlab/vue-require-i18n-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
/>
2020-04-22 19:07:51 +05:30
<!-- eslint-enable @gitlab/vue-require-i18n-attribute-strings -->
2019-07-31 22:56:46 +05:30
</gl-form-group>
2020-04-22 19:07:51 +05:30
<gl-deprecated-button variant="success" @click="updateExternalDashboardUrl">
2019-07-31 22:56:46 +05:30
{{ __('Save Changes') }}
2020-04-22 19:07:51 +05:30
</gl-deprecated-button>
2019-07-31 22:56:46 +05:30
</form>
</div>
</section>
</template>