This commit is contained in:
2022-12-25 02:14:06 +00:00
parent 560e64db85
commit 43475bc399
2 changed files with 200 additions and 85 deletions

View File

@@ -235,6 +235,13 @@ export default {
}); });
break; break;
case socktype.SubscriptionServer:
vm.$router.push({
name: "subscription-server-edit",
params: { recordid: tid.id }
});
break;
default: default:
window.$gz.eventBus.$emit( window.$gz.eventBus.$emit(
"notify-warning", "notify-warning",

View File

@@ -11,7 +11,7 @@
v-model="obj.name" v-model="obj.name"
dense dense
:readonly="formState.readOnly" :readonly="formState.readOnly"
:label="$sock.t('SubscriptionServerName')" :label="$sock.t('SubServerName')"
:rules="[form().required(this, 'name')]" :rules="[form().required(this, 'name')]"
:error-messages="form().serverErrors(this, 'name')" :error-messages="form().serverErrors(this, 'name')"
data-cy="name" data-cy="name"
@@ -19,104 +19,188 @@
></v-text-field> ></v-text-field>
</v-col> </v-col>
<v-col <v-col cols="12" sm="6" lg="4" xl="3">
v-if="form().showMe(this, 'Vendor')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-pick-list <gz-pick-list
ref="vendorId" ref="customerId"
v-model="obj.vendorId" v-model="obj.customerId"
:aya-type="sockTypes().Vendor" :aya-type="sockTypes().Customer"
show-edit-icon show-edit-icon
:readonly="formState.readOnly" :readonly="formState.readOnly"
:label="$sock.t('Vendor')" :label="$sock.t('Customer')"
:error-messages="form().serverErrors(this, 'vendorId')" :error-messages="form().serverErrors(this, 'customerId')"
:rules="[form().required(this, 'vendorId')]" @input="fieldValueChanged('customerId')"
@input="fieldValueChanged('vendorId')"
></gz-pick-list> ></gz-pick-list>
</v-col> </v-col>
<v-col <v-col cols="12" sm="6" lg="4" xl="3">
v-if="form().showMe(this, 'SubscriptionServerVendorCode')" <gz-date-time-picker
cols="12" ref="created"
sm="6" v-model="obj.created"
lg="4" :label="$sock.t('Created')"
xl="3" :rules="[form().required(this, 'created')]"
> :readonly="formState.readOnly"
:error-messages="form().serverErrors(this, 'created')"
data-cy="created"
@input="fieldValueChanged('created')"
></gz-date-time-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field <v-text-field
ref="vendorCode" ref="dataCenter"
v-model="obj.vendorCode" v-model="obj.dataCenter"
dense dense
:readonly="formState.readOnly" :readonly="formState.readOnly"
:label="$sock.t('SubscriptionServerVendorCode')" :label="$sock.t('SubServerDatacenter')"
data-cy="vendorCode" data-cy="dataCenter"
:error-messages="form().serverErrors(this, 'vendorCode')" :error-messages="form().serverErrors(this, 'dataCenter')"
:rules="[form().required(this, 'vendorCode')]" :rules="[form().required(this, 'dataCenter')]"
@input="fieldValueChanged('vendorCode')" @input="fieldValueChanged('dataCenter')"
></v-text-field> ></v-text-field>
</v-col> </v-col>
<v-col <v-col cols="12" sm="6" lg="4" xl="3">
v-if="form().showMe(this, 'SubscriptionServerOurCode')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field <v-text-field
ref="ourCode" ref="timeZone"
v-model="obj.ourCode" v-model="obj.timeZone"
dense dense
:readonly="formState.readOnly" :readonly="formState.readOnly"
:label="$sock.t('SubscriptionServerOurCode')" :label="$sock.t('SubServerTimeZone')"
data-cy="ourCode" data-cy="timeZone"
:error-messages="form().serverErrors(this, 'ourCode')" :error-messages="form().serverErrors(this, 'timeZone')"
:rules="[form().required(this, 'ourCode')]" :rules="[form().required(this, 'timeZone')]"
@input="fieldValueChanged('ourCode')" @input="fieldValueChanged('timeZone')"
></v-text-field> ></v-text-field>
</v-col> </v-col>
<v-col <v-col cols="12" sm="6" lg="4" xl="3">
v-if="form().showMe(this, 'SubscriptionServerLicenseInterval')" <v-text-field
cols="12" ref="dbId"
sm="6" v-model="obj.dbId"
lg="4" dense
xl="3"
>
<gz-duration-picker
ref="licenseInterval"
v-model="obj.licenseInterval"
:readonly="formState.readOnly" :readonly="formState.readOnly"
:label="$sock.t('SubscriptionServerLicenseInterval')" :label="$sock.t('DatabaseID')"
:show-seconds="false" data-cy="dbId"
data-cy="licenseInterval" :error-messages="form().serverErrors(this, 'dbId')"
:error-messages="form().serverErrors(this, 'licenseInterval')" @input="fieldValueChanged('dbId')"
@input="fieldValueChanged('licenseInterval')" ></v-text-field>
></gz-duration-picker>
</v-col> </v-col>
<v-col <v-col cols="12" sm="6" lg="4" xl="3">
v-if="form().showMe(this, 'SubscriptionServerMaintInterval')" <gz-date-time-picker
cols="12" ref="lastUpdated"
sm="6" v-model="obj.lastUpdated"
lg="4" :label="$sock.t('SubServerLastUpdated')"
xl="3"
>
<gz-duration-picker
ref="maintInterval"
v-model="obj.maintInterval"
:readonly="formState.readOnly" :readonly="formState.readOnly"
:label="$sock.t('SubscriptionServerMaintInterval')" :error-messages="form().serverErrors(this, 'lastUpdated')"
:show-seconds="false" data-cy="lastUpdated"
data-cy="maintInterval" @input="fieldValueChanged('lastUpdated')"
:error-messages="form().serverErrors(this, 'maintInterval')" ></gz-date-time-picker>
@input="fieldValueChanged('maintInterval')"
></gz-duration-picker>
</v-col> </v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
ref="subscriptionExpire"
v-model="obj.subscriptionExpire"
:label="$sock.t('SubServerSubExpire')"
:rules="[form().required(this, 'subscriptionExpire')]"
:readonly="formState.readOnly"
:error-messages="form().serverErrors(this, 'subscriptionExpire')"
data-cy="subscriptionExpire"
@input="fieldValueChanged('subscriptionExpire')"
></gz-date-time-picker>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="operatingSystem"
v-model="obj.operatingSystem"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerOperatingSystem')"
data-cy="operatingSystem"
:error-messages="form().serverErrors(this, 'operatingSystem')"
@input="fieldValueChanged('operatingSystem')"
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="customerSubDomain"
v-model="obj.customerSubDomain"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerCustomerDomain')"
data-cy="customerSubDomain"
:error-messages="form().serverErrors(this, 'customerSubDomain')"
@input="fieldValueChanged('customerSubDomain')"
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-checkbox
ref="trial"
v-model="obj.trial"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerTrial')"
data-cy="trial"
:error-messages="form().serverErrors(this, 'trial')"
@change="fieldValueChanged('trial')"
></v-checkbox>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="trialCompany"
v-model="obj.trialCompany"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerTrialCompany')"
data-cy="trialCompany"
:error-messages="form().serverErrors(this, 'trialCompany')"
@input="fieldValueChanged('trialCompany')"
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-text-field
ref="trialContact"
v-model="obj.trialContact"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerTrialContact')"
data-cy="trialContact"
:error-messages="form().serverErrors(this, 'trialContact')"
@input="fieldValueChanged('trialContact')"
></v-text-field>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-email
ref="trialEmail"
v-model="obj.trialEmail"
:readonly="formState.readOnly"
:label="$sock.t('SubServerTrialEmail')"
data-cy="trialEmail"
:error-messages="form().serverErrors(this, 'trialEmail')"
@input="fieldValueChanged('trialEmail')"
></gz-email>
</v-col>
<v-col v-if="form().showMe(this, 'SubServerNotes')" cols="12">
<v-textarea
ref="notes"
v-model="obj.notes"
dense
:readonly="formState.readOnly"
:label="$sock.t('SubServerNotes')"
:error-messages="form().serverErrors(this, 'notes')"
data-cy="notes"
auto-grow
@input="fieldValueChanged('notes')"
></v-textarea>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3"> <v-col cols="12" sm="6" lg="4" xl="3">
<v-checkbox <v-checkbox
ref="active" ref="active"
@@ -183,7 +267,7 @@ export default {
active: true, active: true,
customerId: 0, customerId: 0,
notes: null, notes: null,
created: window.$gz.locale.nowUTC8601String(), created: window.$gz.locale.nowUTC8601String(),
dataCenter: null, dataCenter: null,
timeZone: null, timeZone: null,
dbId: null, dbId: null,
@@ -659,18 +743,27 @@ async function initForm(vm) {
async function fetchTranslatedText() { async function fetchTranslatedText() {
await window.$gz.translation.cacheTranslations([ await window.$gz.translation.cacheTranslations([
"SubscriptionServer", "SubscriptionServer",
"SubscriptionServerName", "SubServerName",
"Vendor", "Customer",
"SubscriptionServerLicenseInterval", "SubServerNotes",
"SubscriptionServerMaintInterval", "Created",
"SubscriptionServerSubscriptionServerOverseerID", "SubServerDatacenter",
"SubscriptionServerVendorCode", "SubServerTimeZone",
"SubscriptionServerOurCode" "DatabaseID",
"SubServerLastUpdated",
"SubServerSubExpire",
"SubServerTrial",
"SubServerTrialContact",
"SubServerTrialEmail",
"SubServerTrialCompany",
"SubServerOperatingSystem",
"SubServerCustomerDomain"
]); ]);
} }
/* /*
"CREATE TABLE asubscriptionserver (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, active BOOL NOT NULL DEFAULT true, created TIMESTAMPTZ NOT NULL, " "CREATE TABLE asubscriptionserver (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, active BOOL NOT NULL DEFAULT true, created TIMESTAMPTZ NOT NULL, "
+ "name TEXT NOT NULL, notes TEXT, datacenter TEXT NOT NULL, timezone TEXT NOT NULL, dbid TEXT, lastupdated TIMESTAMPTZ, subscriptionexpire TIMESTAMPTZ NOT NULL, " + "name TEXT NOT NULL, notes TEXT, datacenter TEXT NOT NULL, timezone TEXT NOT NULL,
dbid TEXT, lastupdated TIMESTAMPTZ, subscriptionexpire TIMESTAMPTZ NOT NULL, "
+ "trial BOOL NOT NULL DEFAULT true, trialcontact TEXT, trialemail TEXT, trialcompany TEXT, operatingsystem TEXT, customersubdomain TEXT, " + "trial BOOL NOT NULL DEFAULT true, trialcontact TEXT, trialemail TEXT, trialcompany TEXT, operatingsystem TEXT, customersubdomain TEXT, "
+ "wiki TEXT, tags VARCHAR(255) ARRAY, customerid BIGINT REFERENCES acustomer(id) )" + "wiki TEXT, tags VARCHAR(255) ARRAY, customerid BIGINT REFERENCES acustomer(id) )"
[Required] [Required]
@@ -709,6 +802,21 @@ await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SE
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerOperatingSystem', 'OS' FROM atranslation t where t.baselanguage = 'en'"); await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerOperatingSystem', 'OS' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerCustomerDomain', 'Customer subdomain' FROM atranslation t where t.baselanguage = 'en'"); await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerCustomerDomain', 'Customer subdomain' FROM atranslation t where t.baselanguage = 'en'");
name: null,
active: true,
customerId: 0,
notes: null,
created: window.$gz.locale.nowUTC8601String(),
dataCenter: null,
timeZone: null,
dbId: null,
lastUpdated: null,
subscriptionExpire: null,
trial: true,
trialContact: null,
trialEmail: null,
trialCompany: null,
operatingSystem: "Ubuntu 22.10",
customerSubDomain: null,
*/ */
</script> </script>