Skip to content

Commit

Permalink
center: update project-single hbs
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxiaohei committed Oct 31, 2023
1 parent bb52a2c commit 1087372
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 45 deletions.
59 changes: 59 additions & 0 deletions binary/center/templates/css/input.css
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,62 @@
#sign-in-button {
@apply text-xl px-4 py-2 bg-primary rounded-lg text-white hover:bg-white hover:border hover:border-primary hover:text-primary;
}
#project-navbar {
@apply font-medium text-center text-gray-500 border-b border-gray-200;
}
#project-navbar li {
@apply mr-2;
}
#project-navbar li a.item {
@apply inline-block p-4 border-b-2 border-transparent rounded-t-lg hover:text-gray-600 hover:border-gray-300;
}
#project-navbar li a.item.active {
@apply text-primary border-primary hover:text-primary hover:border-primary;
}
#project-navbar li a.item.disable {
@apply cursor-not-allowed text-gray-400 hover:text-gray-400 hover:border-transparent;
}
#project-main {
@apply mt-6 flex space-x-4;
}
#project-main > .left {
@apply w-3/4;
}
#project-main > .right {
@apply w-1/4;
}
#project-main .deployment-status {
@apply bg-sky-50 rounded-lg p-6;
}
#project-main .deployment-status h3,
.deployment-lists h3 {
@apply text-xl font-semibold;
}
#project-main .deployment-status .desc,
.deployment-lists .desc,
#deployment-list .date {
@apply text-gray-400;
}
#project-main .deployment-status p {
@apply leading-6;
}
#project-main .deployment-status .label {
@apply mt-6 text-gray-400 uppercase;
}
#project-main .deployment-status .domains .link,
#deployment-list .link {
@apply hover:underline;
}

.deployment-lists {
@apply p-6 border rounded-lg border-gray-200 my-4;
}
#deployment-list {
@apply mt-4;
}
#deployment-list .item {
@apply py-3 flex justify-between;
}
#deployment-list .prod-badge {
@apply px-1 py-0.5 text-sm text-white bg-blue-500 rounded-lg;
}
87 changes: 50 additions & 37 deletions binary/center/templates/project-single.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,49 +13,62 @@
<span class="count">PENDING PRODUCTION DEPLOYMENT</span>
</div>
<div id="project-navbar">

<ul class="flex flex-wrap -mb-px">
<li>
<a href="#" class="item active">Overview</a>
</li>
<li>
<a class="item disable">Traffic</a>
</li>
<li>
<a href="#" class="item">Settings</a>
</li>
</ul>
</div>
<div id="projects-list" class="mt-6">
<div class="flex space-x-4">
<div class="project-card">
<div class="card-left">
<div class="card-title">spryest-pyknoses-242</div>
<div class="card-metadata">
<span class="item">Rust</span>
<span class="item">1 Deploys</span>
<span class="item">30 Days ago</span>
</div>
<div class="card-link">
<a href="#"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"
class="w-5 h-5 inline-block mr-1">
<path fill-rule="evenodd"
d="M4.25 5.5a.75.75 0 00-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 00.75-.75v-4a.75.75 0 011.5 0v4A2.25 2.25 0 0112.75 17h-8.5A2.25 2.25 0 012 14.75v-8.5A2.25 2.25 0 014.25 4h5a.75.75 0 010 1.5h-5z"
clip-rule="evenodd" />
<path fill-rule="evenodd"
d="M6.194 12.753a.75.75 0 001.06.053L16.5 4.44v2.81a.75.75 0 001.5 0v-4.5a.75.75 0 00-.75-.75h-4.5a.75.75 0 000 1.5h2.553l-9.056 8.194a.75.75 0 00-.053 1.06z"
clip-rule="evenodd" />
</svg>
spryest-pyknoses-242.binary.com</a>
</div>
<div id="project-main" class="mt-6 flex space-x-4">
<div class="left">
<div class="deployment-status">
<h3>Production Deployment</h3>
<p class="desc">This project is in Production.</p>
<div class="domains">
<p class="label">domain</p>
<p class="link"><a href="#">calm-cod-79-hxzfdq7zh6w7.dev</a></p>
<p class="link"><a href="#">calm-cod-79.dev</a></p>
</div>
<div class="card-right">
<a href="#" class="action-button">Running</a>
<div class="updated">
<p class="label">updated</p>
<p>3 Days ago</p>
</div>
</div>
<div class="project-card">
<div class="card-left">
<div class="card-title">spryest-pyknoses-242</div>
<div class="card-metadata">
<span class="item">Rust</span>
<span class="item">1 Deploys</span>
<span class="item">30 Days ago</span>
</div>
</div>
<div class="card-right">
<a href="#" class="action-button">Running</a>
</div>

<div class="deployment-lists">
<h3>All Deployments</h3>
<p class="desc">All deployments for this project.</p>
<ul id="deployment-list">
<li class="item">
<div class="left">
<a href="#" class="link">calm-cod-79-hxzfdq7zh6w7.xxxx.dev</a>
<span class="prod-badge">prod</span>
</div>
<div class="right">
<span class="date">3 Days ago</span>
<span class="ops">ops</span>
</div>
</li>
<li class="item">
<div class="left">
<span class="status">ok</span>
<a href="#" class="link">calm-cod-79-hxzfdq7zh6w7.xxxx.dev</a>
</div>
<div class="right">
<span class="date">3 Days ago</span>
<span class="ops">ops</span>
</div>
</li>
</ul>
</div>
</div>
<div class="right">w-1/4</div>
</div>
</main>
{{> partials/footer.hbs}}
Expand Down
18 changes: 10 additions & 8 deletions binary/center/templates/signin.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,19 @@
afterSignUpUrl: "/projects",
});
// if clerk is signed in, redirect to projects page
if (window.Clerk.session && window.Clerk.user) {
await window.Clerk.navigate('/projects'); // TODO: target should from query string "redirect=xxx"
return;
}
let show = function () {
let show = async function () {
if (!window.Clerk.isReady()) {
return
}
clearInterval(window.intervalID)
// if clerk is signed in, redirect to projects page
if (window.Clerk.session && window.Clerk.user) {
await window.Clerk.navigate('/projects'); // TODO: target should from query string "redirect=xxx"
return;
}
// render ui
const signInComponent = document.querySelector('#sign-in');
window.Clerk.openSignIn(signInComponent, {
appearance: {
Expand All @@ -47,7 +49,7 @@
button.disabled = false;
button.textContent = "Sign-in via Clerk.js"
}
window.intervalID = setInterval(show, 200);
}
Expand Down

0 comments on commit 1087372

Please sign in to comment.