This commit is contained in:
2023-01-12 19:49:43 +00:00
parent dc22aeb718
commit 0a55d8c8ff
2 changed files with 31 additions and 79 deletions

View File

@@ -680,24 +680,5 @@ async function populateSelectionLists(vm) {
vm.selectLists.pGroups = window.$gz.enums.getSelectionList("productgroup");
}
/*
public string Name { get; set; }
public bool Active { get; set; }
public long VendorId { get; set; }
public TimeSpan LicenseInterval { get; set; }
public TimeSpan MaintInterval { get; set; }
public string VendorCode { get; set; }
public string OurCode { get; set; }
public string Wiki { get; set; }
public List<string> Tags { get; set; }
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'Product', 'Product' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'ProductList', 'Products' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'ProductName', 'Name' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'ProductLicenseInterval', 'License period' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'ProductMaintInterval', 'Maintenance period' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'ProductVendorCode', 'Vendor code' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'ProductOurCode', 'Our code' FROM atranslation t where t.baselanguage = 'en'");
*/
</script>

View File

@@ -55,7 +55,22 @@
@input="fieldValueChanged('customerId')"
></gz-pick-list>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<v-select
ref="serverState"
v-model="obj.serverState"
dense
:items="selectLists.serverStates"
item-text="name"
item-value="id"
:readonly="formState.readOnly"
:label="$sock.t('ServerState')"
data-cy="serverState"
:rules="[form().integerValid(this, 'serverState')]"
:error-messages="form().serverErrors(this, 'serverState')"
@input="fieldValueChanged('serverState')"
></v-select>
</v-col>
<v-col cols="12" sm="6" lg="4" xl="3">
<gz-date-time-picker
ref="created"
@@ -345,6 +360,7 @@ export default {
name: null,
active: true,
customerId: null,
serverState: 0,
notes: null,
created: window.$gz.locale.nowUTC8601String(),
dataCenter: null,
@@ -362,6 +378,7 @@ export default {
tags: []
},
selectLists: {
serverStates: [],
dataCenters: [
{ id: "SF", name: "San Francisco" },
{ id: "NY", name: "New York" },
@@ -1437,6 +1454,7 @@ let JUST_DELETED = false;
async function initForm(vm) {
await fetchTranslatedText();
await window.$gz.formCustomTemplate.get(FORM_CUSTOM_TEMPLATE_KEY, vm);
await populateSelectionLists(vm);
}
//////////////////////////////////////////////////////////
@@ -1462,66 +1480,19 @@ async function fetchTranslatedText() {
"SubServerOperatingSystem",
"SubServerCustomerDomain",
"LoanUnitRateMonthCost",
"SubServerIP"
"SubServerIP",
"ServerState"
]);
}
/*
"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, "
+ "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) )"
[Required]
public string Name { get; set; }
public bool Active { get; set; }
public string Notes { get; set; }
public DateTime Created { get; set; }
[Required]
public string DataCenter { get; set; }
[Required]
public string TimeZone { get; set; }
public string DbId { get; set; }
public DateTime? LastUpdated { get; set; }
public DateTime SubscriptionExpire { get; set; }
public bool Trial { get; set; }
public string TrialContact { get; set; }
public string TrialEmail { get; set; }
public string TrialCompany { get; set; }
public string OperatingSystem { get; set; }
public string CustomerSubDomain { get; set; }
public long? CustomerId { get; set; }
public string Wiki { get; set; }
public List<string> Tags { get; set; }
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubscriptionServer', 'Subscription server' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubscriptionServerList', 'Subscription servers' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerName', 'Name' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerNotes', 'Notes' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerDatacenter', 'Data center' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerTimeZone', 'Time zone' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerLastUpdated', 'Last updated' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerSubExpire', 'Subscription expires' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerTrialContact', 'Trial contact' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerTrialEmail', 'TrialEmail' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerTrial', 'Trial' FROM atranslation t where t.baselanguage = 'en'");
await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SubServerTrialCompany', 'Trial company' 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'");
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,
*/
//////////////////////
//
//
async function populateSelectionLists(vm) {
//ensure the pick lists required are pre-fetched
await window.$gz.enums.fetchEnumList("ServerState");
vm.selectLists.serverStates = window.$gz.enums.getSelectionList(
"ServerState"
);
}
</script>