Fix a number of typescript errors (#32773)
Fixes 96 typescript errors. Behaviour changes are commented below. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
e619384098
commit
8a53a39c42
19 changed files with 81 additions and 80 deletions
|
@ -1,14 +1,14 @@
|
|||
import {hideElem, showElem, toggleElem} from '../utils/dom.ts';
|
||||
|
||||
const service = document.querySelector('#service_type');
|
||||
const user = document.querySelector('#auth_username');
|
||||
const pass = document.querySelector('#auth_password');
|
||||
const token = document.querySelector('#auth_token');
|
||||
const mirror = document.querySelector('#mirror');
|
||||
const lfs = document.querySelector('#lfs');
|
||||
const lfsSettings = document.querySelector('#lfs_settings');
|
||||
const lfsEndpoint = document.querySelector('#lfs_endpoint');
|
||||
const items = document.querySelectorAll('#migrate_items input[type=checkbox]');
|
||||
const service = document.querySelector<HTMLInputElement>('#service_type');
|
||||
const user = document.querySelector<HTMLInputElement>('#auth_username');
|
||||
const pass = document.querySelector<HTMLInputElement>('#auth_password');
|
||||
const token = document.querySelector<HTMLInputElement>('#auth_token');
|
||||
const mirror = document.querySelector<HTMLInputElement>('#mirror');
|
||||
const lfs = document.querySelector<HTMLInputElement>('#lfs');
|
||||
const lfsSettings = document.querySelector<HTMLElement>('#lfs_settings');
|
||||
const lfsEndpoint = document.querySelector<HTMLElement>('#lfs_endpoint');
|
||||
const items = document.querySelectorAll<HTMLInputElement>('#migrate_items input[type=checkbox]');
|
||||
|
||||
export function initRepoMigration() {
|
||||
checkAuth();
|
||||
|
@ -25,11 +25,11 @@ export function initRepoMigration() {
|
|||
});
|
||||
lfs?.addEventListener('change', setLFSSettingsVisibility);
|
||||
|
||||
const cloneAddr = document.querySelector('#clone_addr');
|
||||
const cloneAddr = document.querySelector<HTMLInputElement>('#clone_addr');
|
||||
cloneAddr?.addEventListener('change', () => {
|
||||
const repoName = document.querySelector('#repo_name');
|
||||
const repoName = document.querySelector<HTMLInputElement>('#repo_name');
|
||||
if (cloneAddr.value && !repoName?.value) { // Only modify if repo_name input is blank
|
||||
repoName.value = cloneAddr.value.match(/^(.*\/)?((.+?)(\.git)?)$/)[3];
|
||||
repoName.value = /^(.*\/)?((.+?)(\.git)?)$/.exec(cloneAddr.value)[3];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -41,8 +41,8 @@ function checkAuth() {
|
|||
checkItems(serviceType !== 1);
|
||||
}
|
||||
|
||||
function checkItems(tokenAuth) {
|
||||
let enableItems;
|
||||
function checkItems(tokenAuth: boolean) {
|
||||
let enableItems = false;
|
||||
if (tokenAuth) {
|
||||
enableItems = token?.value !== '';
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue