Skip to content

[pull] main from GUI-for-Cores:main #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 438 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
438 commits
Select commit Hold shift + click to select a range
932c00b
fix: Rolling Release Flag
Ayideyia Oct 13, 2024
97b884f
cd: rolling-release.yml
Ayideyia Oct 13, 2024
e146598
fix: Rolling Release Flag
Ayideyia Oct 13, 2024
3eb2d2a
Update preview image
Ayideyia Oct 13, 2024
62b7e00
fix: resolve markdown rendering issues in table
Ayideyia Oct 13, 2024
afd406f
Update dependencies
Ayideyia Oct 16, 2024
f202cd5
refactor: useTemplateRef
Ayideyia Oct 18, 2024
d043050
fix: type error
Ayideyia Oct 19, 2024
dccca9c
update default MTU
Oct 21, 2024
a0f8064
feat: add API support for creating HTTPS services in `StartServer`
Ayideyia Oct 23, 2024
aa432e7
ci: Hide the Dock icon on macOS.
Ayideyia Oct 23, 2024
0f515d0
Release v1.8.9
Ayideyia Oct 23, 2024
1b7fe4e
chore: Update eslint.config.js
Ayideyia Oct 27, 2024
5d7659d
feat: Customizable button text
Ayideyia Oct 27, 2024
4800959
feat: Adapt to sing-box 1.10.0
Ayideyia Oct 30, 2024
efecf50
fix: Update the reference tag of the proxy group.
Ayideyia Oct 31, 2024
c093fc5
refactor: change proxy group reference from tag to ID
Ayideyia Nov 2, 2024
bc3fa00
Update default profile
Ayideyia Nov 2, 2024
8ef4529
fix: default profile
Ayideyia Nov 2, 2024
5a7531e
Update default profile
Ayideyia Nov 2, 2024
4716ae2
chore: Temporarily enable support for deprecated configurations
Ayideyia Nov 9, 2024
69d67b2
feat: Purple color
minlaxz Nov 9, 2024
407824a
chore: Temporarily enable support for deprecated configurations
Ayideyia Nov 11, 2024
0b96849
Merge pull request #6 from minlaxz/patch-purple-color
Ayideyia Nov 11, 2024
844776a
Update dependencies
Ayideyia Dec 8, 2024
b4e119e
feat: Add log alert feature and set log level to debug
Ayideyia Dec 22, 2024
927a928
Merge refactor-profiles into main branch
Ayideyia Dec 22, 2024
1b34e07
fix: Update kernel branch to 'latest' and remove compatibility code f…
Ayideyia Dec 22, 2024
dc791db
Refactor: Refactor profile creation and update subscription handling …
Ayideyia Dec 22, 2024
7b74f30
chore: Enable automatic system proxy setting in app settings
Ayideyia Dec 22, 2024
5aa98a3
chore: Enable rolling release option in app settings
Ayideyia Dec 22, 2024
ac4bd04
feat: Include APP_VERSION in userAgent and add stringifyNoFolding uti…
Ayideyia Dec 22, 2024
4bc6c57
chore: enable trailing commas in Prettier configuration
Ayideyia Dec 22, 2024
41e7aae
fix: remove runtime config after change
Ayideyia Dec 23, 2024
8957872
chore: Clear log output path at runtime
Ayideyia Dec 23, 2024
cc4e860
refactor: improve plugin management logic
Ayideyia Dec 24, 2024
af9230e
feat: enhance proxy type options with count of occurrences
Ayideyia Dec 24, 2024
48f01ee
feat: add 'shadowsocksr' to default excluded protocols
Ayideyia Dec 24, 2024
3faea1e
fix: translate label in Picker component
Ayideyia Dec 24, 2024
799d410
feat: add support for FakeIP DNS server and rules configuration
Ayideyia Dec 24, 2024
dac58c5
fix: remove runtime config after change
Ayideyia Dec 25, 2024
98c9b12
Update dependencies
Ayideyia Dec 25, 2024
54b88ce
Release v1.9.0
Ayideyia Dec 25, 2024
2900274
feat: add invert field to DNS rules and update related components
Ayideyia Dec 26, 2024
1f1ed79
feat: profilesUpgrader
Ayideyia Dec 26, 2024
3b96cf1
feat: enhance profilesUpgrader to support new rule set transformation…
Ayideyia Jan 1, 2025
fb134d6
feat: update profilesUpgrader to enhance rule transformation and add …
Ayideyia Jan 2, 2025
fb36e21
feat: enhance transformProfileV189To190 to handle deprecated proxy gr…
Ayideyia Jan 5, 2025
c31b875
feat: integrate transformProfileV189To190 for profile upgrades and en…
Ayideyia Jan 5, 2025
403fc94
feat: improve profiles upgrade logic for address and backup handling
Ayideyia Jan 5, 2025
2b22056
feat: add duplicate removal logic in profiles store during disk sync
Ayideyia Jan 5, 2025
ad003ff
fix: Restore mixin and script during runtime profile restoration.
Ayideyia Jan 6, 2025
25281ce
feat: refactor allow-lan logic to support IPv6 addresses
Ayideyia Jan 6, 2025
2bc5bee
feat: enhance route generation by filtering out disabled inbound rules
Ayideyia Jan 6, 2025
6dd4032
feat: add stable branch adaptation logic in config generation
Ayideyia Jan 6, 2025
2c74932
feat: update kernel branch from 'latest' to 'alpha'
Ayideyia Jan 6, 2025
43044aa
feat: remove 'Direct' type from proxy filtering in tray and groups co…
Ayideyia Jan 6, 2025
1f558a8
Fix: Resolve issue with opening TUN from tray menu
Ayideyia Jan 7, 2025
2a4dc11
refactor: simplify outbound rule assignment for HijackDNS action
Ayideyia Jan 7, 2025
9c2514f
feat: add clearable option to Select component and update InterfaceSe…
Ayideyia Jan 7, 2025
4671109
feat: add clearable option to multiple Select components in ProfilesView
Ayideyia Jan 7, 2025
0bbfa60
fix: translation
Ayideyia Jan 7, 2025
aff55d3
feat: add find_process option to route configuration and update trans…
Ayideyia Jan 8, 2025
50ece72
feat: Support selecting multiple rule sets
Ayideyia Jan 8, 2025
e53e1c5
fix: correct rule set display names
Ayideyia Jan 9, 2025
cae7231
fix: streamline inbound profile handling and ensure Tun inbound is pr…
Ayideyia Jan 12, 2025
3f30c71
fix: prevent duplicate Tun inbound entries in runtime profile
Ayideyia Jan 12, 2025
c15fa95
fix: use ruleset update_interval instead of extra for route generation
Ayideyia Jan 14, 2025
ce931cb
fix: clear default route_address in DefaultInboundTun configuration
Ayideyia Jan 14, 2025
49c0b7a
fix: avoid generating an empty array for `route_address`
Ayideyia Jan 14, 2025
4ad9509
fix: resolve route error when restoring configuration
Ayideyia Jan 15, 2025
e5d6196
Release v1.9.1
Ayideyia Jan 15, 2025
fef4916
fix: reduce debounce time for saving app settings
Ayideyia Jan 19, 2025
7fee550
fix: correct resolver address and detour in profile upgrader
Jan 20, 2025
5f09d2a
fix: filter valid inbound types when restoring profile inbounds
Ayideyia Jan 20, 2025
747bf34
chore: update Vite configuration for base path and formatting
Ayideyia Jan 21, 2025
d82183d
fix: typo
Noktomezo Jan 23, 2025
583b798
fix: correct spelling from OverView to Overview
Noktomezo Jan 23, 2025
0b26dd3
fix: another typo
Noktomezo Jan 23, 2025
2d43bb0
fix: correct typos and improve text clarity
Noktomezo Jan 23, 2025
457984a
fix: uppercase setting names
Noktomezo Jan 23, 2025
c002656
fix: text clarity
Noktomezo Jan 23, 2025
38e2065
Merge pull request #10 from Noktomezo/dev
Ayideyia Jan 24, 2025
508ff0f
feat: russian locale
Noktomezo Jan 26, 2025
82f28e3
feat: russian locale upd
Noktomezo Jan 26, 2025
3d93998
chore: restore back typecheck method
Noktomezo Jan 26, 2025
65dca49
chore: run format
Noktomezo Jan 26, 2025
261bf65
fix: missing word
Noktomezo Jan 26, 2025
9964580
Merge pull request #11 from Noktomezo/ru-locale
Ayideyia Jan 26, 2025
c29a94d
fix: Add boundary condition handling for `diffMs === 0` to return "no…
Ayideyia Jan 26, 2025
085efc3
chore: remove legacy compatibility code
Ayideyia Jan 31, 2025
0b63f75
refactor: optimize user mapping and conditional property setting in g…
Feb 2, 2025
2309b82
Update dependencies
Ayideyia Feb 3, 2025
688246b
feat: add support for KDE desktop
Ayideyia Feb 3, 2025
51c8a8b
Update dependencies
Ayideyia Feb 4, 2025
120183d
Update dependencies
Ayideyia Feb 9, 2025
4497d61
Release v1.9.2
Ayideyia Feb 9, 2025
2cdab04
fix: clear default route addresses in profile upgrader
Ayideyia Feb 9, 2025
927fec7
fix: retrieve assets from the latest prerelease version in AlphaBranc…
Ayideyia Feb 12, 2025
975975c
Update dependencies
Ayideyia Feb 19, 2025
f12fe9f
Release v1.9.3
Ayideyia Feb 19, 2025
f35747c
feat: add security warning for non-GitHub auto-built versions and con…
Ayideyia Feb 27, 2025
1d336e1
refactor: CodeViewer
Ayideyia Mar 1, 2025
1440d6f
fix: improve CodeViewer stability and update ProxiesEditor to use JSO…
Ayideyia Mar 1, 2025
10c9e55
feat: enhance menu component with dynamic dividers and improve direct…
Ayideyia Mar 2, 2025
658b6ab
feat: add context property to PluginType and update related component…
Ayideyia Mar 2, 2025
07e175a
feat: add Plugin Hub functionality with version tracking and update c…
Ayideyia Mar 4, 2025
169db9f
fix: remove unnecessary console logs in plugin update process
Ayideyia Mar 4, 2025
c63546a
refactor: redesign plugin versioning scheme
Ayideyia Mar 5, 2025
e352839
fix: translation
Ayideyia Mar 6, 2025
cae3592
feat: add stopOutputKeyword option to ExecOptions for process output …
Ayideyia Mar 9, 2025
28d2e2d
Update dependencies
Ayideyia Mar 9, 2025
4b9fd1e
Release v1.9.4
Ayideyia Mar 9, 2025
36b40e1
fix: translation
Ayideyia Mar 9, 2025
acda00f
feat: ru geosite & geoip rulesets
Noktomezo Mar 10, 2025
f69019d
chore: less code reuse
Noktomezo Mar 10, 2025
f2230b7
chore: reset to previous
Noktomezo Mar 10, 2025
421d758
Merge pull request #12 from Noktomezo/geo-ru
Ayideyia Mar 10, 2025
7981c86
Fix TypeScript errors, add Persian language support, and implement RT…
BrontoDIY Mar 12, 2025
3bf589f
revert: roll back some code changes
Ayideyia Mar 12, 2025
5c26556
Merge pull request #13 from BrontoDIY:main
Ayideyia Mar 12, 2025
28afce7
feat: add button to check for plugin updates
Ayideyia Mar 15, 2025
7c85f23
feat: Support sing-box v1.12.0
Ayideyia Mar 20, 2025
d5d39d9
fix: use optional chaining for route_address in generateInbounds func…
Ayideyia Mar 20, 2025
4a94214
fix: `ip_accept_any` type
Ayideyia Mar 21, 2025
871890a
fix: FreeConsole failure in KillProcessImpl
Ayideyia Mar 21, 2025
2cd7348
fix: correct DNS configuration generation error
Ayideyia Mar 21, 2025
5484f0b
refactor: optimize `KillProcess`
Ayideyia Mar 21, 2025
432baf0
Release v1.9.5
Ayideyia Mar 21, 2025
fa7a631
perf: change runtime log level to `info`
Ayideyia Mar 22, 2025
e4d687c
fix: improve error handling in HomeView by displaying error message
Ayideyia Mar 22, 2025
2a13252
feat: add new sniffer options for Stun, Bittorrent, Dtls, and Ntp
Ayideyia Mar 22, 2025
408451b
feat: Add a reset button to the fake IP address input field.
Ayideyia Mar 23, 2025
01cb63e
feat: Implement reusable modal component
Ayideyia Mar 23, 2025
8523e14
feat: Add CodeMirror merge view support in CodeViewer component
Ayideyia Mar 23, 2025
efb76a6
refactor: modal usage
Ayideyia Mar 23, 2025
e7582fd
fix: reset loading only on error
Ayideyia Mar 25, 2025
b6bf481
fix: remove meaningless detour configurations from DNS servers
Ayideyia Mar 25, 2025
58e55c9
feat: Add PluginChangelog component to display plugin changelogs
Ayideyia Mar 25, 2025
9c5e53f
revert: fix: remove meaningless detour configurations from DNS servers
Ayideyia Mar 26, 2025
6322eb2
chore: clean up code
Ayideyia Mar 26, 2025
45c5b04
refactor: replace interaction hooks with utility methods
Ayideyia Mar 27, 2025
f500464
chore: update Picker component layout for improved flexibility
Ayideyia Mar 27, 2025
ba2d837
feat: add restore functionality for plugins from the official hub
Ayideyia Mar 29, 2025
658c119
fix: ensure detour assignment only applies to non-direct outbounds in…
Ayideyia Mar 30, 2025
b196072
fix: Avoid generating detours for hosts and fakeip DNS server types.
Ayideyia Mar 31, 2025
77fc4c3
Update dependencies
Ayideyia Apr 2, 2025
eddc804
refactor: streamline component registration logic
Ayideyia Apr 3, 2025
5de22b5
feat: Add pagination component
Ayideyia Apr 4, 2025
b1fa678
feat: load full dataset in rule-set hub
Ayideyia Apr 4, 2025
f1aeb53
fix: correct display of Tun mode
Ayideyia Apr 5, 2025
83b08df
refactor: Adjust order of stable core adaptation.
Ayideyia Apr 9, 2025
b958035
fix: subscription update alert message
Noktomezo Apr 9, 2025
c007033
Merge pull request #14 from Noktomezo/quick-fix
Ayideyia Apr 11, 2025
0487006
refactor: remove group delay functionality and add asyncPool for prox…
Ayideyia Apr 12, 2025
d62d37c
refactor: improve group delay testing and UI feedback
Ayideyia Apr 13, 2025
b5b0cf5
feat: implement concurrent subscribe updates using asyncPool for impr…
Ayideyia Apr 13, 2025
6ca3b02
feat: implement concurrent ruleset updates using asyncPool for improv…
Ayideyia Apr 13, 2025
6a2d25e
feat: implement concurrent plugin updates using asyncPool for improve…
Ayideyia Apr 13, 2025
265854f
perf: Implement caching for system/kernel proxy retrieval to improve …
Ayideyia Apr 16, 2025
979079d
fix: remove `strategy` field from DNS rules in stable branch adaptation
Ayideyia Apr 17, 2025
3c7a80e
refactor: unify tray menu click handling via 'onMenuItemClick' event
Ayideyia Apr 20, 2025
c1fb67b
refactor: optimize tray menu update watcher with computed proxy summary
Ayideyia Apr 20, 2025
a0842d7
feat: add emit threshold for upload/download progress events
Ayideyia Apr 20, 2025
b3b18d6
Update dependencies
Ayideyia Apr 20, 2025
be63382
Release v1.9.6
Ayideyia Apr 20, 2025
02028d6
fix: set runtimeProfile.id to match profile.id
Ayideyia Apr 21, 2025
ed34d7b
feat: support subscription script processing logic
Ayideyia Apr 22, 2025
94027ea
Update dependencies
Ayideyia Apr 28, 2025
408fb4d
refactor: core branch management
Ayideyia Apr 29, 2025
4358d35
feat: add core version rollback
Ayideyia Apr 30, 2025
3ba243f
Fix: Add OS check to avoid kernel download errors on old Linux systems.
May 1, 2025
2f99954
refactor: About page
Ayideyia May 1, 2025
a56bb0f
Merge pull request #15 from Bubble-droid/main
Ayideyia May 1, 2025
d72b415
improve tag display when adding ruleset
Ayideyia May 2, 2025
46cf088
Merge branch 'main' of github.com:GUI-for-Cores/GUI.for.SingBox
Ayideyia May 2, 2025
0df201f
prevent overwriting log level if already set to Trace, Debug, or Info
Ayideyia May 2, 2025
aac3ab5
add manual chunks comment in vite config
Ayideyia May 3, 2025
2d78262
feat: Add Redirect option to RequestOptions and HTTP client config
Ayideyia May 4, 2025
89047a6
refactor: bridge
Ayideyia May 5, 2025
1905d5b
refactor: useCoreBranch
Ayideyia May 5, 2025
75a088c
perf: refactor GetTimeout and optimize GetHeader functions.
Ayideyia May 6, 2025
6bc1fb9
refactor: StartServer
Ayideyia May 6, 2025
0bd9f00
Update dependencies
Ayideyia May 6, 2025
fefb33e
Release v1.9.7
Ayideyia May 6, 2025
05aaf8e
fix(legacy http3 config): use correct address
vollate May 9, 2025
84bf625
Merge pull request #16 from vollate/main
Ayideyia May 10, 2025
9cd885f
Improved mouse wheel event handling and debounce logic in the home pa…
Ayideyia May 11, 2025
1428a9e
adjust scroll event threshold for showing controller
Ayideyia May 11, 2025
000a854
refactor: restructure page layout for better readability and maintain…
Ayideyia May 12, 2025
c1ca5dd
fix: Move the close button outside the controller template
Ayideyia May 13, 2025
b239a46
feat: Add controller panel close mode option
Ayideyia May 13, 2025
4e252f4
Fix: Ensure proxy delay history is recorded on both success and failure
Ayideyia May 14, 2025
dd0b32a
refactor: Simplify slot rendering logic and improve styling for switc…
Ayideyia May 15, 2025
edbea4f
Reduce sleep duration during refresh and improve button formatting
Ayideyia May 15, 2025
3fb527c
❤️Update dependencies
Ayideyia May 19, 2025
64d228d
feat: replace sampleID with secure key generator for Clash API secret
Ayideyia May 21, 2025
dea13ff
feat: add change event emission for checkbox and radio components
Ayideyia May 24, 2025
78cd035
feat: add custom action handling to app store and integrate in OverVi…
Ayideyia May 24, 2025
85b9775
fix: correct change event emission in toggle function for switch comp…
Ayideyia May 24, 2025
a7c9380
feat: enhance custom action slot options to include ref in render fun…
Ayideyia May 24, 2025
85fd1c4
feat: add unique ID to custom actions and update rendering in OverVie…
Ayideyia May 24, 2025
e697f1d
fix: correct change event emission in toggle function for switch comp…
Ayideyia May 25, 2025
970b4fe
add new features
jilliss May 25, 2025
1d143fd
chore: update connection metadata keys
Ayideyia May 25, 2025
61062a0
refactor: enhance code readability and structure
Ayideyia May 25, 2025
2954c36
format
Ayideyia May 25, 2025
2590503
format
Ayideyia May 25, 2025
0fc6da6
Merge pull request #17 from jilliss/dev
Ayideyia May 25, 2025
5797b53
fix: close button now hides settings modal
Ayideyia May 25, 2025
853cef7
feat: add success message on resetting connections and improve sort v…
Ayideyia May 25, 2025
f73b2c1
chore: add eslint-plugin-import
Ayideyia May 26, 2025
44a486c
pnpm lint & pnpm format
Ayideyia May 26, 2025
caab006
feat: initialize workspace configuration with project folders
Ayideyia May 26, 2025
e9ae41e
Update component name
Ayideyia May 27, 2025
f311cfe
fix: update change event return type in Switch component
Ayideyia May 27, 2025
12666fc
feat: implement CustomAction component
Ayideyia May 27, 2025
ade14a1
Update dependencies
Ayideyia May 27, 2025
2c03aad
feat: enable custom headers in subscription requests
Ayideyia May 30, 2025
0cc119a
refactor: refactor SubscribeForm to use computed properties for type …
Ayideyia May 30, 2025
0123e26
refactor: update API types and improve WebSocket handling in kernel A…
Ayideyia Jun 2, 2025
b35c2f2
feat: add core started and stopped triggers to plugin system
Ayideyia Jun 2, 2025
a1e285f
feat: add buttons for core started and stopped events in PluginView
Ayideyia Jun 2, 2025
b529525
feat: add plugin hook events before core starts and stops
Ayideyia Jun 4, 2025
22a404a
feat: update menu settings to include options for adding plugins and …
Ayideyia Jun 5, 2025
b0cc566
Update dependencies
Ayideyia Jun 6, 2025
cd8e2d1
fix: enhance core stop handling with promises for better synchronization
Ayideyia Jun 8, 2025
bd3a6f9
fix: encode group name in useProxy call to handle special characters
Ayideyia Jun 8, 2025
80a24e1
feat: enhance modal functionality and improve global method definitions
Ayideyia Jun 12, 2025
cb40b0c
feat: enhance table rendering with custom slot support and improved c…
Ayideyia Jun 13, 2025
faa3ee9
fix: render custom components correctly inside tables
Ayideyia Jun 13, 2025
4ed7b94
feat: add SparkleIcon component and integrate hasUI property in plugi…
Ayideyia Jun 13, 2025
eabe2dd
feat: enhance modal component with loading states and action handling
Ayideyia Jun 15, 2025
2e28a26
Update dependencies
Ayideyia Jun 19, 2025
b274e7c
ci: upgrade to latest pnpm and Go versions
Ayideyia Jun 19, 2025
145e3da
refactor: bridge
Ayideyia Jun 19, 2025
36208cf
fix: avoid blocking by continuing to read stdout after stop keyword d…
Ayideyia Jun 19, 2025
12e30a8
Update README.md
Ayideyia Jun 19, 2025
f6f120c
feat: add progress indicator and error handling during app setup
Ayideyia Jun 19, 2025
4fc2414
feat: enhance app exit handling with improved user feedback and state…
Ayideyia Jun 21, 2025
a62ab34
feat: add latency test concurrency limit
Ayideyia Jun 21, 2025
d41782f
feat: add reset functionality for more settings in GroupsController
Ayideyia Jun 21, 2025
cfae928
refactor: move core cache clearing to BranchDetail view
Ayideyia Jun 21, 2025
f9b3a63
fix: ensure onEnd callback is called after event cleanup in ExecBackg…
Ayideyia Jun 22, 2025
1b4a064
feat: support custom request method for updating subscription
Ayideyia Jun 22, 2025
b05f4d4
feat: add debugOutline setting to app settings
Ayideyia Jun 22, 2025
3e02b77
Release v1.9.8-Alpha
Ayideyia Jun 22, 2025
2464ced
fix: use transformRequest before sending request
Ayideyia Jun 25, 2025
263d0bd
refactor: improve traffic status logic and type annotations
Ayideyia Jun 25, 2025
6486723
ci: add rolling-release-alpha.yml
Ayideyia Jun 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: Supports Markdown preview
  • Loading branch information
Ayideyia committed Sep 25, 2024
commit 9eee20371e01608ded6c59bac5c35dc08236bca2
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"@codemirror/lang-yaml": "^6.1.1",
"@codemirror/theme-one-dark": "^6.1.2",
"codemirror": "6.0.1",
"marked": "^14.1.2",
"pinia": "^2.2.2",
"vue": "^3.5.6",
"vue-codemirror6": "^1.3.4",
Expand Down
10 changes: 10 additions & 0 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/src/components/CodeViewer/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const props = withDefaults(defineProps<Props>(), {
const ready = ref(false)
const appSettings = useAppSettingsStore()

const lang = { json, javascript, yaml }[props.lang]()
const lang = { json, javascript, yaml }[props.lang]?.()
const linter = props.lang === 'json' ? jsonParseLinter() : undefined

const completion = computed(() =>
Expand Down
30 changes: 23 additions & 7 deletions frontend/src/components/Confirm/index.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
<script setup lang="ts">
import { computed } from 'vue'
import { marked } from 'marked'

import useI18n from '@/lang'

export type Options = {
type: 'text' | 'markdown'
}

interface Props {
title: string
message: string | Record<string, any>
options?: Options
cancel?: boolean
}

const props = withDefaults(defineProps<Props>(), { cancel: true })
const props = withDefaults(defineProps<Props>(), {
cancel: true,
options: () => ({ type: 'text' })
})

const emits = defineEmits(['confirm', 'cancel', 'finish'])

Expand All @@ -23,19 +34,22 @@ const handleCancel = () => {
emits('finish')
}

const getMessage = () => {
if (typeof props.message === 'string') {
const message = computed(() => {
if (typeof props.message !== 'string') {
return props.message
}
if (props.options.type === 'text') {
return t(props.message)
}
return props.message
}
return marked.use().parse(props.message)
})
</script>

<template>
<Transition name="slide-down" appear>
<div class="confirm">
<div class="title">{{ t(title) }}</div>
<div class="message select-text">{{ getMessage() }}</div>
<div class="message select-text" v-html="message"></div>
<div class="form-action">
<Button v-if="cancel" @click="handleCancel" size="small">{{ t('common.cancel') }}</Button>
<Button @click="handleConfirm" size="small" type="primary">
Expand All @@ -54,6 +68,8 @@ const getMessage = () => {
background: var(--toast-bg);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
border-radius: 4px;
display: flex;
flex-direction: column;

.title {
font-weight: bold;
Expand All @@ -66,8 +82,8 @@ const getMessage = () => {
padding: 6px;
word-break: break-all;
white-space: pre-wrap;
max-height: 300px;
overflow-y: auto;
flex: 1;
}
}
</style>
6 changes: 4 additions & 2 deletions frontend/src/hooks/useAlert.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { render, createVNode } from 'vue'

import ConfirmComp from '@/components/Confirm/index.vue'
import ConfirmComp, { type Options } from '@/components/Confirm/index.vue'

const createAlert = (title: string, message: string) => {
const createAlert = (title: string, message: string, options: Partial<Options> = {}) => {
return new Promise((resolve) => {
const dom = document.createElement('div')
dom.style.cssText = `
Expand All @@ -13,10 +13,12 @@ const createAlert = (title: string, message: string) => {
right: 0;
display: flex;
justify-content: center;
max-height: 70%;
`
const vnode = createVNode(ConfirmComp, {
title,
message,
options,
cancel: false,
onConfirm: resolve,
onFinish: () => {
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/hooks/useConfirm.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { render, createVNode } from 'vue'

import ConfirmComp from '@/components/Confirm/index.vue'
import ConfirmComp, { type Options } from '@/components/Confirm/index.vue'

const createConfirm = (title: string, message: string) => {
const createConfirm = (title: string, message: string, options: Partial<Options> = {}) => {
return new Promise((resolve, reject) => {
const dom = document.createElement('div')
dom.style.cssText = `
Expand All @@ -13,10 +13,12 @@ const createConfirm = (title: string, message: string) => {
right: 0;
display: flex;
justify-content: center;
max-height: 70%;
`
const vnode = createVNode(ConfirmComp, {
title,
message,
options,
onConfirm: resolve,
onCancel: () => reject('cancelled'),
onFinish: () => {
Expand Down