-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01b8db0
commit 0e5c460
Showing
13 changed files
with
477 additions
and
53 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace mauricerenck\IndieConnector; | ||
|
||
use Kirby\Http\Response; | ||
|
||
return [ | ||
'routes' => [ | ||
[ | ||
'pattern' => 'indieconnector/queue/processItem/(:any)', | ||
'method' => 'POST', | ||
'action' => function (string $id) { | ||
$queueHandler = new QueueHandler(); | ||
$response = $queueHandler->getAndProcessQueuedItem($id); | ||
|
||
return new Response(json_encode($response), 'application/json'); | ||
}, | ||
], | ||
|
||
[ | ||
'pattern' => 'indieconnector/queue/process', | ||
'method' => 'POST', | ||
'action' => function () { | ||
$postBody = kirby()->request()->data(); | ||
$queueHandler = new QueueHandler(); | ||
|
||
$results = []; | ||
foreach ($postBody as $item) { | ||
$response = $queueHandler->getAndProcessQueuedItem($item); | ||
$results[] = $response; | ||
} | ||
|
||
return new Response(json_encode($results), 'application/json'); | ||
}, | ||
], | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
<template> | ||
<k-inside> | ||
<div class="k-webmentions-queue-view"> | ||
<k-header>IndieConnector</k-header> | ||
<k-tabs | ||
tab="queue" | ||
:tabs="[ | ||
{ name: 'webmentions', label: 'Webmentions', link: '/webmentions' }, | ||
{ name: 'queue', label: 'Queue', link: '/webmentions/queue', badge: itemsInQueue } | ||
]" | ||
theme='warning' | ||
|
||
/> | ||
|
||
<k-info-field v-if="disabled" label="Queue disabled" text="The queue feature is disabled. Configure it in your config.php" /> | ||
|
||
<QueueList :queuedItems="queuedItems" /> | ||
</div> | ||
</k-inside> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
props: { | ||
disabled: Boolean, | ||
queuedItems: Object, | ||
itemsInQueue: Number | ||
}, | ||
methods: { | ||
}, | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
.k-webmentions-queue-view { | ||
.wrapper { | ||
background: #fff; | ||
box-shadow: var(--box-shadow-item); | ||
padding: 10px 20px; | ||
margin-top: var(--spacing-6); | ||
} | ||
.muted { | ||
color: var(--color-gray-600); | ||
} | ||
h2 { | ||
font-size: var(--text-3xl); | ||
margin: 2em 0 1em 0; | ||
} | ||
.bottom-margin { | ||
margin-bottom: var(--spacing-6); | ||
} | ||
.status { | ||
border: 1px solid var(--color-gray-400); | ||
background-color: var(--color-gray-200); | ||
border-radius: var(--rounded-md); | ||
padding: var(--spacing-1) var(--spacing-2); | ||
&.error { | ||
border: 1px solid var(--color-red-400); | ||
background-color: var(--color-red-200); | ||
} | ||
&.running { | ||
border: 1px solid var(--color-blue-400); | ||
background-color: var(--color-blue-200); | ||
} | ||
&.failed { | ||
border: 1px solid var(--color-red-600); | ||
background-color: var(--color-red-400); | ||
} | ||
&.success { | ||
border: 1px solid var(--color-green-400); | ||
background-color: var(--color-green-200); | ||
} | ||
} | ||
} | ||
</style> |
Oops, something went wrong.