From 1539608790725aa0f34474f426a492d1fc483ade Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Fri, 16 Oct 2020 12:07:15 +0200 Subject: [PATCH] merge components into table, first experiments with jquery get --- src/App.vue | 53 +++++-------- src/components/Table/Table.vue | 97 ++++++++++++++++++++++-- src/components/TableItem/TableItem.vue | 101 ------------------------- src/main.js | 3 + 4 files changed, 111 insertions(+), 143 deletions(-) delete mode 100644 src/components/TableItem/TableItem.vue diff --git a/src/App.vue b/src/App.vue index f17942f..04c1eb8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -2,10 +2,10 @@ @@ -41,35 +47,14 @@ export default { Breadcrumb, Table, }, - data() { - return { - loading: false, - date: Date.now() + 86400000 * 3, - date2: Date.now() + 86400000 * 3 + Math.floor(Math.random() * 86400000 / 2), - show: true, - starred: false, - } - }, - methods: { - addOption(val) { - this.options.push(val) - this.select.push(val) - }, - previous(data) { - console.debug(data) - }, - next(data) { - console.debug(data) - }, - close(data) { - console.debug(data) - }, - newButtonAction(e) { - console.debug(e) - }, - log(e) { - console.debug(e) - }, + data: () => ({ + tableData: undefined, + }), + mounted() { + this.$jquery.get('https://de1.api.radio-browser.info/json/stations/topclick?limit=10') + .function((data) => { + this.tableData = data + }) }, } diff --git a/src/components/Table/Table.vue b/src/components/Table/Table.vue index ab1ea14..bfe4f40 100644 --- a/src/components/Table/Table.vue +++ b/src/components/Table/Table.vue @@ -10,22 +10,62 @@ - + + +
+ + + + {{ stationName }} + + + + + + Add to favorites + + + Details + + + + @@ -53,7 +93,7 @@ table { th.nameColumn { width: 100%; - padding-left: 35px; + padding-left: 57px; } } @@ -76,4 +116,45 @@ table td { background-repeat: no-repeat; } +tr { + height: 51px; + background-color: var(--color-background-light); + + tr:hover, tr:focus, tr.mouseOver td { + background-color: var(--color-background-hover); + } + +} + +tr td:first-child { + padding-left: 40px; + width: 32px; + padding-right: 0px; +} + +td { + border-bottom: 1px solid var(--color-border); +} + +td.filenameColumn .innernametext { + color: var(--color-main-text); +} + +.stationIcon { + width: 32px; + height: 32px; + background-repeat: no-repeat; + background-size: contain; + background-position: center; +} + +.actionColumn { + width: auto; + padding-right: 40px; +} + +.filenameColumn { + width: 100%; +} + diff --git a/src/components/TableItem/TableItem.vue b/src/components/TableItem/TableItem.vue deleted file mode 100644 index 5d4d12f..0000000 --- a/src/components/TableItem/TableItem.vue +++ /dev/null @@ -1,101 +0,0 @@ - - - - - diff --git a/src/main.js b/src/main.js index 21d9806..ad8efaf 100644 --- a/src/main.js +++ b/src/main.js @@ -24,8 +24,11 @@ import { translate, translatePlural } from '@nextcloud/l10n' import App from './App' +import jquery from 'jquery' + Vue.prototype.t = translate Vue.prototype.n = translatePlural +Vue.prototype.$jquery = jquery export default new Vue({ el: '#content',