Merge pull request #182 from appwrite/fix-function-review

draft: fix function design review
This commit is contained in:
Torsten Dittmann authored and GitHub committed 2023-01-31 13:04:17 +01:00
commit fc530c8290
17 files changed
+553 -297

No files matched your search

+14 -14
View File
@@ -10,8 +10,8 @@
"dependencies": {
"@analytics/google-analytics": "^1.0.5",
"@aw-labs/appwrite-console": "^13.1.0",
"@aw-labs/icons": "0.0.0-77",
"@aw-labs/ui": "0.0.0-77",
"@aw-labs/icons": "0.0.0-82",
"@aw-labs/ui": "0.0.0-82",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.19.0",
"@sentry/tracing": "^7.19.0",
@@ -154,14 +154,14 @@
}
},
"node_modules/@aw-labs/icons": {
"version": "0.0.0-77",
"resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-77.tgz",
"integrity": "sha512-z/gH6B//qShnlJbf1sxv0ltSbRvJha1El0pl4jACAWDD+orgh2hzBrv6YdgPi1AVBTacu2GWWTcyobItghbpgA=="
"version": "0.0.0-82",
"resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-82.tgz",
"integrity": "sha512-TQ3abZGBjisd4WpeBVSUihY98drljdlcdw++z8icNpQVYohmUejRHU59mhmIfXCkhpA1s0tW+5xEMp0WmLNp9Q=="
},
"node_modules/@aw-labs/ui": {
"version": "0.0.0-77",
"resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-77.tgz",
"integrity": "sha512-y/7cbPFcK+jUnarsn9X1arrIB69RVMPWMjjIiiaX7uSa0rq9ZN1agBZxfA63meyh23kdIK4K5CcJhatShMMsYg==",
"version": "0.0.0-82",
"resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-82.tgz",
"integrity": "sha512-zZDTP117uxMrwzAacOcpSXI77FMFcfv6+Da1R5sDWoqxhvZ0Wyx0Z6cn3dakV0M3zJfYZQ49LmSnU/5wqHPc7A==",
"dependencies": {
"@aw-labs/icons": "*",
"normalize.css": "^8.0.1",
@@ -7749,14 +7749,14 @@
}
},
"@aw-labs/icons": {
"version": "0.0.0-77",
"resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-77.tgz",
"integrity": "sha512-z/gH6B//qShnlJbf1sxv0ltSbRvJha1El0pl4jACAWDD+orgh2hzBrv6YdgPi1AVBTacu2GWWTcyobItghbpgA=="
"version": "0.0.0-82",
"resolved": "https://registry.npmjs.org/@aw-labs/icons/-/icons-0.0.0-82.tgz",
"integrity": "sha512-TQ3abZGBjisd4WpeBVSUihY98drljdlcdw++z8icNpQVYohmUejRHU59mhmIfXCkhpA1s0tW+5xEMp0WmLNp9Q=="
},
"@aw-labs/ui": {
"version": "0.0.0-77",
"resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-77.tgz",
"integrity": "sha512-y/7cbPFcK+jUnarsn9X1arrIB69RVMPWMjjIiiaX7uSa0rq9ZN1agBZxfA63meyh23kdIK4K5CcJhatShMMsYg==",
"version": "0.0.0-82",
"resolved": "https://registry.npmjs.org/@aw-labs/ui/-/ui-0.0.0-82.tgz",
"integrity": "sha512-zZDTP117uxMrwzAacOcpSXI77FMFcfv6+Da1R5sDWoqxhvZ0Wyx0Z6cn3dakV0M3zJfYZQ49LmSnU/5wqHPc7A==",
"requires": {
"@aw-labs/icons": "*",
"normalize.css": "^8.0.1",
+2 -2
View File
@@ -22,8 +22,8 @@
"@analytics/google-analytics": "^1.0.5",
"analytics": "^0.8.1",
"@aw-labs/appwrite-console": "^13.1.0",
"@aw-labs/icons": "0.0.0-77",
"@aw-labs/ui": "0.0.0-77",
"@aw-labs/icons": "0.0.0-82",
"@aw-labs/ui": "0.0.0-82",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.19.0",
"@sentry/tracing": "^7.19.0",
+2 -1
View File
@@ -1,9 +1,10 @@
<script lang="ts">
export let withIndentation = false;
export let open = false;
</script>
<li class="collapsible-item">
<details class="collapsible-wrapper">
<details class="collapsible-wrapper" {open}>
<summary class="collapsible-button">
<slot name="beforetitle" />
<div>
+1
View File
@@ -20,4 +20,5 @@ export { default as InputChoice } from './inputChoice.svelte';
export { default as InputPhone } from './inputPhone.svelte';
export { default as InputCron } from './inputCron.svelte';
export { default as InputURL } from './inputURL.svelte';
export { default as InputSecret } from './inputSecret.svelte';
export { default as Helper } from './helper.svelte';
+49
View File
@@ -0,0 +1,49 @@
<script lang="ts">
import { FormItem } from '.';
export let id: string;
export let label: string;
export let showLabel = true;
export let value = '';
export let placeholder = '';
let showInPlainText = false;
</script>
<FormItem>
<label class:u-hide={!showLabel} class="label" for={id}>{label}</label>
<div class="input-text-wrapper" style="--amount-of-buttons:1">
{#if showInPlainText}
<div
contenteditable="true"
role="textbox"
{id}
aria-placeholder={placeholder}
name={id}
type="text"
class="input-text is-resizable"
bind:textContent={value} />
{:else}
<input
{id}
{placeholder}
name={id}
type="password"
class="input-text"
autocomplete="off"
bind:value />
{/if}
<div class="options-list">
<button
type="button"
on:click={() => (showInPlainText = !showInPlainText)}
class="options-list-button"
aria-label="show / hide password">
<span
class:icon-eye={!showInPlainText}
class:icon-eye-off={showInPlainText}
aria-hidden="true" />
</button>
</div>
</div>
</FormItem>
+6 -6
View File
@@ -8,17 +8,17 @@ export function calculateTime(time: number) {
const years = Math.floor(months / 12);
if (milliseconds < 1000) {
return milliseconds + 'ms';
return `${milliseconds}ms`;
} else if (seconds < 60) {
return `${seconds} s`;
return `${seconds}s`;
} else if (minutes < 60) {
return `${minutes} m`;
return `${minutes}m`;
} else if (hours < 24) {
return `${hours} h`;
return `${hours}h`;
} else if (days < 30) {
return `${days} d`;
return `${days}d`;
} else if (months < 12) {
return `${months} M`;
return `${months}M`;
} else {
return `${years} y`;
}
+194
View File
@@ -0,0 +1,194 @@
<svg width="263" height="187" viewBox="0 0 263 187" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path d="M0 104.8L92.8817 158L191 103.443L98.6696 44L0 104.8Z" fill="url(#paint0_linear_715_216661)"/>
<path d="M78 149.76V70.8117C78 68.1822 79.4116 65.7532 81.7016 64.4423L176.542 10.1522C177.299 9.71879 178.243 10.2628 178.243 11.1321V92.2432L234.218 125.698C235.667 126.564 235.692 128.647 234.264 129.547L143.933 186.479C143.217 186.93 142.309 186.948 141.577 186.524L78 149.76Z" fill="url(#paint1_linear_715_216661)"/>
<path d="M142.302 182.211L81.2913 147.137L177.891 91.8164L232.687 124.324L227.603 128.031L209.243 140.293L142.302 182.211Z" fill="url(#paint2_linear_715_216661)"/>
<path d="M131.34 170.008L99.7219 150.936L181.984 103.693L209.867 120.289C211.327 121.158 211.332 123.254 209.877 124.131L133.688 170.009C132.967 170.443 132.061 170.443 131.34 170.008Z" fill="url(#paint3_linear_715_216661)"/>
<path d="M81.2913 147.901V71.8133C81.2913 69.5537 82.4972 67.4699 84.4459 66.3622L176.376 14.1066C177.126 13.6803 178.053 14.2281 178.053 15.0977V92.1827L81.2913 147.901Z" fill="url(#paint4_linear_715_216661)"/>
<path d="M91.1648 120.578V78.6742C91.1648 77.4604 91.8209 76.3403 92.8825 75.7416L161.226 37.2006C161.979 36.7758 162.913 37.3169 162.913 38.1781V82.1453C162.913 82.9498 162.481 83.6929 161.78 84.0938L94.5507 122.526C93.0442 123.387 91.1648 122.306 91.1648 120.578Z" fill="url(#paint5_linear_715_216661)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M197.8 102.207L98.0312 160.437L97.7473 159.945L197.516 101.714L197.8 102.207Z" fill="url(#paint6_radial_715_216661)" fill-opacity="0.2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M203.724 106.825L103.299 165.055L103.013 164.563L203.439 106.332L203.724 106.825Z" fill="url(#paint7_radial_715_216661)" fill-opacity="0.2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M208.99 110.119L109.221 167.695L108.938 167.208L208.707 109.632L208.99 110.119Z" fill="url(#paint8_radial_715_216661)" fill-opacity="0.2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M213.598 114.084L115.142 172.314L114.862 171.822L213.318 113.591L213.598 114.084Z" fill="url(#paint9_radial_715_216661)" fill-opacity="0.2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M142.241 163.736L110.254 146.425L110.521 145.921L142.508 163.232L142.241 163.736Z" fill="url(#paint10_radial_715_216661)" fill-opacity="0.2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M150.794 158.458L118.811 141.791L119.082 141.303L151.065 157.97L150.794 158.458Z" fill="url(#paint11_radial_715_216661)" fill-opacity="0.2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M200.824 130.085L168.837 112.774L169.104 112.271L201.091 129.582L200.824 130.085Z" fill="url(#paint12_radial_715_216661)" fill-opacity="0.2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M209.383 124.807L178.053 107.499L178.319 106.992L209.649 124.3L209.383 124.807Z" fill="url(#paint13_radial_715_216661)" fill-opacity="0.2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M152.776 149.88L128.026 136.517L128.29 136.024L153.04 149.388L152.776 149.88Z" fill="url(#paint14_radial_715_216661)" fill-opacity="0.2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M161.327 144.602L135.925 131.874L136.195 131.405L161.597 144.132L161.327 144.602Z" fill="url(#paint15_radial_715_216661)" fill-opacity="0.2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M168.574 140.643L143.824 126.643L144.087 126.127L168.837 140.127L168.574 140.643Z" fill="url(#paint16_radial_715_216661)" fill-opacity="0.2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M177.111 136.024L150.407 122.024L150.691 121.508L177.395 135.508L177.111 136.024Z" fill="url(#paint17_radial_715_216661)" fill-opacity="0.2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M185.03 131.406L160.28 117.406L160.544 116.89L185.293 130.89L185.03 131.406Z" fill="url(#paint18_radial_715_216661)" fill-opacity="0.2"/>
<path d="M100.38 153.544V151.553L133.16 170.039L212.282 122.828V125.103L133.16 172.314L100.38 153.544Z" fill="url(#paint19_linear_715_216661)"/>
<mask id="mask0_715_216661" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="114" y="54" width="32" height="50">
<rect width="36.5471" height="36.5756" transform="matrix(0.760455 -0.342831 0.0885824 0.98983 114 67.2461)" fill="url(#pattern0)"/>
</mask>
<g mask="url(#mask0_715_216661)">
<rect width="44.8986" height="46.2551" transform="matrix(0.816641 -0.577552 0 1 107.193 72.9014)" fill="url(#paint20_linear_715_216661)"/>
</g>
<path d="M100.292 152.757V150.793L132.797 169.037L211.26 122.444V124.69L132.797 171.282L100.292 152.757Z" fill="url(#paint21_linear_715_216661)"/>
<rect width="69.9128" height="56.6135" rx="4" transform="matrix(-0.852264 0.523112 0 1 108.062 36.0459)" fill="url(#paint22_linear_715_216661)"/>
<rect width="64.432" height="51.2609" rx="4" transform="matrix(-0.852264 0.523112 0 1 105.798 40.1113)" fill="url(#paint23_linear_715_216661)"/>
<path d="M53.3551 77.3952C53.3551 76.8859 53.6153 76.4117 54.045 76.1382L78.6161 60.4986C79.5372 59.9124 80.7417 60.5735 80.7417 61.6652C80.7417 62.1351 80.5034 62.5731 80.1087 62.8283L55.6506 78.6441C54.6604 79.2844 53.3552 78.5743 53.3551 77.3952Z" fill="url(#paint24_linear_715_216661)"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M97.4483 65.5557L99.0289 67.0129L99.0289 67.0134L100.03 67.9368L100.046 68.9267L99.3147 69.4704L99.0649 69.1997L99.31 84.0835L63.0345 104.592L63.3629 105.036L57.2702 109.896L53.3892 114.116L50.8778 111.556L51.0527 111.366L50.8231 111.496C52.8964 107.41 58.5463 99.0877 64.5596 98.4851C69.5085 97.9893 71.9743 92.1852 73.6496 88.2417C74.5188 86.1957 75.1753 84.6505 75.8553 84.6073C76.5598 84.5625 77.7691 84.9912 79.0752 85.4542C81.4601 86.2997 84.1676 87.2595 84.7136 85.6599L84.7635 85.5135L84.7635 85.5135C85.6212 82.9989 87.2112 78.3373 89.1436 77C89.8333 76.5227 90.4936 75.2781 91.324 73.7128C92.6549 71.2044 94.4227 67.8725 97.4483 65.5557Z" fill="url(#paint25_linear_715_216661)"/>
<path d="M100.355 87.4904L100.032 67.9375C94.0812 71.3011 92.2708 78.5698 90.3622 79.8985C88.4536 81.2271 87.436 84.5503 86.6187 87.0109C85.8013 89.4714 79.5196 85.7775 77.5906 85.8686C75.6615 85.9597 73.9739 100.654 66.6909 101.273C60.8646 101.768 55.3947 109.99 53.3881 114.039L100.355 87.4904Z" fill="url(#paint26_linear_715_216661)"/>
<path d="M71.3845 14.9684L74.769 12.9629V16.9155L71.3845 18.9404V14.9684Z" fill="url(#paint27_linear_715_216661)"/>
<path d="M71.3845 14.9684L68.0001 12.9629V16.9155L71.3845 18.9404V14.9684Z" fill="url(#paint28_linear_715_216661)"/>
<path d="M68.001 12.9684L71.3563 11L74.7699 12.9684L71.3563 15.0148L68.001 12.9684Z" fill="url(#paint29_linear_715_216661)"/>
<path d="M123.625 8.94131L131.25 4.42285V13.3282L123.625 17.8905V8.94131Z" fill="url(#paint30_linear_715_216661)"/>
<path d="M123.625 8.94131L116.001 4.42285V13.3282L123.625 17.8905V8.94131Z" fill="url(#paint31_linear_715_216661)"/>
<path d="M116 4.43489L123.559 0L131.249 4.43489L123.559 9.04542L116 4.43489Z" fill="url(#paint32_linear_715_216661)"/>
<path d="M231.286 34.2339L242.57 27.5459V40.7271L231.286 47.4801V34.2339Z" fill="url(#paint33_linear_715_216661)"/>
<path d="M231.286 34.2339L220.002 27.5459V40.7271L231.286 47.4801V34.2339Z" fill="url(#paint34_linear_715_216661)"/>
<path d="M220 27.5643L231.187 21L242.568 27.5643L231.187 34.3886L220 27.5643Z" fill="url(#paint35_linear_715_216661)"/>
<defs>
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
<use xlink:href="#image0_715_216661" transform="translate(-0.000390163) scale(0.00833984 0.00833333)"/>
</pattern>
<linearGradient id="paint0_linear_715_216661" x1="135.326" y1="151.214" x2="76.4419" y2="106.924" gradientUnits="userSpaceOnUse">
<stop stop-color="#F02E65"/>
<stop offset="1" stop-color="#F02E65" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint1_linear_715_216661" x1="-249.784" y1="125.042" x2="437.702" y2="213.155" gradientUnits="userSpaceOnUse">
<stop stop-color="#3E435A"/>
<stop offset="1" stop-color="#3C4158"/>
</linearGradient>
<linearGradient id="paint2_linear_715_216661" x1="229.396" y1="83.8986" x2="11.6863" y2="176.887" gradientUnits="userSpaceOnUse">
<stop stop-color="#1B1B28"/>
<stop offset="1" stop-color="#282A3B" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint3_linear_715_216661" x1="171.141" y1="136.684" x2="109.455" y2="195.59" gradientUnits="userSpaceOnUse">
<stop stop-color="#373B4D"/>
<stop offset="1" stop-color="#373B4D" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint4_linear_715_216661" x1="256.713" y1="22.8665" x2="-11.676" y2="203.275" gradientUnits="userSpaceOnUse">
<stop stop-color="#1B1B28"/>
<stop offset="1" stop-color="#373B4D"/>
</linearGradient>
<linearGradient id="paint5_linear_715_216661" x1="89.47" y1="115.191" x2="229.847" y2="46.6013" gradientUnits="userSpaceOnUse">
<stop stop-color="#373B4D"/>
<stop offset="1" stop-color="#2C3041"/>
</linearGradient>
<radialGradient id="paint6_radial_715_216661" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(147.774 131.076) rotate(90) scale(29.1153 49.8845)">
<stop stop-color="#F7F7F7"/>
<stop offset="1" stop-color="#F7F7F7" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint7_radial_715_216661" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(153.369 135.694) rotate(90) scale(29.1153 50.2127)">
<stop stop-color="#F7F7F7"/>
<stop offset="1" stop-color="#F7F7F7" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint8_radial_715_216661" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(158.964 138.664) rotate(90) scale(28.7882 49.8845)">
<stop stop-color="#F7F7F7"/>
<stop offset="1" stop-color="#F7F7F7" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint9_radial_715_216661" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(164.23 142.953) rotate(90) scale(29.1153 49.2281)">
<stop stop-color="#F7F7F7"/>
<stop offset="1" stop-color="#F7F7F7" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint10_radial_715_216661" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(126.381 154.828) rotate(90) scale(8.6556 15.9934)">
<stop stop-color="#F7F7F7"/>
<stop offset="1" stop-color="#F7F7F7" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint11_radial_715_216661" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(134.938 149.88) rotate(90) scale(8.33342 15.9913)">
<stop stop-color="#F7F7F7"/>
<stop offset="1" stop-color="#F7F7F7" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint12_radial_715_216661" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(184.964 121.178) rotate(90) scale(8.6556 15.9934)">
<stop stop-color="#F7F7F7"/>
<stop offset="1" stop-color="#F7F7F7" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint13_radial_715_216661" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(193.851 115.9) rotate(90) scale(8.65394 15.6649)">
<stop stop-color="#F7F7F7"/>
<stop offset="1" stop-color="#F7F7F7" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint14_radial_715_216661" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(140.533 142.952) rotate(90) scale(6.68179 12.375)">
<stop stop-color="#F7F7F7"/>
<stop offset="1" stop-color="#F7F7F7" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint15_radial_715_216661" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(148.761 138.003) rotate(90) scale(6.36361 12.7006)">
<stop stop-color="#F7F7F7"/>
<stop offset="1" stop-color="#F7F7F7" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint16_radial_715_216661" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(156.331 133.385) rotate(90) scale(6.99997 12.375)">
<stop stop-color="#F7F7F7"/>
<stop offset="1" stop-color="#F7F7F7" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint17_radial_715_216661" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(163.901 128.766) rotate(90) scale(6.99997 13.352)">
<stop stop-color="#F7F7F7"/>
<stop offset="1" stop-color="#F7F7F7" stop-opacity="0"/>
</radialGradient>
<radialGradient id="paint18_radial_715_216661" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(172.787 124.148) rotate(90) scale(6.99997 12.375)">
<stop stop-color="#F7F7F7"/>
<stop offset="1" stop-color="#F7F7F7" stop-opacity="0"/>
</radialGradient>
<linearGradient id="paint19_linear_715_216661" x1="104.659" y1="208.934" x2="417.781" y2="71.8376" gradientUnits="userSpaceOnUse">
<stop stop-color="#282A3B"/>
<stop offset="1" stop-color="#2E3453"/>
</linearGradient>
<linearGradient id="paint20_linear_715_216661" x1="8.41849" y1="4.29512" x2="33.7002" y2="40.1243" gradientUnits="userSpaceOnUse">
<stop stop-color="#FCFCFF"/>
<stop offset="1" stop-color="#C4C6D7"/>
</linearGradient>
<linearGradient id="paint21_linear_715_216661" x1="122.149" y1="196.543" x2="220.119" y2="121.155" gradientUnits="userSpaceOnUse">
<stop stop-color="#484848"/>
<stop offset="1" stop-color="#3F3F41" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint22_linear_715_216661" x1="35.2051" y1="-11.3284" x2="30.2948" y2="84.0833" gradientUnits="userSpaceOnUse">
<stop stop-color="#292D44"/>
<stop offset="1" stop-color="#9C9CA7" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint23_linear_715_216661" x1="32.4453" y1="-10.2573" x2="28.0767" y2="76.1415" gradientUnits="userSpaceOnUse">
<stop stop-color="#25283C"/>
<stop offset="1" stop-color="#2C3041" stop-opacity="0.02"/>
</linearGradient>
<linearGradient id="paint24_linear_715_216661" x1="52.6358" y1="78.7983" x2="79.8057" y2="70.4944" gradientUnits="userSpaceOnUse">
<stop stop-color="#34384A"/>
<stop offset="1" stop-color="#454B5D" stop-opacity="0.03"/>
</linearGradient>
<linearGradient id="paint25_linear_715_216661" x1="98.8459" y1="54.2317" x2="56.6561" y2="98.485" gradientUnits="userSpaceOnUse">
<stop stop-color="#F02E65"/>
<stop offset="1" stop-color="#F02E65" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint26_linear_715_216661" x1="111.712" y1="67.9165" x2="86.0627" y2="126.159" gradientUnits="userSpaceOnUse">
<stop stop-color="#F02E65"/>
<stop offset="0.582533" stop-color="#8D325B"/>
<stop offset="1" stop-color="#282A3B" stop-opacity="0"/>
</linearGradient>
<linearGradient id="paint27_linear_715_216661" x1="82.9167" y1="10.8746" x2="73.0633" y2="18.9239" gradientUnits="userSpaceOnUse">
<stop stop-color="#A3315E"/>
<stop offset="1" stop-color="#96325D"/>
</linearGradient>
<linearGradient id="paint28_linear_715_216661" x1="65.305" y1="13.0091" x2="68.8877" y2="20.9779" gradientUnits="userSpaceOnUse">
<stop stop-color="#9D2D58"/>
<stop offset="1" stop-color="#6F3359"/>
</linearGradient>
<linearGradient id="paint29_linear_715_216661" x1="68.5024" y1="13.009" x2="76.7128" y2="13.009" gradientUnits="userSpaceOnUse">
<stop stop-color="#C42E5E"/>
<stop offset="1" stop-color="#AF2D5B"/>
</linearGradient>
<linearGradient id="paint30_linear_715_216661" x1="149.606" y1="-0.282263" x2="127.406" y2="17.8515" gradientUnits="userSpaceOnUse">
<stop stop-color="#A12D59"/>
<stop offset="1" stop-color="#A1315E"/>
</linearGradient>
<linearGradient id="paint31_linear_715_216661" x1="109.929" y1="4.52707" x2="118.001" y2="22.4806" gradientUnits="userSpaceOnUse">
<stop stop-color="#B32E5C"/>
<stop offset="1" stop-color="#79335A"/>
</linearGradient>
<linearGradient id="paint32_linear_715_216661" x1="117.13" y1="4.52643" x2="135.627" y2="4.52643" gradientUnits="userSpaceOnUse">
<stop stop-color="#F02E65"/>
<stop offset="1" stop-color="#BE2D5D"/>
</linearGradient>
<linearGradient id="paint33_linear_715_216661" x1="269.735" y1="20.5816" x2="236.877" y2="47.4177" gradientUnits="userSpaceOnUse">
<stop stop-color="#AC2D5A"/>
<stop offset="1" stop-color="#97325D"/>
</linearGradient>
<linearGradient id="paint34_linear_715_216661" x1="211.016" y1="27.7002" x2="222.966" y2="54.2728" gradientUnits="userSpaceOnUse">
<stop stop-color="#F02E65"/>
<stop offset="1" stop-color="#7C335B"/>
</linearGradient>
<linearGradient id="paint35_linear_715_216661" x1="221.672" y1="27.6998" x2="249.046" y2="27.6998" gradientUnits="userSpaceOnUse">
<stop stop-color="#DD2E62"/>
<stop offset="1" stop-color="#B62D5C"/>
</linearGradient>
<image id="image0_715_216661" width="120" height="120" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHgAAAB4CAYAAAA5ZDbSAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3L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U+vll6Z8/ZdMN5T2JXOa7XeactZ3kPzCOOxH77wtlQv9mBIbdGhPAoyRavCfxvY2FJpbLYX6d2XuiUMvSpEe402ShZCx9ifB/TYyzf7ofP38iv1cuCyYvsqkP26rIvwyP/0QMdxbq7sv22Tikj4Su9fk392fY2OdLxrXqm6Fnyf/xanVueKwQ2EZeArYGN0Zk3IMRw10ntjeqgPEGcXmQ9xv6OTjOpnVCmvS24HGacc4wrXb1M9vki0Line truncated
</defs>
</svg>

After

Width:  |  Height:  |  Size: 22 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

+8 -6
View File
@@ -116,11 +116,13 @@
</header>
{#if selectedTab === 'logs'}
<code class="code-panel-content">
{$log.data.buildStdout ?? 'No logs recorded'}
{$log.data.buildStdout ? $log.data.buildStdout : 'No logs recorded'}
</code>
{:else}
<code class="code-panel-content">
{$log.data.buildStderr ?? 'No errors recorded'}
{$log.data.buildStderr
? $log.data.buildStderr
: 'No errors recorded'}
</code>
{/if}
</section>
@@ -149,7 +151,7 @@
Created at: {toLocaleDateTime($log.data.$createdAt)}</time>
</div>
<div>
<p>Triggered by: {$log.data.trigger}</p>
<p>Triggered by: <b>{$log.data.trigger}</b></p>
</div>
<div class="status u-margin-inline-start-auto">
<Status status={$log.data.status}>{$log.data.status}</Status>
@@ -191,15 +193,15 @@
</header>
{#if selectedTab === 'logs'}
<code class="code-panel-content">
{$log.data.stdout ?? 'No logs recorded'}
{$log.data.stdout ? $log.data.stdout : 'No logs recorded'}
</code>
{:else if selectedTab === 'errors'}
<code class="code-panel-content">
{$log.data.stderr ?? 'No errors recorded'}
{$log.data.stderr ? $log.data.stderr : 'No errors recorded'}
</code>
{:else}
<code class="code-panel-content">
{$log.data.response ?? 'No response recorded'}
{$log.data.response ? $log.data.response : 'No response recorded'}
</code>
{/if}
</section>
@@ -92,7 +92,7 @@
{:else}
<Empty
single
href="https://appwrite.io/docs/functions"
href="https://appwrite.io/docs/functions#deployFunction"
target="function"
on:click={openWizard} />
{/if}
@@ -1,7 +1,7 @@
<script lang="ts">
import { Button } from '$lib/elements/forms';
import { Button, InputSecret } from '$lib/elements/forms';
import { Modal } from '$lib/components';
import { InputText, InputPassword, FormList } from '$lib/elements/forms';
import { InputText, FormList } from '$lib/elements/forms';
import { createEventDispatcher } from 'svelte';
import type { Models } from '@aw-labs/appwrite-console';
@@ -42,15 +42,9 @@
placeholder="Enter key"
bind:value={pair.key}
required
autofocus />
<InputPassword
id="value"
label="Value"
minlength={0}
showPasswordButton
placeholder="Enter value"
bind:value={pair.value}
required />
autofocus
autocomplete={false} />
<InputSecret id="value" label="Value" placeholder="Enter value" bind:value={pair.value} />
</FormList>
<svelte:fragment slot="footer">
<Button secondary on:click={close}>Cancel</Button>
@@ -155,98 +155,120 @@
<div class="common-section">
<Heading tag="h3" size="7">Inactive</Heading>
</div>
{#if data.deployments.total > 1}
<Table>
<TableHeader>
<TableCellHead width={90}>Deployment ID</TableCellHead>
<TableCellHead width={140}>Created</TableCellHead>
<TableCellHead width={100}>Status</TableCellHead>
<TableCellHead width={100}>Build Time</TableCellHead>
<TableCellHead width={70}>Size</TableCellHead>
<TableCellHead width={25} />
</TableHeader>
<TableBody>
{#each data.deployments.deployments as deployment, index}
{#if deployment.$id !== $func.deployment}
<TableRow>
<TableCell title="Deployment ID">
<Copy value={deployment.$id}>
<Pill button trim>
<span class="icon-duplicate" aria-hidden="true" />
<span class="text u-trim">{deployment.$id}</span>
</Pill>
</Copy>
</TableCell>
<TableCellText title="Created">
{toLocaleDateTime(deployment.$createdAt)}
</TableCellText>
<Table>
<TableHeader>
<TableCellHead width={90}>Deployment ID</TableCellHead>
<TableCellHead width={140}>Created</TableCellHead>
<TableCellHead width={100}>Status</TableCellHead>
<TableCellHead width={100}>Build Time</TableCellHead>
<TableCellHead width={70}>Size</TableCellHead>
<TableCellHead width={25} />
</TableHeader>
<TableBody>
{#each data.deployments.deployments as deployment, index}
{#if deployment.$id !== $func.deployment}
<TableRow>
<TableCell title="Deployment ID">
<Copy value={deployment.$id}>
<Pill button trim>
<span class="icon-duplicate" aria-hidden="true" />
<span class="text u-trim">{deployment.$id}</span>
</Pill>
</Copy>
</TableCell>
<TableCellText title="Created">
{toLocaleDateTime(deployment.$createdAt)}
</TableCellText>
<TableCell title="Status">
<Status status={deployment.status}>
{deployment.status}
</Status>
</TableCell>
<TableCell title="Status">
<Status status={deployment.status}>
{deployment.status}
</Status>
</TableCell>
<TableCellText title="Build Time">
{#if deployment.status === 'ready'}
{calculateTime(deployment.buildTime)}
{/if}
</TableCellText>
<TableCellText title="Build Time">
{#if deployment.status === 'ready'}
{calculateTime(deployment.buildTime)}
{/if}
</TableCellText>
<TableCellText title="Size">
{calculateSize(deployment.size)}
</TableCellText>
<TableCellText title="Size">
{calculateSize(deployment.size)}
</TableCellText>
<TableCell showOverflow>
<DropList
bind:show={showDropdown[index]}
placement="bottom-start"
noArrow>
<button
class="button is-only-icon is-text"
aria-label="More options"
on:click|preventDefault={() => {
showDropdown[index] = !showDropdown[index];
}}>
<span class="icon-dots-horizontal" aria-hidden="true" />
</button>
<svelte:fragment slot="list">
<DropListItem
icon="lightning-bolt"
on:click={() => {
selectedDeployment = deployment;
showActivate = true;
showDropdown = [];
<TableCell showOverflow>
<DropList
bind:show={showDropdown[index]}
placement="bottom-start"
noArrow>
<button
class="button is-only-icon is-text"
aria-label="More options"
on:click|preventDefault={() => {
showDropdown[index] = !showDropdown[index];
}}>
Activate
</DropListItem>
<DropListItem
icon="terminal"
on:click={() => {
$log.show = true;
$log.func = $func;
$log.data = deployment;
showDropdown = [];
}}>
Output
</DropListItem>
<DropListItem
icon="trash"
on:click={() => {
selectedDeployment = deployment;
showDropdown = [];
showDelete = true;
}}>
Delete
</DropListItem>
</svelte:fragment>
</DropList>
</TableCell>
</TableRow>
{/if}
{/each}
</TableBody>
</Table>
<span class="icon-dots-horizontal" aria-hidden="true" />
</button>
<svelte:fragment slot="list">
<DropListItem
icon="lightning-bolt"
on:click={() => {
selectedDeployment = deployment;
showActivate = true;
showDropdown = [];
}}>
Activate
</DropListItem>
<DropListItem
icon="terminal"
on:click={() => {
$log.show = true;
$log.func = $func;
$log.data = deployment;
showDropdown = [];
}}>
Output
</DropListItem>
<DropListItem
icon="trash"
on:click={() => {
selectedDeployment = deployment;
showDropdown = [];
showDelete = true;
}}>
Delete
</DropListItem>
</svelte:fragment>
</DropList>
</TableCell>
</TableRow>
{/if}
{/each}
</TableBody>
</Table>
{:else}
<Empty single target="deployment" on:click={() => (showCreate = true)}>
<div class="u-text-center">
<Heading size="7" tag="h2"
>You have no inactive deployments. Create one to see it here.</Heading>
<p class="body-text-2 u-margin-block-start-4">
Learn more about deployments in our Documentation.
</p>
</div>
<div class="u-flex u-gap-16 u-main-center">
<Button
external
href="https://appwrite.io/docs/functions#createFunction"
text
event="empty_documentation"
ariaLabel={`create {target}`}>Documentation</Button>
<Button secondary on:click={() => (showCreate = true)}>
Create deployment
</Button>
</div>
</Empty>
{/if}
{:else}
<Empty
single
@@ -255,12 +277,12 @@
on:click={() => (showCreate = true)} />
{/if}
<div class="u-flex u-margin-block-start-32 u-main-space-between">
<p class="text">Total results: {data.deployments.total}</p>
<p class="text">Total results: {data.deployments.total ? data.deployments.total - 1 : 0}</p>
<Pagination
limit={PAGE_LIMIT}
path={`/console/project-${$page.params.project}/functions/function-${$page.params.function}`}
offset={data.offset}
sum={data.deployments.total} />
sum={data.deployments.total ? data.deployments.total - 1 : 0} />
</div>
</Container>
@@ -5,11 +5,13 @@
import { createEventDispatcher, onMount } from 'svelte';
import { addNotification } from '$lib/stores/notifications';
import { page } from '$app/stores';
import Github from '$lib/images/github-illustration.svg';
import GithubLight from '$lib/images/github-illustration-light.svg';
import GithubDark from '$lib/images/github-illustration-dark.svg';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';
import { func } from './store';
import { trackEvent } from '$lib/actions/analytics';
import { app } from '$lib/stores/app';
export let showCreate = false;
@@ -117,7 +119,7 @@
on:click={() => (mode = Mode.Github)}
selected={mode === Mode.Github}
event="deploy_github">
GitHub - Soon!
GitHub - (Soon!)
</Tab>
<Tab
on:click={() => (mode = Mode.Manual)}
@@ -141,8 +143,8 @@
>.
</p>
<Collapsible>
{#each ['Unix', 'CMD', 'PowerShell'] as category}
<CollapsibleItem>
{#each ['Unix', 'CMD', 'PowerShell'] as category, i}
<CollapsibleItem open={i === 0}>
<svelte:fragment slot="title">{category}</svelte:fragment>
<Code
withLineNumbers
@@ -156,7 +158,11 @@
{:else if mode === Mode.Github}
<div class="common-section grid-1-2">
<div class="grid-1-2-col-1 u-flex u-flex-vertical u-gap-16">
<img src={Github} alt="github" />
{#if $app.themeInUse === 'dark'}
<img src={GithubDark} alt="github" />
{:else}
<img src={GithubLight} alt="github" />
{/if}
</div>
<div class="grid-1-2-col-2 u-flex u-flex-vertical u-gap-24">
<h3 class="body-text-1">Coming Soon!</h3>
@@ -55,8 +55,8 @@
<TableCellHead width={140}>Created</TableCellHead>
<TableCellHead width={110}>Status</TableCellHead>
<TableCellHead width={90}>Trigger</TableCellHead>
<TableCellHead width={100}>Duration</TableCellHead>
<TableCellHead width={40} />
<TableCellHead width={80}>Duration</TableCellHead>
<TableCellHead width={50} />
</TableHeader>
<TableBody>
{#each data.executions.executions as execution}
@@ -4,9 +4,10 @@
Box,
DropList,
DropListItem,
Copy,
Empty,
EventModal
EventModal,
Output,
Secret
} from '$lib/components';
import { Container } from '$lib/layout';
import { Button, InputNumber, InputText, InputCron, Form, FormList } from '$lib/elements/forms';
@@ -25,7 +26,15 @@
import { Roles } from '$lib/components/permissions';
import { symmetricDifference } from '$lib/helpers/array';
import TableList from '$lib/elements/table/tableList.svelte';
import { TableCell, TableCellText } from '$lib/elements/table';
import {
Table,
TableBody,
TableCell,
TableCellHead,
TableCellText,
TableHeader,
TableRow
} from '$lib/elements/table';
import Heading from '$lib/components/heading.svelte';
import { writable, type Writable } from 'svelte/store';
import { invalidate } from '$app/navigation';
@@ -40,7 +49,6 @@
let selectedVar: Models.Variable = null;
// let showVariablesUpload = false;
let showVariablesModal = false;
let showVariablesValue = [];
let showVariablesDropdown = [];
let timeout: number = null;
let functionName: string = null;
@@ -300,7 +308,7 @@
<div>
<Heading tag="h6" size="7">{$func.name}</Heading>
<p>{$func.runtime}</p>
<p class="text u-capitalize">{$func.runtime}</p>
</div>
</div>
<svelte:fragment slot="aside">
@@ -346,7 +354,12 @@
<Heading tag="h6" size="7">Execute Access</Heading>
<p>
Choose who can execute this function using the client API. For more information,
check out the Permissions Guide in our documentation.
check out the <a
href="https://appwrite.io/docs/permissions"
target="_blank"
rel="noopener noreferrer"
class="link">
Permissions Guide</a> in our documentation.
</p>
<svelte:fragment slot="aside">
<Roles bind:roles={permissions} />
@@ -364,28 +377,28 @@
<p>Set the events that will trigger your function. Maximum 100 events allowed.</p>
<svelte:fragment slot="aside">
{#if $eventSet.size}
<TableList>
{#each Array.from($eventSet) as event}
<li class="table-row">
<TableCellText title="id">
{event}
</TableCellText>
<TableCell showOverflow title="options" width={40}>
<button
class="button is-text is-only-icon"
aria-label="delete id"
on:click|preventDefault={() => {
$eventSet.delete(event);
eventSet.set($eventSet);
}}>
<span class="icon-x" aria-hidden="true" />
</button>
</TableCell>
</li>
{/each}
</TableList>
<div class="u-flex u-flex-vertical u-gap-16">
<TableList>
{#each Array.from($eventSet) as event}
<li class="table-row">
<TableCellText title="id">
{event}
</TableCellText>
<TableCell showOverflow title="options" width={40}>
<button
class="button is-text is-only-icon"
aria-label="delete id"
on:click|preventDefault={() => {
$eventSet.delete(event);
eventSet.set($eventSet);
}}>
<span class="icon-x" aria-hidden="true" />
</button>
</TableCell>
</li>
{/each}
</TableList>
<div class="u-flex u-margin-block-start-16">
<Button text noMargin on:click={() => (showEvents = true)}>
<span class="icon-plus" aria-hidden="true" />
<span class="u-text">Add event</span>
@@ -407,7 +420,7 @@
<Heading tag="h6" size="7">Update CRON Schedule</Heading>
<p>
Set a CRON schedule to trigger your function. Leave blank for no schedule. <a
href="https://appwrite.io/docs/functions#createFunction"
href="https://en.wikipedia.org/wiki/Cron"
target="_blank"
rel="noopener noreferrer"
class="link">
@@ -428,6 +441,98 @@
</CardGrid>
</Form>
<CardGrid>
<Heading tag="h6" size="7">Update Function Variables</Heading>
<p>Set the variables (or secret keys) that will be passed to your function at runtime.</p>
<svelte:fragment slot="aside">
<div class="u-flex u-margin-inline-start-auto u-gap-16">
<Button disabled={!data.variables.total} secondary on:click={downloadVariables}>
<span class="icon-download" />
<span class="text">Download .env file</span>
</Button>
<!-- <Button secondary on:click={() => (showVariablesUpload = true)}>
<span class="icon-upload" />
<span class="text">Import .env file</span>
</Button> -->
</div>
{#if data.variables.total}
<div class="u-flex u-flex-vertical u-gap-16">
<Table noMargin noStyles>
<TableHeader>
<TableCellHead>Key</TableCellHead>
<TableCellHead>Value</TableCellHead>
<TableCellHead width={30} />
</TableHeader>
<TableBody>
{#each data.variables.variables as variable, i}
<TableRow>
<TableCell title="key">
<Output value={variable.key}>
{variable.key}
</Output>
</TableCell>
<TableCell showOverflow title="value">
<Secret value={variable.value} />
</TableCell>
<TableCell showOverflow title="options">
<DropList
bind:show={showVariablesDropdown[i]}
placement="bottom-start"
noArrow>
<Button
text
round
ariaLabel="more options"
on:click={() =>
(showVariablesDropdown[i] =
!showVariablesDropdown[i])}>
<span
class="icon-dots-horizontal"
aria-hidden="true" />
</Button>
<svelte:fragment slot="list">
<DropListItem
icon="pencil"
on:click={() => {
selectedVar = variable;
showVariablesDropdown[i] = false;
showVariablesModal = true;
}}>
Edit
</DropListItem>
<DropListItem
icon="trash"
on:click={async () => {
handleVariableDeleted(variable);
showVariablesDropdown[i] = false;
}}>
Delete
</DropListItem>
</svelte:fragment>
</DropList>
</TableCell>
</TableRow>
{/each}
</TableBody>
</Table>
<Button
text
noMargin
on:click={() => {
showVariablesModal = true;
}}>
<span class="icon-plus" aria-hidden="true" />
<span class="text">Create variable</span>
</Button>
</div>
{:else}
<Empty on:click={() => (showVariablesModal = !showVariablesModal)}
>Create a variable to get started</Empty>
{/if}
</svelte:fragment>
</CardGrid>
<Form on:submit={updateTimeout}>
<CardGrid>
<Heading tag="h6" size="7">Update Timeout</Heading>
@@ -452,124 +557,6 @@
</CardGrid>
</Form>
<CardGrid>
<Heading tag="h6" size="7">Update Function Variables</Heading>
<p>Set the variables (or secret keys) that will be passed to your function at runtime.</p>
<svelte:fragment slot="aside">
<div class="u-flex u-margin-inline-start-auto u-gap-16">
<Button secondary on:click={downloadVariables}>
<span class="icon-download" />
<span class="text">Download .env file</span>
</Button>
<!-- <Button secondary on:click={() => (showVariablesUpload = true)}>
<span class="icon-upload" />
<span class="text">Import .env file</span>
</Button> -->
</div>
<table class="table is-remove-outer-styles">
<thead class="table-thead">
<tr class="table-row">
<th class="table-thead-col">
<span class="eyebrow-heading-3">Key</span>
</th>
<th class="table-thead-col">
<span class="eyebrow-heading-3">Value</span>
</th>
<th class="table-thead-col" style="--p-col-width:40" />
</tr>
</thead>
<tbody class="table-tbody">
{#if data.variables.total}
{#each data.variables.variables as variable, i}
<tr class="table-row">
<td class="table-col" data-title="Key">
<span class="text">{variable.key}</span>
</td>
<td class="table-col u-overflow-visible" data-title="value">
<div class="interactive-text-output">
{#if showVariablesValue[i]}
<span class="text">{variable.value}</span>
{:else}
<span class="text">••••••••</span>
{/if}
<div class="u-flex u-cross-child-start u-gap-8">
<button
on:click|preventDefault={() =>
(showVariablesValue[i] =
!showVariablesValue[i])}
class="interactive-text-output-button"
aria-label="show hidden text">
{#if showVariablesValue[i]}
<span class="icon-eye-off" aria-hidden="true" />
{:else}
<span class="icon-eye" aria-hidden="true" />
{/if}
</button>
<Copy bind:value={variable.value}>
<button
class="interactive-text-output-button"
aria-label="copy text">
<span
class="icon-duplicate"
aria-hidden="true" />
</button>
</Copy>
</div>
</div>
</td>
<td class="table-col u-overflow-visible" data-title="options">
<DropList
bind:show={showVariablesDropdown[i]}
placement="bottom-start"
noArrow>
<button
class="button is-text is-only-icon"
aria-label="more options"
on:click|preventDefault={() =>
(showVariablesDropdown[i] =
!showVariablesDropdown[i])}>
<span class="icon-dots-horizontal" aria-hidden="true" />
</button>
<svelte:fragment slot="list">
<DropListItem
icon="pencil"
on:click={() => {
selectedVar = variable;
showVariablesDropdown[i] = false;
showVariablesModal = true;
}}>
Edit
</DropListItem>
<DropListItem
icon="trash"
on:click={async () => {
handleVariableDeleted(variable);
showVariablesDropdown[i] = false;
}}>
Delete
</DropListItem>
</svelte:fragment>
</DropList>
</td>
</tr>
{/each}
{/if}
</tbody>
</table>
<div class="u-flex u-margin-block-start-16">
<button
class="button is-text u-padding-inline-0"
type="button"
on:click={() => {
showVariablesModal = true;
}}>
<span class="icon-plus" aria-hidden="true" />
<span class="text">Create variable</span>
</button>
</div>
</svelte:fragment>
</CardGrid>
<CardGrid danger>
<Heading tag="h6" size="7">Delete Function</Heading>
<p>
@@ -42,9 +42,8 @@
{#if !showCustomId}
<div>
<Pill button on:click={() => (showCustomId = !showCustomId)}>
<span class="icon-pencil" aria-hidden="true" /><span class="text">
Function ID
</span>
<span class="icon-pencil" aria-hidden="true" />
<span class="text">Function ID </span>
</Pill>
</div>
{:else}
@@ -2,14 +2,13 @@
import { WizardStep } from '$lib/layout';
import { createFunction } from './store';
import Create from '../createVariable.svelte';
import { DropList, DropListItem, Secret, Empty } from '$lib/components';
import { DropList, DropListItem, Secret, Empty, Output } from '$lib/components';
import type { Models } from '@aw-labs/appwrite-console';
import {
Table,
TableBody,
TableCell,
TableCellHead,
TableCellText,
TableHeader,
TableRow
} from '$lib/elements/table';
@@ -59,21 +58,23 @@
<TableBody>
{#each $createFunction.vars as variable, i}
<TableRow>
<TableCellText title="key">
{variable.key}
</TableCellText>
<TableCell title="key">
<Output value={variable.key}>
{variable.key}
</Output>
</TableCell>
<TableCell showOverflow title="value">
<Secret value={variable.value} />
</TableCell>
<TableCell showOverflow title="options">
<DropList bind:show={showDropdown[i]} placement="bottom-start" noArrow>
<button
class="button is-text is-only-icon"
aria-label="more options"
on:click|preventDefault={() =>
(showDropdown[i] = !showDropdown[i])}>
<Button
text
round
ariaLabel="more options"
on:click={() => (showDropdown[i] = !showDropdown[i])}>
<span class="icon-dots-horizontal" aria-hidden="true" />
</button>
</Button>
<svelte:fragment slot="list">
<DropListItem
icon="pencil"