|
@@ -29,7 +29,7 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="item"
|
|
|
- :class="{active: window.content === 'labels', inactive: !currentProject}"
|
|
|
+ :class="{active: window.content === 'labels', inactive: !currentProject || !labelsEnabled}"
|
|
|
@click="ifProjectIsOpened(show, 'labels')">
|
|
|
<img src="@/assets/icons/tag.svg">
|
|
|
<span>Labels</span>
|
|
@@ -70,29 +70,36 @@ export default {
|
|
|
name: "side-navigation-bar",
|
|
|
props: ['window', 'socket', 'status', 'currentProject'],
|
|
|
computed: {
|
|
|
- collapsed: function() {
|
|
|
+ collapsed: function () {
|
|
|
if (!this.status)
|
|
|
return false;
|
|
|
|
|
|
return this.status.settings.frontend.collapse;
|
|
|
},
|
|
|
- mediaAvailable: function() {
|
|
|
+ mediaAvailable: function () {
|
|
|
return this.currentProject && 'data' in this.currentProject && Object.keys(this.currentProject.data).length > 0;
|
|
|
+ },
|
|
|
+ labelsEnabled: function () {
|
|
|
+ return this.currentProject
|
|
|
+ && (
|
|
|
+ this.currentProject.model.supports.includes('labeled-images')
|
|
|
+ || this.currentProject.model.supports.includes('labeled-bounding-boxes')
|
|
|
+ );
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- closeSelf: function() {
|
|
|
+ closeSelf: function () {
|
|
|
this.$emit('close', null);
|
|
|
},
|
|
|
- ifProjectIsOpened: function(fun, ...args) {
|
|
|
+ ifProjectIsOpened: function (fun, ...args) {
|
|
|
if (this.currentProject)
|
|
|
fun.bind(fun)(...args);
|
|
|
},
|
|
|
- show: function(value) {
|
|
|
+ show: function (value) {
|
|
|
this.window.content = value;
|
|
|
this.closeSelf();
|
|
|
},
|
|
|
- collapse: function() {
|
|
|
+ collapse: function () {
|
|
|
this.socket.post('/settings', {
|
|
|
frontend: {
|
|
|
collapse: !this.collapsed
|