mirror of
https://github.com/unraid/api.git
synced 2026-04-25 08:49:00 -05:00
refactor(web): KeyActions extensibility
This commit is contained in:
@@ -41,30 +41,21 @@ const showExpireTime = computed(() => {
|
||||
:t="t"
|
||||
/>
|
||||
</header>
|
||||
<ul v-if="stateData.actions" class="list-reset flex flex-col gap-y-8px px-16px">
|
||||
<li v-if="connectPluginInstalled && unraidApiStatus !== 'online'">
|
||||
<BrandButton
|
||||
class="w-full"
|
||||
:disabled="unraidApiStatus === 'connecting' || unraidApiStatus === 'restarting'"
|
||||
:icon="unraidApiStatus === 'restarting' ? BrandLoadingWhite : unraidApiRestartAction?.icon"
|
||||
:text="unraidApiStatus === 'restarting' ? t('Restarting unraid-api…') : t('Restart unraid-api')"
|
||||
:title="unraidApiStatus === 'restarting' ? t('Restarting unraid-api…') : t('Restart unraid-api')"
|
||||
@click="unraidApiRestartAction?.click()"
|
||||
/>
|
||||
</li>
|
||||
<li v-for="action in stateData.actions" :key="action.name">
|
||||
<BrandButton
|
||||
class="w-full"
|
||||
:disabled="action?.disabled"
|
||||
:external="action?.external"
|
||||
:href="action?.href"
|
||||
:icon="action.icon"
|
||||
:text="t(action.text)"
|
||||
:title="action?.title ? t(action?.title) : null"
|
||||
@click="action.click()"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
<template v-if="stateData.actions">
|
||||
<ul v-if="connectPluginInstalled && unraidApiStatus !== 'online'" class="list-reset flex flex-col gap-y-8px px-16px">
|
||||
<li>
|
||||
<BrandButton
|
||||
class="w-full"
|
||||
:disabled="unraidApiStatus === 'connecting' || unraidApiStatus === 'restarting'"
|
||||
:icon="unraidApiStatus === 'restarting' ? BrandLoadingWhite : unraidApiRestartAction?.icon"
|
||||
:text="unraidApiStatus === 'restarting' ? t('Restarting unraid-api…') : t('Restart unraid-api')"
|
||||
:title="unraidApiStatus === 'restarting' ? t('Restarting unraid-api…') : t('Restart unraid-api')"
|
||||
@click="unraidApiRestartAction?.click()"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
<KeyActions :actions="stateData.actions" :t="t" />
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user