mirror of
https://github.com/rikkaneko/paste.git
synced 2025-08-03 12:40:07 +01:00
Fix js/css path (paste)
Fix collapse layout animation (web) Signed-off-by: Joe Ma <rikkaneko23@gmail.com>
This commit is contained in:
parent
576a543703
commit
7e65c403f7
3 changed files with 23 additions and 7 deletions
24
src/index.ts
24
src/index.ts
|
@ -23,8 +23,8 @@ import dedent from 'dedent-js';
|
||||||
|
|
||||||
// Constants
|
// Constants
|
||||||
const SERVICE_URL = 'pb.nekoul.com';
|
const SERVICE_URL = 'pb.nekoul.com';
|
||||||
const PASTE_INDEX_HTML_URL_v1 = 'https://raw.githubusercontent.com/rikkaneko/paste/main/web/v1/paste.html';
|
const PASTE_WEB_URL_v1 = 'https://raw.githubusercontent.com/rikkaneko/paste/main/web/v1';
|
||||||
const PASTE_INDEX_HTML_URL = 'https://raw.githubusercontent.com/rikkaneko/paste/main/web/v2/paste.html';
|
const PASTE_WEB_URL = 'https://raw.githubusercontent.com/rikkaneko/paste/main/web/v2';
|
||||||
const UUID_LENGTH = 4;
|
const UUID_LENGTH = 4;
|
||||||
|
|
||||||
export interface Env {
|
export interface Env {
|
||||||
|
@ -69,7 +69,23 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (path === '/v1' && method == 'GET') {
|
if (path === '/v1' && method == 'GET') {
|
||||||
return await fetch(PASTE_INDEX_HTML_URL_v1, {
|
return await fetch(PASTE_WEB_URL_v1 + '/paste.html', {
|
||||||
|
cf: {
|
||||||
|
cacheEverything: true,
|
||||||
|
},
|
||||||
|
}).then(value => {
|
||||||
|
return new Response(value.body, {
|
||||||
|
// Add the correct content-type to response header
|
||||||
|
headers: {
|
||||||
|
'content-type': 'text/html; charset=UTF-8;',
|
||||||
|
'cache-control': 'public, max-age=172800',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (/\/(js|css)\/.*$/.test(path) && method == 'GET') {
|
||||||
|
return await fetch(PASTE_WEB_URL + path, {
|
||||||
cf: {
|
cf: {
|
||||||
cacheEverything: true,
|
cacheEverything: true,
|
||||||
},
|
},
|
||||||
|
@ -88,7 +104,7 @@ export default {
|
||||||
switch (method) {
|
switch (method) {
|
||||||
// Fetch the HTML for uploading text/file
|
// Fetch the HTML for uploading text/file
|
||||||
case 'GET': {
|
case 'GET': {
|
||||||
return await fetch(PASTE_INDEX_HTML_URL, {
|
return await fetch(PASTE_WEB_URL + '/paste.html', {
|
||||||
cf: {
|
cf: {
|
||||||
cacheEverything: true,
|
cacheEverything: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
.card-header .fa {
|
.card-header .fa-chevron-down {
|
||||||
transition: .3s transform ease-in-out;
|
transition: .3s transform ease-in-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-header .collapsed .fa {
|
.card-header .collapsed .fa-chevron-down {
|
||||||
transform: rotate(90deg);
|
transform: rotate(90deg);
|
||||||
}
|
}
|
|
@ -112,7 +112,7 @@
|
||||||
<div class="card-header mb-3">
|
<div class="card-header mb-3">
|
||||||
<span data-bs-toggle="collapse" data-bs-target="#advanced_settings_layout" aria-expanded="false"
|
<span data-bs-toggle="collapse" data-bs-target="#advanced_settings_layout" aria-expanded="false"
|
||||||
aria-controls="advanced_settings_layout" id="advanced_settings_control"
|
aria-controls="advanced_settings_layout" id="advanced_settings_control"
|
||||||
class="d-block">
|
class="d-block collapsed">
|
||||||
<i class="fa fa-chevron-down pull-right mt-1"></i>
|
<i class="fa fa-chevron-down pull-right mt-1"></i>
|
||||||
Advanced Settings
|
Advanced Settings
|
||||||
</span>
|
</span>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue