@things-factory/kpi 10.0.3 → 10.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/pages/kpi/kpi-view.ts +2 -0
- package/client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.ts +2 -0
- package/client/viewparts/kpi-metric-input.ts +2 -0
- package/client/viewparts/kpi-metric-meta-editor.ts +2 -0
- package/dist-client/pages/kpi/kpi-view.js +2 -0
- package/dist-client/pages/kpi/kpi-view.js.map +1 -1
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js +2 -0
- package/dist-client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-client/viewparts/kpi-metric-input.js +2 -0
- package/dist-client/viewparts/kpi-metric-input.js.map +1 -1
- package/dist-client/viewparts/kpi-metric-meta-editor.js +2 -0
- package/dist-client/viewparts/kpi-metric-meta-editor.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -62,6 +62,8 @@ export class KpiView extends localize(i18next)(LitElement) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
textarea {
|
|
65
|
+
background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));
|
|
66
|
+
color: var(--input-field-color, var(--md-sys-color-on-surface));
|
|
65
67
|
width: 100%;
|
|
66
68
|
min-height: 100px;
|
|
67
69
|
padding: var(--spacing-small);
|
|
@@ -38,6 +38,8 @@ export class KpiMetricValueManualEntryForm extends LitElement {
|
|
|
38
38
|
}
|
|
39
39
|
input,
|
|
40
40
|
textarea {
|
|
41
|
+
background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));
|
|
42
|
+
color: var(--input-field-color, var(--md-sys-color-on-surface));
|
|
41
43
|
font-size: 1em;
|
|
42
44
|
padding: 6px 8px;
|
|
43
45
|
border: 1px solid #ccc;
|
|
@@ -24,6 +24,8 @@ export class KpiMetricInput extends LitElement {
|
|
|
24
24
|
}
|
|
25
25
|
input,
|
|
26
26
|
select {
|
|
27
|
+
background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));
|
|
28
|
+
color: var(--input-field-color, var(--md-sys-color-on-surface));
|
|
27
29
|
font: inherit;
|
|
28
30
|
padding: 2px 4px;
|
|
29
31
|
}
|
|
@@ -58,6 +58,8 @@ export class KpiMetricMetaEditor extends LitElement {
|
|
|
58
58
|
input[type='number'],
|
|
59
59
|
select,
|
|
60
60
|
textarea {
|
|
61
|
+
background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));
|
|
62
|
+
color: var(--input-field-color, var(--md-sys-color-on-surface));
|
|
61
63
|
width: 100%;
|
|
62
64
|
box-sizing: border-box;
|
|
63
65
|
padding: 6px 8px;
|
|
@@ -64,6 +64,8 @@ let KpiView = class KpiView extends localize(i18next)(LitElement) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
textarea {
|
|
67
|
+
background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));
|
|
68
|
+
color: var(--input-field-color, var(--md-sys-color-on-surface));
|
|
67
69
|
width: 100%;
|
|
68
70
|
min-height: 100px;
|
|
69
71
|
padding: var(--spacing-small);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-view.js","sourceRoot":"","sources":["../../../client/pages/kpi/kpi-view.ts"],"names":[],"mappings":";AAAA,OAAO,gDAAgD,CAAA;AACvD,OAAO,8CAA8C,CAAA;AACrD,OAAO,oCAAoC,CAAA;AAE3C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAG1C,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,QAAQ,CAAC,OAAO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AAC,CAAC,CAAC,2BAA2B,CAAC;;;;;;;mBAO5C,IAAI,CAAC,GAAG,EAAE,QAAQ,IAAI,EAAE;mBACxB,CAAC,CAAM,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;yBACrD,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC;;;KAGrD,CAAA;IACH,CAAC;IAED,cAAc,CAAC,QAAgB,EAAE,KAAU;QACzC,IAAI,CAAC,GAAG,GAAG;YACT,GAAG,IAAI,CAAC,GAAG;YACX,CAAC,QAAQ,CAAC,EAAE,KAAK;SAClB,CAAA;QAED,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,iBAAiB,EAAE;YACpD,MAAM,EAAE,IAAI,CAAC,GAAG;YAChB,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;SACf,CAAC,CAAC,CAAA;QAEH,IAAI,CAAC,aAAa,EAAE,CAAA;IACtB,CAAC;;AA7G2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;oCAAc;AApE9B,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CAmLnB","sourcesContent":["import '@material/web/textfield/outlined-text-field.js'\nimport '@material/web/textfield/filled-text-field.js'\nimport '@material/web/checkbox/checkbox.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { i18next, localize } from '@operato/i18n'\n\n@customElement('kpi-view')\nexport class KpiView extends localize(i18next)(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-medium);\n padding: var(--spacing-medium);\n }\n\n .form-group {\n display: flex;\n flex-direction: column;\n gap: var(--spacing-small);\n }\n\n .form-row {\n display: flex;\n gap: var(--spacing-medium);\n align-items: center;\n }\n\n .form-row > * {\n flex: 1;\n }\n\n label {\n font-weight: 500;\n color: var(--md-sys-color-on-surface);\n margin-bottom: var(--spacing-small);\n }\n\n md-outlined-text-field,\n md-filled-text-field,\n md-outlined-select {\n width: 100%;\n }\n\n .checkbox-group {\n display: flex;\n align-items: center;\n gap: var(--spacing-small);\n }\n\n .section-title {\n font-size: 1.1rem;\n font-weight: 600;\n color: var(--md-sys-color-primary);\n margin-top: var(--spacing-large);\n margin-bottom: var(--spacing-medium);\n border-bottom: 1px solid var(--md-sys-color-outline-variant);\n padding-bottom: var(--spacing-small);\n }\n\n textarea {\n background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));\n color: var(--input-field-color, var(--md-sys-color-on-surface));\n width: 100%;\n min-height: 100px;\n padding: var(--spacing-small);\n border: 1px solid var(--md-sys-color-outline);\n border-radius: var(--md-sys-shape-corner-small);\n font-family: monospace;\n resize: vertical;\n }\n `\n ]\n\n @property({ type: Object }) kpi: any = {}\n\n render() {\n return html`\n <div class=\"section-title\">${i18next.t('label.basic_information')}</div>\n \n <div class=\"form-group\">\n <label>Name *</label>\n <md-outlined-text-field\n .value=${this.kpi?.name || ''}\n @input=${(e: any) => this.updateProperty('name', e.target.value)}\n required\n ></md-outlined-text-field>\n </div>\n\n <div class=\"form-group\">\n <label>Description</label>\n <md-outlined-text-field\n .value=${this.kpi?.description || ''}\n @input=${(e: any) => this.updateProperty('description', e.target.value)}\n type=\"textarea\"\n rows=\"3\"\n ></md-outlined-text-field>\n </div>\n\n <div class=\"form-group\">\n <label>Weight</label>\n <md-outlined-text-field\n type=\"number\"\n .value=${this.kpi?.weight?.toString() || '1'}\n @input=${(e: any) => this.updateProperty('weight', parseFloat(e.target.value) || 1)}\n min=\"0\"\n step=\"0.1\"\n ></md-outlined-text-field>\n </div>\n\n <div class=\"form-row\">\n <div class=\"checkbox-group\">\n <md-checkbox\n ?checked=${this.kpi?.active !== false}\n @change=${(e: any) => this.updateProperty('active', e.target.checked)}\n ></md-checkbox>\n <label>Active</label>\n </div>\n\n <div class=\"checkbox-group\">\n <md-checkbox\n ?checked=${this.kpi?.isLeaf !== false}\n @change=${(e: any) => this.updateProperty('isLeaf', e.target.checked)}\n ></md-checkbox>\n <label>${i18next.t('label.is_leaf_node')}</label>\n </div>\n </div>\n\n <div class=\"section-title\">${i18next.t('label.formula_calculation')}</div>\n\n <div class=\"form-group\">\n <label>${i18next.t('label.kpi_formula')}</label>\n <textarea\n .value=${this.kpi?.formula || ''}\n @input=${(e: any) => this.updateProperty('formula', e.target.value)}\n placeholder=\"${i18next.t('placeholder.enter_formula')}\"\n ></textarea>\n </div>\n\n <div class=\"form-group\">\n <label>${i18next.t('label.score_formula')}</label>\n <textarea\n .value=${this.kpi?.scoreFormula || ''}\n @input=${(e: any) => this.updateProperty('scoreFormula', e.target.value)}\n placeholder=\"${i18next.t('placeholder.enter_score_formula')}\"\n ></textarea>\n </div>\n\n <div class=\"section-title\">Schedule</div>\n\n <div class=\"form-group\">\n <label>Cron Schedule</label>\n <md-outlined-text-field\n .value=${this.kpi?.schedule || ''}\n @input=${(e: any) => this.updateProperty('schedule', e.target.value)}\n placeholder=\"${i18next.t('placeholder.cron_schedule')}\"\n ></md-outlined-text-field>\n </div>\n\n <div class=\"form-group\">\n <label>Timezone</label>\n <md-outlined-text-field\n .value=${this.kpi?.timezone || ''}\n @input=${(e: any) => this.updateProperty('timezone', e.target.value)}\n placeholder=\"${i18next.t('placeholder.timezone')}\"\n ></md-outlined-text-field>\n </div>\n `\n }\n\n updateProperty(property: string, value: any) {\n this.kpi = {\n ...this.kpi,\n [property]: value\n }\n\n this.dispatchEvent(new CustomEvent('property-change', {\n detail: this.kpi,\n bubbles: true,\n composed: true\n }))\n\n this.requestUpdate()\n }\n\n}"]}
|
|
@@ -45,6 +45,8 @@ let KpiMetricValueManualEntryForm = class KpiMetricValueManualEntryForm extends
|
|
|
45
45
|
}
|
|
46
46
|
input,
|
|
47
47
|
textarea {
|
|
48
|
+
background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));
|
|
49
|
+
color: var(--input-field-color, var(--md-sys-color-on-surface));
|
|
48
50
|
font-size: 1em;
|
|
49
51
|
padding: 6px 8px;
|
|
50
52
|
border: 1px solid #ccc;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kpi-metric-value-manual-entry-form.js","sourceRoot":"","sources":["../../../client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAG9D,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,UAAU;IAAtD;;
|
|
1
|
+
{"version":3,"file":"kpi-metric-value-manual-entry-form.js","sourceRoot":"","sources":["../../../client/pages/kpi-metric-value/kpi-metric-value-manual-entry-form.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAG9D,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,UAAU;IAAtD;;QAuDI,cAAS,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,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H,CAAC;;AAjF2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6DAAY;AAC9B;IAAR,KAAK,EAAE;;gEAAkD;AACjD;IAAR,KAAK,EAAE;;4DAAW;AACV;IAAR,KAAK,EAAE;;0DAAS;AACR;IAAR,KAAK,EAAE;;2DAAU;AACT;IAAR,KAAK,EAAE;;8DAAgB;AA3Db,6BAA6B;IADzC,aAAa,CAAC,oCAAoC,CAAC;GACvC,6BAA6B,CAwIzC","sourcesContent":["import { html, LitElement, css } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { client } from '@operato/graphql'\nimport { notify } from '@operato/layout'\nimport gql from 'graphql-tag'\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\n\n@customElement('kpi-metric-value-manual-entry-form')\nexport class KpiMetricValueManualEntryForm extends LitElement {\n static styles = [\n CommonHeaderStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n background-color: var(--md-sys-color-surface, #f4f6fa);\n }\n form {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n }\n .form-card {\n flex: 1;\n display: flex;\n flex-direction: column;\n padding: 32px 32px 0 32px;\n background: #fff;\n }\n label {\n font-weight: 500;\n margin-bottom: 4px;\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n input,\n textarea {\n background-color: var(--input-field-background, var(--md-sys-color-surface-container-highest));\n color: var(--input-field-color, var(--md-sys-color-on-surface));\n font-size: 1em;\n padding: 6px 8px;\n border: 1px solid #ccc;\n margin-top: 2px;\n resize: none;\n }\n .desc {\n font-size: 0.95em;\n color: #888;\n margin-top: 8px;\n }\n .footer span {\n font-size: 0.8em;\n color: var(--md-sys-color-on-surface);\n line-height: 1.5;\n padding: 10px;\n }\n `\n ]\n\n @property({ type: Object }) metric: any\n @state() valueDate = new Date().toISOString().slice(0, 10)\n @state() value = ''\n @state() org = ''\n @state() meta = ''\n @state() loading = false\n\n render() {\n return html`\n <form style=\"display:flex;flex-direction:column;height:100%;\">\n <div class=\"form-card\">\n <div style=\"font-size:1.1em;font-weight:bold;margin-bottom:16px;\"><b>Metric:</b> ${this.metric?.name}</div>\n <label>\n 날짜\n <input type=\"date\" .value=${this.valueDate} @input=${e => (this.valueDate = e.target.value)} required />\n </label>\n <label>\n 값\n <input type=\"number\" .value=${this.value} @input=${e => (this.value = e.target.value)} required />\n </label>\n <label>\n 그룹 (선택)\n <input type=\"text\" .value=${this.org} @input=${e => (this.org = e.target.value)} />\n </label>\n <label>\n 메타정보 (선택, JSON)\n <textarea .value=${this.meta} @input=${e => (this.meta = e.target.value)}></textarea>\n </label>\n <div class=\"desc\">입력방식: MANUAL, Source: MANUAL (자동 지정)</div>\n </div>\n </form>\n <div class=\"footer\">\n <div filler></div>\n <button type=\"button\" ?disabled=${this.loading} done @click=${this.save}><md-icon>save</md-icon>저장</button>\n </div>\n `\n }\n\n async save() {\n this.loading = true\n let parsedMeta = undefined\n if (this.meta) {\n try {\n parsedMeta = JSON.parse(this.meta)\n } catch (err) {\n notify({ message: '메타정보는 올바른 JSON이어야 합니다.', level: 'error' })\n this.loading = false\n return\n }\n }\n try {\n await client.mutate({\n mutation: gql`\n mutation ($metricName: String!, $value: Float!, $org: String, $meta: Object) {\n recordKpiMetricValue(metricName: $metricName, value: $value, meta: $meta, org: $org) {\n id\n }\n }\n `,\n variables: {\n metricName: this.metric.name,\n value: parseFloat(this.value),\n org: this.org || undefined,\n meta: parsedMeta\n }\n })\n notify({ message: 'Metric 값이 저장되었습니다.' })\n this.dispatchEvent(new CustomEvent('saved', { bubbles: true, composed: true }))\n let el: any = this.parentElement\n while (el) {\n if (typeof el.close === 'function') {\n el.close()\n break\n }\n el = el.parentElement\n }\n } catch (err: any) {\n notify({ message: '저장 실패: ' + (err?.message || err), level: 'error' })\n } finally {\n this.loading = false\n }\n }\n}\n"]}
|