From 62511d486d22c95b9b70e2770e6f59424b5cf4c4 Mon Sep 17 00:00:00 2001 From: saikrishna321 Date: Mon, 29 Apr 2024 16:28:37 +0530 Subject: [PATCH] update submodule --- buildAndCopyWeb.sh | 4 ++-- dashboard-frontend | 2 +- src/app/routers/grid.ts | 49 ----------------------------------------- src/modules | 2 +- 4 files changed, 4 insertions(+), 53 deletions(-) diff --git a/buildAndCopyWeb.sh b/buildAndCopyWeb.sh index f890d68ea..0572b82e6 100755 --- a/buildAndCopyWeb.sh +++ b/buildAndCopyWeb.sh @@ -1,4 +1,4 @@ -if [ -d "dashboard-web" ]; then +if [ -d "dashboard-frontend" ]; then # shellcheck disable=SC2164 cd dashboard-frontend npm install --force @@ -10,5 +10,5 @@ if [ -d "dashboard-web" ]; then cp -R ./dashboard-frontend/dist/* src/public/ echo "Build date - `date` by `whoami`" > src/public/version.txt else - echo "Directory dashboard-web does not exist." + echo "Directory dashboard-frontend does not exist." fi diff --git a/dashboard-frontend b/dashboard-frontend index 95681b9c4..a695df15a 160000 --- a/dashboard-frontend +++ b/dashboard-frontend @@ -1 +1 @@ -Subproject commit 95681b9c4959498f6b354ac588faeef74013fc1b +Subproject commit a695df15ae328e8a55bfd10ab64dc55baf7d8c78 diff --git a/src/app/routers/grid.ts b/src/app/routers/grid.ts index 0970afb8f..e7a6e5a99 100644 --- a/src/app/routers/grid.ts +++ b/src/app/routers/grid.ts @@ -14,31 +14,9 @@ import { DeviceFarmManager } from '../../device-managers'; import Container from 'typedi'; import { IPluginArgs } from '../../interfaces/IPluginArgs'; import { IDevice } from '../../interfaces/IDevice'; -import path from 'path'; -import multer from 'multer'; import { saveTestExecutionMetaData } from '../../wdio-service/wdio-service'; -import os from 'os'; -import { DevicePlugin } from '../../plugin'; -import { uploadFileRemote } from '../../modules/device-control/DeviceHelper'; const SERVER_UP_TIME = new Date().toISOString(); -const uploadDir = path.join(os.homedir(), '.cache', 'appium-device-farm', 'assets'); - -const storage = multer.diskStorage({ - destination: (req: any, file: any, cb: any) => { - cb(null, uploadDir); - }, - filename: (req: any, file: any, cb: any) => { - if (file.originalname === 'wda-resign.ipa') { - cb(null, file.originalname); - } else { - cb(null, file.fieldname + '-' + Date.now() + path.extname(file.originalname)); - } - }, -}); - -//will be using this for uplading -const upload = multer({ storage: storage }); async function getDevices(request: Request, response: Response) { let devices = (await ADTDatabase.DeviceModel).find(); const { sessionId } = request.query; @@ -295,33 +273,6 @@ function register(router: Router, pluginArgs: IPluginArgs) { router.get('/node/:host/status', _.curry(nodeAdbStatusOnOtherHost)(pluginArgs.bindHostOrIp)); //router.post('/upload', uploadFile); - router.post('/upload', upload.single('file'), async function (req: any, res) { - console.log('storage location is ', req.hostname + '/' + req.file.path); - const devices = (await ADTDatabase.DeviceModel).chain().find().data(); - const uniqByHost = _.uniqBy(devices, 'host'); - const appPath = path.join( - os.homedir(), - '.cache', - 'appium-device-farm', - 'assets', - 'wda-resign.ipa', - ); - const asyncCall = async (device: IDevice) => { - if (device.nodeId !== DevicePlugin.NODE_ID) { - console.log('Uploading WDA to remote machines'); - await uploadFileRemote(appPath, device); - } - }; - await Promise.all(uniqByHost.map((device: IDevice) => asyncCall(device))); - if (req.file) { - console.log('storage location is ', req.hostname + '/' + req.file.path); - res - .status(200) - .json({ success: true, message: 'File uploaded successfully', file: req.file }); - } else { - res.status(400).json({ success: false, message: 'File upload failed' }); - } - }); //router.post('/tap', clickElementFromScreen); // node status router.get( diff --git a/src/modules b/src/modules index bce1514e7..04fcca463 160000 --- a/src/modules +++ b/src/modules @@ -1 +1 @@ -Subproject commit bce1514e7c569b6c6f2d16538521102346e09983 +Subproject commit 04fcca463682b1c956fde0baae7316bfcc825e4d