merge-requests/1845/head
parent
3ac67ab727
commit
7bb28bb23c
@ -0,0 +1,58 @@
|
|||||||
|
import BooleanSetting from '../helpers/boolean_setting.vue'
|
||||||
|
import ChoiceSetting from '../helpers/choice_setting.vue'
|
||||||
|
import IntegerSetting from '../helpers/integer_setting.vue'
|
||||||
|
import StringSetting from '../helpers/string_setting.vue'
|
||||||
|
import GroupSetting from '../helpers/group_setting.vue'
|
||||||
|
import Popover from 'src/components/popover/popover.vue'
|
||||||
|
|
||||||
|
import SharedComputedObject from '../helpers/shared_computed_object.js'
|
||||||
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
import {
|
||||||
|
faGlobe
|
||||||
|
} from '@fortawesome/free-solid-svg-icons'
|
||||||
|
|
||||||
|
library.add(
|
||||||
|
faGlobe
|
||||||
|
)
|
||||||
|
|
||||||
|
const FrontendsTab = {
|
||||||
|
provide () {
|
||||||
|
return {
|
||||||
|
defaultDraftMode: true,
|
||||||
|
defaultSource: 'admin'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
BooleanSetting,
|
||||||
|
ChoiceSetting,
|
||||||
|
IntegerSetting,
|
||||||
|
StringSetting,
|
||||||
|
GroupSetting,
|
||||||
|
Popover
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
if (this.user.rights.admin) {
|
||||||
|
this.$store.dispatch('loadFrontendsStuff')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
frontends () {
|
||||||
|
return this.$store.state.adminSettings.frontends
|
||||||
|
},
|
||||||
|
...SharedComputedObject()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
update (frontend, suggestRef) {
|
||||||
|
const ref = suggestRef || frontend.refs[0]
|
||||||
|
const { name } = frontend
|
||||||
|
const payload = { name, ref }
|
||||||
|
|
||||||
|
this.$store.state.api.backendInteractor.installFrontend({ payload })
|
||||||
|
.then((externalUser) => {
|
||||||
|
this.$store.dispatch('loadFrontendsStuff')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default FrontendsTab
|
@ -0,0 +1,13 @@
|
|||||||
|
.frontends-tab {
|
||||||
|
.cards-list {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
dd {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
word-wrap: nowrap;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow-x: hidden;
|
||||||
|
max-width: 80%;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
<template>
|
||||||
|
<div class="frontends-tab" :label="$t('admin_dash.tabs.frontends')">
|
||||||
|
<div class="setting-item">
|
||||||
|
<h2>{{ $t('admin_dash.tabs.frontends') }}</h2>
|
||||||
|
<ul class="setting-list cards-list">
|
||||||
|
<li v-for="frontend in frontends" :key="frontend.name">
|
||||||
|
<strong>{{ frontend.name }}</strong>
|
||||||
|
<dl>
|
||||||
|
<dt>{{ $t('admin_dash.frontend.repository') }}</dt>
|
||||||
|
<dd><a :href="frontend.git">{{ frontend.git }}</a></dd>
|
||||||
|
<dt v-if="expertLevel">{{ $t('admin_dash.frontend.versions') }}</dt>
|
||||||
|
<dd v-if="expertLevel">{{ frontend.refs }}</dd>
|
||||||
|
<dt v-if="expertLevel">{{ $t('admin_dash.frontend.build_url') }}</dt>
|
||||||
|
<dd v-if="expertLevel">{{ frontend.build_url }}</dd>
|
||||||
|
</dl>
|
||||||
|
<div>
|
||||||
|
<span class="btn-group">
|
||||||
|
<button
|
||||||
|
class="button button-default btn"
|
||||||
|
type="button"
|
||||||
|
:title="$t('admin_dash.frontend.update')"
|
||||||
|
@click="update(frontend)"
|
||||||
|
>
|
||||||
|
{{
|
||||||
|
frontend.installed
|
||||||
|
? $t('admin_dash.frontend.reinstall')
|
||||||
|
: $t('admin_dash.frontend.install')
|
||||||
|
}}
|
||||||
|
</button>
|
||||||
|
<Popover
|
||||||
|
v-if="frontend.refs.length > 1"
|
||||||
|
trigger="click"
|
||||||
|
class="button-dropdown"
|
||||||
|
placement="bottom"
|
||||||
|
>
|
||||||
|
<template #content>
|
||||||
|
<div class="dropdown-menu">
|
||||||
|
<button
|
||||||
|
v-for="ref in frontend.refs"
|
||||||
|
:key="ref"
|
||||||
|
class="button-default dropdown-item"
|
||||||
|
@click="update(frontend, ref)"
|
||||||
|
>
|
||||||
|
<i18n-t keypath="admin_dash.frontend.install_version">
|
||||||
|
<template #version>
|
||||||
|
<code>{{ ref }}</code>
|
||||||
|
</template>
|
||||||
|
</i18n-t>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #trigger>
|
||||||
|
<button
|
||||||
|
class="button button-default btn"
|
||||||
|
type="button"
|
||||||
|
:title="$t('admin_dash.frontend.update')"
|
||||||
|
>
|
||||||
|
<FAIcon icon="chevron-down" />
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
</Popover>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script src="./frontends_tab.js"></script>
|
||||||
|
|
||||||
|
<style lang="scss" src="./frontends_tab.scss"></style>
|
Loading…
Reference in new issue