Does some stuff
This commit is contained in:
@@ -5,13 +5,15 @@
|
|||||||
export let categories: string[];
|
export let categories: string[];
|
||||||
export let selectedCategories: string[];
|
export let selectedCategories: string[];
|
||||||
export let toggleCategory: (category: string) => void;
|
export let toggleCategory: (category: string) => void;
|
||||||
|
|
||||||
|
const isSelected = (selected: string[], current: string) => selected.map((c) => c.toLocaleLowerCase()).includes(current.toLocaleLowerCase());
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="categories" transition:slide>
|
<div class="categories" transition:slide>
|
||||||
{#each Object.keys(categories) as category}
|
{#each Object.keys(categories) as category}
|
||||||
<Button
|
<Button
|
||||||
action={() => toggleCategory(category)}
|
action={() => toggleCategory(category)}
|
||||||
selected="{selectedCategories.includes(category)}"
|
selected="{isSelected(selectedCategories, category)}"
|
||||||
>
|
>
|
||||||
{category}
|
{category}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
const makeRenderData = () => {
|
const makeRenderData = () => {
|
||||||
const results = [
|
const results = [
|
||||||
{ label: 'Pulls', value: formatBigNumber(info.pull_count), icon: 'download' },
|
{ label: 'Pulls', value: formatBigNumber(info.pull_count), icon: 'download' },
|
||||||
{ label: 'Stars', value: formatBigNumber(info.star_count), icon: 'star' },
|
{ label: 'Stars', value: formatBigNumber(info.star_count) || 'None yet', icon: 'star' },
|
||||||
{ label: 'User', value: info.hub_user, icon: 'user' },
|
{ label: 'User', value: info.hub_user, icon: 'user' },
|
||||||
{ label: 'Created', value: formatDate(info.date_registered), icon: 'published' },
|
{ label: 'Created', value: formatDate(info.date_registered), icon: 'published' },
|
||||||
{ label: 'Updated', value: timeAgo(info.last_updated), icon: 'updated' },
|
{ label: 'Updated', value: timeAgo(info.last_updated), icon: 'updated' },
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if dockerRunCommands}
|
{#if dockerRunCommands && dockerRunCommands.length > 0}
|
||||||
<hr />
|
<hr />
|
||||||
<h3>Via Docker Run</h3>
|
<h3>Via Docker Run</h3>
|
||||||
{#each dockerRunCommands as command, index}
|
{#each dockerRunCommands as command, index}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export const generateDockerRunCommand = (template: Template) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const generateDockerRunCommands = (stack: Service[]) => {
|
export const generateDockerRunCommands = (stack: Service[]) => {
|
||||||
const commands = stack.map((service) => {
|
const commands = stack.filter((s) => s.image).map((service) => {
|
||||||
let cmd = `docker run --name ${service.name} -d \\\n`;
|
let cmd = `docker run --name ${service.name} -d \\\n`;
|
||||||
if (service.command) {
|
if (service.command) {
|
||||||
cmd += ` ${service.command} \\\n`;
|
cmd += ` ${service.command} \\\n`;
|
||||||
|
|||||||
Reference in New Issue
Block a user