6 Commits

3 changed files with 30 additions and 32 deletions

View File

@@ -46,11 +46,11 @@ RUN pacman -Sy --noconfirm postgresql-libs \
&& set -x \
&& pacman -Syu --noconfirm \
&& pacman -Scc --noconfirm \
&& printf "\n[lib32]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf \
&& printf "\n[system-gremlins]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf \
&& printf "\n[world-gremlins]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf \
&& printf "\n[galaxy-gremlins]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf \
&& printf "\n[lib32-gremlins]\nInclude = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf \
&& printf "[lib32]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
&& printf "[system-gremlins]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
&& printf "[world-gremlins]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
&& printf "[galaxy-gremlins]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
&& printf "[lib32-gremlins]\nInclude = /etc/pacman.d/mirrorlist\n" >> /etc/pacman.conf \
&& pacman -Sy --noconfirm
WORKDIR /usr/share/artixweb_packages

View File

@@ -121,33 +121,31 @@ pub async fn index(
repos.join(":")
};
let s = if let Ok(result) =
let mut s = PackagesNavigation {
user_email,
packages: Vec::new(),
repos,
total: 0,
query: query_url.join("&"),
total_pages: 1,
generation_time: 0,
offset,
limit
};
if let Ok(result) =
get_packages_inner(&repos_criteria, limit, offset, search_criteria, Some(&pool)).await
{
PackagesNavigation {
user_email,
packages: result.0,
repos,
total: result.1,
query: query_url.join("&"),
total_pages: if limit > 0 {
(result.1 as f64 / limit as f64).ceil() as usize
} else {
1
},
generation_time: start_time.elapsed().as_millis(),
offset,
limit,
}
.render()
.unwrap()
} else {
return Ok(HttpResponse::NotFound()
.content_type("text/html")
.body("<html><body>404 - Page Not Found!</body></html>"));
};
s.packages = result.0;
s.total = result.1;
s.total_pages = if limit > 0 {
(result.1 as f64 / limit as f64).ceil() as usize
} else {
1
};
}
s.generation_time = start_time.elapsed().as_millis();
Ok(HttpResponse::Ok().content_type("text/html").body(s))
Ok(HttpResponse::Ok().content_type("text/html").body(s.render().unwrap()))
}
#[allow(clippy::unnecessary_wraps)]

View File

@@ -35,8 +35,8 @@
<h2>{{ pkg.package_name }}-{{ pkg.version }} {% if pkg.flagged %}(<span class="flagged">flagged</span>){% endif %}</h2>
<section role="action_panel" class="action_panel">
<h4>Actions Panel</h4>
<section role="action"><a href="{{ pkg.gitea_url }}" target="blank">View Package Sources</a></section>
<section role="action"><a href="{{ pkg.gitea_url }}/graph" target="blank">View Package Changes</a></section>
<section role="action"><a href="{{ pkg.gitea_url }}">View Package Sources</a></section>
<section role="action"><a href="{{ pkg.gitea_url }}/graph">View Package Changes</a></section>
{% if !pkg.flagged %}
<section role="action"><a href="/flag_package/{{ pkg.package_name }}/{{ pkg.version }}">Flag package out-of-date</a></section>
{% else %}
@@ -65,7 +65,7 @@
<section role="value">{{ pkg.replaces|provides_or_replaces }}</section>
{% endif %}
<section role="key">Upstream URL:</section>
<section role="value"><a href="{{ pkg.upstream_url }}" target="_blank">{{ pkg.upstream_url }}</a></section>
<section role="value"><a href="{{ pkg.upstream_url }}">{{ pkg.upstream_url }}</a></section>
<section role="key">Size:</section>
<section role="value">{{ pkg.size|human_readable }} MB</section>
<section role="key">Installed Size:</section>