diff --git a/src/newui/src/components/Player/Demos.vue b/src/newui/src/components/Player/Demos.vue index 0854c6a..fee542b 100644 --- a/src/newui/src/components/Player/Demos.vue +++ b/src/newui/src/components/Player/Demos.vue @@ -13,6 +13,7 @@ import { DemoApi } from 'src/api/demo'; import { Format } from 'src/utils/formatters'; import DataTable from 'components/common/DataTable.vue'; +import MatchDetails from 'components/Player/MatchDetails.vue'; /* ====================== Data ====================== */ @@ -21,7 +22,7 @@ const props = defineProps<{ }>(); const tableRef = ref(); -const columns: DataTableHeader[] = [ +const columns = [ { label: 'Date', name: 'timestamp', align: 'left', style: 'width: 75px' }, // { label: 'Type', name: 'type' }, { label: 'Rank', name: 'mmRankUpdate' }, @@ -32,7 +33,8 @@ const columns: DataTableHeader[] = [ { label: 'D', name: 'deaths' }, { label: 'KDD', name: 'kdd' }, { label: 'ADR', name: 'adr' }, -]; +] as DataTableHeader[]; +const matchDetailsRef = ref(); /* ====================== Methods ====================== */ @@ -53,11 +55,22 @@ const formatDate = (timestamp: number) => { return date.formatDate(timestamp * 1000, dateFormat); }; + +const showMatchDetails = (row: DemoResponse) => { + matchDetailsRef.value.open(row.demoid); +}; diff --git a/src/newui/src/components/Player/MatchDetails.vue b/src/newui/src/components/Player/MatchDetails.vue new file mode 100644 index 0000000..9b7ee5b --- /dev/null +++ b/src/newui/src/components/Player/MatchDetails.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/src/newui/src/components/common/DataTable.vue b/src/newui/src/components/common/DataTable.vue index 47fae66..fa0657c 100644 --- a/src/newui/src/components/common/DataTable.vue +++ b/src/newui/src/components/common/DataTable.vue @@ -1,15 +1,15 @@ @@ -141,6 +149,7 @@ onMounted(async () => { separator="horizontal" wrap-cells @request="getData" + @row-click="rowClicked" >