Skip to content

Commit

Permalink
fix(admin(js,vue)): cleanup lint, deprecate AlertServices
Browse files Browse the repository at this point in the history
  • Loading branch information
satkunas committed Jan 25, 2023
1 parent a4cd121 commit 6ab51ab
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 188 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const setup = (props, context) => {
})
const replicas = computed(() => {
const { [service.value]: { total_replicas, updated_replicas } = {} } = $store.state.k8s.services
// eslint-disable-next-line no-unused-vars
return [ ...Array(total_replicas) ].map((_, i) => (i < updated_replicas))
})
Expand Down
2 changes: 1 addition & 1 deletion html/pfappserver/root/src/utils/regex.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ export const reNumeric = value => /^-?[0-9]*$/.test(value)
// eslint-disable-next-line no-useless-escape
export const reStaticRoute = value => /^(?:[0-9]{1,3}\.){3}[0-9]{1,3}\/?(\d+)?\s+?(via\s+(?:[0-9]{1,3}\.){3}[0-9]{1,3}\s+?)?dev\s+[a-z,0-9\.]+$/i.test(value)

// eslint-disable-next-line no-control-regex
export const reAscii = value => /^([\x20-\x7E]+)$/.test(value)
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
:to="{ name: 'newEventLogger', params: { eventLoggerType: value } }"
>{{ text }}</b-dropdown-item>
</b-dropdown>
<base-button-system-service
service="packetfence-mariadb" restart start stop
class="ml-1" />
</base-search>
<b-table ref="tableRef"
:busy="isLoading"
Expand Down Expand Up @@ -99,7 +96,6 @@
import {
BaseButtonConfirm,
BaseButtonHelp,
BaseButtonSystemService,
BaseSearch,
BaseSearchInputColumns,
BaseServices,
Expand All @@ -109,7 +105,6 @@ import {
const components = {
BaseButtonConfirm,
BaseButtonHelp,
BaseButtonSystemService,
BaseSearch,
BaseSearchInputColumns,
BaseServices,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
AlertServices,
BaseView,

FormButtonBar,
TheForm
} from './'
Expand All @@ -10,36 +10,17 @@ const components = {
TheForm
}

import { computed } from '@vue/composition-api'
import { renderHOCWithScopedSlots } from '@/components/new/'
import { useViewResource, useViewResourceProps as props } from '../../_composables/useViewResource'
import * as resource from '../_composables/useResource'

const setup = (props, context) => {

const viewResource = useViewResource(resource, props, context)
const {
isLoading,
isModified
} = viewResource

const scopedSlotProps = computed(() => ({ ...props, isLoading: isLoading.value, isModified: isModified.value }))

return {
...viewResource,
scopedSlotProps
}
}

const render = renderHOCWithScopedSlots(BaseView, { components, props, setup }, {
buttonsPrepend: AlertServices
})
import * as resource from '../_composables/useResource'
const setup = (props, context) => useViewResource(resource, props, context)

// @vue/component
export default {
name: 'the-view',
extends: BaseView,
inheritAttrs: false,
components,
props,
render
setup
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
BaseFormGroupTextarea,
BaseFormGroupToggleDisabledEnabled
} from '@/components/new/'
import AlertServices from './AlertServices'
import TheForm from './TheForm'
import TheView from './TheView'

Expand All @@ -20,7 +19,6 @@ export {
BaseFormGroupInput as FormGroupSubjectPrefix,

BaseViewResource as BaseView,
AlertServices,
TheForm,
TheView
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ export const useStore = $store => {
updateItem: params => $store.dispatch('$_bases/updateFencing', params)
}
}

export const useServices = () => computed(() => {
return {
message: i18n.t('Creating or modifying the syslog forwarders requires to restart the rsyslog system service.'),
services: ['pfdns', 'iptables'],
}
})

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {
AlertServices,
BaseView,
FormButtonBar,
TheForm
Expand All @@ -10,8 +9,6 @@ const components = {
TheForm
}

import { computed } from '@vue/composition-api'
import { renderHOCWithScopedSlots } from '@/components/new/'
import { useViewCollectionItem, useViewCollectionItemProps } from '../../_composables/useViewCollectionItem'
import * as collection from '../_composables/useCollection'

Expand All @@ -20,25 +17,7 @@ const props = {
...collection.useItemProps
}

const setup = (props, context) => {

const viewCollectionItem = useViewCollectionItem(collection, props, context)
const {
isLoading,
isModified
} = viewCollectionItem

const scopedSlotProps = computed(() => ({ ...props, isLoading: isLoading.value, isModified: isModified.value }))

return {
...viewCollectionItem,
scopedSlotProps
}
}

const render = renderHOCWithScopedSlots(BaseView, { components, props, setup }, {
buttonsPrepend: AlertServices
})
const setup = (props, context) => useViewCollectionItem(collection, props, context)

// @vue/component
export default {
Expand All @@ -47,5 +26,5 @@ export default {
extends: BaseView,
components,
props,
render
setup
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
BaseFormGroupInputNumber,
BaseFormGroupToggleDisabledEnabled
} from '@/components/new/'
import AlertServices from './AlertServices'
import TheForm from './TheForm'
import TheView from './TheView'

Expand All @@ -22,7 +21,6 @@ export {
BaseFormGroupInputNumber as FormGroupPort,
BaseFormGroupChosenOne as FormGroupProto,

AlertServices,
TheForm,
TheView
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ export const useServices = () => computed(() => {
return {
message: i18n.t('Creating or modifying the syslog forwarders requires to restart the rsyslog system service.'),
system_services: ['rsyslog'],
k8s_services: [],
systemd: false
}
})

Expand Down

0 comments on commit 6ab51ab

Please sign in to comment.