-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Servers console performance improvements (#3007)
* feat: init selecting paper+purpur on purchase flow Signed-off-by: Evan Song <[email protected]> * feat: properly implement Paper/Purpur in Platform Signed-off-by: Evan Song <[email protected]> * chore: correct wording Signed-off-by: Evan Song <[email protected]> * feat: redo platform modal Signed-off-by: Evan Song <[email protected]> * Switch to HCaptcha for Auth-related captchas (#2945) * Switch to HCaptcha for Auth-related captchas * run fmt * fix hcaptcha not loading * fix: more robust loader dropdown logic Signed-off-by: Evan Song <[email protected]> * fix: handle "not yet supported" install err Signed-off-by: Evan Song <[email protected]> * chore: fix icon kerfuffles Signed-off-by: Evan Song <[email protected]> * chore: improve vanilla install modal title Signed-off-by: Evan Song <[email protected]> * fix: spacing Signed-off-by: Evan Song <[email protected]> * feat: usePyroConsole store instead of passing a prop to prevent bulk panel refreshing * chore: improve no loader state Signed-off-by: Evan Song <[email protected]> * fix: type error Signed-off-by: Evan Song <[email protected]> * chore: adjust mod version modal title Signed-off-by: Evan Song <[email protected]> * chore: adjust modpack warning copy Signed-off-by: Evan Song <[email protected]> * feat: vanilla empty state in content page Signed-off-by: Evan Song <[email protected]> * chore: adjust copy Signed-off-by: Evan Song <[email protected]> * chore: update icon Signed-off-by: Evan Song <[email protected]> * fix: loader type Signed-off-by: Evan Song <[email protected]> * fix: loader type Signed-off-by: Evan Song <[email protected]> * feat: always show dropdown if possible Signed-off-by: Evan Song <[email protected]> * chore: improve spacing Signed-off-by: Evan Song <[email protected]> * chore: appear disabled Signed-off-by: Evan Song <[email protected]> * h Signed-off-by: Evan Song <[email protected]> * chore: if reinstalling, show it on the modal title Signed-off-by: Evan Song <[email protected]> * feat: put it in the dropdown, they said Signed-off-by: Evan Song <[email protected]> * chore: adjust style Signed-off-by: Evan Song <[email protected]> * chore: sort paper-purpur versions desc Signed-off-by: Evan Song <[email protected]> * fix: do not consider backup limit in reinstall prompt Signed-off-by: Evan Song <[email protected]> * feat: backup locking, plugin support * fix: content type error Signed-off-by: Evan Song <[email protected]> * fix: casing Signed-off-by: Evan Song <[email protected]> * fix: plugins pt 2 * feat: backups, mrpack * fix: type errors come on Signed-off-by: Evan Song <[email protected]> * fix: spacing Signed-off-by: Evan Song <[email protected]> * fix: type maxing * chore: show copy button on allocation rows Signed-off-by: Evan Song <[email protected]> * feat: suspend improvement --------- Signed-off-by: Evan Song <[email protected]> Co-authored-by: Geometrically <[email protected]> Co-authored-by: Jai A <[email protected]> Co-authored-by: TheWander02 <[email protected]>
- Loading branch information
1 parent
742c0ed
commit 6ec1dcf
Showing
4 changed files
with
89 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { createGlobalState } from "@vueuse/core"; | ||
import { type Ref, ref } from "vue"; | ||
|
||
/** | ||
* Maximum number of console output lines to store | ||
* @type {number} | ||
*/ | ||
const maxLines = 5000; | ||
|
||
/** | ||
* Provides a global console output state management system | ||
* Allows adding, storing, and clearing console output with a maximum line limit | ||
* | ||
* @returns {Object} Console state management methods and reactive state | ||
* @property {Ref<string[]>} consoleOutput - Reactive array of console output lines | ||
* @property {function(string): void} addConsoleOutput - Method to add a new console output line | ||
* @property {function(): void} clear - Method to clear all console output | ||
*/ | ||
export const usePyroConsole = createGlobalState(() => { | ||
/** | ||
* Reactive array storing console output lines | ||
* @type {Ref<string[]>} | ||
*/ | ||
const output: Ref<string[]> = ref<string[]>([]); | ||
|
||
/** | ||
* Adds a new output line to the console output | ||
* Automatically removes the oldest line if max output is exceeded | ||
* | ||
* @param {string} line - The console output line to add | ||
*/ | ||
const addLine = (line: string): void => { | ||
output.value.push(line); | ||
|
||
if (output.value.length > maxLines) { | ||
output.value.shift(); | ||
} | ||
}; | ||
|
||
/** | ||
* Adds multiple output lines to the console output | ||
* Automatically removes the oldest lines if max output is exceeded | ||
* | ||
* @param {string[]} lines - The console output lines to add | ||
* @returns {void} | ||
*/ | ||
const addLines = (lines: string[]): void => { | ||
output.value.push(...lines); | ||
|
||
if (output.value.length > maxLines) { | ||
output.value.splice(0, output.value.length - maxLines); | ||
} | ||
}; | ||
|
||
/** | ||
* Clears all console output lines | ||
*/ | ||
const clear = (): void => { | ||
output.value = []; | ||
}; | ||
|
||
return { | ||
output, | ||
addLine, | ||
addLines, | ||
clear, | ||
}; | ||
}); |