root: true,
env: {
- node: true
+ node: true,
},
plugins: ['simple-import-sort'],
'plugin:import/typescript',
'plugin:vue/vue3-recommended',
'@vue/eslint-config-typescript/recommended',
- '@vue/eslint-config-prettier'
+ '@vue/eslint-config-prettier',
],
settings: {
'import/resolver': {
typescript: {
- project: './tsconfig.json'
- }
- }
+ project: './tsconfig.json',
+ },
+ },
},
parserOptions: {
sourceType: 'module',
- ecmaVersion: 'latest'
+ ecmaVersion: 'latest',
},
rules: {
'no-debugger': env.NODE_ENV === 'production' ? 'warn' : 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
- 'vue/multi-word-component-names': 'off'
- }
+ 'vue/multi-word-component-names': 'off',
+ },
})
export default {
'*.{.css,json,md,yml,yaml,html,js,jsx,cjs,mjs,ts,tsx,cts,mts}': 'prettier --cache --write',
- '*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}':
- 'eslint . --cache --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore'
+ // '*.{vue,js,jsx,cjs,mjs,ts,tsx,cts,mts}':
+ // 'eslint . --cache --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore',
}
"arrowParens": "avoid",
"singleQuote": true,
"semi": false,
- "trailingComma": "none"
+ "trailingComma": "es5"
}
autoStart: convertToBoolean(state.autoStart),
persistentConfiguration: convertToBoolean(state.persistentConfiguration),
ocppStrictCompliance: convertToBoolean(state.ocppStrictCompliance),
- enableStatistics: convertToBoolean(state.enableStatistics)
+ enableStatistics: convertToBoolean(state.enableStatistics),
})
.then(() => {
$toast.success('Charging stations successfully added')
autoStart: false,
persistentConfiguration: true,
ocppStrictCompliance: true,
- enableStatistics: false
+ enableStatistics: false,
})
watch(getCurrentInstance()!.appContext.config.globalProperties.$templates, () => {
}>()
const state = ref<{ supervisionUrl: string }>({
- supervisionUrl: ''
+ supervisionUrl: '',
})
</script>
}>()
const state = ref<{ idTag: string }>({
- idTag: ''
+ idTag: '',
})
</script>
const id = props.shared === true ? `shared-toggle-button-${props.id}` : `toggle-button-${props.id}`
const state = ref<{ status: boolean }>({
- status: getFromLocalStorage<boolean>(id, props.status ?? false)
+ status: getFromLocalStorage<boolean>(id, props.status ?? false),
})
const click = (): void => {
() => {
$router.push({
name: 'start-transaction',
- params: { hashId, chargingStationId, connectorId }
+ params: { hashId, chargingStationId, connectorId },
})
}
"
name: 'set-supervision-url',
params: {
hashId: chargingStation.stationInfo.hashId,
- chargingStationId: chargingStation.stationInfo.chargingStationId
- }
+ chargingStationId: chargingStation.stationInfo.chargingStationId,
+ },
})
}
"
type RequestPayload,
type ResponsePayload,
ResponseStatus,
- type UIServerConfigurationSection
+ type UIServerConfigurationSection,
} from '@/types'
import { randomUUID, validateUUID } from './Utils'
return this.sendRequest(ProcedureName.ADD_CHARGING_STATIONS, {
template,
numberOfStations,
- options
+ options,
})
}
public async deleteChargingStation(hashId: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.DELETE_CHARGING_STATIONS, {
- hashIds: [hashId]
+ hashIds: [hashId],
})
}
public async setSupervisionUrl(hashId: string, supervisionUrl: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.SET_SUPERVISION_URL, {
hashIds: [hashId],
- url: supervisionUrl
+ url: supervisionUrl,
})
}
public async startChargingStation(hashId: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.START_CHARGING_STATION, {
- hashIds: [hashId]
+ hashIds: [hashId],
})
}
public async stopChargingStation(hashId: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.STOP_CHARGING_STATION, {
- hashIds: [hashId]
+ hashIds: [hashId],
})
}
public async openConnection(hashId: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.OPEN_CONNECTION, {
- hashIds: [hashId]
+ hashIds: [hashId],
})
}
public async closeConnection(hashId: string): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.CLOSE_CONNECTION, {
- hashIds: [hashId]
+ hashIds: [hashId],
})
}
return this.sendRequest(ProcedureName.START_TRANSACTION, {
hashIds: [hashId],
connectorId,
- idTag
+ idTag,
})
}
): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.STOP_TRANSACTION, {
hashIds: [hashId],
- transactionId
+ transactionId,
})
}
): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.START_AUTOMATIC_TRANSACTION_GENERATOR, {
hashIds: [hashId],
- connectorIds: [connectorId]
+ connectorIds: [connectorId],
})
}
): Promise<ResponsePayload> {
return this.sendRequest(ProcedureName.STOP_AUTOMATIC_TRANSACTION_GENERATOR, {
hashIds: [hashId],
- connectorIds: [connectorId]
+ connectorIds: [connectorId],
})
}
`${this.uiServerConfiguration.protocol}${this.uiServerConfiguration.version}`,
`authorization.basic.${btoa(
`${this.uiServerConfiguration.authentication.username}:${this.uiServerConfiguration.authentication.password}`
- ).replace(/={1,2}$/, '')}`
+ ).replace(/={1,2}$/, '')}`,
]
: `${this.uiServerConfiguration.protocol}${this.uiServerConfiguration.version}`
this.ws = new WebSocket(
getLocalStorage,
randomUUID,
setToLocalStorage,
- useUIClient
+ useUIClient,
} from './Utils'
path: '/',
name: 'charging-stations',
components: {
- default: ChargingStationsView
- }
+ default: ChargingStationsView,
+ },
},
{
path: '/add-charging-stations',
name: 'add-charging-stations',
components: {
default: ChargingStationsView,
- action: AddChargingStations
- }
+ action: AddChargingStations,
+ },
},
{
path: '/set-supervision-url/:hashId/:chargingStationId',
name: 'set-supervision-url',
components: {
default: ChargingStationsView,
- action: SetSupervisionUrl
+ action: SetSupervisionUrl,
},
- props: { default: false, action: true }
+ props: { default: false, action: true },
},
{
path: '/start-transaction/:hashId/:chargingStationId/:connectorId',
name: 'start-transaction',
components: {
default: ChargingStationsView,
- action: StartTransaction
+ action: StartTransaction,
},
- props: { default: false, action: true }
+ props: { default: false, action: true },
},
{
name: 'not-found',
path: '/:pathMatch(.*)*',
components: {
- default: NotFoundView
- }
- }
- ]
+ default: NotFoundView,
+ },
+ },
+ ],
})
export enum IdTagDistribution {
RANDOM = 'random',
ROUND_ROBIN = 'round-robin',
- CONNECTOR_AFFINITY = 'connector-affinity'
+ CONNECTOR_AFFINITY = 'connector-affinity',
}
export interface AutomaticTransactionGeneratorConfiguration extends JsonObject {
Idle = 'Idle',
InstallationFailed = 'InstallationFailed',
Installing = 'Installing',
- Installed = 'Installed'
+ Installed = 'Installed',
}
export interface FirmwareUpgrade extends JsonObject {
}
export const FirmwareStatus = {
- ...OCPP16FirmwareStatus
+ ...OCPP16FirmwareStatus,
} as const
export type FirmwareStatus = OCPP16FirmwareStatus
REMOTE_START_TRANSACTION = 'RemoteStartTransaction',
REMOTE_STOP_TRANSACTION = 'RemoteStopTransaction',
GET_DIAGNOSTICS = 'GetDiagnostics',
- TRIGGER_MESSAGE = 'TriggerMessage'
+ TRIGGER_MESSAGE = 'TriggerMessage',
}
export const IncomingRequestCommand = {
- ...OCPP16IncomingRequestCommand
+ ...OCPP16IncomingRequestCommand,
} as const
export type IncomingRequestCommand = OCPP16IncomingRequestCommand
START_TRANSACTION = 'StartTransaction',
STOP_TRANSACTION = 'StopTransaction',
METER_VALUES = 'MeterValues',
- DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification'
+ DIAGNOSTICS_STATUS_NOTIFICATION = 'DiagnosticsStatusNotification',
}
export const RequestCommand = {
- ...OCPP16RequestCommand
+ ...OCPP16RequestCommand,
} as const
export type RequestCommand = OCPP16RequestCommand
export enum OCPP16RegistrationStatus {
ACCEPTED = 'Accepted',
PENDING = 'Pending',
- REJECTED = 'Rejected'
+ REJECTED = 'Rejected',
}
export interface OCPP16BootNotificationResponse extends JsonObject {
FirmwareStatusNotification = 'FirmwareStatusNotification',
Heartbeat = 'Heartbeat',
MeterValues = 'MeterValues',
- StatusNotification = 'StatusNotification'
+ StatusNotification = 'StatusNotification',
}
export const MessageTrigger = {
- ...OCPP16MessageTrigger
+ ...OCPP16MessageTrigger,
} as const
export type MessageTrigger = OCPP16MessageTrigger
export enum OCPPVersion {
VERSION_16 = '1.6',
VERSION_20 = '2.0',
- VERSION_201 = '2.0.1'
+ VERSION_201 = '2.0.1',
}
export enum OCPPProtocol {
- JSON = 'json'
+ JSON = 'json',
}
export enum CurrentType {
AC = 'AC',
- DC = 'DC'
+ DC = 'DC',
}
export enum Voltage {
VOLTAGE_110 = 110,
VOLTAGE_230 = 230,
VOLTAGE_400 = 400,
- VOLTAGE_800 = 800
+ VOLTAGE_800 = 800,
}
export enum AmpereUnits {
MILLI_AMPERE = 'mA',
CENTI_AMPERE = 'cA',
DECI_AMPERE = 'dA',
- AMPERE = 'A'
+ AMPERE = 'A',
}
export interface ConnectorStatus extends JsonObject {
export enum OCPP16AvailabilityType {
INOPERATIVE = 'Inoperative',
- OPERATIVE = 'Operative'
+ OPERATIVE = 'Operative',
}
export type AvailabilityType = OCPP16AvailabilityType
FINISHING = 'Finishing',
RESERVED = 'Reserved',
UNAVAILABLE = 'Unavailable',
- FAULTED = 'Faulted'
+ FAULTED = 'Faulted',
}
export type ChargePointStatus = OCPP16ChargePointStatus
import type { JsonObject } from './JsonType'
export enum Protocol {
- UI = 'ui'
+ UI = 'ui',
}
export enum ApplicationProtocol {
WS = 'ws',
- WSS = 'wss'
+ WSS = 'wss',
}
export enum ProtocolVersion {
- '0.0.1' = '0.0.1'
+ '0.0.1' = '0.0.1',
}
export enum AuthenticationType {
- PROTOCOL_BASIC_AUTH = 'protocol-basic-auth'
+ PROTOCOL_BASIC_AUTH = 'protocol-basic-auth',
}
export type ProtocolRequest = [
`${string}-${string}-${string}-${string}-${string}`,
ProcedureName,
- RequestPayload
+ RequestPayload,
]
export type ProtocolResponse = [
`${string}-${string}-${string}-${string}-${string}`,
- ResponsePayload
+ ResponsePayload,
]
export type ProtocolRequestHandler = (
START_AUTOMATIC_TRANSACTION_GENERATOR = 'startAutomaticTransactionGenerator',
STOP_AUTOMATIC_TRANSACTION_GENERATOR = 'stopAutomaticTransactionGenerator',
START_TRANSACTION = 'startTransaction',
- STOP_TRANSACTION = 'stopTransaction'
+ STOP_TRANSACTION = 'stopTransaction',
}
export interface RequestPayload extends JsonObject {
export enum ResponseStatus {
SUCCESS = 'success',
- FAILURE = 'failure'
+ FAILURE = 'failure',
}
export interface ResponsePayload extends JsonObject {
ChargingStationInfo,
ChargingStationOptions,
ConnectorStatus,
- Status
+ Status,
} from './ChargingStationType'
export type { ConfigurationData, UIServerConfigurationSection } from './ConfigurationType'
export {
type RequestPayload,
type ResponsePayload,
ResponseStatus,
- type SimulatorState
+ type SimulatorState,
} from './UIProtocol'
getLocalStorage,
randomUUID,
setToLocalStorage,
- useUIClient
+ useUIClient,
} from '@/composables'
import type {
ChargingStationData,
ResponsePayload,
SimulatorState,
- UIServerConfigurationSection
+ UIServerConfigurationSection,
} from '@/types'
const simulatorState = ref<SimulatorState | undefined>(undefined)
gettingSimulatorState: false,
gettingTemplates: false,
gettingChargingStations: false,
- uiServerIndex: getFromLocalStorage<number>('uiServerConfigurationIndex', 0)
+ uiServerIndex: getFromLocalStorage<number>('uiServerConfigurationIndex', 0),
})
const clearToggleButtons = (): void => {
.uiServer as UIServerConfigurationSection[]
).map((configuration: UIServerConfigurationSection, index: number) => ({
index,
- configuration
+ configuration,
}))
const startSimulator = (): void => {
test('renders CS table columns name', () => {
const chargingStations: ChargingStationData[] = []
const wrapper = shallowMount(CSTable, {
- props: { chargingStations, idTag: '0' }
+ props: { chargingStations, idTag: '0' },
})
expect(wrapper.text()).to.include('Name')
expect(wrapper.text()).to.include('Started')
plugins: [vue(), vueJsx()],
resolve: {
alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url))
- }
- }
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
+ },
+ },
})
root: fileURLToPath(new URL('./', import.meta.url)),
coverage: {
provider: 'v8',
- reporter: ['text', 'lcov']
- }
- }
+ reporter: ['text', 'lcov'],
+ },
+ },
})
)