Skip to content

Commit

Permalink
Added button to remove statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
opengs committed Dec 25, 2023
1 parent 7612cbf commit ead4571
Show file tree
Hide file tree
Showing 7 changed files with 329 additions and 325 deletions.
3 changes: 3 additions & 0 deletions src-electron/electron-preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ const executionEngineAPI = {
async stopListeningForStatistics (callback: (_e: IpcRendererEvent, data: ModuleExecutionStatisticsEventData) => void): Promise<void> {
await ipcRenderer.invoke('executionEngine:stopListeningForStatistics')
ipcRenderer.off('executionEngine:statistics', callback)
},
async deleteStatistics (): Promise<void> {
return await ipcRenderer.invoke('executionEngine:deleteStatistics')
}
}

Expand Down
11 changes: 11 additions & 0 deletions src-electron/handlers/engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,13 @@ export class ExecutionEngine {
this.statisticsListeners.splice(index, 1)
}
}

public async deleteStatistics() {
const config = await this.getState()
config.statistics = []
config.statisticsTotals.totalBytesSent = 0
await this.setState(config)
}
}

export function handleExecutionEngine(modules: Array<Distress | DB1000N | MHDDOSProxy>): ExecutionEngine {
Expand Down Expand Up @@ -344,6 +351,10 @@ export function handleExecutionEngine(modules: Array<Distress | DB1000N | MHDDOS
ipcMain.handle('executionEngine:stopListeningForStatistics', async (e) => {
engine.stopListeningForStatistics(e.sender)
})
ipcMain.handle('executionEngine:deleteStatistics', async () => {
await engine.deleteStatistics()
})


void engine.init()

Expand Down
2 changes: 2 additions & 0 deletions src/i18n/en-US/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,12 @@ export default {
idDescription: "How to get ID ? Look on",
data: "Storage",
dataDescription: "Currently your modules are located in the folder:",
warnDelStatistics: "Are you sure you want to delete the statistics?",
warnDelCache: "Are you sure you want to delete the modules cache? The app will close after this action and may not restart automatically.",
warnDelData: "Do you really want to delete all data, including cache, settings, and modules? The app will close after this action and may not restart automatically.",
openDataFolder: "Open Data Folder",
changeModulesDataLocation: "Change Modules Data Location",
deleteStatistics: "Delete Statistics",
deleteModulesCache: "Delete Modules Cache",
deleteAllTheData: "Factory Settings",

Expand Down
2 changes: 2 additions & 0 deletions src/i18n/ua-UA/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,12 @@ export default {
idDescription: "Де взяти ID ? Загляньте до",
data: "Сховище",
dataDescription: "Наразі ваші модулі знаходяться в папці:",
warnDelStatistics: "Ви справді хочете видалити всю статистику?",
warnDelCache: "Ви справді хочете видалити кеш модулів? Програма закриється після цієї дії та може не перезапуститися автоматично.",
warnDelData: "Ви справді бажаєте видалити всі дані, включаючи кеш налаштувань і модулів? Програма закриється після цієї дії та може не перезапуститися автоматично.",
openDataFolder: "Відкрити папку з даними",
changeModulesDataLocation: "Змінити розташування даних модулів",
deleteStatistics: "Видалити статистику",
deleteModulesCache: "Видалити кеш модулів",
deleteAllTheData: "Заводські налаштування",

Expand Down
4 changes: 2 additions & 2 deletions src/layouts/snowEffect/SnowEffectComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let bodyHeightPx = null;
let pageHeightVh = null;
function setHeightVariables() {
bodyHeightPx = document.body.offsetHeight - 70;
bodyHeightPx = document.body.offsetHeight - 100;
pageHeightVh = (100 * bodyHeightPx) / window.innerHeight;
}
Expand Down Expand Up @@ -92,7 +92,7 @@ function generateSnowCSS(snowDensity = 200) {
let rule = baseCSS;
for (let i = 1; i < snowDensity; i++) {
let randomX = Math.random() * 70; // vw
let randomX = Math.random() * 60; // vw
let randomOffset = Math.random() * 10; // vw;
let randomXEnd = randomX + randomOffset;
let randomXEndYoyo = randomX + randomOffset / 2;
Expand Down
139 changes: 0 additions & 139 deletions src/layouts/snowEffect/pure-snow.js

This file was deleted.

Loading

0 comments on commit ead4571

Please sign in to comment.