Skip to content

Commit

Permalink
Merge pull request #382 from Gankra/installers
Browse files Browse the repository at this point in the history
feat(custom-installers): create a new middle layer for artifacts
  • Loading branch information
Gankra authored Jun 19, 2023
2 parents 8fbc2f8 + 8066060 commit f6a6693
Show file tree
Hide file tree
Showing 20 changed files with 1,641 additions and 644 deletions.
1 change: 1 addition & 0 deletions oranda-css/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ table {

table th {
@apply text-left uppercase;
padding: 1rem;
}

table td {
Expand Down
9 changes: 9 additions & 0 deletions oranda-css/css/buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,13 @@
color: var(--light-color);
background-color: var(--dark-color);
border-color: var(--light-color);
}

select {
color: var(--dark-color);
background-color: var(--light-color);
}
.dark select {
color: var(--light-color);
background-color: var(--dark-color);
}
46 changes: 44 additions & 2 deletions oranda-css/css/pages/artifacts.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,29 @@
background-color: var(--dark-highlight-bg-color);
}

ul.tabs {
@apply flex border-b-2;
}

ul.tabs li {
@apply hover:cursor-pointer m-0 px-3 py-2 text-base;
}


ul.tabs li.selected {
color: var(--light-highlight-bg-color);
background-color: var(--light-highlight-fg-color);
}

.dark ul.tabs li.selected {
color: var(--dark-highlight-bg-color);
background-color: var(--dark-highlight-fg-color);
}

.install-content {
@apply max-w-full p-0 m-0;
}

.detect {
@apply text-center pr-2 md:pr-0;
}
Expand All @@ -42,7 +65,7 @@
}

.artifact-header {
@apply max-w-full;
@apply max-w-full w-full;
}

.artifact-header > div:not(.install-code-wrapper) {
Expand All @@ -58,7 +81,7 @@
}

.install-code-wrapper > pre {
@apply flex-grow;
@apply flex-grow flex-shrink;
}

.install-code-wrapper > .button {
Expand All @@ -69,6 +92,25 @@
@apply rounded-none;
}

.download-wrapper {
@apply flex flex-row justify-center;
}
.button .button-subtitle {
@apply text-xs block;
}

.published-date {
@apply block mb-2;
}

.arch-select {
@apply self-end;
}

.arch {
@apply p-0 m-0 pt-4;
}
.arch .contents {
@apply pt-4;
min-height: 7rem;
}
17 changes: 17 additions & 0 deletions src/config/oranda_config/artifacts/package_managers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,23 @@ pub struct PackageManagersConfig {
pub additional: Option<IndexMap<String, String>>,
}

impl PackageManagersConfig {
pub fn has(&self, key: &str) -> bool {
self.preferred
.as_ref()
.map(|p| p.contains_key(key))
.unwrap_or(false)
|| self
.additional
.as_ref()
.map(|p| p.contains_key(key))
.unwrap_or(false)
}
pub fn has_npm(&self) -> bool {
self.has("npm") || self.has("npx")
}
}

impl ApplyLayer for PackageManagersConfig {
fn apply_layer(&mut self, layer: Self) {
self.preferred.apply_opt(layer.preferred);
Expand Down
Loading

0 comments on commit f6a6693

Please sign in to comment.