debian-mirror-gitlab/app/assets/javascripts/jobs/components/log/line_number.vue

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

35 lines
632 B
Vue
Raw Normal View History

2019-12-04 20:38:33 +05:30
<script>
export default {
2020-07-28 23:09:34 +05:30
functional: true,
2019-12-04 20:38:33 +05:30
props: {
lineNumber: {
type: Number,
required: true,
},
path: {
type: String,
required: true,
},
},
2020-07-28 23:09:34 +05:30
render(h, { props }) {
const { lineNumber, path } = props;
2019-12-04 20:38:33 +05:30
2022-08-13 15:12:31 +05:30
const parsedLineNumber = lineNumber + 1;
2020-07-28 23:09:34 +05:30
const lineId = `L${parsedLineNumber}`;
const lineHref = `${path}#${lineId}`;
return h(
'a',
{
class: 'gl-link d-inline-block text-right line-number flex-shrink-0',
attrs: {
id: lineId,
href: lineHref,
},
},
parsedLineNumber,
);
2019-12-04 20:38:33 +05:30
},
};
</script>