Compare commits
1 commit
44c6a3b1a7
...
b773a0dde1
Author | SHA1 | Date | |
---|---|---|---|
b773a0dde1 |
1 changed files with 6 additions and 3 deletions
|
@ -1,8 +1,10 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import TableComponent from '@/components/TableComponent.vue';
|
import TableComponent from '@/components/TableComponent.vue';
|
||||||
|
import {getConfigs} from '@/services/ServerConfigs'
|
||||||
|
|
||||||
const tableHeader = ["ID", "Server ID", "System Message", "Rate limit"]
|
const serverConfigs = await getConfigs()
|
||||||
const tableRows = [["1", "name", "comment", "1"]]
|
const tableHeader = ["ID", "Server ID", "System Message", "Rate limit", "Created"]
|
||||||
|
const tableRows = serverConfigs.map(config => [config.id, config.serverId, config.systemMessage.slice(0, 47) + "...", config.rateLimit, config.time])
|
||||||
const actions = [{ class: "btn btn-sm btn-info m-1", content: "Edit", event: (_: number) => { } }, { class: "btn btn-sm btn-error m-1", content: "Delete", event: (_: number) => { } }]
|
const actions = [{ class: "btn btn-sm btn-info m-1", content: "Edit", event: (_: number) => { } }, { class: "btn btn-sm btn-error m-1", content: "Delete", event: (_: number) => { } }]
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
@ -10,5 +12,6 @@ const actions = [{ class: "btn btn-sm btn-info m-1", content: "Edit", event: (_:
|
||||||
<h1 class="text-xl normal-case">Server Configs</h1>
|
<h1 class="text-xl normal-case">Server Configs</h1>
|
||||||
<button class="btn btn-circle btn-success">Add</button>
|
<button class="btn btn-circle btn-success">Add</button>
|
||||||
</div>
|
</div>
|
||||||
<TableComponent :tableHeader="tableHeader" :tableRows="tableRows" :actions="actions" />
|
<TableComponent v-if="serverConfigs.length" :tableHeader="tableHeader" :tableRows="tableRows" :actions="actions" />
|
||||||
|
<p v-else class="m-5">No server configs</p>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in a new issue