Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sailassist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
CpjJwWHV
Sailassist
Commits
853238a3
Commit
853238a3
authored
Jan 13, 2024
by
shigemi miura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PDF表示サイズ変更
ログアウト時にデータを消去 ユーザー名の1文字目がスペースの場合無効にする
parent
abc71913
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
48 deletions
+28
-48
InputUserNameView.swift
Seilassist/Sailassist/Login/View/InputUserNameView.swift
+19
-4
MenuView.swift
Seilassist/Sailassist/Menu/MenuView.swift
+6
-0
PDFViewer.swift
Seilassist/Sailassist/Menu/View/PDFViewer.swift
+2
-0
SharingData.swift
Seilassist/Sailassist/SharingData/SharingData.swift
+1
-44
No files found.
Seilassist/Sailassist/Login/View/InputUserNameView.swift
View file @
853238a3
...
...
@@ -6,6 +6,7 @@
//
import
SwiftUI
import
Combine
struct
InputUserNameView
:
View
{
@ObservedObject
var
sessionLogin
:
SessionLogin
=
SessionLogin
()
...
...
@@ -16,8 +17,11 @@ struct InputUserNameView: View {
@Binding
var
isAlert
:
Bool
@Binding
var
alertType
:
AlertType
@State
private
var
isEmptyAlert
=
false
@State
private
var
isSpaceAlert
=
false
@State
var
timer
:
Timer
?
let
textLimit
=
127
var
body
:
some
View
{
VStack
{
VStack
(
alignment
:
.
leading
,
spacing
:
0
)
{
...
...
@@ -36,6 +40,11 @@ struct InputUserNameView: View {
)
.
frame
(
height
:
49
)
.
padding
(
.
zero
)
.
onReceive
(
Just
(
param
.
userName
))
{
_
in
if
param
.
userName
.
count
>
textLimit
{
param
.
userName
=
String
(
param
.
userName
.
prefix
(
textLimit
))
}
}
}
Divider
()
...
...
@@ -47,6 +56,9 @@ struct InputUserNameView: View {
Button
(
action
:
{
if
param
.
userName
.
isEmpty
{
isEmptyAlert
=
true
}
else
if
param
.
userName
.
first
==
" "
||
param
.
userName
.
first
==
" "
{
param
.
userName
=
""
isSpaceAlert
=
true
}
else
{
print
(
debug
:
"signin: id(
\(
param
.
shipId
)
), pass(
\(
param
.
password
)
), name(
\(
param
.
userName
)
)"
)
isAlert
=
false
...
...
@@ -63,10 +75,13 @@ struct InputUserNameView: View {
.
foregroundColor
(
ColorSet
.
ButtonText
.
color
)
.
background
(
ColorSet
.
LoginBk01
.
color
)
})
.
alert
(
isPresented
:
$
isEmptyAlert
)
{
return
Alert
(
title
:
Text
(
"Error"
),
message
:
Text
(
"User Name not entered."
)
)
.
alert
(
"Error"
,
isPresented
:
$
isEmptyAlert
)
{
}
message
:
{
Text
(
"User Name not entered."
)
}
.
alert
(
"Error"
,
isPresented
:
$
isSpaceAlert
)
{
}
message
:
{
Text
(
"Spaces are not allowed in the first character."
)
}
.
padding
(
.
top
,
40
)
}
...
...
Seilassist/Sailassist/Menu/MenuView.swift
View file @
853238a3
...
...
@@ -212,6 +212,12 @@ struct MenuView: View {
Preferences
.
UserName
=
""
loginViewModel
.
isLogin
=
false
sceneDelegate
.
tabWindow
?
.
isHidden
=
true
SharingData
.
message
.
mode
=
0
SharingData
.
message
.
messages
=
[]
SharingData
.
pushHistory
.
focusPushHistory
=
nil
SharingData
.
pushHistory
.
pushHistoryData
=
[:]
}
Button
(
"No"
)
{}
}
message
:
{
Text
(
"Are you sure?"
)
}
...
...
Seilassist/Sailassist/Menu/View/PDFViewer.swift
View file @
853238a3
...
...
@@ -15,6 +15,8 @@ struct PDFViewer: UIViewRepresentable{
func
makeUIView
(
context
:
Context
)
->
some
PDFView
{
let
pdfView
=
PDFView
()
pdfView
.
document
=
PDFDocument
(
url
:
self
.
url
)
pdfView
.
autoScales
=
true
pdfView
.
displayMode
=
.
singlePageContinuous
return
pdfView
}
...
...
Seilassist/Sailassist/SharingData/SharingData.swift
View file @
853238a3
...
...
@@ -74,50 +74,7 @@ class SharingData{
static
var
message
=
Message
()
class
Message
:
ObservableObject
{
@Published
var
mode
:
Int
=
0
// 0:通常 , 1:Warning中
@Published
var
messages
:
[
ChatMessage
]
=
[
ChatMessage
(
shipId
:
10000003
,
messageId
:
"92c2dfb5-f5ed-4943-98a3-9848d7f9a962"
,
type
:
0
,
time
:
"2023-10-06T01:51:01.872Z"
,
location
:
1
,
from
:
"はだだ"
,
fromId
:
"487420489"
,
message
:
"999"
,
stampId
:
0
,
viewer
:
[
Viewer
(
time
:
"2023-10-06T01:51:12.973Z"
,
location
:
1
,
id
:
""
),
Viewer
(
time
:
"2023-10-06T01:51:12.973Z"
,
location
:
2
,
id
:
""
)
]
),
ChatMessage
(
shipId
:
10000001
,
messageId
:
"92c2dfb5-f5ed-4943-98a3-a848d7f9a962"
,
type
:
0
,
time
:
"2023-10-06T01:51:01.872Z"
,
location
:
1
,
from
:
"はだだ"
,
fromId
:
"487420489"
,
message
:
"999"
,
stampId
:
0
,
viewer
:
[
Viewer
(
time
:
"2023-10-06T01:51:12.973Z"
,
location
:
1
,
id
:
""
),
Viewer
(
time
:
"2023-10-06T01:51:12.973Z"
,
location
:
2
,
id
:
""
)
]
),
]
@Published
var
messages
:
[
ChatMessage
]
=
[]
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment