Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Clash Verge
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
many-archive
Clash Verge
Commits
46494542
There was an error fetching the commit references. Please try again later.
Unverified
Commit
46494542
authored
2 years ago
by
GyDi
Browse files
Options
Downloads
Patches
Plain Diff
fix: remove smoother
parent
a45dc6ef
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/profile/profile-new.tsx
+79
-79
79 additions, 79 deletions
src/components/profile/profile-new.tsx
src/components/profile/smoother.tsx
+0
-30
0 additions, 30 deletions
src/components/profile/smoother.tsx
with
79 additions
and
109 deletions
src/components/profile/profile-new.tsx
+
79
−
79
View file @
46494542
...
...
@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
import
{
useLockFn
,
useSetState
}
from
"
ahooks
"
;
import
{
Button
,
Collapse
,
Dialog
,
DialogActions
,
DialogContent
,
...
...
@@ -21,7 +22,6 @@ import { Settings } from "@mui/icons-material";
import
{
createProfile
}
from
"
@/services/cmds
"
;
import
Notice
from
"
../base/base-notice
"
;
import
FileInput
from
"
./file-input
"
;
import
{
Smoother
}
from
"
./smoother
"
;
interface
Props
{
open
:
boolean
;
...
...
@@ -94,98 +94,98 @@ const ProfileNew = (props: Props) => {
<
DialogTitle
sx
=
{
{
pb
:
0.5
}
}
>
{
t
(
"
Create Profile
"
)
}
</
DialogTitle
>
<
DialogContent
sx
=
{
{
width
:
336
,
pb
:
1
}
}
>
<
Smoother
>
<
FormControl
size
=
"small"
fullWidth
sx
=
{
{
mt
:
2
,
mb
:
1
}
}
>
<
InputLabel
>
Type
</
InputLabel
>
<
Select
autoFocus
label
=
{
t
(
"
Type
"
)
}
value
=
{
form
.
type
}
onChange
=
{
(
e
)
=>
setForm
({
type
:
e
.
target
.
value
})
}
>
<
MenuItem
value
=
"remote"
>
Remote
</
MenuItem
>
<
MenuItem
value
=
"local"
>
Local
</
MenuItem
>
<
MenuItem
value
=
"script"
>
Script
</
MenuItem
>
<
MenuItem
value
=
"merge"
>
Merge
</
MenuItem
>
</
Select
>
</
FormControl
>
<
FormControl
size
=
"small"
fullWidth
sx
=
{
{
mt
:
2
,
mb
:
1
}
}
>
<
InputLabel
>
Type
</
InputLabel
>
<
Select
autoFocus
label
=
{
t
(
"
Type
"
)
}
value
=
{
form
.
type
}
onChange
=
{
(
e
)
=>
setForm
({
type
:
e
.
target
.
value
})
}
>
<
MenuItem
value
=
"remote"
>
Remote
</
MenuItem
>
<
MenuItem
value
=
"local"
>
Local
</
MenuItem
>
<
MenuItem
value
=
"script"
>
Script
</
MenuItem
>
<
MenuItem
value
=
"merge"
>
Merge
</
MenuItem
>
</
Select
>
</
FormControl
>
<
TextField
{
...
textFieldProps
}
label
=
{
t
(
"
Name
"
)
}
autoComplete
=
"off"
value
=
{
form
.
name
}
onChange
=
{
(
e
)
=>
setForm
({
name
:
e
.
target
.
value
})
}
/>
<
TextField
{
...
textFieldProps
}
label
=
{
t
(
"
Descriptions
"
)
}
autoComplete
=
"off"
value
=
{
form
.
desc
}
onChange
=
{
(
e
)
=>
setForm
({
desc
:
e
.
target
.
value
})
}
/>
{
form
.
type
===
"
remote
"
&&
(
<
TextField
{
...
textFieldProps
}
label
=
{
t
(
"
Name
"
)
}
label
=
{
t
(
"
Subscription URL
"
)
}
autoComplete
=
"off"
value
=
{
form
.
name
}
onChange
=
{
(
e
)
=>
setForm
({
name
:
e
.
target
.
value
})
}
value
=
{
form
.
url
}
onChange
=
{
(
e
)
=>
setForm
({
url
:
e
.
target
.
value
})
}
/>
)
}
{
form
.
type
===
"
local
"
&&
(
<
FileInput
onChange
=
{
(
val
)
=>
(
fileDataRef
.
current
=
val
)
}
/>
)
}
<
Collapse
in
=
{
form
.
type
===
"
remote
"
&&
showOpt
}
timeout
=
"auto"
unmountOnExit
>
<
TextField
{
...
textFieldProps
}
label
=
{
t
(
"
Descriptions
"
)
}
label
=
"User Agent"
autoComplete
=
"off"
value
=
{
form
.
desc
}
onChange
=
{
(
e
)
=>
set
Form
({
desc
:
e
.
target
.
value
})
}
value
=
{
option
.
user_agent
}
onChange
=
{
(
e
)
=>
set
Option
({
user_agent
:
e
.
target
.
value
})
}
/>
{
form
.
type
===
"
remote
"
&&
(
<
TextField
{
...
textFieldProps
}
label
=
{
t
(
"
Subscription URL
"
)
}
autoComplete
=
"off"
value
=
{
form
.
url
}
onChange
=
{
(
e
)
=>
setForm
({
url
:
e
.
target
.
value
})
}
/>
)
}
{
form
.
type
===
"
local
"
&&
(
<
FileInput
onChange
=
{
(
val
)
=>
(
fileDataRef
.
current
=
val
)
}
/>
)
}
{
form
.
type
===
"
remote
"
&&
showOpt
&&
(
<>
<
TextField
{
...
textFieldProps
}
label
=
"User Agent"
autoComplete
=
"off"
value
=
{
option
.
user_agent
}
onChange
=
{
(
e
)
=>
setOption
({
user_agent
:
e
.
target
.
value
})
}
/>
<
FormControlLabel
label
=
{
t
(
"
Use System Proxy
"
)
}
labelPlacement
=
"start"
sx
=
{
{
ml
:
0
,
my
:
1
}
}
control
=
{
<
Switch
color
=
"primary"
checked
=
{
option
.
with_proxy
}
onChange
=
{
(
_e
,
c
)
=>
setOption
((
o
)
=>
({
self_proxy
:
c
?
false
:
o
.
self_proxy
,
with_proxy
:
c
,
}))
}
/>
<
FormControlLabel
label
=
{
t
(
"
Use System Proxy
"
)
}
labelPlacement
=
"start"
sx
=
{
{
ml
:
0
,
my
:
1
}
}
control
=
{
<
Switch
color
=
"primary"
checked
=
{
option
.
with_proxy
}
onChange
=
{
(
_e
,
c
)
=>
setOption
((
o
)
=>
({
self_proxy
:
c
?
false
:
o
.
self_proxy
,
with_proxy
:
c
,
}))
}
/>
<
FormControlLabel
label
=
{
t
(
"
Use Clash Proxy
"
)
}
labelPlacement
=
"start"
sx
=
{
{
ml
:
0
,
my
:
1
}
}
control
=
{
<
Switch
color
=
"primary"
checked
=
{
option
.
self_proxy
}
onChange
=
{
(
_e
,
c
)
=>
setOption
((
o
)
=>
({
with_proxy
:
c
?
false
:
o
.
with_proxy
,
self_proxy
:
c
,
}))
}
/>
}
/>
<
FormControlLabel
label
=
{
t
(
"
Use Clash Proxy
"
)
}
labelPlacement
=
"start"
sx
=
{
{
ml
:
0
,
my
:
1
}
}
control
=
{
<
Switch
color
=
"primary"
checked
=
{
option
.
self_proxy
}
onChange
=
{
(
_e
,
c
)
=>
setOption
((
o
)
=>
({
with_proxy
:
c
?
false
:
o
.
with_proxy
,
self_proxy
:
c
,
}))
}
/>
</>
)
}
</
Smoother
>
}
/>
</
Collapse
>
</
DialogContent
>
<
DialogActions
sx
=
{
{
px
:
2
,
pb
:
2
,
position
:
"
relative
"
}
}
>
...
...
This diff is collapsed.
Click to expand it.
src/components/profile/smoother.tsx
deleted
100644 → 0
+
0
−
30
View file @
a45dc6ef
import
{
useEffect
,
useRef
}
from
"
react
"
;
export
const
Smoother
:
React
.
FC
=
({
children
})
=>
{
const
self
=
useRef
<
HTMLDivElement
>
(
null
);
useEffect
(()
=>
{
if
(
typeof
window
.
getComputedStyle
==
"
undefined
"
)
return
;
const
element
=
self
.
current
;
if
(
!
element
)
return
;
var
height
=
window
.
getComputedStyle
(
element
).
height
;
element
.
style
.
transition
=
"
none
"
;
element
.
style
.
height
=
"
auto
"
;
var
targetHeight
=
window
.
getComputedStyle
(
element
).
height
;
element
.
style
.
height
=
height
;
setTimeout
(()
=>
{
element
.
style
.
transition
=
"
height .5s
"
;
element
.
style
.
height
=
targetHeight
;
},
0
);
});
return
(
<
div
ref
=
{
self
}
style
=
{
{
overflowY
:
"
hidden
"
,
}
}
>
{
children
}
</
div
>
);
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment