diff --git a/kyuubi-server/web-ui/src/api/editor/index.ts b/kyuubi-server/web-ui/src/api/editor/index.ts new file mode 100644 index 00000000000..daaf0471c12 --- /dev/null +++ b/kyuubi-server/web-ui/src/api/editor/index.ts @@ -0,0 +1,77 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import request from '@/utils/request' +import type { + IOpenSessionRequest, + IRunSqlRequest, + IGetSqlRowsetRequest, + IGetSqlMetadataRequest +} from './types' + +export function openSession(data: IOpenSessionRequest): any { + return request({ + url: 'api/v1/sessions', + method: 'post', + data + }) +} + +export function closeSession(identifier: string): any { + return request({ + url: `api/v1/sessions/${identifier}`, + method: 'delete' + }) +} + +export function runSql(data: IRunSqlRequest, identifier: string): any { + return request({ + url: `api/v1/sessions/${identifier}/operations/statement`, + method: 'post', + data + }) +} + +export function getSqlRowset(params: IGetSqlRowsetRequest): any { + return request({ + url: `api/v1/operations/${params.operationHandleStr}/rowset`, + method: 'get', + params + }) +} + +export function getSqlMetadata(params: IGetSqlMetadataRequest): any { + return request({ + url: `api/v1/operations/${params.operationHandleStr}/resultsetmetadata`, + method: 'get', + params + }) +} + +export function getLog(identifier: string): any { + return request({ + url: `api/v1/operations/${identifier}/log`, + method: 'get' + }) +} + +export function closeOperation(identifier: string) { + return request({ + url: `api/v1/admin/operations/${identifier}`, + method: 'delete' + }) +} diff --git a/kyuubi-server/web-ui/src/api/editor/types.ts b/kyuubi-server/web-ui/src/api/editor/types.ts new file mode 100644 index 00000000000..0bc4c2086c6 --- /dev/null +++ b/kyuubi-server/web-ui/src/api/editor/types.ts @@ -0,0 +1,42 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +interface IOpenSessionRequest { + 'kyuubi.engine.type': string +} + +interface IRunSqlRequest { + statement: string + runAsync: boolean +} + +interface IGetSqlRowsetRequest { + operationHandleStr: string + fetchorientation: 'FETCH_NEXT' + maxrows: number +} + +interface IGetSqlMetadataRequest { + operationHandleStr: string +} + +export { + IOpenSessionRequest, + IRunSqlRequest, + IGetSqlRowsetRequest, + IGetSqlMetadataRequest +} diff --git a/kyuubi-server/web-ui/src/api/server/index.ts b/kyuubi-server/web-ui/src/api/server/index.ts index e2d74d7dbaf..4dd402b67f7 100644 --- a/kyuubi-server/web-ui/src/api/server/index.ts +++ b/kyuubi-server/web-ui/src/api/server/index.ts @@ -17,7 +17,7 @@ import request from '@/utils/request' -export function getAllServer() { +export function getAllServer(): any { return request({ url: 'api/v1/admin/server', method: 'get' diff --git a/kyuubi-server/web-ui/src/api/server/types.ts b/kyuubi-server/web-ui/src/api/server/types.ts new file mode 100644 index 00000000000..c747f436007 --- /dev/null +++ b/kyuubi-server/web-ui/src/api/server/types.ts @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +interface IServer { + attributes: any | null + host: string + instance: string + namespace: string + nodeName: string + port: number + status: string +} + +export { IServer } diff --git a/kyuubi-server/web-ui/src/assets/images/document.svg b/kyuubi-server/web-ui/src/assets/images/document.svg new file mode 100644 index 00000000000..e3d1bfe1beb --- /dev/null +++ b/kyuubi-server/web-ui/src/assets/images/document.svg @@ -0,0 +1,22 @@ + + + + + diff --git a/kyuubi-server/web-ui/src/assets/kyuubi-logo.svg b/kyuubi-server/web-ui/src/assets/images/kyuubi-logo.svg similarity index 100% rename from kyuubi-server/web-ui/src/assets/kyuubi-logo.svg rename to kyuubi-server/web-ui/src/assets/images/kyuubi-logo.svg diff --git a/kyuubi-server/web-ui/src/assets/kyuubi.png b/kyuubi-server/web-ui/src/assets/images/kyuubi.png similarity index 100% rename from kyuubi-server/web-ui/src/assets/kyuubi.png rename to kyuubi-server/web-ui/src/assets/images/kyuubi.png diff --git a/kyuubi-server/web-ui/src/components/monaco-editor/index.vue b/kyuubi-server/web-ui/src/components/monaco-editor/index.vue index a98a3f31b79..65a2dba3421 100644 --- a/kyuubi-server/web-ui/src/components/monaco-editor/index.vue +++ b/kyuubi-server/web-ui/src/components/monaco-editor/index.vue @@ -88,7 +88,7 @@ editor = monaco.editor.create(codeEditBox.value, { value: props.modelValue, language: props.language, - theme: monacoEditorThemeRef.value, + theme: props.theme || monacoEditorThemeRef.value, ...props.options }) diff --git a/kyuubi-server/web-ui/src/components/monaco-editor/types.ts b/kyuubi-server/web-ui/src/components/monaco-editor/types.ts index 80400565eb0..aa962d43c1a 100644 --- a/kyuubi-server/web-ui/src/components/monaco-editor/types.ts +++ b/kyuubi-server/web-ui/src/components/monaco-editor/types.ts @@ -53,10 +53,7 @@ export const editorProps = { default: 'sql' }, theme: { - type: String as PropType, - validator(value: string): boolean { - return ['vs', 'vs-dark'].includes(value) - }, + type: String as PropType, default: 'vs' }, options: { @@ -72,7 +69,7 @@ export const editorProps = { }, readOnly: false, contextmenu: true, - fontSize: 16, + fontSize: 14, scrollBeyondLastLine: true, overviewRulerBorder: false } diff --git a/kyuubi-server/web-ui/src/layout/components/aside/index.vue b/kyuubi-server/web-ui/src/layout/components/aside/index.vue index 42db213e33a..c5d1e41aeb5 100644 --- a/kyuubi-server/web-ui/src/layout/components/aside/index.vue +++ b/kyuubi-server/web-ui/src/layout/components/aside/index.vue @@ -18,8 +18,8 @@