debian-mirror-gitlab/app/assets/javascripts/ide/components/ide_status_list.vue

45 lines
1.2 KiB
Vue
Raw Normal View History

2019-09-04 21:01:54 +05:30
<script>
2020-07-28 23:09:34 +05:30
import { GlLink, GlTooltipDirective } from '@gitlab/ui';
2021-03-11 19:13:27 +05:30
import { mapGetters } from 'vuex';
2020-11-24 15:15:51 +05:30
import { isTextFile, getFileEOL } from '~/ide/utils';
2021-03-11 19:13:27 +05:30
import TerminalSyncStatusSafe from './terminal_sync/terminal_sync_status_safe.vue';
2019-09-04 21:01:54 +05:30
export default {
2020-06-23 00:09:42 +05:30
components: {
2020-07-28 23:09:34 +05:30
GlLink,
2020-06-23 00:09:42 +05:30
TerminalSyncStatusSafe,
},
2020-07-28 23:09:34 +05:30
directives: {
GlTooltip: GlTooltipDirective,
},
2019-09-04 21:01:54 +05:30
computed: {
...mapGetters(['activeFile']),
2021-01-29 00:20:46 +05:30
...mapGetters('editor', ['activeFileEditor']),
2020-06-23 00:09:42 +05:30
activeFileEOL() {
return getFileEOL(this.activeFile.content);
},
2020-11-24 15:15:51 +05:30
activeFileIsText() {
return isTextFile(this.activeFile);
},
2019-09-04 21:01:54 +05:30
},
};
</script>
<template>
<div class="ide-status-list d-flex">
<template v-if="activeFile">
2020-07-28 23:09:34 +05:30
<div>
<gl-link v-gl-tooltip.hover :href="activeFile.permalink" :title="__('Open in file view')">
{{ activeFile.name }}
</gl-link>
2019-09-04 21:01:54 +05:30
</div>
2020-07-28 23:09:34 +05:30
<div>{{ activeFileEOL }}</div>
2021-01-29 00:20:46 +05:30
<div v-if="activeFileIsText">
{{ activeFileEditor.editorRow }}:{{ activeFileEditor.editorColumn }}
</div>
<div>{{ activeFileEditor.fileLanguage }}</div>
2019-09-04 21:01:54 +05:30
</template>
2020-06-23 00:09:42 +05:30
<terminal-sync-status-safe />
2019-09-04 21:01:54 +05:30
</div>
</template>