mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-13 03:02:38 +00:00
[MIRROR] NT Software Hub shows programs you do not have permissions to download (#1115)
* NT Software Hub shows programs you do not have permissions to download (#54075) * Show disabled downloads so you know what exists * sorted list of apps * NT Software Hub shows programs you do not have permissions to download Co-authored-by: NightRed <nightred@gmail.com>
This commit is contained in:
@@ -149,7 +149,7 @@
|
|||||||
for(var/A in main_repo)
|
for(var/A in main_repo)
|
||||||
var/datum/computer_file/program/P = A
|
var/datum/computer_file/program/P = A
|
||||||
// Only those programs our user can run will show in the list
|
// Only those programs our user can run will show in the list
|
||||||
if(!P.can_run(user,transfer = 1, access = access) || hard_drive.find_file_by_name(P.filename))
|
if(hard_drive.find_file_by_name(P.filename))
|
||||||
continue
|
continue
|
||||||
all_entries.Add(list(list(
|
all_entries.Add(list(list(
|
||||||
"filename" = P.filename,
|
"filename" = P.filename,
|
||||||
@@ -157,6 +157,7 @@
|
|||||||
"fileinfo" = P.extended_desc,
|
"fileinfo" = P.extended_desc,
|
||||||
"compatibility" = check_compatibility(P),
|
"compatibility" = check_compatibility(P),
|
||||||
"size" = P.size,
|
"size" = P.size,
|
||||||
|
"access" = P.can_run(user,transfer = 1, access = access)
|
||||||
)))
|
)))
|
||||||
data["hackedavailable"] = FALSE
|
data["hackedavailable"] = FALSE
|
||||||
if(emagged) // If we are running on emagged computer we have access to some "bonus" software
|
if(emagged) // If we are running on emagged computer we have access to some "bonus" software
|
||||||
@@ -170,7 +171,9 @@
|
|||||||
"filename" = P.filename,
|
"filename" = P.filename,
|
||||||
"filedesc" = P.filedesc,
|
"filedesc" = P.filedesc,
|
||||||
"fileinfo" = P.extended_desc,
|
"fileinfo" = P.extended_desc,
|
||||||
|
"compatibility" = check_compatibility(P),
|
||||||
"size" = P.size,
|
"size" = P.size,
|
||||||
|
"access" = TRUE,
|
||||||
)))
|
)))
|
||||||
data["hacked_programs"] = hacked_programs
|
data["hacked_programs"] = hacked_programs
|
||||||
|
|
||||||
|
|||||||
@@ -43,11 +43,20 @@ export const NtosNetDownloader = (props, context) => {
|
|||||||
</LabeledList>
|
</LabeledList>
|
||||||
</Section>
|
</Section>
|
||||||
<Section>
|
<Section>
|
||||||
{downloadable_programs.map(program => (
|
{downloadable_programs
|
||||||
<Program
|
.filter(program => program.access)
|
||||||
key={program.filename}
|
.map(program => (
|
||||||
program={program} />
|
<Program
|
||||||
))}
|
key={program.filename}
|
||||||
|
program={program} />
|
||||||
|
))}
|
||||||
|
{downloadable_programs
|
||||||
|
.filter(program => !program.access)
|
||||||
|
.map(program => (
|
||||||
|
<Program
|
||||||
|
key={program.filename}
|
||||||
|
program={program} />
|
||||||
|
))}
|
||||||
</Section>
|
</Section>
|
||||||
{!!hackedavailable && (
|
{!!hackedavailable && (
|
||||||
<Section title="UNKNOWN Software Repository">
|
<Section title="UNKNOWN Software Repository">
|
||||||
@@ -100,7 +109,9 @@ const Program = (props, context) => {
|
|||||||
fluid
|
fluid
|
||||||
icon="download"
|
icon="download"
|
||||||
content="Download"
|
content="Download"
|
||||||
disabled={downloading || program.size > disk_free}
|
disabled={
|
||||||
|
downloading || program.size > disk_free || !program.access
|
||||||
|
}
|
||||||
onClick={() => act('PRG_downloadfile', {
|
onClick={() => act('PRG_downloadfile', {
|
||||||
filename: program.filename,
|
filename: program.filename,
|
||||||
})} />
|
})} />
|
||||||
@@ -113,6 +124,12 @@ const Program = (props, context) => {
|
|||||||
Incompatible!
|
Incompatible!
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
{!(program.access) && (
|
||||||
|
<Box mt={1} italic fontSize="12px" position="relative">
|
||||||
|
<Icon mx={1} color="red" name="times" />
|
||||||
|
Invalid credentials loaded!
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
{program.size > disk_free && (
|
{program.size > disk_free && (
|
||||||
<Box mt={1} italic fontSize="12px" position="relative">
|
<Box mt={1} italic fontSize="12px" position="relative">
|
||||||
<Icon mx={1} color="red" name="times" />
|
<Icon mx={1} color="red" name="times" />
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user