debian-mirror-gitlab/app/assets/javascripts/ci/runner/components/runner_detail.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.1 KiB
Vue
Raw Normal View History

2022-04-04 11:22:00 +05:30
<script>
import { __ } from '~/locale';
/**
* Usage:
*
* With a `value` prop:
*
* <runner-detail label="Field Name" :value="value" />
*
* Or a `value` slot:
*
* <runner-detail label="Field Name">
* <template #value>
* <strong>{{ value }}</strong>
* </template>
* </runner-detail>
*
*/
export default {
props: {
label: {
type: String,
2022-10-11 01:57:18 +05:30
default: null,
required: false,
2022-04-04 11:22:00 +05:30
},
value: {
type: String,
default: null,
required: false,
},
emptyValue: {
type: String,
default: __('None'),
required: false,
},
},
};
</script>
<template>
2022-08-27 11:52:29 +05:30
<div class="gl-display-contents">
2022-10-11 01:57:18 +05:30
<dt class="gl-mb-5 gl-mr-6 gl-max-w-26">
<template v-if="label || $scopedSlots.label">
<slot name="label">{{ label }}</slot>
</template>
</dt>
2022-08-27 11:52:29 +05:30
<dd class="gl-mb-5">
<template v-if="value || $scopedSlots.value">
2022-04-04 11:22:00 +05:30
<slot name="value">{{ value }}</slot>
</template>
2023-03-04 22:38:38 +05:30
<span v-else class="gl-text-secondary">{{ emptyValue }}</span>
2022-04-04 11:22:00 +05:30
</dd>
</div>
</template>