Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rosekey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
freelynetwork
Rosekey
Commits
daba865a
Commit
daba865a
authored
3 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
wip: refactor(client): migrate components to composition api
parent
41e18aa9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/client/src/pages/settings/privacy.vue
+31
-55
31 additions, 55 deletions
packages/client/src/pages/settings/privacy.vue
with
31 additions
and
55 deletions
packages/client/src/pages/settings/privacy.vue
+
31
−
55
View file @
daba865a
...
...
@@ -47,8 +47,8 @@
</div>
</template>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'
vue
'
;
<
script
lang=
"ts"
setup
>
import
{
}
from
'
vue
'
;
import
FormSwitch
from
'
@/components/form/switch.vue
'
;
import
FormSelect
from
'
@/components/form/select.vue
'
;
import
FormSection
from
'
@/components/form/section.vue
'
;
...
...
@@ -56,63 +56,39 @@ import FormGroup from '@/components/form/group.vue';
import
*
as
os
from
'
@/os
'
;
import
{
defaultStore
}
from
'
@/store
'
;
import
*
as
symbols
from
'
@/symbols
'
;
import
{
i18n
}
from
'
@/i18n
'
;
import
{
$i
}
from
'
@/account
'
;
export
default
defineComponent
({
components
:
{
FormSelect
,
FormSection
,
FormGroup
,
FormSwitch
,
},
let
isLocked
=
$ref
(
$i
.
isLocked
);
let
autoAcceptFollowed
=
$ref
(
$i
.
autoAcceptFollowed
);
let
noCrawle
=
$ref
(
$i
.
noCrawle
);
let
isExplorable
=
$ref
(
$i
.
isExplorable
);
let
hideOnlineStatus
=
$ref
(
$i
.
hideOnlineStatus
);
let
publicReactions
=
$ref
(
$i
.
publicReactions
);
let
ffVisibility
=
$ref
(
$i
.
ffVisibility
);
emits
:
[
'
info
'
],
data
()
{
return
{
[
symbols
.
PAGE_INFO
]:
{
title
:
this
.
$ts
.
privacy
,
icon
:
'
fas fa-lock-open
'
,
bg
:
'
var(--bg)
'
,
},
isLocked
:
false
,
autoAcceptFollowed
:
false
,
noCrawle
:
false
,
isExplorable
:
false
,
hideOnlineStatus
:
false
,
publicReactions
:
false
,
ffVisibility
:
'
public
'
,
}
},
let
defaultNoteVisibility
=
$computed
(
defaultStore
.
makeGetterSetter
(
'
defaultNoteVisibility
'
));
let
defaultNoteLocalOnly
=
$computed
(
defaultStore
.
makeGetterSetter
(
'
defaultNoteLocalOnly
'
));
let
rememberNoteVisibility
=
$computed
(
defaultStore
.
makeGetterSetter
(
'
rememberNoteVisibility
'
));
let
keepCw
=
$computed
(
defaultStore
.
makeGetterSetter
(
'
keepCw
'
));
computed
:
{
defaultNoteVisibility
:
defaultStore
.
makeGetterSetter
(
'
defaultNoteVisibility
'
),
defaultNoteLocalOnly
:
defaultStore
.
makeGetterSetter
(
'
defaultNoteLocalOnly
'
),
rememberNoteVisibility
:
defaultStore
.
makeGetterSetter
(
'
rememberNoteVisibility
'
),
keepCw
:
defaultStore
.
makeGetterSetter
(
'
keepCw
'
),
},
function
save
()
{
os
.
api
(
'
i/update
'
,
{
isLocked
:
!!
isLocked
,
autoAcceptFollowed
:
!!
autoAcceptFollowed
,
noCrawle
:
!!
noCrawle
,
isExplorable
:
!!
isExplorable
,
hideOnlineStatus
:
!!
hideOnlineStatus
,
publicReactions
:
!!
publicReactions
,
ffVisibility
:
ffVisibility
,
});
}
created
()
{
this
.
isLocked
=
this
.
$i
.
isLocked
;
this
.
autoAcceptFollowed
=
this
.
$i
.
autoAcceptFollowed
;
this
.
noCrawle
=
this
.
$i
.
noCrawle
;
this
.
isExplorable
=
this
.
$i
.
isExplorable
;
this
.
hideOnlineStatus
=
this
.
$i
.
hideOnlineStatus
;
this
.
publicReactions
=
this
.
$i
.
publicReactions
;
this
.
ffVisibility
=
this
.
$i
.
ffVisibility
;
defineExpose
({
[
symbols
.
PAGE_INFO
]:
{
title
:
i18n
.
locale
.
privacy
,
icon
:
'
fas fa-lock-open
'
,
bg
:
'
var(--bg)
'
,
},
methods
:
{
save
()
{
os
.
api
(
'
i/update
'
,
{
isLocked
:
!!
this
.
isLocked
,
autoAcceptFollowed
:
!!
this
.
autoAcceptFollowed
,
noCrawle
:
!!
this
.
noCrawle
,
isExplorable
:
!!
this
.
isExplorable
,
hideOnlineStatus
:
!!
this
.
hideOnlineStatus
,
publicReactions
:
!!
this
.
publicReactions
,
ffVisibility
:
this
.
ffVisibility
,
});
}
}
});
</
script
>
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