move_users #5

Merged
vbuglov merged 4 commits from move_users into master 2024-04-03 09:28:15 +00:00
28 changed files with 145 additions and 184 deletions
Showing only changes of commit 2b2ad786b2 - Show all commits

View File

@ -42,6 +42,12 @@ prehook:
@chmod +x $(HOOK_PATH)
@echo "Pre-push hook set successfully."
add:
ifeq ($(pack),)
$(error mn is not set)
endif
yarn add "../repo/${pack}/"
push:
ifeq ($(commit),)
$(error mn is not set)

View File

@ -15,6 +15,7 @@
"lint_fix": "yarn eslint './**/*.{js,vue}' --fix"
},
"dependencies": {
"3-class-complex-assistants": "../repo/3-class-complex-assistants/",
"axios": "^1.6.7",
"flowbite": "^2.3.0",
"flowbite-vue": "^0.1.2",

View File

@ -1,32 +1,45 @@
import {get, post, put, remove} from './apiHelpers.js'
import {convertList, convertObject} from '@helpers/adapter/adapter.js'
import {Logger} from '3-class-complex-assistants'
import moment from 'moment/moment.js'
const config = {
id: "id",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
created_at: "createdAt",
updated_at: "updatedAt",
deleted_at: "deletedAt",
name: "name",
port: "port",
proxy_ip: "proxy_ip",
internet_uri: "internet_uri",
proxy_ip: "proxyIp",
internet_uri: "internetUri",
description: "description",
is_online: "is_online",
site_ip: "device_ip",
is_online: "isOnline",
site_ip: "deviceIp",
}
const configToServer = {
id: "id",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at",
createdAt: "created_at",
updatedAt: "updated_at",
deletedAt: "deleted_at",
name: "name",
port: "port",
proxy_ip: "proxy_ip",
internet_uri: "internet_uri",
proxyIp: "proxy_ip",
internetUri: "internet_uri",
description: "description",
is_online: "is_online",
device_ip: "site_ip",
isOnline: "is_online",
deviceIp: "site_ip",
}
const loggerInfo = {
"loggerLevel": 1,
"serviceName": "users-manage",
"port": 5173,
"datetime": moment().format("YYYY-MM-DDTHH:mm:ss"),
}
const callbackError = (error) => {
return console.err(error)
}
class Services {
@ -40,6 +53,7 @@ class Services {
this.apiAddr = apiAddr
this.config = config
this.configToServer = configToServer
this.loggerConfig = {...loggerInfo, callFunc: callbackError, isPushToServer: true}
}
/**
@ -59,13 +73,14 @@ class Services {
*/
async createService(payload) {
const logger = new Logger(this.loggerConfig)
let newService = []
const updatedPort = parseFloat(payload.port)
const updatedService = {...convertObject(payload, {config: this.configToServer}), port: updatedPort}
await post(`${this.apiAddr}/servers`, updatedService).then(res => {
newService = convertObject(res.value, {config: this.config})
}).catch(err => {
console.log('err', err)
logger.error(err)
})
return newService
}
@ -77,6 +92,7 @@ class Services {
*/
async updateService(payload) {
const logger = new Logger(this.loggerConfig)
let resService = []
const updatedPort = parseFloat(payload.port)
const updatedService = {...convertObject(payload, {config: this.configToServer}), port: updatedPort}
@ -84,7 +100,7 @@ class Services {
await put(`${this.apiAddr}/servers`, updatedService, payload.id).then(res => {
resService = convertObject(res.value, {config: this.config})
}).catch(err => {
console.log('err', err)
logger.error(err)
})
}
return resService
@ -97,11 +113,12 @@ class Services {
*/
async deleteService(id) {
const logger = new Logger(this.loggerConfig)
let deletedServiceId = null
await remove(`${this.apiAddr}/servers`, id).then((res) => {
deletedServiceId = res.id
}).catch(err => {
console.log('err', err)
logger.error(err)
})
return deletedServiceId
}

View File

@ -8,7 +8,7 @@ import {devUsersList} from './StaticData.js'
* @param {Number} id
*/
const adapter_config = {
const adapterConfig = {
id: "id",
first_name: "firstName",
last_name: "lastName",
@ -17,7 +17,7 @@ const adapter_config = {
service_id: "serviceId",
}
const server_config = {
const serverConfig = {
id: "id",
firstName: "first_name",
lastName: "last_name",
@ -35,8 +35,8 @@ class Users {
*/
constructor(apiAddr, params = {mode: 'prod'}) {
this.apiAddr = apiAddr
this.config = adapter_config
this.server_config = server_config
this.config = adapterConfig
this.serverConfig = serverConfig
this.mode = params.mode
}
@ -76,7 +76,7 @@ class Users {
* @returns {Promise<Object>}
*/
async createUser(userData) {
const newUser = await post(`${this.apiAddr}/users`, convertObject(userData, {config: this.server_config}))
const newUser = await post(`${this.apiAddr}/users`, convertObject(userData, {config: this.serverConfig}))
return convertObject(newUser, {config: this.config})
}
@ -88,7 +88,7 @@ class Users {
async updateUser(userData) {
const updatedUserData = {...userData}
delete updatedUserData.id
const newUser = await put(`${this.apiAddr}/users/${userData.id}`, convertObject(updatedUserData, {config: this.server_config}))
const newUser = await put(`${this.apiAddr}/users/${userData.id}`, convertObject(updatedUserData, {config: this.serverConfig}))
return convertObject(newUser, {config: this.config})
}

View File

@ -2,7 +2,6 @@
export default {
name: 'VDoubleSwitch',
components: {
// Button,
},
props: {
machine: {

View File

@ -1,4 +1,3 @@
<!-- eslint-disable vue/prop-name-casing -->
<script>
import {mapGetters} from 'vuex'
import Input from '@atoms/VInput.vue'
@ -51,11 +50,11 @@ export default {
secondColor="#2563eb"
firstTitle="Офлайн"
secondTitle="Онлайн"
:isCheck="selectedService?.is_online"
:isCheck="selectedService?.isOnline"
position="col"
labelClass="items-start pb-2"
switchClass="switcher mt-1"
@switched="(e) => editData({key: 'is_online', value: e})"
@switched="(e) => editData({key: 'isOnline', value: e})"
/>
</div>
<Input
@ -91,8 +90,8 @@ export default {
<span class="mr-2 min-w-[80px]">IP proxy:</span>
<Input
id="proxyIp"
name="proxy_ip"
:value="selectedService?.proxy_ip"
name="proxyIp"
:value="selectedService?.proxyIp"
inputClass="py-2"
placeholder="IP proxy"
:onChange="editData"
@ -102,8 +101,8 @@ export default {
<span class="mr-2 min-w-[80px]">IP устр-ва:</span>
<Input
id="deviceIp"
name="device_ip"
:value="selectedService?.device_ip"
name="deviceIp"
:value="selectedService?.deviceIp"
inputClass="py-2"
placeholder="IP устройства"
:onChange="editData"

View File

@ -35,11 +35,11 @@ export default {
default: "",
type: String
},
device_ip: {
deviceIp: {
default: "",
type: String
},
proxy_ip: {
proxyIp: {
default: "",
type: String
},
@ -68,13 +68,11 @@ export default {
},
watch: {
isSaveData: function (newVal) {
// console.log('newVal', newVal)
if (newVal) {
this.saveServiceData()
}
},
isOnline: function (newVal) {
// console.log('newVal', newVal)
this.status = this.setStatus(newVal)
}
},
@ -92,14 +90,13 @@ export default {
const data = {
name: this.selectedService.name,
port: this.selectedService.port,
device_ip: this.selectedService.device_ip,
proxy_ip: this.selectedService.proxy_ip,
deviceIp: this.selectedService.deviceIp,
proxyIp: this.selectedService.proxyIp,
description: this.selectedService.description,
is_online: this.selectedService.is_online,
isOnline: this.selectedService.isOnline,
}
this.serviceOfServices.createNewService(data)
} else {
// this.updateRoutesWithApi(this.selectedService)
this.serviceOfServices.saveService(this.selectedService)
}
},
@ -168,10 +165,10 @@ export default {
</span>
</div>
<p class=" font-normal text-sm text-gray-700 dark:text-gray-400 mb-2 flex">
<span class="min-w-[80px] font-w-700 inline-block flex"> IP proxy:</span> {{ proxy_ip }}
<span class="min-w-[80px] font-w-700 inline-block flex"> IP proxy:</span> {{ proxyIp }}
</p>
<p class=" font-normal text-sm text-gray-700 dark:text-gray-400 mb-2 flex">
<span class="min-w-[80px] font-w-700 inline-block flex"> IP устр-ва:</span> {{ device_ip }}
<span class="min-w-[80px] font-w-700 inline-block flex"> IP устр-ва:</span> {{ deviceIp }}
</p>
<p class=" font-normal text-sm text-gray-700 dark:text-gray-400 mb-2 flex ">
<span class="min-w-[80px] font-w-700 inline-block flex"> Описание:</span> <span

View File

@ -57,9 +57,9 @@ export default {
:service="service"
:name="service.name"
:port="`${service.port}`"
:device_ip="service.device_ip"
:proxy_ip="service.proxy_ip"
:isOnline="service.is_online"
:deviceIp="service.deviceIp"
:proxyIp="service.proxyIp"
:isOnline="service.isOnline"
:description="service.description"
/>
</div>

View File

@ -51,7 +51,6 @@ export default {
this.serviceOfUsers.editUserByService(params)
},
saveUser() {
// console.log('Save user')
this.errorPassword = isRepeatPasswordEmpty(this.selectedUser.password, this.repeatPassword)
if (this.errorPassword) return
this.serviceOfUsers.saveUpdatedDataUser(this.selectedService.id)

View File

@ -33,7 +33,6 @@ export default {
},
watch: {
selectedService: function (newValue, oldValue) {
console.log('newValue.id', newValue.id)
if (newValue.id !== oldValue.id) {
this.serviceOfUsers.setStatusUser('inactive')
}

View File

@ -6,7 +6,6 @@ const generatePassword = () => {
const randomNumber = Math.floor(Math.random() * chars.length)
pass += chars.substring(randomNumber, randomNumber + 1)
}
// console.log('pass', pass)
return pass
}

View File

@ -49,7 +49,6 @@ class ServiceOfServices {
async editSelectedService(params) {
const selectedService = this.store.getters['services/selectedService']
// console.log('selectedService', selectedService)
selectedService[params.key] = params.value
this.store.dispatch('services/editSelectedService', selectedService)
}
@ -65,7 +64,6 @@ class ServiceOfServices {
const editedService = await this.adapterOfServices.updateService(updateService)
const services = this.store.getters['services/services']
const updatedServices = !isEmpty(editedService) ? updatedService(editedService, services) : services
// console.log('updatedServices', updatedServices)
this.store.dispatch('services/saveService', updatedServices)
return editedService
}

View File

@ -13,7 +13,6 @@ class UsersOfServices {
*/
async getUsers(mode) {
const users = await this.adapter.getUsers({mode})
// await this.saveSiteUsers(users)
this.store.dispatch('users/updateUsers', users)
return users
}
@ -28,7 +27,6 @@ class UsersOfServices {
const users = await this.adapter.getUsers({mode})
const usersWithService = await this.adapter.getUsersByServiceId(serviceId, mode)
const usersWithoutService = usersWithoutThisService(serviceId, users)
// await this.saveSiteUsers(users)
this.store.dispatch('users/updateUsers', users)
this.store.dispatch('users/updateUsersWithService', usersWithService)
this.store.dispatch('users/updateUsersWithoutService', usersWithoutService)
@ -43,8 +41,6 @@ class UsersOfServices {
async getUsersWithoutService(serviceId) {
const users = this.store.getters['users/users']
const filteredUsers = usersWithoutThisService(serviceId, users)
// await this.saveSiteUsers(users)
// console.log('filteredUsers', filteredUsers)
this.store.dispatch('users/updateUsersWithoutService', filteredUsers)
return filteredUsers
}
@ -55,10 +51,7 @@ class UsersOfServices {
* @returns {Promise<Object>}
*/
async createNewUser() {
// const createdUser = await this.adapter.createUser(userData)
const newUser = {id: -1, firstName: '',lastName: '', role: '', email: '', password: '', serviceId: []}
// const users = this.store.getters['users/users']
// const updatedUsers = addedUser(newUser, users)
this.store.dispatch('users/updateSelectedUser', newUser)
return newUser
}
@ -118,7 +111,6 @@ class UsersOfServices {
*/
async editUserByService(params) {
const selectedUser = this.store.getters['users/selectedUser']
// console.log('selectedService', selectedService)
if (selectedUser) {
selectedUser[params.key] = params.value
this.store.dispatch('users/updateSelectedUser', selectedUser)
@ -150,7 +142,6 @@ class UsersOfServices {
* @returns {Promise<Object>}
*/
async saveUpdatedDataUser(serviceId) {
// console.log('serviceId', serviceId)
const selectedUser = this.store.getters['users/selectedUser']
// const userStatus = this.store.getters['users/userStatus']
if (selectedUser && selectedUser.id) {
@ -171,7 +162,6 @@ class UsersOfServices {
// return createdUser
}
if (selectedUser.id !== -1) {
// console.log('selectedUser', selectedUser)
// const updatedUser = await this.adapter.updateUser(selectedUser) // Запрос на обновление пользователя с новыми данными
const users = this.store.getters['users/usersWithService']
const updatedUsers = updatedUser(selectedUser, users)

View File

@ -8,7 +8,6 @@ const getUserById = (id, users) => {
}
const usersWithThisService = (serviceId, users) => {
// console.log('serviceId', serviceId)
return users.filter((user) => user.serviceId.includes(serviceId))
}

View File

@ -1,6 +1,4 @@
import routeOptions from './routeOptions.json'
// import Services from '@helpers/Services/Services.js';
// import {config} from './StaticData.js'
import {isEmpty} from "ramda";
const initState = {
@ -65,7 +63,6 @@ const actions = {
saveServices: async ({commit}, services) => {
commit('setServices', services)
commit('setServicesState', 'active')
// console.log('services', services)
},
saveService: async ({commit}, updatedServices) => {

View File

@ -1,8 +1,3 @@
// import Users from '@helpers/Users/Users.js';
// const path = import.meta.env.VITE_API_ADDR
// const UsersService = new Users(path)
const initState = {
userStatus: 'inactive',
@ -38,7 +33,6 @@ const mutations = {
const actions = {
updateUsers: async ({commit}, users) => {
commit('setUsers', users)
// console.log('users', users)
},
updateUserStatus: async ({commit}, userStatus) => {
commit('setUserStatus', userStatus)

View File

@ -51,10 +51,8 @@ class UsersInService {
is_online: selectedService.is_online,
}
const newService = await this.serviceOfServices.createNewService(data)
console.log('newService', newService)
this.serviceOfUsers.saveUpdatedDataUser(newService.id)
} else {
// this.updateRoutesWithApi(this.selectedService)
this.serviceOfServices.saveService(selectedService)
this.serviceOfUsers.saveUpdatedDataUser(selectedService.id)
}

View File

@ -53,42 +53,42 @@ const defaultServices = [
const resServices = [
{
"id": 1,
"created_at": "2024-03-06T17:31:31.948355541+03:00",
"updated_at": "2024-03-06T17:31:31.948355541+03:00",
"deleted_at": null,
"createdAt": "2024-03-06T17:31:31.948355541+03:00",
"updatedAt": "2024-03-06T17:31:31.948355541+03:00",
"deletedAt": null,
"name": "jsonplaceholder.typicode.com",
"port": 9965,
"proxy_ip": "172.25.78.153",
"device_ip": "https://jsonplaceholder.typicode.com/",
"internet_uri": "localhost",
"proxyIp": "172.25.78.153",
"deviceIp": "https://jsonplaceholder.typicode.com/",
"internetUri": "localhost",
"description": "localhost",
"is_online": true
"isOnline": true
},
{
"id": 2,
"created_at": "2024-03-07T11:43:51.026265459+03:00",
"updated_at": "2024-03-07T13:35:12.506368972+03:00",
"deleted_at": null,
"createdAt": "2024-03-07T11:43:51.026265459+03:00",
"updatedAt": "2024-03-07T13:35:12.506368972+03:00",
"deletedAt": null,
"name": "new 2",
"port": 4548,
"proxy_ip": "172.25.78.151",
"device_ip": "172.25.78.151",
"internet_uri": "",
"proxyIp": "172.25.78.151",
"deviceIp": "172.25.78.151",
"internetUri": "",
"description": "new site 2",
"is_online": true
"isOnline": true
},
{
"id": 3,
"created_at": "2024-03-07T11:43:51.027148541+03:00",
"updated_at": "2024-03-07T13:35:24.919273428+03:00",
"deleted_at": null,
"createdAt": "2024-03-07T11:43:51.027148541+03:00",
"updatedAt": "2024-03-07T13:35:24.919273428+03:00",
"deletedAt": null,
"name": "new 3",
"port": 2527,
"proxy_ip": "172.25.78.151",
"device_ip": "172.25.78.151",
"internet_uri": "",
"proxyIp": "172.25.78.151",
"deviceIp": "172.25.78.151",
"internetUri": "",
"description": "new site 3...",
"is_online": true
"isOnline": true
}
]

View File

@ -53,42 +53,42 @@ const defaultServices = [
const resServices = [
{
"id": 1,
"created_at": "2024-03-06T17:31:31.948355541+03:00",
"updated_at": "2024-03-06T17:31:31.948355541+03:00",
"deleted_at": null,
"createdAt": "2024-03-06T17:31:31.948355541+03:00",
"updatedAt": "2024-03-06T17:31:31.948355541+03:00",
"deletedAt": null,
"name": "jsonplaceholder.typicode.com",
"port": 9965,
"proxy_ip": "172.25.78.153",
"device_ip": "https://jsonplaceholder.typicode.com/",
"internet_uri": "localhost",
"proxyIp": "172.25.78.153",
"deviceIp": "https://jsonplaceholder.typicode.com/",
"internetUri": "localhost",
"description": "localhost",
"is_online": true
"isOnline": true
},
{
"id": 2,
"created_at": "2024-03-07T11:43:51.026265459+03:00",
"updated_at": "2024-03-07T13:35:12.506368972+03:00",
"deleted_at": null,
"createdAt": "2024-03-07T11:43:51.026265459+03:00",
"updatedAt": "2024-03-07T13:35:12.506368972+03:00",
"deletedAt": null,
"name": "new 2",
"port": 4548,
"proxy_ip": "172.25.78.151",
"device_ip": "172.25.78.151",
"internet_uri": "",
"proxyIp": "172.25.78.151",
"deviceIp": "172.25.78.151",
"internetUri": "",
"description": "new site 2",
"is_online": true
"isOnline": true
},
{
"id": 3,
"created_at": "2024-03-07T11:43:51.027148541+03:00",
"updated_at": "2024-03-07T13:35:24.919273428+03:00",
"deleted_at": null,
"createdAt": "2024-03-07T11:43:51.027148541+03:00",
"updatedAt": "2024-03-07T13:35:24.919273428+03:00",
"deletedAt": null,
"name": "new 3",
"port": 2527,
"proxy_ip": "172.25.78.151",
"device_ip": "172.25.78.151",
"internet_uri": "",
"proxyIp": "172.25.78.151",
"deviceIp": "172.25.78.151",
"internetUri": "",
"description": "new site 3...",
"is_online": true
"isOnline": true
}
]
@ -393,8 +393,6 @@ describe("tests services store with vuex", () => {
const resetSelectedService = store.getters['services/selectedService']
const resetServices = store.getters['services/services']
// console.log('Reset store 11 test', resetSelectedService)
expect(resetSelectedService).toBe(null) // After reset store
expect(resetServices).toStrictEqual([]) // After reset store

View File

@ -169,8 +169,6 @@ describe("tests users store with vuex", () => {
const usersWithServices = store.getters['users/usersWithService']
// console.log('usersWithServices', usersWithServices)
const userAddedService = usersWithServices.find(user => user.id === 5)
expect(userAddedService).toBeDefined()
@ -278,9 +276,7 @@ describe("tests users store with vuex", () => {
await serviceOfUsers.saveUpdatedDataUser(2)
const usersWithService = store.getters['users/usersWithService']
const userAfterUpdating = usersWithService.find(user => user.id === 3)
// console.log('userAfterUpdating', userAfterUpdating)
const userAfterUpdating = usersWithService.find(user => user.id === 3)
expect(userAfterUpdating).toBeDefined()
@ -320,8 +316,6 @@ describe("tests users store with vuex", () => {
const resetUsers = store.getters['users/users']
const resetUserStatus = store.getters['users/userStatus']
// console.log('Reset store 11 test', resetSelectedService)
expect(resetSelectedUser).toBe(null) // After reset store
expect(resetUsers).toStrictEqual([]) // After reset store
expect(resetUserStatus).toEqual('inactive') // After reset store

View File

@ -15,10 +15,4 @@ describe('tests for caseOfUsersInService', () => {
test('init', () => {
expect(caseOfUsersInService).toBeDefined()
})
// test('fetchUsersWithoutService', async () => {
// await caseOfUsersInService.fetchUsersWithoutService()
// const storeUsers = store.getters['users/usersWithoutSite']
// expect(storeUsers).toEqual([appUser])
// })
})

View File

@ -70,7 +70,6 @@ describe("tests EditServiceCard component", () => {
const selectedService = store.getters['services/selectedService']
const wrapper = mount(EditServiceCard, {
// shallow: true,
global: {
plugins: [store]
},

View File

@ -42,16 +42,16 @@ describe("tests Service Card component", () => {
const resServices = [
{
"id": 1,
"created_at": "2024-03-06T17:31:31.948355541+03:00",
"updated_at": "2024-03-06T17:31:31.948355541+03:00",
"deleted_at": null,
"createdAt": "2024-03-06T17:31:31.948355541+03:00",
"updatedAt": "2024-03-06T17:31:31.948355541+03:00",
"deletedAt": null,
"name": "jsonplaceholder.typicode.com",
"port": 9965,
"proxy_ip": "172.25.78.153",
"device_ip": "https://jsonplaceholder.typicode.com/",
"internet_uri": "localhost",
"proxyIp": "172.25.78.153",
"deviceIp": "https://jsonplaceholder.typicode.com/",
"internetUri": "localhost",
"description": "localhost",
"is_online": true
"isOnline": true
},
]
@ -75,7 +75,6 @@ describe("tests Service Card component", () => {
test('Service Card mounted with vuex', async () => {
const wrapper = mount(ServiceCard, {
// shallow: true,
global: {
plugins: [store]
},
@ -85,8 +84,6 @@ describe("tests Service Card component", () => {
},
})
// console.log('wrapper.html', wrapper.html())
await serviceOfServices.fetchServices()
store.commit('services/setServicesState', 'active')
@ -177,8 +174,6 @@ describe("tests Service Card component", () => {
},
})
// console.log('wrapper.html', wrapper.html())
await wrapper.get('[test-id="canelButton"]').trigger('click')
expect(wrapper.html()).not.toContain('Отменить')
@ -202,8 +197,6 @@ describe("tests Service Card component", () => {
},
})
// console.log('wrapper.html', wrapper.vm.status)
const defaultStatus = wrapper.vm.status
expect(defaultStatus.title).toContain('disable')
@ -281,19 +274,14 @@ describe("tests Service Card component", () => {
},
})
// console.log('wrapper.html', wrapper.html())
const defaultIsDelete = wrapper.vm.isDelete
expect(defaultIsDelete).toBe(false)
await wrapper.get('.ri-close-line').trigger('click') // Рендер отрисовывает только с помощью триггером
// wrapper.vm.deleteService(true)
const updatedIsDelete = wrapper.vm.isDelete
// console.log('wrapper.html', wrapper.html())
expect(updatedIsDelete).toBe(true)
expect(wrapper.html()).toContain('Отменить')

View File

@ -69,42 +69,42 @@ describe("tests Services List component", () => {
const resServices = [
{
"id": 1,
"created_at": "2024-03-06T17:31:31.948355541+03:00",
"updated_at": "2024-03-06T17:31:31.948355541+03:00",
"deleted_at": null,
"createdAt": "2024-03-06T17:31:31.948355541+03:00",
"updatedAt": "2024-03-06T17:31:31.948355541+03:00",
"deletedAt": null,
"name": "jsonplaceholder.typicode.com",
"port": 9965,
"proxy_ip": "172.25.78.153",
"device_ip": "https://jsonplaceholder.typicode.com/",
"internet_uri": "localhost",
"proxyIp": "172.25.78.153",
"deviceIp": "https://jsonplaceholder.typicode.com/",
"internetUri": "localhost",
"description": "localhost",
"is_online": true
"isOnline": true
},
{
"id": 2,
"created_at": "2024-03-07T11:43:51.026265459+03:00",
"updated_at": "2024-03-07T13:35:12.506368972+03:00",
"deleted_at": null,
"createdAt": "2024-03-07T11:43:51.026265459+03:00",
"updatedAt": "2024-03-07T13:35:12.506368972+03:00",
"deletedAt": null,
"name": "new 2",
"port": 4548,
"proxy_ip": "172.25.78.151",
"device_ip": "172.25.78.151",
"internet_uri": "",
"proxyIp": "172.25.78.151",
"deviceIp": "172.25.78.151",
"internetUri": "",
"description": "new site 2",
"is_online": true
"isOnline": true
},
{
"id": 3,
"created_at": "2024-03-07T11:43:51.027148541+03:00",
"updated_at": "2024-03-07T13:35:24.919273428+03:00",
"deleted_at": null,
"createdAt": "2024-03-07T11:43:51.027148541+03:00",
"updatedAt": "2024-03-07T13:35:24.919273428+03:00",
"deletedAt": null,
"name": "new 3",
"port": 2527,
"proxy_ip": "172.25.78.151",
"device_ip": "172.25.78.151",
"internet_uri": "",
"proxyIp": "172.25.78.151",
"deviceIp": "172.25.78.151",
"internetUri": "",
"description": "new site 3...",
"is_online": true
"isOnline": true
}
]
@ -123,7 +123,6 @@ describe("tests Services List component", () => {
test('Services List mounted with vuex', async () => {
const wrapper = mount(ServicesList, {
// shallow: true,
global: {
plugins: [store]
},
@ -137,8 +136,6 @@ describe("tests Services List component", () => {
},
})
// console.log('wrapper.vm', wrapper.vm)
await serviceOfServices.fetchServices()
const uploadServices = store.getters['services/services']

View File

@ -20,7 +20,6 @@ const users = {
state.notIncludedSiteUsersList = []
},
saveUsersOffSite({commit}, users) {
console.log(users)
commit('setUsersOffSite', users)
}
},

View File

@ -285,7 +285,7 @@ describe("tests UserEditor component", () => {
})
// await wrapper.setData({ showNewPassword: true })
// console.log('passwordField', passwordField.attributes().type)
// expect(passwordField.attributes().type).toBe(true)
wrapper.vm.togglePass()

View File

@ -39,16 +39,16 @@ describe("tests Services Manager Page component", () => {
const resServices = [
{
"id": 1,
"created_at": "2024-03-06T17:31:31.948355541+03:00",
"updated_at": "2024-03-06T17:31:31.948355541+03:00",
"deleted_at": null,
"createdAt": "2024-03-06T17:31:31.948355541+03:00",
"updatedAt": "2024-03-06T17:31:31.948355541+03:00",
"deletedAt": null,
"name": "jsonplaceholder.typicode.com",
"port": 9965,
"proxy_ip": "172.25.78.153",
"device_ip": "https://jsonplaceholder.typicode.com/",
"internet_uri": "localhost",
"proxyIp": "172.25.78.153",
"deviceIp": "https://jsonplaceholder.typicode.com/",
"internetUri": "localhost",
"description": "localhost",
"is_online": true
"isOnline": true
},
]
@ -61,14 +61,11 @@ describe("tests Services Manager Page component", () => {
test('Services Manager Page mounted with vuex', async () => {
const wrapper = mount(Services, {
// shallow: true,
global: {
plugins: [store]
}
})
// console.log('wrapper.vm', wrapper.vm)
await serviceOfServices.fetchServices()
const uploadServices = store.getters['services/services']

View File

@ -2,6 +2,9 @@
# yarn lockfile v1
"3-class-complex-assistants@../repo/3-class-complex-assistants/":
version "0.0.6"
"@aashutoshrathi/word-wrap@^1.2.3":
version "1.2.6"
resolved "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf"