Skip to content

Commit

Permalink
feat: add merits services
Browse files Browse the repository at this point in the history
  • Loading branch information
k1rill-fedoseev committed Dec 18, 2024
1 parent a3768cd commit d8935cd
Show file tree
Hide file tree
Showing 5 changed files with 282 additions and 0 deletions.
2 changes: 2 additions & 0 deletions hosted_services.csv
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ visualizer,👁️
autoscout,🌐
multichain-aggregator,📡
metadata,🏷️
merits,🏆
merits-admin,🧰
Empty file.
140 changes: 140 additions & 0 deletions services/merits-admin/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Available swagger versions for service <code>merits-admin</code></title>

<!-- Bootstrap CSS -->
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
/>

<!-- Google Font -->
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
rel="stylesheet"
/>

<style>
body {
font-family: 'Roboto', sans-serif;
background-color: #f8f9fa;
margin: 0;
padding: 2rem;
}

h1 {
text-align: center;
margin-bottom: 2rem;
color: #343a40;
}

.version-section {
background: #ffffff;
padding: 1rem 2rem;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.version-title {
font-weight: 500;
color: #007bff;
margin-bottom: 1rem;
}

ul {
list-style-type: none;
padding-left: 0;
}

li {
margin: 0.5rem 0;
}

a {
text-decoration: none;
color: #007bff;
}

a:hover {
text-decoration: underline;
color: #0056b3;
}

.back-button {
display: block;
margin: 2rem 0;
text-align: center;
}
</style>

<script>
async function loadFileList() {
try {
const response = await fetch(`https://raw.githubusercontent.com/blockscout/swaggers/master/services/merits-admin/hosted_versions.txt`);
if (!response.ok) {
throw new Error('Failed to load hosted_versions.txt');
}
const text = await response.text();
const versions = text.split('\n').filter(file => file.trim() !== '');

const tagsList = document.getElementById('tags-list');
const commitsList = document.getElementById('commits-list');
const branchesList = document.getElementById('branches-list');

versions.forEach(version => {
const li = document.createElement('li');
const a = document.createElement('a');
a.href = `./${version}/index.html`;
a.textContent = version;

if (version.startsWith('v')) {
li.appendChild(a);
tagsList.appendChild(li);
} else if (/^[a-f0-9]{8}/.test(version)) {
li.appendChild(a);
commitsList.appendChild(li);
} else {
li.appendChild(a);
branchesList.appendChild(li);
}
});
} catch (error) {
console.error('Error loading file list:', error);
}
}

window.onload = loadFileList;
</script>
</head>

<body>
<h1>Available Swagger Versions for <code>merits-admin</code></h1>
<div class="container version-section">
<div class="row">
<div class="col-md-4">
<h2 class="version-title">Branches</h2>
<ul id="branches-list"></ul>
</div>
<div class="col-md-4">
<h2 class="version-title">Tags</h2>
<ul id="tags-list"></ul>
</div>
<div class="col-md-4">
<h2 class="version-title">Commits</h2>
<ul id="commits-list"></ul>
</div>
</div>
</div>

<!-- Back to Home button -->
<div class="back-button">
<a href="/swaggers" class="btn btn-secondary">Back to Home</a>
</div>

<!-- Bootstrap JS and dependencies (optional) -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
Empty file.
140 changes: 140 additions & 0 deletions services/merits/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Available swagger versions for service <code>merits</code></title>

<!-- Bootstrap CSS -->
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
/>

<!-- Google Font -->
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap"
rel="stylesheet"
/>

<style>
body {
font-family: 'Roboto', sans-serif;
background-color: #f8f9fa;
margin: 0;
padding: 2rem;
}

h1 {
text-align: center;
margin-bottom: 2rem;
color: #343a40;
}

.version-section {
background: #ffffff;
padding: 1rem 2rem;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.version-title {
font-weight: 500;
color: #007bff;
margin-bottom: 1rem;
}

ul {
list-style-type: none;
padding-left: 0;
}

li {
margin: 0.5rem 0;
}

a {
text-decoration: none;
color: #007bff;
}

a:hover {
text-decoration: underline;
color: #0056b3;
}

.back-button {
display: block;
margin: 2rem 0;
text-align: center;
}
</style>

<script>
async function loadFileList() {
try {
const response = await fetch(`https://raw.githubusercontent.com/blockscout/swaggers/master/services/merits/hosted_versions.txt`);
if (!response.ok) {
throw new Error('Failed to load hosted_versions.txt');
}
const text = await response.text();
const versions = text.split('\n').filter(file => file.trim() !== '');

const tagsList = document.getElementById('tags-list');
const commitsList = document.getElementById('commits-list');
const branchesList = document.getElementById('branches-list');

versions.forEach(version => {
const li = document.createElement('li');
const a = document.createElement('a');
a.href = `./${version}/index.html`;
a.textContent = version;

if (version.startsWith('v')) {
li.appendChild(a);
tagsList.appendChild(li);
} else if (/^[a-f0-9]{8}/.test(version)) {
li.appendChild(a);
commitsList.appendChild(li);
} else {
li.appendChild(a);
branchesList.appendChild(li);
}
});
} catch (error) {
console.error('Error loading file list:', error);
}
}

window.onload = loadFileList;
</script>
</head>

<body>
<h1>Available Swagger Versions for <code>merits</code></h1>
<div class="container version-section">
<div class="row">
<div class="col-md-4">
<h2 class="version-title">Branches</h2>
<ul id="branches-list"></ul>
</div>
<div class="col-md-4">
<h2 class="version-title">Tags</h2>
<ul id="tags-list"></ul>
</div>
<div class="col-md-4">
<h2 class="version-title">Commits</h2>
<ul id="commits-list"></ul>
</div>
</div>
</div>

<!-- Back to Home button -->
<div class="back-button">
<a href="/swaggers" class="btn btn-secondary">Back to Home</a>
</div>

<!-- Bootstrap JS and dependencies (optional) -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>

0 comments on commit d8935cd

Please sign in to comment.