MCPcopy Create free account
hub / github.com/error311/FileRise / setType

Function setType

public/js/adminPanel.js:1986–2010  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

1984 };
1985
1986 const setType = (type) => {
1987 let t = (type || 'local').toLowerCase();
1988 if (!allowedTypeSet.has(t)) {
1989 t = sourceTypeEl?.options?.[0]?.value
1990 ? String(sourceTypeEl.options[0].value).toLowerCase()
1991 : 'local';
1992 }
1993 sourceTypeEl.value = t;
1994 typeBlocks.forEach(block => {
1995 block.hidden = block.getAttribute('data-type') !== t;
1996 });
1997 if (sourceDisableTrashEl) {
1998 const forcePermanentDelete = (t === 'gdrive');
1999 sourceDisableTrashEl.disabled = forcePermanentDelete;
2000 if (forcePermanentDelete) {
2001 sourceDisableTrashEl.checked = true;
2002 sourceDisableTrashEl.title = tf(
2003 'source_gdrive_trash_note',
2004 'Trash is not supported on Google Drive sources; deletes are permanent.'
2005 );
2006 } else {
2007 sourceDisableTrashEl.removeAttribute('title');
2008 }
2009 }
2010 };
2011
2012 const resetSecrets = () => {
2013 [

Callers 4

resetFormFunction · 0.85
fillFormFunction · 0.85
initSourcesSectionFunction · 0.85
initGatewaysSectionFunction · 0.85

Calls 1

tfFunction · 0.70

Tested by

no test coverage detected