Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
375 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<template> | ||
<div class="toolForm"> | ||
<div class="toolFormTitle"> | ||
<slot name="title">{{ title }}</slot> | ||
</div> | ||
<div class="toolFormBody"> | ||
<table class="manage-table colored" border="0" cellspacing="0" cellpadding="0" width="100%"> | ||
<slot name="columns"> | ||
<th v-for="column in columns" bgcolor="#D8D8D8">{{ column.text }}</th> | ||
</slot> | ||
<slot name="rows"> | ||
<template v-for="(row, index) in rows"> | ||
<tr :class="[index % 2 === 0 ? 'tr' : 'odd_row']"> | ||
<td v-for="column in columns">{{ row[column.dataIndex] }}</td> | ||
</tr> | ||
</template> | ||
</slot> | ||
</table> | ||
<div v-if="isLoaded !== undefined && !isLoaded" :style="{ textAlign: 'center', padding: '7px 0' }"> | ||
Loading... | ||
</div> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
isLoaded: { | ||
type: Boolean | ||
}, | ||
title: { | ||
type: String | ||
}, | ||
columns: { | ||
type: Array | ||
}, | ||
rows: { | ||
type: Array | ||
} | ||
} | ||
} | ||
</script> |
47 changes: 47 additions & 0 deletions
47
client/galaxy/scripts/components/admin/data-manager-grid.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<template> | ||
<table class="tabletip"> | ||
<thead> | ||
<tr> | ||
<th :colspan="dataManagerColumns.length" style="font-size:120%"> | ||
Data Manager: {{ dataManagerTableName }} | ||
<a class="icon-btn" href="javascript:void(0)" | ||
@click="handleReloadButtonClick" | ||
:title="`Reload ${dataManagerTableName} tool data table`" | ||
><span class="fa fa-refresh"></span></a> | ||
</th> | ||
</tr> | ||
<tr> | ||
<th v-for="column in dataManagerColumns">{{ column }}</th> | ||
</tr> | ||
</thead> | ||
<tbody v-for="item in dataManagerItems"> | ||
<tr> | ||
<td v-for="column in dataManagerColumns">{{ item[column] }}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
dataManagerTableName: { | ||
type: String, | ||
required: true | ||
}, | ||
dataManagerColumns: { | ||
type: Array, | ||
required: true | ||
}, | ||
dataManagerItems: { | ||
type: Array, | ||
required: true | ||
} | ||
}, | ||
methods: { | ||
handleReloadButtonClick(event) { | ||
this.$emit('reloaddatamanager', this.dataManagerTableName); | ||
} | ||
} | ||
} | ||
</script> |
53 changes: 53 additions & 0 deletions
53
client/galaxy/scripts/components/admin/data-tables-grid.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<template> | ||
<base-grid :is-loaded="isLoaded" :columns="columns"> | ||
<template slot="title"> | ||
Current data table registry contains {{ rows.length }} data tables | ||
</template> | ||
<template slot="rows" v-for="(row, index) in rows"> | ||
<tr :class="[index % 2 === 0 ? 'tr' : 'odd_row']"> | ||
<td><a href="javascript:void(0)" @click="handleTableNameClick">{{ row.name }}</a></td> | ||
<td>{{ row.filename }}</td> | ||
<td>{{ row.tool_data_path }}</td> | ||
<td>{{ row.errors }}</td> | ||
</tr> | ||
</template> | ||
</base-grid> | ||
</template> | ||
|
||
<script> | ||
import BaseGrid from './base-grid.vue'; | ||
export default { | ||
props: { | ||
isLoaded: { | ||
type: Boolean, | ||
required: true | ||
}, | ||
rows: { | ||
type: Array, | ||
required: true | ||
} | ||
}, | ||
data() { | ||
return { | ||
columns: [ | ||
{ text: 'Name', dataIndex: 'name' }, | ||
{ text: 'Filename', dataIndex: 'filename' }, | ||
{ text: 'Tool data path', dataIndex: 'tool_data_path' }, | ||
{ text: 'Errors', dataIndex: 'errors' } | ||
] | ||
} | ||
}, | ||
components: { | ||
'base-grid': BaseGrid | ||
}, | ||
methods: { | ||
handleTableNameClick(event) { | ||
this.$emit('changeview', event.target.text); | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<template> | ||
<div> | ||
<message :message="message" :status="status"></message> | ||
<component | ||
:is="currentView" | ||
v-if="status !== 'error'" | ||
v-bind="currentProps" | ||
@changeview="showDataManager" | ||
@reloaddatamanager="reloadDataManager"> | ||
</component> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import axios from 'axios'; | ||
import Message from '../message.vue'; | ||
import DataTablesGrid from './data-tables-grid.vue'; | ||
import DataManagerGrid from './data-manager-grid.vue'; | ||
export default { | ||
data() { | ||
return { | ||
currentView: 'data-tables-grid', | ||
isLoaded: false, | ||
dataTables: [], | ||
dataManagerTableName: '', | ||
dataManagerColumns: [], | ||
dataManagerItems: [], | ||
message: '', | ||
status: '' | ||
} | ||
}, | ||
components: { | ||
message: Message, | ||
'data-tables-grid': DataTablesGrid, | ||
'data-manager-grid': DataManagerGrid | ||
}, | ||
computed: { | ||
currentProps() { | ||
let props; | ||
if (this.currentView === 'data-tables-grid') { | ||
props = { | ||
isLoaded: this.isLoaded, | ||
rows: this.dataTables | ||
}; | ||
} else { | ||
props = { | ||
dataManagerTableName: this.dataManagerTableName, | ||
dataManagerColumns: this.dataManagerColumns, | ||
dataManagerItems: this.dataManagerItems | ||
}; | ||
} | ||
return props; | ||
} | ||
}, | ||
methods: { | ||
showDataManager(dataManagerTableName) { | ||
axios.get(`${Galaxy.root}data_manager/tool_data_table_items`, { | ||
params: { | ||
table_name: dataManagerTableName | ||
} | ||
}) | ||
.then((response) => { | ||
this.message = response.data.message; | ||
this.status = response.data.status; | ||
if (response.data.status !== 'error' && response.data.status !== 'warning') { | ||
this.dataManagerTableName = dataManagerTableName; | ||
this.dataManagerColumns = response.data.data.columns; | ||
this.dataManagerItems = response.data.data.items; | ||
this.currentView = 'data-manager-grid'; | ||
} | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); | ||
}, | ||
reloadDataManager(dataManagerTableName) { | ||
axios.get(`${Galaxy.root}data_manager/reload_tool_data_table`, { | ||
params: { | ||
table_name: dataManagerTableName | ||
} | ||
}) | ||
.then((response) => { | ||
this.message = response.data.message; | ||
this.status = response.data.status; | ||
if (response.data.status !== 'error' && response.data.status !== 'warning') { | ||
this.dataManagerItems = response.data.data.items; | ||
} | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); | ||
} | ||
}, | ||
created() { | ||
axios.get(`${Galaxy.root}admin/data_tables_list`) | ||
.then((response) => { | ||
this.isLoaded = true; | ||
this.dataTables = response.data.data; | ||
this.message = response.data.message; | ||
this.status = response.data.status; | ||
}) | ||
.catch((error) => { | ||
console.error(error); | ||
}); | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<template> | ||
<div v-if="message" :class="[status + 'message']">{{ message }}</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'Message', | ||
props: { | ||
message: { | ||
type: String, | ||
required: true | ||
}, | ||
status: { | ||
type: String, | ||
default: 'done' | ||
} | ||
} | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.