mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-08 08:04:21 +00:00
[UI] Fix scoped-access-token
- Regression of #4571 - Refactor to not use the component API of Vue. The root cause is still unknown.
This commit is contained in:
parent
ea1a0ebbc3
commit
aa5163d5c4
|
@ -77,14 +77,12 @@
|
||||||
<p class="activity meta">
|
<p class="activity meta">
|
||||||
<p>{{ctx.Locale.Tr "settings.access_token_desc" (HTMLFormat `href="%s/api/swagger" target="_blank"` AppSubUrl) (`href="https://forgejo.org/docs/latest/user/token-scope/" target="_blank"`|SafeHTML)}}</p>
|
<p>{{ctx.Locale.Tr "settings.access_token_desc" (HTMLFormat `href="%s/api/swagger" target="_blank"` AppSubUrl) (`href="https://forgejo.org/docs/latest/user/token-scope/" target="_blank"`|SafeHTML)}}</p>
|
||||||
</p>
|
</p>
|
||||||
<div class="scoped-access-token-mount">
|
<div class="scoped-access-token"
|
||||||
<scoped-access-token-selector
|
data-is-admin="{{if .IsAdmin}}true{{else}}false{{end}}"
|
||||||
:is-admin="{{if .IsAdmin}}true{{else}}false{{end}}"
|
data-no-access-label="{{ctx.Locale.Tr "settings.permission_no_access"}}"
|
||||||
no-access-label="{{ctx.Locale.Tr "settings.permission_no_access"}}"
|
data-read-label="{{ctx.Locale.Tr "settings.permission_read"}}"
|
||||||
read-label="{{ctx.Locale.Tr "settings.permission_read"}}"
|
data-write-label="{{ctx.Locale.Tr "settings.permission_write"}}"
|
||||||
write-label="{{ctx.Locale.Tr "settings.permission_write"}}"
|
></div>
|
||||||
></scoped-access-token-selector>
|
|
||||||
</div>
|
|
||||||
</details>
|
</details>
|
||||||
<button id="scoped-access-submit" class="ui primary button">
|
<button id="scoped-access-submit" class="ui primary button">
|
||||||
{{ctx.Locale.Tr "settings.generate_token"}}
|
{{ctx.Locale.Tr "settings.generate_token"}}
|
||||||
|
|
|
@ -78,10 +78,13 @@ export default sfc;
|
||||||
* Initialize category toggle sections
|
* Initialize category toggle sections
|
||||||
*/
|
*/
|
||||||
export function initScopedAccessTokenCategories() {
|
export function initScopedAccessTokenCategories() {
|
||||||
for (const el of document.getElementsByClassName('scoped-access-token-mount')) {
|
for (const el of document.getElementsByClassName('scoped-access-token')) {
|
||||||
createApp({})
|
createApp(sfc, {
|
||||||
.component('scoped-access-token-selector', sfc)
|
isAdmin: el.getAttribute('data-is-admin') === 'true',
|
||||||
.mount(el);
|
noAccessLabel: el.getAttribute('data-no-access-label'),
|
||||||
|
readLabel: el.getAttribute('data-read-label'),
|
||||||
|
writeLabel: el.getAttribute('data-write-label'),
|
||||||
|
}).mount(el);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue