Skip to content

Commit 81ee93e

Browse files
authored
Fix repo settings and protocol log problems (#35012) (#35013)
Backport #35012
1 parent 053f918 commit 81ee93e

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

modules/setting/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ func loadServerFrom(rootCfg ConfigProvider) {
275275
HTTPAddr = filepath.Join(AppWorkPath, HTTPAddr)
276276
}
277277
default:
278-
log.Fatal("Invalid PROTOCOL %q", Protocol)
278+
log.Fatal("Invalid PROTOCOL %q", protocolCfg)
279279
}
280280
UseProxyProtocol = sec.Key("USE_PROXY_PROTOCOL").MustBool(false)
281281
ProxyProtocolTLSBridging = sec.Key("PROXY_PROTOCOL_TLS_BRIDGING").MustBool(false)

web_src/js/features/repo-settings.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {minimatch} from 'minimatch';
22
import {createMonaco} from './codeeditor.ts';
3-
import {onInputDebounce, queryElems, toggleClass, toggleElem} from '../utils/dom.ts';
3+
import {onInputDebounce, queryElems, toggleElem} from '../utils/dom.ts';
44
import {POST} from '../modules/fetch.ts';
55
import {initRepoSettingsBranchesDrag} from './repo-settings-branches.ts';
66
import {fomanticQuery} from '../modules/fomantic/base.ts';
@@ -124,14 +124,18 @@ function initRepoSettingsOptions() {
124124
const pageContent = document.querySelector('.page-content.repository.settings.options');
125125
if (!pageContent) return;
126126

127-
// Enable or select internal/external wiki system and issue tracker.
127+
// toggle related panels for the checkbox/radio inputs, the "selector" may not exist
128+
const toggleTargetContextPanel = (selector: string, enabled: boolean) => {
129+
if (!selector) return;
130+
queryElems(document, selector, (el) => el.classList.toggle('disabled', !enabled));
131+
};
128132
queryElems<HTMLInputElement>(pageContent, '.enable-system', (el) => el.addEventListener('change', () => {
129-
toggleClass(el.getAttribute('data-target'), 'disabled', !el.checked);
130-
toggleClass(el.getAttribute('data-context'), 'disabled', el.checked);
133+
toggleTargetContextPanel(el.getAttribute('data-target'), el.checked);
134+
toggleTargetContextPanel(el.getAttribute('data-context'), !el.checked);
131135
}));
132136
queryElems<HTMLInputElement>(pageContent, '.enable-system-radio', (el) => el.addEventListener('change', () => {
133-
toggleClass(el.getAttribute('data-target'), 'disabled', el.value === 'false');
134-
toggleClass(el.getAttribute('data-context'), 'disabled', el.value === 'true');
137+
toggleTargetContextPanel(el.getAttribute('data-target'), el.value === 'true');
138+
toggleTargetContextPanel(el.getAttribute('data-context'), el.value === 'false');
135139
}));
136140

137141
queryElems<HTMLInputElement>(pageContent, '.js-tracker-issue-style', (el) => el.addEventListener('change', () => {

0 commit comments

Comments
 (0)